diff --git a/tests/crashes/124833.rs b/tests/crashes/124833.rs new file mode 100644 index 0000000000000..f1c4847b544a5 --- /dev/null +++ b/tests/crashes/124833.rs @@ -0,0 +1,10 @@ +//@ known-bug: rust-lang/rust#124833 +#![feature(generic_const_items)] + +trait Trait { + const C<'a>: &'a str; +} + +impl Trait for () { + const C<'a>: = "C"; +} diff --git a/tests/crashes/124857.rs b/tests/crashes/124857.rs new file mode 100644 index 0000000000000..4b952fd64ccfb --- /dev/null +++ b/tests/crashes/124857.rs @@ -0,0 +1,11 @@ +//@ known-bug: rust-lang/rust#124857 +//@ compile-flags: -Znext-solver=coherence + +#![feature(effects)] + +#[const_trait] +trait Foo {} + +impl const Foo for i32 {} + +impl const Foo for T where T: ~const Foo {} diff --git a/tests/crashes/124891.rs b/tests/crashes/124891.rs new file mode 100644 index 0000000000000..9b5892418c897 --- /dev/null +++ b/tests/crashes/124891.rs @@ -0,0 +1,22 @@ +//@ known-bug: rust-lang/rust#124891 + +type Tait = impl FnOnce() -> (); + +fn reify_as_tait() -> Thunk { + Thunk::new(|cont| cont) +} + +struct Thunk(F); + +impl Thunk { + fn new(f: F) + where + F: ContFn, + { + todo!(); + } +} + +trait ContFn {} + +impl ()> ContFn for F {} diff --git a/tests/crashes/124894.rs b/tests/crashes/124894.rs new file mode 100644 index 0000000000000..230cf4a89c151 --- /dev/null +++ b/tests/crashes/124894.rs @@ -0,0 +1,11 @@ +//@ known-bug: rust-lang/rust#124894 +//@ compile-flags: -Znext-solver=coherence + +#![feature(generic_const_exprs)] + +pub trait IsTrue {} +impl IsZST for T where (): IsTrue<{ std::mem::size_of::() == 0 }> {} + +pub trait IsZST {} + +impl IsZST for IsZST {} diff --git a/tests/crashes/125081.rs b/tests/crashes/125081.rs new file mode 100644 index 0000000000000..7139caaa00df7 --- /dev/null +++ b/tests/crashes/125081.rs @@ -0,0 +1,7 @@ +//@ known-bug: rust-lang/rust#125081 + +use std::cell::Cell; + +fn main() { + let _: Cell<&str, "a"> = Cell::new('β); +} diff --git a/tests/crashes/125099.rs b/tests/crashes/125099.rs new file mode 100644 index 0000000000000..bfc8c8fdcf683 --- /dev/null +++ b/tests/crashes/125099.rs @@ -0,0 +1,24 @@ +//@ known-bug: rust-lang/rust#125099 + +pub trait ContFn: Fn(T) -> Self::Future { + type Future; +} +impl ContFn for F +where + F: Fn(T), +{ + type Future = (); +} + +pub trait SeqHandler { + type Requires; + fn process>() -> impl Sized; +} + +pub struct ConvertToU64; +impl SeqHandler for ConvertToU64 { + type Requires = u64; + fn process>() -> impl Sized {} +} + +fn main() {} diff --git a/tests/crashes/125155.rs b/tests/crashes/125155.rs new file mode 100644 index 0000000000000..165061d4b5296 --- /dev/null +++ b/tests/crashes/125155.rs @@ -0,0 +1,17 @@ +//@ known-bug: rust-lang/rust#125155 + +enum NestedEnum { + First, + Second, + Third +} +enum Enum { + Variant2(Option<*mut &'a &'b ()>) +} + + +fn foo(x: Enum) -> isize { + match x { + Enum::Variant2(NestedEnum::Third) => 4, + } +} diff --git a/tests/crashes/125185.rs b/tests/crashes/125185.rs new file mode 100644 index 0000000000000..8693d6c7662b2 --- /dev/null +++ b/tests/crashes/125185.rs @@ -0,0 +1,16 @@ +//@ known-bug: rust-lang/rust#125185 +//@ compile-flags: -Zvalidate-mir + +type Foo = impl Send; + +struct A; + +const VALUE: Foo = value(); + +fn test(foo: Foo<'a>, f: impl for<'b> FnMut()) { + match VALUE { + 0 | 0 => {} + + _ => (), + } +} diff --git a/tests/crashes/125249.rs b/tests/crashes/125249.rs new file mode 100644 index 0000000000000..18196d7b34fe8 --- /dev/null +++ b/tests/crashes/125249.rs @@ -0,0 +1,8 @@ +//@ known-bug: rust-lang/rust#125185 +#![feature(return_position_impl_trait_in_trait, return_type_notation)] + +trait IntFactory { + fn stream(&self) -> impl IntFactory + Send>; +} + +pub fn main() {}