656db98bd9
CC #99430
33 lines
1.2 KiB
Plaintext
33 lines
1.2 KiB
Plaintext
error[E0506]: cannot assign to `greeting` because it is borrowed
|
|
--> $DIR/issue-58776-borrowck-scans-children.rs:5:5
|
|
|
|
|
LL | let res = (|| (|| &greeting)())();
|
|
| -- -------- borrow occurs due to use in closure
|
|
| |
|
|
| `greeting` is borrowed here
|
|
LL |
|
|
LL | greeting = "DEALLOCATED".to_string();
|
|
| ^^^^^^^^ `greeting` is assigned to here but it was already borrowed
|
|
...
|
|
LL | println!("thread result: {:?}", res);
|
|
| --- borrow later used here
|
|
|
|
error[E0505]: cannot move out of `greeting` because it is borrowed
|
|
--> $DIR/issue-58776-borrowck-scans-children.rs:7:10
|
|
|
|
|
LL | let res = (|| (|| &greeting)())();
|
|
| -- -------- borrow occurs due to use in closure
|
|
| |
|
|
| borrow of `greeting` occurs here
|
|
...
|
|
LL | drop(greeting);
|
|
| ^^^^^^^^ move out of `greeting` occurs here
|
|
...
|
|
LL | println!("thread result: {:?}", res);
|
|
| --- borrow later used here
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
Some errors have detailed explanations: E0505, E0506.
|
|
For more information about an error, try `rustc --explain E0505`.
|