]> git.proxmox.com Git - rustc.git/blob - src/test/ui/moves/moves-based-on-type-capture-clause-bad.nll.stderr
New upstream version 1.34.2+dfsg1
[rustc.git] / src / test / ui / moves / moves-based-on-type-capture-clause-bad.nll.stderr
1 error[E0382]: borrow of moved value: `x`
2 --> $DIR/moves-based-on-type-capture-clause-bad.rs:8:20
3 |
4 LL | let x = "Hello world!".to_string();
5 | - move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait
6 LL | thread::spawn(move|| {
7 | ------ value moved into closure here
8 LL | println!("{}", x);
9 | - variable moved due to use in closure
10 LL | });
11 LL | println!("{}", x); //~ ERROR use of moved value
12 | ^ value borrowed here after move
13
14 error: aborting due to previous error
15
16 For more information about this error, try `rustc --explain E0382`.