Closed
Description
I haven't checked whether that is actually true, but we should have an unleash-the-miri-inside-of-you test for the following code snippet. In contrast to normal compilation I expect this to pass compilation and then segfault LLVM or similar, but we may catch it. No matter the result, we should have a test for it.
#![feature(thread_local)]
use std::thread;
#[thread_local]
static mut A: u8 = 0;
static B: &u8 = unsafe { &A };
Errors:
Compiling playground v0.0.1 (/playground)
warning: unused import: `std::thread`
--> src/lib.rs:3:5
|
3 | use std::thread;
| ^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
error[E0625]: thread-local statics cannot be accessed at compile-time
--> src/lib.rs:8:27
|
8 | static B: &u8 = unsafe { &A };
| ^
error: aborting due to previous error
error: could not compile `playground`.
To learn more, run the command again with --verbose.