about summary refs log tree commit diff
path: root/tests/ui/statics/nested_thread_local.rs
blob: 2590cc579cd27c07814d6311e5704c6d6ba4b3a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// Check that we forbid nested statics in `thread_local` statics.

#![feature(thread_local)]

#[thread_local]
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() {}