2018-08-08 14:28:26 +02:00
|
|
|
error[E0504]: cannot move `v` into closure because it is borrowed
|
2018-08-08 18:01:04 +02:00
|
|
|
--> $DIR/borrowck-loan-blocks-move-cc.rs:25:27
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
2018-08-15 01:16:05 +02:00
|
|
|
LL | let w = &v;
|
|
|
|
| - borrow of `v` occurs here
|
2018-08-08 14:28:26 +02:00
|
|
|
LL | thread::spawn(move|| {
|
|
|
|
LL | println!("v={}", *v);
|
|
|
|
| ^ move into closure occurs here
|
|
|
|
|
|
|
|
error[E0504]: cannot move `v` into closure because it is borrowed
|
2018-08-15 01:16:05 +02:00
|
|
|
--> $DIR/borrowck-loan-blocks-move-cc.rs:35:27
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
2018-08-15 01:16:05 +02:00
|
|
|
LL | let w = &v;
|
|
|
|
| - borrow of `v` occurs here
|
2018-08-08 14:28:26 +02:00
|
|
|
LL | thread::spawn(move|| {
|
|
|
|
LL | println!("v={}", *v);
|
|
|
|
| ^ move into closure occurs here
|
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0504`.
|