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