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