Address some review comments
This commit is contained in:
parent
3db0568c40
commit
569792acbc
18
tests/compile-fail/never_transmute_humans.rs
Normal file
18
tests/compile-fail/never_transmute_humans.rs
Normal file
@ -0,0 +1,18 @@
|
||||
// This should fail even without validation
|
||||
// compile-fail causes rustc ICE: rust-lang/rust#50570
|
||||
// compile-flags: -Zmir-emit-validate=0
|
||||
|
||||
#![feature(never_type)]
|
||||
#![allow(unreachable_code)]
|
||||
#![allow(unused_variables)]
|
||||
|
||||
struct Human;
|
||||
|
||||
fn main() {
|
||||
let x: ! = unsafe {
|
||||
std::mem::transmute::<Human, !>(Human) //~ ERROR entered unreachable code
|
||||
};
|
||||
f(x)
|
||||
}
|
||||
|
||||
fn f(x: !) -> ! { x }
|
@ -1,14 +0,0 @@
|
||||
// Validation forces more allocation; disable it.
|
||||
// compile-flags: -Zmir-emit-validate=0
|
||||
#![feature(box_syntax, custom_attribute, attr_literals)]
|
||||
#![miri(memory_size=1024)]
|
||||
|
||||
// On 64bit platforms, the allocator needs 32 bytes allocated to pass a return value, so that's the error we see.
|
||||
// On 32bit platforms, it's just 16 bytes.
|
||||
// error-pattern: tried to allocate
|
||||
|
||||
fn main() {
|
||||
loop {
|
||||
::std::mem::forget(box 42);
|
||||
}
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
// ignore-test
|
||||
|
||||
fn main() {
|
||||
let data: [u8; 1024*1024*1024] = [42; 1024*1024*1024];
|
||||
//~^ ERROR: tried to allocate
|
||||
assert_eq!(data.len(), 1024*1024*1024);
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
//error-pattern: reached the configured maximum execution time
|
||||
#![feature(custom_attribute, attr_literals)]
|
||||
#![miri(step_limit=1000)]
|
||||
|
||||
fn main() {
|
||||
for i in 0..1000000 {
|
||||
assert!(i < 1000);
|
||||
}
|
||||
}
|
@ -203,7 +203,7 @@ fn run_pass_rustc() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[ignore] // TODO: update test errors
|
||||
#[should_panic] // TODO: update test errors
|
||||
fn compile_fail_miri() {
|
||||
let sysroot = get_sysroot();
|
||||
let host = get_host();
|
||||
|
Loading…
x
Reference in New Issue
Block a user