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