]> git.lizzy.rs Git - rust.git/blob - src/test/ui/union/union-borrow-move-parent-sibling.stderr
c5baf82c74584ba8481175a000220e789277fd7c
[rust.git] / src / test / ui / union / union-borrow-move-parent-sibling.stderr
1 error[E0502]: cannot borrow `u.y` as immutable because `u.x.0` is also borrowed as mutable
2   --> $DIR/union-borrow-move-parent-sibling.rs:15:14
3    |
4 LL |     let a = &mut u.x.0;
5    |                  ----- mutable borrow occurs here
6 LL |     let b = &u.y; //~ ERROR cannot borrow `u.y`
7    |              ^^^ immutable borrow occurs here
8 LL |     use_borrow(a);
9 LL | }
10    | - mutable borrow ends here
11
12 error[E0382]: use of moved value: `u.y`
13   --> $DIR/union-borrow-move-parent-sibling.rs:22:9
14    |
15 LL |     let a = u.x.0;
16    |         - value moved here
17 LL |     let b = u.y; //~ ERROR use of moved value: `u.y`
18    |         ^ value used here after move
19    |
20    = note: move occurs because `u.y` has type `[type error]`, which does not implement the `Copy` trait
21
22 error[E0502]: cannot borrow `u.y` as immutable because `u.x.0.0` is also borrowed as mutable
23   --> $DIR/union-borrow-move-parent-sibling.rs:28:14
24    |
25 LL |     let a = &mut (u.x.0).0;
26    |                  --------- mutable borrow occurs here
27 LL |     let b = &u.y; //~ ERROR cannot borrow `u.y`
28    |              ^^^ immutable borrow occurs here
29 LL |     use_borrow(a);
30 LL | }
31    | - mutable borrow ends here
32
33 error[E0382]: use of moved value: `u.y`
34   --> $DIR/union-borrow-move-parent-sibling.rs:35:9
35    |
36 LL |     let a = (u.x.0).0;
37    |         - value moved here
38 LL |     let b = u.y; //~ ERROR use of moved value: `u.y`
39    |         ^ value used here after move
40    |
41    = note: move occurs because `u.y` has type `[type error]`, which does not implement the `Copy` trait
42
43 error[E0502]: cannot borrow `u` (via `u.x`) as immutable because `u` is also borrowed as mutable (via `*u.y`)
44   --> $DIR/union-borrow-move-parent-sibling.rs:41:14
45    |
46 LL |     let a = &mut *u.y;
47    |                  ---- mutable borrow occurs here (via `*u.y`)
48 LL |     let b = &u.x; //~ ERROR cannot borrow `u` (via `u.x`)
49    |              ^^^ immutable borrow occurs here (via `u.x`)
50 LL |     use_borrow(a);
51 LL | }
52    | - mutable borrow ends here
53
54 error[E0382]: use of moved value: `u.x`
55   --> $DIR/union-borrow-move-parent-sibling.rs:48:9
56    |
57 LL |     let a = *u.y;
58    |         - value moved here
59 LL |     let b = u.x; //~ ERROR use of moved value: `u.x`
60    |         ^ value used here after move
61    |
62    = note: move occurs because `u.x` has type `[type error]`, which does not implement the `Copy` trait
63
64 error: aborting due to 6 previous errors
65
66 Some errors occurred: E0382, E0502.
67 For more information about an error, try `rustc --explain E0382`.