]> git.lizzy.rs Git - rust.git/blob - src/test/ui/error-codes/E0504.stderr
Merge commit 'd3a2366ee877075c59b38bd8ced55f224fc7ef51' into sync_cg_clif-2022-07-26
[rust.git] / src / test / ui / error-codes / E0504.stderr
1 error[E0505]: cannot move out of `fancy_num` because it is borrowed
2   --> $DIR/E0504.rs:9:13
3    |
4 LL |     let fancy_ref = &fancy_num;
5    |                     ---------- borrow of `fancy_num` occurs here
6 LL |
7 LL |     let x = move || {
8    |             ^^^^^^^ move out of `fancy_num` occurs here
9 LL |         println!("child function: {}", fancy_num.num);
10    |                                        ------------- move occurs due to use in closure
11 ...
12 LL |     println!("main function: {}", fancy_ref.num);
13    |                                   ------------- borrow later used here
14
15 error: aborting due to previous error
16
17 For more information about this error, try `rustc --explain E0505`.