more crash tests

This commit is contained in:
Matthias Krüger 2024-09-18 00:10:25 +02:00
parent f609b7e058
commit 12814c8aa5
7 changed files with 97 additions and 0 deletions

19
tests/crashes/120016.rs Normal file
View File

@ -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<Output = impl Sized>;
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() {}

12
tests/crashes/127804.rs Normal file
View File

@ -0,0 +1,12 @@
//@ known-bug: #127804
struct Thing;
pub trait Every {
type Assoc;
}
impl<T: ?Sized> Every for Thing {
type Assoc = T;
}
fn foo(_: <Thing as Every>::Assoc) {}

15
tests/crashes/128119.rs Normal file
View File

@ -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 }
}

15
tests/crashes/128232.rs Normal file
View File

@ -0,0 +1,15 @@
//@ known-bug: #128232
#![feature(generic_const_exprs, unsized_const_params)]
fn function() {}
struct Wrapper<const F: fn()>;
impl Wrapper<{ bar() }> {
fn call() {}
}
fn main() {
Wrapper::<function>::call;
}

6
tests/crashes/130411.rs Normal file
View File

@ -0,0 +1,6 @@
//@ known-bug: #130411
trait Project {
const SELF: Self;
}
fn take1(_: Project<SELF = {}>) {}

17
tests/crashes/130413.rs Normal file
View File

@ -0,0 +1,17 @@
//@ known-bug: #130413
#![feature(transmutability)]
trait Aaa {
type Y;
}
trait Bbb {
type B: std::mem::TransmuteFrom<()>;
}
impl<T> Bbb for T
where
T: Aaa,
{
type B = T::Y;
}

13
tests/crashes/130425.rs Normal file
View File

@ -0,0 +1,13 @@
//@ known-bug: #130425
//@ compile-flags: -Zmir-opt-level=5 -Zpolymorphize=on
struct S<T>(T)
where
[T; (
|_: u8| {
static FOO: Sync = AtomicUsize::new(0);
unsafe { &*(&FOO as *const _ as *const usize) }
},
1,
)
.1]: Copy;