Auto merge of #130975 - matthiaskrgr:nice_ice_shall_suffice, r=jieyouxu

crashes: more tests

r? `@jieyouxu`
This commit is contained in:
bors 2024-09-29 13:09:08 +00:00
commit d194948e50
7 changed files with 89 additions and 0 deletions

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

@ -0,0 +1,13 @@
//@ known-bug: #130521
#![feature(object_safe_for_dispatch)]
struct Vtable(dyn Cap);
trait Cap<'a> {}
union Transmute {
t: u64,
u: &'static Vtable,
}
const G: &Copy = unsafe { Transmute { t: 1 }.u };

22
tests/crashes/130524.rs Normal file
View File

@ -0,0 +1,22 @@
//@ known-bug: #130524
trait Transform {
type Output<'a>;
}
trait Propagate<Input> {}
fn new_node<T: Transform>(_c: Vec<Box<dyn for<'a> Propagate<<T as Transform>::Output<'a>>>>) -> T {
todo!()
}
impl<Input, T> Propagate<Input> for T {}
struct Noop;
impl Transform for Noop {
type Output<'a> = ();
}
fn main() {
let _node: Noop = new_node(vec![Box::new(Noop)]);
}

20
tests/crashes/130627.rs Normal file
View File

@ -0,0 +1,20 @@
//@ known-bug: #130627
#![feature(trait_alias)]
trait Test {}
#[diagnostic::on_unimplemented(
message="message",
label="label",
note="note"
)]
trait Alias = Test;
// Use trait alias as bound on type parameter.
fn foo<T: Alias>(v: &T) {
}
pub fn main() {
foo(&1);
}

4
tests/crashes/130687.rs Normal file
View File

@ -0,0 +1,4 @@
//@ known-bug: #130687
//@ only-x86_64
pub struct Data([u8; usize::MAX >> 16]);
const _: &'static Data = &Data([0; usize::MAX >> 16]);

11
tests/crashes/130779.rs Normal file
View File

@ -0,0 +1,11 @@
//@ known-bug: #130779
#![feature(never_patterns)]
enum E { A }
fn main() {
match E::A {
! |
if true => {}
}
}

10
tests/crashes/130921.rs Normal file
View File

@ -0,0 +1,10 @@
//@ known-bug: #130921
//@ compile-flags: -Zvalidate-mir -Copt-level=0 --crate-type lib
pub fn hello() -> [impl Sized; 2] {
if false {
let x = hello();
let _: &[i32] = &x;
}
todo!()
}

9
tests/crashes/130970.rs Normal file
View File

@ -0,0 +1,9 @@
//@ known-bug: #130970
//@ compile-flags: -Zmir-opt-level=5 -Zvalidate-mir
fn main() {
extern "C" {
static symbol: [usize];
}
println!("{}", symbol[0]);
}