2019-02-27 15:01:42 -06:00
|
|
|
error[E0506]: cannot assign to `greeting` because it is borrowed
|
2019-04-07 10:07:36 -05:00
|
|
|
--> $DIR/issue-58776-borrowck-scans-children.rs:5:5
|
2019-02-27 15:01:42 -06:00
|
|
|
|
|
|
|
|
LL | let res = (|| (|| &greeting)())();
|
|
|
|
| -- -------- borrow occurs due to use in closure
|
|
|
|
| |
|
2023-01-14 21:06:44 -06:00
|
|
|
| `greeting` is borrowed here
|
2022-06-08 13:07:59 -05:00
|
|
|
LL |
|
2019-02-27 15:01:42 -06:00
|
|
|
LL | greeting = "DEALLOCATED".to_string();
|
2023-01-14 21:06:44 -06:00
|
|
|
| ^^^^^^^^ `greeting` is assigned to here but it was already borrowed
|
2019-02-27 15:01:42 -06:00
|
|
|
...
|
|
|
|
LL | println!("thread result: {:?}", res);
|
|
|
|
| --- borrow later used here
|
|
|
|
|
2023-02-08 15:29:52 -06:00
|
|
|
error: aborting due to previous error
|
2019-02-27 15:01:42 -06:00
|
|
|
|
2023-02-08 15:29:52 -06:00
|
|
|
For more information about this error, try `rustc --explain E0506`.
|