fork/rust

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

borsAuto merge of #69444 - pietroalbini:stable-next-final-v2-new, r=pietroalbinif3e1a954d2e

1.41.1
690 B17 linesraw
1error[E0505]: cannot move out of `fancy_num` because it is borrowed
2  --> $DIR/E0504.rs:9:13
3   |
4LL |     let fancy_ref = &fancy_num;
5   |                     ---------- borrow of `fancy_num` occurs here
6LL | 
7LL |     let x = move || {
8   |             ^^^^^^^ move out of `fancy_num` occurs here
9LL |         println!("child function: {}", fancy_num.num);
10   |                                        --------- move occurs due to use in closure
11...
12LL |     println!("main function: {}", fancy_ref.num);
13   |                                   ------------- borrow later used here
14
15error: aborting due to previous error
16
17For more information about this error, try `rustc --explain E0505`.