1 // rust-lang/rust#47215: at one time, the compiler categorized
2 // thread-local statics as a temporary rvalue, as a way to enforce
3 // that they are only valid for a given lifetime.
5 // The problem with this is that you cannot move out of static items,
6 // but you *can* move temporary rvalues. I.e., the categorization
7 // above only solves half of the problem presented by thread-local
10 #![feature(thread_local)]
13 static mut X: ::std::sync::atomic::AtomicUsize = ::std::sync::atomic::AtomicUsize::new(0);
17 let mut x = X; //~ ERROR cannot move out of static item `X` [E0507]