]> git.proxmox.com Git - rustc.git/blob - src/test/ui/borrowck/borrowck-swap-mut-base-ptr.stderr
New upstream version 1.67.1+dfsg1
[rustc.git] / src / test / ui / borrowck / borrowck-swap-mut-base-ptr.stderr
1 error[E0502]: cannot borrow `t0` as mutable because it is also borrowed as immutable
2 --> $DIR/borrowck-swap-mut-base-ptr.rs:13:10
3 |
4 LL | let p: &isize = &*t0; // Freezes `*t0`
5 | ---- immutable borrow occurs here
6 LL | swap(&mut t0, &mut t1);
7 | ^^^^^^^ mutable borrow occurs here
8 LL | *t1 = 22;
9 LL | p.use_ref();
10 | ----------- immutable borrow later used here
11
12 error: aborting due to previous error
13
14 For more information about this error, try `rustc --explain E0502`.