fork/rust

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

borsAuto merge of #69854 - pietroalbini:stable-next, r=Centrilb8cedc00407

1.42.0
1.7 KiB40 linesraw
1warning: 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   |
4LL |         let shared = &v;
5   |                      -- immutable borrow occurs here
6LL | 
7LL |         v.push(shared.len());
8   |         ^      ------ immutable borrow later used here
9   |         |
10   |         mutable borrow occurs here
11   |
12note: lint level defined here
13  --> $DIR/two-phase-reservation-sharing-interference-future-compat-lint.rs:18:13
14   |
15LL |     #![warn(mutable_borrow_reservation_conflict)]
16   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17   = warning: this borrowing pattern was not meant to be accepted, and may become a hard error in the future
18   = note: for more information, see issue #59159 <https://github.com/rust-lang/rust/issues/59159>
19
20error: 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   |
23LL |         let shared = &v;
24   |                      -- immutable borrow occurs here
25LL | 
26LL |         v.push(shared.len());
27   |         ^      ------ immutable borrow later used here
28   |         |
29   |         mutable borrow occurs here
30   |
31note: lint level defined here
32  --> $DIR/two-phase-reservation-sharing-interference-future-compat-lint.rs:31:13
33   |
34LL |     #![deny(mutable_borrow_reservation_conflict)]
35   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
36   = warning: this borrowing pattern was not meant to be accepted, and may become a hard error in the future
37   = note: for more information, see issue #59159 <https://github.com/rust-lang/rust/issues/59159>
38
39error: aborting due to previous error
40