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