]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-mut-borrow-linear-errors.mir.stderr
806c3a623bc681effd3975b53213f6f207dcfe67
[rust.git] / src / test / ui / borrowck / borrowck-mut-borrow-linear-errors.mir.stderr
1 error[E0499]: cannot borrow `x` as mutable more than once at a time
2   --> $DIR/borrowck-mut-borrow-linear-errors.rs:13:30
3    |
4 LL |             1 => { addr.push(&mut x); } //[ast]~ ERROR [E0499]
5    |                    ----      ^^^^^^ second mutable borrow occurs here
6    |                    |
7    |                    first borrow used here, in later iteration of loop
8 ...
9 LL |             _ => { addr.push(&mut x); } //[ast]~ ERROR [E0499]
10    |                              ------ first mutable borrow occurs here
11
12 error[E0499]: cannot borrow `x` as mutable more than once at a time
13   --> $DIR/borrowck-mut-borrow-linear-errors.rs:15:30
14    |
15 LL |             1 => { addr.push(&mut x); } //[ast]~ ERROR [E0499]
16    |                    ---- first borrow used here, in later iteration of loop
17 LL |             //[mir]~^ ERROR [E0499]
18 LL |             2 => { addr.push(&mut x); } //[ast]~ ERROR [E0499]
19    |                              ^^^^^^ second mutable borrow occurs here
20 LL |             //[mir]~^ ERROR [E0499]
21 LL |             _ => { addr.push(&mut x); } //[ast]~ ERROR [E0499]
22    |                              ------ first mutable borrow occurs here
23
24 error[E0499]: cannot borrow `x` as mutable more than once at a time
25   --> $DIR/borrowck-mut-borrow-linear-errors.rs:17:30
26    |
27 LL |             _ => { addr.push(&mut x); } //[ast]~ ERROR [E0499]
28    |                              ^^^^^^ mutable borrow starts here in previous iteration of loop
29
30 error: aborting due to 3 previous errors
31
32 For more information about this error, try `rustc --explain E0499`.