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