diff --git a/ices/101465.rs b/ices/101465.rs new file mode 100644 index 00000000..37adcf99 --- /dev/null +++ b/ices/101465.rs @@ -0,0 +1,20 @@ +#![feature(trait_alias)] + +struct B; + +struct C; + +trait Tr2 = Into; + +fn foo2>() {} + +fn foo() -> impl Sized { + let x = foo2::<_>(); + + match true { + true => B, + false => C, + } +} + +pub fn main() {} diff --git a/ices/101518-1.sh b/ices/101518-1.sh new file mode 100644 index 00000000..f0e1474a --- /dev/null +++ b/ices/101518-1.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +rustc -Cincremental=/tmp/a -Zincremental-verify-ich=yes --crate-type lib - <<'EOF' + + +#[derive(PartialEq, Eq)] +struct Id<'a> { + ns: &'a str, +} +fn visit_struct() { + let id = Id { ns: "random1" }; + const FLAG: Id<'static> = Id { + ns: "needs_to_be_the_same", + }; + match id { + FLAG => {} + _ => {} + } +} +fn visit_struct2() { + let id = Id { ns: "random2" }; + const FLAG: Id<'static> = Id { + ns: "needs_to_be_the_same", + }; + match id { + FLAG => {} + _ => {} + } +} + +EOF diff --git a/ices/101518-2.sh b/ices/101518-2.sh new file mode 100644 index 00000000..1c2e5893 --- /dev/null +++ b/ices/101518-2.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +rustc -Cincremental=/tmp/a -Zincremental-verify-ich=yes --crate-type lib - <<'EOF' + +#[derive(Eq, PartialEq)] +struct Id(&'static str); + +fn f() { + const FLAG: Id = Id(""); + match Id("") { + FLAG => (), + _ => (), + }; +} + +fn g() { + const FLAG: Id = Id(""); + match Id("") { + FLAG => (), + _ => (), + }; +} + +EOF diff --git a/ices/101557.rs b/ices/101557.rs new file mode 100644 index 00000000..772ad48d --- /dev/null +++ b/ices/101557.rs @@ -0,0 +1,40 @@ +#![feature(generic_const_exprs)] +use std::marker::PhantomData; + +trait Trait { + const CONST: usize; +} + +struct A { + _marker: PhantomData, +} + +impl Trait for [i8; N] { + const CONST: usize = N; +} + +impl From for A<[i8; N]> { + fn from(_: usize) -> Self { + todo!() + } +} + +impl From> for A { + fn from(_: A<[i8; T::CONST]>) -> Self { + todo!() + } +} + +fn f() -> A +where + [(); T::CONST]:, +{ + // Usage of `0` is arbitrary + let a = A::<[i8; T::CONST]>::from(0); + A::::from(a) +} + +fn main() { + // Usage of `1` is arbitrary + f::<[i8; 1]>(); +}