rust/src/test/ui/consts/miri_unleashed/drop.rs

21 lines
526 B
Rust
Raw Normal View History

2019-12-24 05:20:36 -06:00
// compile-flags: -Zunleash-the-miri-inside-of-you
// ignore-x86 FIXME: missing sysroot spans (#53081)
2019-12-24 05:20:36 -06:00
#![deny(const_err)]
use std::mem::ManuallyDrop;
fn main() {}
static TEST_OK: () = {
let v: Vec<i32> = Vec::new();
let _v = ManuallyDrop::new(v);
};
// Make sure we catch executing bad drop functions.
// The actual error is located in `real_drop_in_place` so we can't capture it with the
// error annotations here.
static TEST_BAD: () = {
let _v: Vec<i32> = Vec::new();
//~^ WARN skipping const check
};