2018-08-08 12:28:26 +00:00
|
|
|
error[E0499]: cannot borrow `x` as mutable more than once at a time
|
2019-04-22 07:40:08 +00:00
|
|
|
--> $DIR/borrowck-mut-borrow-linear-errors.rs:10:30
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-03-17 09:52:07 +00:00
|
|
|
LL | 1 => { addr.push(&mut x); }
|
2019-05-09 22:01:39 +00:00
|
|
|
| ^^^^^^ second mutable borrow occurs here
|
2019-04-22 07:40:08 +00:00
|
|
|
LL | 2 => { addr.push(&mut x); }
|
2019-03-17 09:52:07 +00:00
|
|
|
LL | _ => { addr.push(&mut x); }
|
2023-06-22 20:30:23 +00:00
|
|
|
| ---- ------ first mutable borrow occurs here
|
|
|
|
| |
|
2019-05-09 22:01:39 +00:00
|
|
|
| first borrow later used here
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error[E0499]: cannot borrow `x` as mutable more than once at a time
|
2019-04-22 07:40:08 +00:00
|
|
|
--> $DIR/borrowck-mut-borrow-linear-errors.rs:11:30
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-03-17 09:52:07 +00:00
|
|
|
LL | 2 => { addr.push(&mut x); }
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^^^^^^ second mutable borrow occurs here
|
2019-03-17 09:52:07 +00:00
|
|
|
LL | _ => { addr.push(&mut x); }
|
2023-06-22 20:30:23 +00:00
|
|
|
| ---- ------ first mutable borrow occurs here
|
|
|
|
| |
|
2019-05-09 22:01:39 +00:00
|
|
|
| first borrow later used here
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error[E0499]: cannot borrow `x` as mutable more than once at a time
|
2019-04-22 07:40:08 +00:00
|
|
|
--> $DIR/borrowck-mut-borrow-linear-errors.rs:12:30
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-03-17 09:52:07 +00:00
|
|
|
LL | _ => { addr.push(&mut x); }
|
2023-06-22 20:30:23 +00:00
|
|
|
| ---- ^^^^^^ `x` was mutably borrowed here in the previous iteration of the loop
|
|
|
|
| |
|
2022-09-20 21:44:55 +00:00
|
|
|
| first borrow used here, in later iteration of loop
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error: aborting due to 3 previous errors
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0499`.
|