Closed
Description
# ramana at pc in ~/Documents/rust-lang/rust on git:fix-e0504 ✖︎ [18:05:33]
→ ./build/x86_64-unknown-linux-gnu/stage1/bin/rustc src/test/compile-fail/E0504.rs -Z borrowck=mir
error[E0505]: cannot move out of `fancy_num` because it is borrowed
--> src/test/compile-fail/E0504.rs:23:13
|
21 | let fancy_ref = &fancy_num;
| ---------- borrow of `fancy_num` occurs here
22 |
23 | let x = move || {
| _____________^
24 | | println!("child function: {}", fancy_num.num); //~ ERROR E0504
25 | | };
| |_____^ move out of `fancy_num` occurs here
error: aborting due to previous error
# ramana at pc in ~/Documents/rust-lang/rust on git:fix-e0504 ✖︎ [18:12:36]
→ ./build/x86_64-unknown-linux-gnu/stage1/bin/rustc src/test/compile-fail/E0504.rs
error[E0504]: cannot move `fancy_num` into closure because it is borrowed
--> src/test/compile-fail/E0504.rs:24:40
|
21 | let fancy_ref = &fancy_num;
| --------- borrow of `fancy_num` occurs here
...
24 | println!("child function: {}", fancy_num.num); //~ ERROR E0504
| ^^^^^^^^^ move into closure occurs here
error: aborting due to previous error
cc @arielb1
I am working on this.