]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/borrowck-bad-nested-calls-move.stderr
Auto merge of #107843 - bjorn3:sync_cg_clif-2023-02-09, r=bjorn3
[rust.git] / tests / ui / borrowck / borrowck-bad-nested-calls-move.stderr
1 error[E0505]: cannot move out of `a` because it is borrowed
2   --> $DIR/borrowck-bad-nested-calls-move.rs:25:9
3    |
4 LL |     let mut a: Box<_> = Box::new(1);
5    |         ----- binding `a` declared here
6 ...
7 LL |     add(
8    |     --- borrow later used by call
9 LL |         &*a,
10    |         --- borrow of `*a` occurs here
11 LL |         a);
12    |         ^ move out of `a` occurs here
13
14 error[E0505]: cannot move out of `a` because it is borrowed
15   --> $DIR/borrowck-bad-nested-calls-move.rs:32:9
16    |
17 LL |     let mut a: Box<_> = Box::new(1);
18    |         ----- binding `a` declared here
19 LL |     add(
20    |     --- borrow later used by call
21 LL |         &*a,
22    |         --- borrow of `*a` occurs here
23 LL |         a);
24    |         ^ move out of `a` occurs here
25
26 error: aborting due to 2 previous errors
27
28 For more information about this error, try `rustc --explain E0505`.