rust/tests/ui/moves/moves-based-on-type-capture...

13 lines
204 B
Rust

//@ run-pass
#![allow(unused_must_use)]
//@ needs-threads
use std::thread;
pub fn main() {
let x = "Hello world!".to_string();
thread::spawn(move|| {
println!("{}", x);
}).join();
}