error[E0382]: use of moved value: `x1`
--> $DIR/borrowck-multiple-captures.rs:25:19
|
+LL | let x1: Box<_> = box 1;
+ | -- move occurs because `x1` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait
LL | drop(x1);
| -- value moved here
...
| ^^^^^^ value used here after move
LL | drop(x1); //~ ERROR capture of moved value: `x1`
| -- use occurs due to use in closure
- |
- = note: move occurs because `x1` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait
error[E0382]: use of moved value: `x2`
--> $DIR/borrowck-multiple-captures.rs:25:19
|
+LL | let x2: Box<_> = box 2;
+ | -- move occurs because `x2` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait
LL | drop(x2);
| -- value moved here
LL | thread::spawn(move|| {
LL | drop(x1); //~ ERROR capture of moved value: `x1`
LL | drop(x2); //~ ERROR capture of moved value: `x2`
| -- use occurs due to use in closure
- |
- = note: move occurs because `x2` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait
error[E0382]: use of moved value: `x`
--> $DIR/borrowck-multiple-captures.rs:36:14
error[E0382]: use of moved value: `x`
--> $DIR/borrowck-multiple-captures.rs:44:19
|
+LL | let x: Box<_> = box 1;
+ | - move occurs because `x` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait
LL | drop(x);
| - value moved here
LL | thread::spawn(move|| {
| ^^^^^^ value used here after move
LL | drop(x); //~ ERROR capture of moved value: `x`
| - use occurs due to use in closure
- |
- = note: move occurs because `x` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait
error: aborting due to 8 previous errors