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

20 lines
474 B
Rust
Raw Normal View History

2019-12-24 05:20:36 -06:00
// compile-flags: -Zunleash-the-miri-inside-of-you
#![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
};