1 //! Ensure that thread-local statics get deallocated when the thread dies.
3 #![feature(thread_local)]
6 static mut TLS: u8 = 0;
8 struct SendRaw(*const u8);
9 unsafe impl Send for SendRaw {}
13 let dangling_ptr = std::thread::spawn(|| SendRaw(&TLS as *const u8)).join().unwrap();
14 let _val = *dangling_ptr.0; //~ ERROR: dereferenced after this allocation got freed