blob: 3a05a1305beedc2c913f3f5e6da9b9b8a0c88151 [file] [log] [blame]
error[E0382]: borrow of moved value: `x`
--> $DIR/moves-based-on-type-capture-clause-bad.rs:8:20
|
LL | let x = "Hello world!".to_string();
| - move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait
LL | thread::spawn(move|| {
| ------ value moved into closure here
LL | println!("{}", x);
| - variable moved due to use in closure
LL | });
LL | println!("{}", x);
| ^ value borrowed here after move
error: aborting due to previous error
For more information about this error, try `rustc --explain E0382`.