|
| 1 | +error[E0505]: cannot move out of `x` because it is borrowed |
| 2 | + --> $DIR/borrow-tuple-fields.rs:22:13 |
| 3 | + | |
| 4 | +LL | let r = &x.0; |
| 5 | + | ---- borrow of `x.0` occurs here |
| 6 | +LL | let y = x; //~ ERROR cannot move out of `x` because it is borrowed |
| 7 | + | ^ move out of `x` occurs here |
| 8 | +LL | |
| 9 | +LL | r.use_ref(); |
| 10 | + | - borrow later used here |
| 11 | + |
| 12 | +error[E0502]: cannot borrow `x.0` as mutable because it is also borrowed as immutable |
| 13 | + --> $DIR/borrow-tuple-fields.rs:28:13 |
| 14 | + | |
| 15 | +LL | let a = &x.0; |
| 16 | + | ---- immutable borrow occurs here |
| 17 | +LL | let b = &mut x.0; //~ ERROR cannot borrow `x.0` as mutable because it is also borrowed as |
| 18 | + | ^^^^^^^^ mutable borrow occurs here |
| 19 | +LL | a.use_ref(); |
| 20 | + | - borrow later used here |
| 21 | + |
| 22 | +error[E0499]: cannot borrow `x.0` as mutable more than once at a time |
| 23 | + --> $DIR/borrow-tuple-fields.rs:33:13 |
| 24 | + | |
| 25 | +LL | let a = &mut x.0; |
| 26 | + | -------- first mutable borrow occurs here |
| 27 | +LL | let b = &mut x.0; //~ ERROR cannot borrow `x.0` as mutable more than once at a time |
| 28 | + | ^^^^^^^^ second mutable borrow occurs here |
| 29 | +LL | a.use_ref(); |
| 30 | + | - borrow later used here |
| 31 | + |
| 32 | +error[E0505]: cannot move out of `x` because it is borrowed |
| 33 | + --> $DIR/borrow-tuple-fields.rs:38:13 |
| 34 | + | |
| 35 | +LL | let r = &x.0; |
| 36 | + | ---- borrow of `x.0` occurs here |
| 37 | +LL | let y = x; //~ ERROR cannot move out of `x` because it is borrowed |
| 38 | + | ^ move out of `x` occurs here |
| 39 | +LL | r.use_ref(); |
| 40 | + | - borrow later used here |
| 41 | + |
| 42 | +error[E0502]: cannot borrow `x.0` as mutable because it is also borrowed as immutable |
| 43 | + --> $DIR/borrow-tuple-fields.rs:43:13 |
| 44 | + | |
| 45 | +LL | let a = &x.0; |
| 46 | + | ---- immutable borrow occurs here |
| 47 | +LL | let b = &mut x.0; //~ ERROR cannot borrow `x.0` as mutable because it is also borrowed as |
| 48 | + | ^^^^^^^^ mutable borrow occurs here |
| 49 | +LL | a.use_ref(); |
| 50 | + | - borrow later used here |
| 51 | + |
| 52 | +error[E0499]: cannot borrow `x.0` as mutable more than once at a time |
| 53 | + --> $DIR/borrow-tuple-fields.rs:48:13 |
| 54 | + | |
| 55 | +LL | let a = &mut x.0; |
| 56 | + | -------- first mutable borrow occurs here |
| 57 | +LL | let b = &mut x.0; //~ ERROR cannot borrow `x.0` as mutable more than once at a time |
| 58 | + | ^^^^^^^^ second mutable borrow occurs here |
| 59 | +LL | a.use_mut(); |
| 60 | + | - borrow later used here |
| 61 | + |
| 62 | +error: aborting due to 6 previous errors |
| 63 | + |
| 64 | +Some errors occurred: E0499, E0502, E0505. |
| 65 | +For more information about an error, try `rustc --explain E0499`. |
0 commit comments