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