diff --git a/tests/crashes/120016.rs b/tests/crashes/120016.rs new file mode 100644 index 00000000000..09175689256 --- /dev/null +++ b/tests/crashes/120016.rs @@ -0,0 +1,19 @@ +//@ known-bug: #120016 +//@ compile-flags: -Zcrate-attr=feature(const_async_blocks) --edition=2021 + +#![feature(type_alias_impl_trait, const_async_blocks)] + +struct Bug { + V1: [(); { + type F = impl std::future::Future; + fn concrete_use() -> F { + //~^ ERROR to be a future that resolves to `u8`, but it resolves to `()` + async {} + } + let f: F = async { 1 }; + //~^ ERROR `async` blocks are not allowed in constants + 1 + }], +} + +fn main() {} diff --git a/tests/crashes/127804.rs b/tests/crashes/127804.rs new file mode 100644 index 00000000000..e583a7c1fc6 --- /dev/null +++ b/tests/crashes/127804.rs @@ -0,0 +1,12 @@ +//@ known-bug: #127804 + +struct Thing; + +pub trait Every { + type Assoc; +} +impl Every for Thing { + type Assoc = T; +} + +fn foo(_: ::Assoc) {} diff --git a/tests/crashes/128119.rs b/tests/crashes/128119.rs new file mode 100644 index 00000000000..7677b15a2f3 --- /dev/null +++ b/tests/crashes/128119.rs @@ -0,0 +1,15 @@ +//@ known-bug: #128119 + +trait Trait { + reuse to_reuse::foo { self } +} + +struct S; + +mod to_reuse { + pub fn foo(&self) -> u32 {} +} + +impl Trait S { + reuse to_reuse::foo { self } +} diff --git a/tests/crashes/128232.rs b/tests/crashes/128232.rs new file mode 100644 index 00000000000..67f61e1b240 --- /dev/null +++ b/tests/crashes/128232.rs @@ -0,0 +1,15 @@ +//@ known-bug: #128232 + +#![feature(generic_const_exprs, unsized_const_params)] + +fn function() {} + +struct Wrapper; + +impl Wrapper<{ bar() }> { + fn call() {} +} + +fn main() { + Wrapper::::call; +} diff --git a/tests/crashes/130411.rs b/tests/crashes/130411.rs new file mode 100644 index 00000000000..b733dcb30d5 --- /dev/null +++ b/tests/crashes/130411.rs @@ -0,0 +1,6 @@ +//@ known-bug: #130411 +trait Project { + const SELF: Self; +} + +fn take1(_: Project) {} diff --git a/tests/crashes/130413.rs b/tests/crashes/130413.rs new file mode 100644 index 00000000000..08435ac6450 --- /dev/null +++ b/tests/crashes/130413.rs @@ -0,0 +1,17 @@ +//@ known-bug: #130413 + +#![feature(transmutability)] +trait Aaa { + type Y; +} + +trait Bbb { + type B: std::mem::TransmuteFrom<()>; +} + +impl Bbb for T +where + T: Aaa, +{ + type B = T::Y; +} diff --git a/tests/crashes/130425.rs b/tests/crashes/130425.rs new file mode 100644 index 00000000000..559b86f7bc2 --- /dev/null +++ b/tests/crashes/130425.rs @@ -0,0 +1,13 @@ +//@ known-bug: #130425 +//@ compile-flags: -Zmir-opt-level=5 -Zpolymorphize=on + +struct S(T) +where + [T; ( + |_: u8| { + static FOO: Sync = AtomicUsize::new(0); + unsafe { &*(&FOO as *const _ as *const usize) } + }, + 1, + ) + .1]: Copy;