fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #71365 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4fb7144ed15

1.43.0
1.5 KiB40 linesraw
1error[E0502]: cannot borrow `v` as mutable because it is also borrowed as immutable
2  --> $DIR/two-phase-reservation-sharing-interference-2.rs:19:5
3   |
4LL |     let shared = &v;
5   |                  -- immutable borrow occurs here
6LL | 
7LL |     v.extend(shared);
8   |     ^^------^^^^^^^^
9   |     | |
10   |     | immutable borrow later used by call
11   |     mutable borrow occurs here
12
13error[E0502]: cannot borrow `v` as mutable because it is also borrowed as immutable
14  --> $DIR/two-phase-reservation-sharing-interference-2.rs:29:5
15   |
16LL |     v.extend(&v);
17   |     ^^------^--^
18   |     | |      |
19   |     | |      immutable borrow occurs here
20   |     | immutable borrow later used by call
21   |     mutable borrow occurs here
22
23warning: cannot borrow `v` as mutable because it is also borrowed as immutable
24  --> $DIR/two-phase-reservation-sharing-interference-2.rs:40:5
25   |
26LL |     let shared = &v;
27   |                  -- immutable borrow occurs here
28LL | 
29LL |     v.push(shared.len());
30   |     ^      ------ immutable borrow later used here
31   |     |
32   |     mutable borrow occurs here
33   |
34   = note: `#[warn(mutable_borrow_reservation_conflict)]` on by default
35   = warning: this borrowing pattern was not meant to be accepted, and may become a hard error in the future
36   = note: for more information, see issue #59159 <https://github.com/rust-lang/rust/issues/59159>
37
38error: aborting due to 2 previous errors
39
40For more information about this error, try `rustc --explain E0502`.