]>
Commit | Line | Data |
---|---|---|
dfeec247 | 1 | // compile-flags: -Zunleash-the-miri-inside-of-you |
1b1a35ee | 2 | // error-pattern: calling non-const function `<Vec<i32> as Drop>::drop` |
f9f354fc | 3 | #![allow(const_err)] |
dfeec247 XL |
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(); | |
dfeec247 | 18 | }; |