]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/miri_unleashed/drop.rs
add test for dropping in const
[rust.git] / src / test / ui / consts / miri_unleashed / drop.rs
1 // compile-flags: -Zunleash-the-miri-inside-of-you
2 #![deny(const_err)]
3
4 use std::mem::ManuallyDrop;
5
6 fn main() {}
7
8 static TEST_OK: () = {
9     let v: Vec<i32> = Vec::new();
10     let _v = ManuallyDrop::new(v);
11 };
12
13 // Make sure we catch executing bad drop functions.
14 // The actual error is located in `real_drop_in_place` so we can't capture it with the
15 // error annotations here.
16 static TEST_BAD: () = {
17     let _v: Vec<i32> = Vec::new();
18     //~^ WARN skipping const check
19 };