2024-04-02 08:00:46 -05:00
|
|
|
// Check that we forbid nested statics in `thread_local` statics.
|
2024-04-02 07:06:52 -05:00
|
|
|
|
|
|
|
#![feature(thread_local)]
|
|
|
|
|
|
|
|
#[thread_local]
|
2024-04-02 08:00:46 -05:00
|
|
|
static mut FOO: &u32 = {
|
|
|
|
//~^ ERROR: does not support implicit nested statics
|
|
|
|
// Prevent promotion (that would trigger on `&42` as an expression)
|
|
|
|
let x = 42;
|
|
|
|
&{ x }
|
|
|
|
};
|
|
|
|
|
|
|
|
fn main() {}
|