Skip to content

Commit d194948

Browse files
committed
Auto merge of rust-lang#130975 - matthiaskrgr:nice_ice_shall_suffice, r=jieyouxu
crashes: more tests r? `@jieyouxu`
2 parents 2da3cb9 + 6d3aee2 commit d194948

File tree

7 files changed

+89
-0
lines changed

7 files changed

+89
-0
lines changed

tests/crashes/130521.rs

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//@ known-bug: #130521
2+
3+
#![feature(object_safe_for_dispatch)]
4+
struct Vtable(dyn Cap);
5+
6+
trait Cap<'a> {}
7+
8+
union Transmute {
9+
t: u64,
10+
u: &'static Vtable,
11+
}
12+
13+
const G: &Copy = unsafe { Transmute { t: 1 }.u };

tests/crashes/130524.rs

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//@ known-bug: #130524
2+
3+
trait Transform {
4+
type Output<'a>;
5+
}
6+
7+
trait Propagate<Input> {}
8+
9+
fn new_node<T: Transform>(_c: Vec<Box<dyn for<'a> Propagate<<T as Transform>::Output<'a>>>>) -> T {
10+
todo!()
11+
}
12+
13+
impl<Input, T> Propagate<Input> for T {}
14+
struct Noop;
15+
16+
impl Transform for Noop {
17+
type Output<'a> = ();
18+
}
19+
20+
fn main() {
21+
let _node: Noop = new_node(vec![Box::new(Noop)]);
22+
}

tests/crashes/130627.rs

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//@ known-bug: #130627
2+
3+
#![feature(trait_alias)]
4+
5+
trait Test {}
6+
7+
#[diagnostic::on_unimplemented(
8+
message="message",
9+
label="label",
10+
note="note"
11+
)]
12+
trait Alias = Test;
13+
14+
// Use trait alias as bound on type parameter.
15+
fn foo<T: Alias>(v: &T) {
16+
}
17+
18+
pub fn main() {
19+
foo(&1);
20+
}

tests/crashes/130687.rs

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

tests/crashes/130779.rs

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//@ known-bug: #130779
2+
#![feature(never_patterns)]
3+
4+
enum E { A }
5+
6+
fn main() {
7+
match E::A {
8+
! |
9+
if true => {}
10+
}
11+
}

tests/crashes/130921.rs

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//@ known-bug: #130921
2+
//@ compile-flags: -Zvalidate-mir -Copt-level=0 --crate-type lib
3+
4+
pub fn hello() -> [impl Sized; 2] {
5+
if false {
6+
let x = hello();
7+
let _: &[i32] = &x;
8+
}
9+
todo!()
10+
}

tests/crashes/130970.rs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//@ known-bug: #130970
2+
//@ compile-flags: -Zmir-opt-level=5 -Zvalidate-mir
3+
4+
fn main() {
5+
extern "C" {
6+
static symbol: [usize];
7+
}
8+
println!("{}", symbol[0]);
9+
}

0 commit comments

Comments
 (0)