2019-12-24 05:20:36 -06:00
|
|
|
// compile-flags: -Zunleash-the-miri-inside-of-you
|
2019-12-25 04:18:39 -06:00
|
|
|
// error-pattern: calling non-const function `<std::vec::Vec<i32> as std::ops::Drop>::drop`
|
2020-04-19 05:32:21 -05:00
|
|
|
#![allow(const_err)]
|
2019-12-24 05:20:36 -06:00
|
|
|
|
|
|
|
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.
|
2019-12-25 04:18:39 -06:00
|
|
|
// The actual error is tested by the error-pattern above.
|
2020-05-03 07:23:08 -05:00
|
|
|
static TEST_BAD: () = {
|
2019-12-24 05:20:36 -06:00
|
|
|
let _v: Vec<i32> = Vec::new();
|
|
|
|
};
|