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

10 lines
190 B
Rust

use std::thread;
fn main() {
let x = "Hello world!".to_string();
thread::spawn(move || {
println!("{}", x);
});
println!("{}", x); //~ ERROR borrow of moved value
}