]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/miri_unleashed/drop.rs
Rollup merge of #84083 - ltratt:threadid_doc_tweak, r=dtolnay
[rust.git] / src / test / ui / consts / miri_unleashed / drop.rs
1 // compile-flags: -Zunleash-the-miri-inside-of-you
2 // error-pattern: calling non-const function `<Vec<i32> as Drop>::drop`
3 #![allow(const_err)]
4
5 use std::mem::ManuallyDrop;
6
7 fn main() {}
8
9 static TEST_OK: () = {
10     let v: Vec<i32> = Vec::new();
11     let _v = ManuallyDrop::new(v);
12 };
13
14 // Make sure we catch executing bad drop functions.
15 // The actual error is tested by the error-pattern above.
16 static TEST_BAD: () = {
17     let _v: Vec<i32> = Vec::new();
18 };