|
| 1 | +warning: cannot borrow `v` as mutable because it is also borrowed as immutable |
| 2 | + --> $DIR/two-phase-reservation-sharing-interference-future-compat-lint.rs:24:9 |
| 3 | + | |
| 4 | +LL | let shared = &v; |
| 5 | + | -- immutable borrow occurs here |
| 6 | +LL | |
| 7 | +LL | v.push(shared.len()); |
| 8 | + | ^ ------ immutable borrow later used here |
| 9 | + | | |
| 10 | + | mutable borrow occurs here |
| 11 | + | |
| 12 | +note: lint level defined here |
| 13 | + --> $DIR/two-phase-reservation-sharing-interference-future-compat-lint.rs:18:13 |
| 14 | + | |
| 15 | +LL | #![warn(mutable_borrow_reservation_conflict)] |
| 16 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 17 | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! |
| 18 | + = note: for more information, see issue #59159 <https://github.com/rust-lang/rust/issues/59159> |
| 19 | + |
| 20 | +error: cannot borrow `v` as mutable because it is also borrowed as immutable |
| 21 | + --> $DIR/two-phase-reservation-sharing-interference-future-compat-lint.rs:37:9 |
| 22 | + | |
| 23 | +LL | let shared = &v; |
| 24 | + | -- immutable borrow occurs here |
| 25 | +LL | |
| 26 | +LL | v.push(shared.len()); |
| 27 | + | ^ ------ immutable borrow later used here |
| 28 | + | | |
| 29 | + | mutable borrow occurs here |
| 30 | + | |
| 31 | +note: lint level defined here |
| 32 | + --> $DIR/two-phase-reservation-sharing-interference-future-compat-lint.rs:31:13 |
| 33 | + | |
| 34 | +LL | #![deny(mutable_borrow_reservation_conflict)] |
| 35 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 36 | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! |
| 37 | + = note: for more information, see issue #59159 <https://github.com/rust-lang/rust/issues/59159> |
| 38 | + |
| 39 | +error: aborting due to previous error |
| 40 | + |
0 commit comments