rust/src/test/ui/borrowck/borrowck-loan-blocks-move-cc.stderr

22 lines
746 B
Plaintext
Raw Normal View History

2018-08-08 14:28:26 +02:00
error[E0504]: cannot move `v` into closure because it is borrowed
--> $DIR/borrowck-loan-blocks-move-cc.rs:25:27
2018-08-08 14:28:26 +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
--> $DIR/borrowck-loan-blocks-move-cc.rs:35:27
2018-08-08 14:28:26 +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`.