Merge branch 'master' into deps
This commit is contained in:
commit
af6ede08b0
@ -70,7 +70,7 @@ RUSTFLAGS='-Zalways-encode-mir' xargo build
|
||||
Now you can run miri against the libstd compiled by xargo:
|
||||
|
||||
```sh
|
||||
MIRI_SYSROOT=~/.xargo/HOST cargo run --bin miri tests/run-pass-fullmir/vecs.rs
|
||||
MIRI_SYSROOT=~/.xargo/HOST cargo run --bin miri tests/run-pass-fullmir/hashmap.rs
|
||||
```
|
||||
|
||||
Notice that you will have to re-run the last step of the preparations above when
|
||||
|
@ -9,7 +9,7 @@ use std::alloc::*;
|
||||
|
||||
fn main() {
|
||||
unsafe {
|
||||
let x = Global.alloc(Layout::from_size_align_unchecked(1, 1));
|
||||
let x = Global.alloc(Layout::from_size_align_unchecked(1, 1)).unwrap();
|
||||
Global.dealloc(x, Layout::from_size_align_unchecked(1, 2));
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ use std::alloc::*;
|
||||
|
||||
fn main() {
|
||||
unsafe {
|
||||
let x = Global.alloc(Layout::from_size_align_unchecked(1, 1));
|
||||
let x = Global.alloc(Layout::from_size_align_unchecked(1, 1)).unwrap();
|
||||
Global.dealloc(x, Layout::from_size_align_unchecked(2, 1));
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ use std::alloc::*;
|
||||
|
||||
fn main() {
|
||||
unsafe {
|
||||
let x = Global.alloc(Layout::from_size_align_unchecked(1, 1));
|
||||
let x = Global.alloc(Layout::from_size_align_unchecked(1, 1)).unwrap();
|
||||
Global.dealloc(x, Layout::from_size_align_unchecked(1, 1));
|
||||
Global.dealloc(x, Layout::from_size_align_unchecked(1, 1));
|
||||
}
|
||||
|
@ -1,3 +1,5 @@
|
||||
// ignore-test FIXME: we are not checking these things on match any more?
|
||||
|
||||
fn main() {
|
||||
assert!(std::char::from_u32(-1_i32 as u32).is_none());
|
||||
match unsafe { std::mem::transmute::<i32, char>(-1) } { //~ ERROR constant evaluation error [E0080]
|
||||
|
@ -1,3 +1,4 @@
|
||||
// ignore-test FIXME: leak detection is disabled
|
||||
//error-pattern: the evaluated program leaked memory
|
||||
|
||||
fn main() {
|
||||
|
@ -1,3 +1,4 @@
|
||||
// ignore-test FIXME: leak detection is disabled
|
||||
//error-pattern: the evaluated program leaked memory
|
||||
|
||||
use std::rc::Rc;
|
||||
|
@ -13,5 +13,5 @@
|
||||
fn main() {
|
||||
// Make sure we catch overflows that would be hidden by first casting the RHS to u32
|
||||
let _n = 1i64 >> (u32::max_value() as i64 + 1); //~ ERROR constant evaluation error [E0080]
|
||||
//~^ NOTE suiriuruihrihue
|
||||
//~^ NOTE attempt to shift right with overflow
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
//ignore-windows
|
||||
// FIXME: Something in panic handling fails validation with full-MIR
|
||||
// compile-flags: -Zmir-emit-validate=0
|
||||
//error-pattern: the evaluated program panicked
|
||||
|
@ -9,7 +9,7 @@ use std::alloc::*;
|
||||
|
||||
fn main() {
|
||||
unsafe {
|
||||
let x = Global.alloc(Layout::from_size_align_unchecked(1, 1));
|
||||
let _y = Global.realloc(x, Layout::from_size_align_unchecked(2, 1), 1);
|
||||
let x = Global.alloc(Layout::from_size_align_unchecked(1, 1)).unwrap();
|
||||
let _y = Global.realloc(x, Layout::from_size_align_unchecked(2, 1), 1).unwrap();
|
||||
}
|
||||
}
|
||||
|
@ -7,9 +7,9 @@ use std::alloc::*;
|
||||
|
||||
fn main() {
|
||||
unsafe {
|
||||
let x = Global.alloc(Layout::from_size_align_unchecked(1, 1));
|
||||
let _y = Global.realloc(x, Layout::from_size_align_unchecked(1, 1), 1);
|
||||
let _z = *(x as *mut u8); //~ ERROR constant evaluation error [E0080]
|
||||
let x = Global.alloc(Layout::from_size_align_unchecked(1, 1)).unwrap();
|
||||
let _y = Global.realloc(x, Layout::from_size_align_unchecked(1, 1), 1).unwrap();
|
||||
let _z = *(x.as_ptr() as *mut u8); //~ ERROR constant evaluation error [E0080]
|
||||
//~^ NOTE dangling pointer was dereferenced
|
||||
}
|
||||
}
|
||||
|
@ -9,8 +9,8 @@ use std::alloc::*;
|
||||
|
||||
fn main() {
|
||||
unsafe {
|
||||
let x = Global.alloc(Layout::from_size_align_unchecked(1, 1));
|
||||
let x = Global.alloc(Layout::from_size_align_unchecked(1, 1)).unwrap();
|
||||
Global.dealloc(x, Layout::from_size_align_unchecked(1, 1));
|
||||
Global.realloc(x, Layout::from_size_align_unchecked(1, 1), 1);
|
||||
Global.realloc(x, Layout::from_size_align_unchecked(1, 1), 1).unwrap();
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
// ignore-test FIXME: we are not making these statics read-only any more?
|
||||
static X: usize = 5;
|
||||
|
||||
#[allow(mutable_transmutes)]
|
||||
|
@ -4,6 +4,7 @@
|
||||
fn main() {
|
||||
let v: Vec<u8> = Vec::with_capacity(10);
|
||||
let undef = unsafe { *v.get_unchecked(5) };
|
||||
let x = undef + 1; //~ ERROR: attempted to read undefined bytes
|
||||
let x = undef + 1; //~ ERROR: error
|
||||
//~^ NOTE attempted to read undefined bytes
|
||||
panic!("this should never print: {}", x);
|
||||
}
|
@ -192,7 +192,9 @@ fn run_pass_miri_noopt() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[ignore] // FIXME: Disabled for now, as the optimizer is pretty broken and crashes...
|
||||
#[ignore]
|
||||
// FIXME: Disabled for now, as the optimizer is pretty broken and crashes...
|
||||
// See https://github.com/rust-lang/rust/issues/50411
|
||||
fn run_pass_miri_opt() {
|
||||
run_pass_miri(true);
|
||||
}
|
||||
@ -204,13 +206,11 @@ fn run_pass_rustc() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[should_panic] // TODO: update test errors
|
||||
fn compile_fail_miri() {
|
||||
let sysroot = get_sysroot();
|
||||
let host = get_host();
|
||||
|
||||
// FIXME: run tests for other targets, too
|
||||
compile_fail(&sysroot, "tests/compile-fail", &host, &host, true);
|
||||
|
||||
compile_fail(&sysroot, "tests/compile-fail-fullmir", &host, &host, true);
|
||||
//compile_fail(&sysroot, "tests/compile-fail-fullmir", &host, &host, true);
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// FIXME: We handle uninitialzied storage here, which currently makes validation fail.
|
||||
// FIXME: We handle uninitialized storage here, which currently makes validation fail.
|
||||
// compile-flags: -Zmir-emit-validate=0
|
||||
|
||||
//ignore-msvc
|
Loading…
x
Reference in New Issue
Block a user