fork/rust

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

borsAuto merge of #68568 - pietroalbini:stable-next, r=pietroalbini5e1a799842b

1.41.0
843 B23 linesraw
1error[E0502]: cannot borrow `*x` as mutable because it is also borrowed as immutable
2  --> $DIR/borrowck-object-lifetime.rs:20:13
3   |
4LL |     let y = x.borrowed();
5   |             - immutable borrow occurs here
6LL |     let z = x.mut_borrowed();
7   |             ^^^^^^^^^^^^^^^^ mutable borrow occurs here
8LL |     y.use_ref();
9   |     - immutable borrow later used here
10
11error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
12  --> $DIR/borrowck-object-lifetime.rs:26:13
13   |
14LL |     let y = x.borrowed();
15   |             - immutable borrow occurs here
16LL |     let z = &mut x;
17   |             ^^^^^^ mutable borrow occurs here
18LL |     y.use_ref();
19   |     - immutable borrow later used here
20
21error: aborting due to 2 previous errors
22
23For more information about this error, try `rustc --explain E0502`.