fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
667 B17 linesraw
1error[E0506]: cannot assign to `greeting` because it is borrowed
2  --> $DIR/issue-58776-borrowck-scans-children.rs:5:5
3   |
4LL |     let res = (|| (|| &greeting)())();
5   |                --      -------- borrow occurs due to use in closure
6   |                |
7   |                `greeting` is borrowed here
8LL |
9LL |     greeting = "DEALLOCATED".to_string();
10   |     ^^^^^^^^ `greeting` is assigned to here but it was already borrowed
11...
12LL |     println!("thread result: {:?}", res);
13   |                                     --- borrow later used here
14
15error: aborting due to previous error
16
17For more information about this error, try `rustc --explain E0506`.