2019-12-24 12:20:36 +01:00
|
|
|
//@ compile-flags: -Zunleash-the-miri-inside-of-you
|
|
|
|
|
|
|
|
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 11:18:39 +01:00
|
|
|
// The actual error is tested by the error-pattern above.
|
2020-05-03 14:23:08 +02:00
|
|
|
static TEST_BAD: () = {
|
2019-12-24 12:20:36 +01:00
|
|
|
let _v: Vec<i32> = Vec::new();
|
2025-03-29 02:41:32 +03:00
|
|
|
}; //~ ERROR could not evaluate static initializer
|
2025-04-12 22:40:34 +03:00
|
|
|
//~| NOTE calling non-const function `<Vec<i32> as Drop>::drop`
|
|
|
|
//~| NOTE inside `std::ptr::drop_in_place::<Vec<i32>> - shim(Some(Vec<i32>))`
|
2025-03-29 02:41:32 +03:00
|
|
|
|
|
|
|
//~? WARN skipping const checks
|