]> git.proxmox.com Git - rustc.git/blob - src/test/ui/borrowck/borrowck-object-lifetime.nll.stderr
New upstream version 1.30.0~beta.7+dfsg1
[rustc.git] / src / test / ui / borrowck / borrowck-object-lifetime.nll.stderr
1 error[E0502]: cannot borrow `*x` as mutable because it is also borrowed as immutable
2 --> $DIR/borrowck-object-lifetime.rs:30:13
3 |
4 LL | let y = x.borrowed();
5 | - immutable borrow occurs here
6 LL | let z = x.mut_borrowed(); //~ ERROR cannot borrow
7 | ^^^^^^^^^^^^^^^^ mutable borrow occurs here
8 LL | y.use_ref();
9 | - borrow later used here
10
11 error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
12 --> $DIR/borrowck-object-lifetime.rs:36:13
13 |
14 LL | let y = x.borrowed();
15 | - immutable borrow occurs here
16 LL | let z = &mut x; //~ ERROR cannot borrow
17 | ^^^^^^ mutable borrow occurs here
18 LL | y.use_ref();
19 | - borrow later used here
20
21 error: aborting due to 2 previous errors
22
23 For more information about this error, try `rustc --explain E0502`.