|
1 | 1 | error[E0502]: cannot borrow `u.a` as mutable because it is also borrowed as immutable |
2 | | - --> $DIR/borrowck-union-borrow.rs:27:23 |
| 2 | + --> $DIR/borrowck-union-borrow.rs:25:23 |
3 | 3 | | |
4 | 4 | LL | let ra = &u.a; |
5 | 5 | | ---- immutable borrow occurs here |
6 | | -LL | let rma = &mut u.a; //[ast]~ ERROR cannot borrow `u.a` as mutable because it is also borrowed as immutable |
| 6 | +LL | let rma = &mut u.a; //~ ERROR cannot borrow `u.a` as mutable because it is also borrowed as immutable |
7 | 7 | | ^^^^^^^^ mutable borrow occurs here |
8 | | -LL | //[mir]~^ ERROR cannot borrow `u.a` as mutable because it is also borrowed as immutable |
9 | 8 | LL | drop(ra); |
10 | 9 | | -- immutable borrow later used here |
11 | 10 |
|
12 | 11 | error[E0506]: cannot assign to `u.a` because it is borrowed |
13 | | - --> $DIR/borrowck-union-borrow.rs:33:13 |
| 12 | + --> $DIR/borrowck-union-borrow.rs:30:13 |
14 | 13 | | |
15 | 14 | LL | let ra = &u.a; |
16 | 15 | | ---- borrow of `u.a` occurs here |
17 | | -LL | u.a = 1; //[ast]~ ERROR cannot assign to `u.a` because it is borrowed |
| 16 | +LL | u.a = 1; //~ ERROR cannot assign to `u.a` because it is borrowed |
18 | 17 | | ^^^^^^^ assignment to borrowed `u.a` occurs here |
19 | | -LL | //[mir]~^ ERROR cannot assign to `u.a` because it is borrowed |
20 | 18 | LL | drop(ra); |
21 | 19 | | -- borrow later used here |
22 | 20 |
|
23 | | -error[E0502]: cannot borrow `u.b` as mutable because it is also borrowed as immutable |
24 | | - --> $DIR/borrowck-union-borrow.rs:50:23 |
| 21 | +error[E0502]: cannot borrow `u` (via `u.b`) as mutable because it is also borrowed as immutable (via `u.a`) |
| 22 | + --> $DIR/borrowck-union-borrow.rs:46:23 |
25 | 23 | | |
26 | 24 | LL | let ra = &u.a; |
27 | | - | ---- immutable borrow occurs here |
28 | | -LL | let rmb = &mut u.b; //[ast]~ ERROR cannot borrow `u` (via `u.b`) as mutable because `u` is also borrowed as immutable (via `u.a`) |
29 | | - | ^^^^^^^^ mutable borrow occurs here |
30 | | -LL | //[mir]~^ ERROR cannot borrow `u.b` as mutable because it is also borrowed as immutable |
| 25 | + | ---- immutable borrow occurs here (via `u.a`) |
| 26 | +LL | let rmb = &mut u.b; //~ ERROR cannot borrow `u` (via `u.b`) as mutable because `u` is also borrowed as immutable (via `u.a`) |
| 27 | + | ^^^^^^^^ mutable borrow occurs here (via `u.b`) |
31 | 28 | LL | drop(ra); |
32 | 29 | | -- immutable borrow later used here |
33 | 30 |
|
34 | 31 | error[E0506]: cannot assign to `u.b` because it is borrowed |
35 | | - --> $DIR/borrowck-union-borrow.rs:56:13 |
| 32 | + --> $DIR/borrowck-union-borrow.rs:51:13 |
36 | 33 | | |
37 | 34 | LL | let ra = &u.a; |
38 | 35 | | ---- borrow of `u.b` occurs here |
39 | | -LL | u.b = 1; //[ast]~ ERROR cannot assign to `u.b` because it is borrowed |
| 36 | +LL | u.b = 1; //~ ERROR cannot assign to `u.b` because it is borrowed |
40 | 37 | | ^^^^^^^ assignment to borrowed `u.b` occurs here |
41 | | -LL | //[mir]~^ ERROR cannot assign to `u.b` because it is borrowed |
42 | 38 | LL | drop(ra); |
43 | 39 | | -- borrow later used here |
44 | 40 |
|
45 | 41 | error[E0502]: cannot borrow `u.a` as immutable because it is also borrowed as mutable |
46 | | - --> $DIR/borrowck-union-borrow.rs:63:22 |
| 42 | + --> $DIR/borrowck-union-borrow.rs:57:22 |
47 | 43 | | |
48 | 44 | LL | let rma = &mut u.a; |
49 | 45 | | -------- mutable borrow occurs here |
50 | | -LL | let ra = &u.a; //[ast]~ ERROR cannot borrow `u.a` as immutable because it is also borrowed as mutable |
| 46 | +LL | let ra = &u.a; //~ ERROR cannot borrow `u.a` as immutable because it is also borrowed as mutable |
51 | 47 | | ^^^^ immutable borrow occurs here |
52 | | -LL | //[mir]~^ ERROR cannot borrow `u.a` as immutable because it is also borrowed as mutable |
53 | 48 | LL | drop(rma); |
54 | 49 | | --- mutable borrow later used here |
55 | 50 |
|
56 | 51 | error[E0503]: cannot use `u.a` because it was mutably borrowed |
57 | | - --> $DIR/borrowck-union-borrow.rs:69:21 |
| 52 | + --> $DIR/borrowck-union-borrow.rs:62:21 |
58 | 53 | | |
59 | 54 | LL | let ra = &mut u.a; |
60 | 55 | | -------- borrow of `u.a` occurs here |
61 | | -LL | let a = u.a; //[ast]~ ERROR cannot use `u.a` because it was mutably borrowed |
| 56 | +LL | let a = u.a; //~ ERROR cannot use `u.a` because it was mutably borrowed |
62 | 57 | | ^^^ use of borrowed `u.a` |
63 | | -LL | //[mir]~^ ERROR cannot use `u.a` because it was mutably borrowed |
64 | 58 | LL | drop(ra); |
65 | 59 | | -- borrow later used here |
66 | 60 |
|
67 | 61 | error[E0499]: cannot borrow `u.a` as mutable more than once at a time |
68 | | - --> $DIR/borrowck-union-borrow.rs:75:24 |
| 62 | + --> $DIR/borrowck-union-borrow.rs:67:24 |
69 | 63 | | |
70 | 64 | LL | let rma = &mut u.a; |
71 | 65 | | -------- first mutable borrow occurs here |
72 | | -LL | let rma2 = &mut u.a; //[ast]~ ERROR cannot borrow `u.a` as mutable more than once at a time |
| 66 | +LL | let rma2 = &mut u.a; //~ ERROR cannot borrow `u.a` as mutable more than once at a time |
73 | 67 | | ^^^^^^^^ second mutable borrow occurs here |
74 | | -LL | //[mir]~^ ERROR cannot borrow `u.a` as mutable more than once at a time |
75 | 68 | LL | drop(rma); |
76 | 69 | | --- first borrow later used here |
77 | 70 |
|
78 | 71 | error[E0506]: cannot assign to `u.a` because it is borrowed |
79 | | - --> $DIR/borrowck-union-borrow.rs:81:13 |
| 72 | + --> $DIR/borrowck-union-borrow.rs:72:13 |
80 | 73 | | |
81 | 74 | LL | let rma = &mut u.a; |
82 | 75 | | -------- borrow of `u.a` occurs here |
83 | | -LL | u.a = 1; //[ast]~ ERROR cannot assign to `u.a` because it is borrowed |
| 76 | +LL | u.a = 1; //~ ERROR cannot assign to `u.a` because it is borrowed |
84 | 77 | | ^^^^^^^ assignment to borrowed `u.a` occurs here |
85 | | -LL | //[mir]~^ ERROR cannot assign to `u.a` because it is borrowed |
86 | 78 | LL | drop(rma); |
87 | 79 | | --- borrow later used here |
88 | 80 |
|
89 | | -error[E0502]: cannot borrow `u.b` as immutable because it is also borrowed as mutable |
90 | | - --> $DIR/borrowck-union-borrow.rs:88:22 |
| 81 | +error[E0502]: cannot borrow `u` (via `u.b`) as immutable because it is also borrowed as mutable (via `u.a`) |
| 82 | + --> $DIR/borrowck-union-borrow.rs:78:22 |
91 | 83 | | |
92 | 84 | LL | let rma = &mut u.a; |
93 | | - | -------- mutable borrow occurs here |
94 | | -LL | let rb = &u.b; //[ast]~ ERROR cannot borrow `u` (via `u.b`) as immutable because `u` is also borrowed as mutable (via `u.a`) |
95 | | - | ^^^^ immutable borrow occurs here |
96 | | -LL | //[mir]~^ ERROR cannot borrow `u.b` as immutable because it is also borrowed as mutable |
| 85 | + | -------- mutable borrow occurs here (via `u.a`) |
| 86 | +LL | let rb = &u.b; //~ ERROR cannot borrow `u` (via `u.b`) as immutable because `u` is also borrowed as mutable (via `u.a`) |
| 87 | + | ^^^^ immutable borrow occurs here (via `u.b`) |
97 | 88 | LL | drop(rma); |
98 | 89 | | --- mutable borrow later used here |
99 | 90 |
|
100 | 91 | error[E0503]: cannot use `u.b` because it was mutably borrowed |
101 | | - --> $DIR/borrowck-union-borrow.rs:94:21 |
| 92 | + --> $DIR/borrowck-union-borrow.rs:83:21 |
102 | 93 | | |
103 | 94 | LL | let ra = &mut u.a; |
104 | 95 | | -------- borrow of `u.a` occurs here |
105 | | -LL | let b = u.b; //[ast]~ ERROR cannot use `u.b` because it was mutably borrowed |
| 96 | +LL | let b = u.b; //~ ERROR cannot use `u.b` because it was mutably borrowed |
106 | 97 | | ^^^ use of borrowed `u.a` |
107 | | -... |
| 98 | +LL | |
108 | 99 | LL | drop(ra); |
109 | 100 | | -- borrow later used here |
110 | 101 |
|
111 | | -error[E0499]: cannot borrow `u.b` as mutable more than once at a time |
112 | | - --> $DIR/borrowck-union-borrow.rs:101:24 |
| 102 | +error[E0499]: cannot borrow `u` (via `u.b`) as mutable more than once at a time |
| 103 | + --> $DIR/borrowck-union-borrow.rs:89:24 |
113 | 104 | | |
114 | 105 | LL | let rma = &mut u.a; |
115 | | - | -------- first mutable borrow occurs here |
116 | | -LL | let rmb2 = &mut u.b; //[ast]~ ERROR cannot borrow `u` (via `u.b`) as mutable more than once at a time |
117 | | - | ^^^^^^^^ second mutable borrow occurs here |
118 | | -LL | //[mir]~^ ERROR cannot borrow `u.b` as mutable more than once at a time |
| 106 | + | -------- first mutable borrow occurs here (via `u.a`) |
| 107 | +LL | let rmb2 = &mut u.b; //~ ERROR cannot borrow `u` (via `u.b`) as mutable more than once at a time |
| 108 | + | ^^^^^^^^ second mutable borrow occurs here (via `u.b`) |
119 | 109 | LL | drop(rma); |
120 | 110 | | --- first borrow later used here |
121 | 111 |
|
122 | 112 | error[E0506]: cannot assign to `u.b` because it is borrowed |
123 | | - --> $DIR/borrowck-union-borrow.rs:107:13 |
| 113 | + --> $DIR/borrowck-union-borrow.rs:94:13 |
124 | 114 | | |
125 | 115 | LL | let rma = &mut u.a; |
126 | 116 | | -------- borrow of `u.b` occurs here |
127 | | -LL | u.b = 1; //[ast]~ ERROR cannot assign to `u.b` because it is borrowed |
| 117 | +LL | u.b = 1; //~ ERROR cannot assign to `u.b` because it is borrowed |
128 | 118 | | ^^^^^^^ assignment to borrowed `u.b` occurs here |
129 | | -LL | //[mir]~^ ERROR cannot assign to `u.b` because it is borrowed |
130 | 119 | LL | drop(rma); |
131 | 120 | | --- borrow later used here |
132 | 121 |
|
|
0 commit comments