blob: c9a7f2c8ed8056c0a5bcfa3bc99c2b99503481aa (
plain)
1
2
3
4
5
6
7
8
9
10
|
//@ run-rustfix
use std::thread;
fn main() {
let x = "Hello world!".to_string();
thread::spawn(move || {
println!("{}", x);
});
println!("{}", x); //~ ERROR borrow of moved value
}
|