1 error[E0506]: cannot assign to `greeting` because it is borrowed
2 --> $DIR/issue-58776-borrowck-scans-children.rs:5:5
4 LL | let res = (|| (|| &greeting)())();
5 | -- -------- borrow occurs due to use in closure
7 | borrow of `greeting` occurs here
9 LL | greeting = "DEALLOCATED".to_string();
10 | ^^^^^^^^ assignment to borrowed `greeting` occurs here
12 LL | println!("thread result: {:?}", res);
13 | --- borrow later used here
15 error[E0505]: cannot move out of `greeting` because it is borrowed
16 --> $DIR/issue-58776-borrowck-scans-children.rs:7:10
18 LL | let res = (|| (|| &greeting)())();
19 | -- -------- borrow occurs due to use in closure
21 | borrow of `greeting` occurs here
24 | ^^^^^^^^ move out of `greeting` occurs here
26 LL | println!("thread result: {:?}", res);
27 | --- borrow later used here
29 error: aborting due to 2 previous errors
31 Some errors have detailed explanations: E0505, E0506.
32 For more information about an error, try `rustc --explain E0505`.