forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#130975 - matthiaskrgr:nice_ice_shall_suffice,…
… r=jieyouxu crashes: more tests r? `@jieyouxu`
- Loading branch information
Showing
7 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 => {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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!() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]); | ||
} |