]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/two-phase-allow-access-during-reservation.nll_target.stderr
implement Hash for proc_macro::LineColumn
[rust.git] / tests / ui / borrowck / two-phase-allow-access-during-reservation.nll_target.stderr
1 error[E0503]: cannot use `i` because it was mutably borrowed
2   --> $DIR/two-phase-allow-access-during-reservation.rs:26:19
3    |
4 LL |     /*1*/ let p = &mut i; // (reservation of `i` starts here)
5    |                   ------ borrow of `i` occurs here
6 LL |
7 LL |     /*2*/ let j = i;      // OK: `i` is only reserved here
8    |                   ^ use of borrowed `i`
9 ...
10 LL |     /*3*/ *p += 1;        // (mutable borrow of `i` starts here, since `p` is used)
11    |           ------- borrow later used here
12
13 error[E0503]: cannot use `i` because it was mutably borrowed
14   --> $DIR/two-phase-allow-access-during-reservation.rs:31:19
15    |
16 LL |     /*1*/ let p = &mut i; // (reservation of `i` starts here)
17    |                   ------ borrow of `i` occurs here
18 ...
19 LL |     /*4*/ let k = i;
20    |                   ^ use of borrowed `i`
21 ...
22 LL |     /*5*/ *p += 1;
23    |           ------- borrow later used here
24
25 error: aborting due to 2 previous errors
26
27 For more information about this error, try `rustc --explain E0503`.