]>
Commit | Line | Data |
---|---|---|
f9f354fc XL |
1 | // revisions: default unleash |
2 | //[unleash]compile-flags: -Zunleash-the-miri-inside-of-you | |
dfeec247 | 3 | |
f9f354fc XL |
4 | // This test ensures that we do not allow ZST statics to initialize themselves without ever |
5 | // actually creating a value of that type. This is important, as the ZST may have private fields | |
6 | // that users can reasonably expect to only get initialized by their own code. Thus unsafe code | |
7 | // can depend on this fact and will thus do unsound things when it is violated. | |
8 | // See https://github.com/rust-lang/rust/issues/71078 for more details. | |
9 | ||
1b1a35ee | 10 | static FOO: () = FOO; //~ cycle detected when const-evaluating + checking `FOO` |
dfeec247 XL |
11 | |
12 | fn main() { | |
13 | FOO | |
14 | } |