Skip to content

Commit

Permalink
Auto merge of rust-lang#130975 - matthiaskrgr:nice_ice_shall_suffice,…
Browse files Browse the repository at this point in the history
… r=jieyouxu

crashes: more tests

r? `@jieyouxu`
  • Loading branch information
bors committed Sep 28, 2024
2 parents 612796c + fa4816b commit 6eef6a0
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/crashes/130521.rs
Original file line number Diff line number Diff line change
@@ -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 changes: 22 additions & 0 deletions tests/crashes/130524.rs
Original file line number Diff line number Diff line change
@@ -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 changes: 20 additions & 0 deletions tests/crashes/130627.rs
Original file line number Diff line number Diff line change
@@ -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);
}
3 changes: 3 additions & 0 deletions tests/crashes/130687.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
//@ known-bug: #130687
pub struct Data([u8; usize::MAX >> 16]);
const _: &'static Data = &Data([0; usize::MAX >> 16]);
11 changes: 11 additions & 0 deletions tests/crashes/130779.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//@ known-bug: #130779
#![feature(never_patterns)]

enum E { A }

fn main() {
match E::A {
! |
if true => {}
}
}
10 changes: 10 additions & 0 deletions tests/crashes/130921.rs
Original file line number Diff line number Diff line change
@@ -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 changes: 9 additions & 0 deletions tests/crashes/130970.rs
Original file line number Diff line number Diff line change
@@ -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]);
}

0 comments on commit 6eef6a0

Please sign in to comment.