blob: ce1880c584a6e94e1dcfb6114c4001fbb9d18074 [file] [log] [blame]
error[E0505]: cannot move out of `x1` because it is borrowed
--> $DIR/borrowck-multiple-captures.rs:22:19
|
LL | let p1 = &x1;
| --- borrow of `x1` occurs here
...
LL | thread::spawn(move|| {
| ^^^^^^ move out of `x1` occurs here
LL | drop(x1); //~ ERROR cannot move `x1` into closure because it is borrowed
| -- move occurs due to use in closure
...
LL | borrow(&*p1);
| ---- borrow later used here
error[E0505]: cannot move out of `x2` because it is borrowed
--> $DIR/borrowck-multiple-captures.rs:22:19
|
LL | let p2 = &x2;
| --- borrow of `x2` occurs here
LL | thread::spawn(move|| {
| ^^^^^^ move out of `x2` occurs here
LL | drop(x1); //~ ERROR cannot move `x1` into closure because it is borrowed
LL | drop(x2); //~ ERROR cannot move `x2` into closure because it is borrowed
| -- move occurs due to use in closure
...
LL | borrow(&*p2);
| ---- borrow later used here
error[E0382]: use of moved value: `x1`
--> $DIR/borrowck-multiple-captures.rs:35:19
|
LL | drop(x1);
| -- value moved here
...
LL | thread::spawn(move|| {
| ^^^^^^ 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:35:19
|
LL | drop(x2);
| -- value moved here
LL | thread::spawn(move|| {
| ^^^^^^ value used here after 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:46:14
|
LL | drop(x); //~ ERROR cannot move `x` into closure because it is borrowed
| - value moved here
LL | drop(x); //~ ERROR use of moved value: `x`
| ^ value used here after move
|
= note: move occurs because `x` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait
error[E0505]: cannot move out of `x` because it is borrowed
--> $DIR/borrowck-multiple-captures.rs:44:19
|
LL | let p = &x;
| -- borrow of `x` occurs here
LL | thread::spawn(move|| {
| ^^^^^^ move out of `x` occurs here
LL | drop(x); //~ ERROR cannot move `x` into closure because it is borrowed
| - move occurs due to use in closure
...
LL | borrow(&*p);
| --- borrow later used here
error[E0382]: use of moved value: `x`
--> $DIR/borrowck-multiple-captures.rs:56:14
|
LL | drop(x); //~ ERROR capture of moved value: `x`
| - value moved here
LL | drop(x); //~ ERROR use of moved value: `x`
| ^ value used here after move
|
= note: move occurs because `x` 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:54:19
|
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
Some errors occurred: E0382, E0505.
For more information about an error, try `rustc --explain E0382`.