@@ -7,25 +7,25 @@ LL | #![feature(bindings_after_at)]
7
7
= note: `#[warn(incomplete_features)]` on by default
8
8
9
9
error[E0007]: cannot bind by-move with sub-bindings
10
- --> $DIR/borrowck-pat-at-and-box.rs:17 :9
10
+ --> $DIR/borrowck-pat-at-and-box.rs:18 :9
11
11
|
12
12
LL | let a @ box &b = Box::new(&C);
13
13
| ^^^^^^^^^^ binds an already bound by-move value by moving it
14
14
15
15
error[E0007]: cannot bind by-move with sub-bindings
16
- --> $DIR/borrowck-pat-at-and-box.rs:21 :9
16
+ --> $DIR/borrowck-pat-at-and-box.rs:22 :9
17
17
|
18
18
LL | let a @ box b = Box::new(C);
19
19
| ^^^^^^^^^ binds an already bound by-move value by moving it
20
20
21
21
error[E0007]: cannot bind by-move with sub-bindings
22
- --> $DIR/borrowck-pat-at-and-box.rs:33 :25
22
+ --> $DIR/borrowck-pat-at-and-box.rs:34 :25
23
23
|
24
24
LL | match Box::new(C) { a @ box b => {} }
25
25
| ^^^^^^^^^ binds an already bound by-move value by moving it
26
26
27
27
error[E0009]: cannot bind by-move and by-ref in the same pattern
28
- --> $DIR/borrowck-pat-at-and-box.rs:60 :21
28
+ --> $DIR/borrowck-pat-at-and-box.rs:38 :21
29
29
|
30
30
LL | let ref a @ box b = Box::new(NC);
31
31
| ------------^
@@ -34,7 +34,7 @@ LL | let ref a @ box b = Box::new(NC);
34
34
| by-ref pattern here
35
35
36
36
error: cannot borrow `a` as mutable because it is also borrowed as immutable
37
- --> $DIR/borrowck-pat-at-and-box.rs:78 :9
37
+ --> $DIR/borrowck-pat-at-and-box.rs:40 :9
38
38
|
39
39
LL | let ref a @ box ref mut b = Box::new(nc());
40
40
| -----^^^^^^^---------
@@ -43,7 +43,7 @@ LL | let ref a @ box ref mut b = Box::new(nc());
43
43
| immutable borrow occurs here
44
44
45
45
error: cannot borrow `a` as mutable because it is also borrowed as immutable
46
- --> $DIR/borrowck-pat-at-and-box.rs:80 :9
46
+ --> $DIR/borrowck-pat-at-and-box.rs:42 :9
47
47
|
48
48
LL | let ref a @ box ref mut b = Box::new(NC);
49
49
| -----^^^^^^^---------
@@ -52,7 +52,7 @@ LL | let ref a @ box ref mut b = Box::new(NC);
52
52
| immutable borrow occurs here
53
53
54
54
error: cannot borrow `a` as mutable because it is also borrowed as immutable
55
- --> $DIR/borrowck-pat-at-and-box.rs:82 :9
55
+ --> $DIR/borrowck-pat-at-and-box.rs:44 :9
56
56
|
57
57
LL | let ref a @ box ref mut b = Box::new(NC);
58
58
| -----^^^^^^^---------
@@ -61,7 +61,7 @@ LL | let ref a @ box ref mut b = Box::new(NC);
61
61
| immutable borrow occurs here
62
62
63
63
error: cannot borrow `a` as mutable because it is also borrowed as immutable
64
- --> $DIR/borrowck-pat-at-and-box.rs:85 :9
64
+ --> $DIR/borrowck-pat-at-and-box.rs:47 :9
65
65
|
66
66
LL | let ref a @ box ref mut b = Box::new(NC);
67
67
| -----^^^^^^^---------
@@ -70,7 +70,7 @@ LL | let ref a @ box ref mut b = Box::new(NC);
70
70
| immutable borrow occurs here
71
71
72
72
error: cannot borrow `a` as immutable because it is also borrowed as mutable
73
- --> $DIR/borrowck-pat-at-and-box.rs:91 :9
73
+ --> $DIR/borrowck-pat-at-and-box.rs:53 :9
74
74
|
75
75
LL | let ref mut a @ box ref b = Box::new(NC);
76
76
| ---------^^^^^^^-----
@@ -79,28 +79,46 @@ LL | let ref mut a @ box ref b = Box::new(NC);
79
79
| mutable borrow occurs here
80
80
81
81
error: cannot borrow `a` as immutable because it is also borrowed as mutable
82
- --> $DIR/borrowck-pat-at-and-box.rs:105 :9
82
+ --> $DIR/borrowck-pat-at-and-box.rs:67 :9
83
83
|
84
84
LL | ref mut a @ box ref b => {
85
85
| ---------^^^^^^^-----
86
86
| | |
87
87
| | immutable borrow occurs here
88
88
| mutable borrow occurs here
89
89
90
+ error[E0009]: cannot bind by-move and by-ref in the same pattern
91
+ --> $DIR/borrowck-pat-at-and-box.rs:76:38
92
+ |
93
+ LL | box [Ok(a), ref xs @ .., Err(b)] => {}
94
+ | ----------- ^ by-move pattern here
95
+ | |
96
+ | by-ref pattern here
97
+
98
+ error[E0009]: cannot bind by-move and by-ref in the same pattern
99
+ --> $DIR/borrowck-pat-at-and-box.rs:82:46
100
+ |
101
+ LL | [Ok(box ref a), ref xs @ .., Err(box b), Err(box ref mut c)] => {}
102
+ | ----- ----------- ^ --------- by-ref pattern here
103
+ | | | |
104
+ | | | by-move pattern here
105
+ | | by-ref pattern here
106
+ | by-ref pattern here
107
+
90
108
error[E0007]: cannot bind by-move with sub-bindings
91
- --> $DIR/borrowck-pat-at-and-box.rs:25 :11
109
+ --> $DIR/borrowck-pat-at-and-box.rs:26 :11
92
110
|
93
111
LL | fn f1(a @ box &b: Box<&C>) {}
94
112
| ^^^^^^^^^^ binds an already bound by-move value by moving it
95
113
96
114
error[E0007]: cannot bind by-move with sub-bindings
97
- --> $DIR/borrowck-pat-at-and-box.rs:29 :11
115
+ --> $DIR/borrowck-pat-at-and-box.rs:30 :11
98
116
|
99
117
LL | fn f2(a @ box b: Box<C>) {}
100
118
| ^^^^^^^^^ binds an already bound by-move value by moving it
101
119
102
120
error: cannot borrow `a` as immutable because it is also borrowed as mutable
103
- --> $DIR/borrowck-pat-at-and-box.rs:97 :11
121
+ --> $DIR/borrowck-pat-at-and-box.rs:59 :11
104
122
|
105
123
LL | fn f5(ref mut a @ box ref b: Box<NC>) {
106
124
| ---------^^^^^^^-----
@@ -109,7 +127,7 @@ LL | fn f5(ref mut a @ box ref b: Box<NC>) {
109
127
| mutable borrow occurs here
110
128
111
129
error[E0382]: use of moved value
112
- --> $DIR/borrowck-pat-at-and-box.rs:17 :18
130
+ --> $DIR/borrowck-pat-at-and-box.rs:18 :18
113
131
|
114
132
LL | let a @ box &b = Box::new(&C);
115
133
| ---------^ ------------ move occurs because value has type `std::boxed::Box<&C>`, which does not implement the `Copy` trait
@@ -118,7 +136,7 @@ LL | let a @ box &b = Box::new(&C);
118
136
| value moved here
119
137
120
138
error[E0382]: use of moved value
121
- --> $DIR/borrowck-pat-at-and-box.rs:21 :17
139
+ --> $DIR/borrowck-pat-at-and-box.rs:22 :17
122
140
|
123
141
LL | let a @ box b = Box::new(C);
124
142
| --------^ ----------- move occurs because value has type `std::boxed::Box<C>`, which does not implement the `Copy` trait
@@ -127,7 +145,7 @@ LL | let a @ box b = Box::new(C);
127
145
| value moved here
128
146
129
147
error[E0382]: use of moved value
130
- --> $DIR/borrowck-pat-at-and-box.rs:33 :33
148
+ --> $DIR/borrowck-pat-at-and-box.rs:34 :33
131
149
|
132
150
LL | match Box::new(C) { a @ box b => {} }
133
151
| ----------- --------^
@@ -137,7 +155,7 @@ LL | match Box::new(C) { a @ box b => {} }
137
155
| move occurs because value has type `std::boxed::Box<C>`, which does not implement the `Copy` trait
138
156
139
157
error[E0502]: cannot borrow `_` as mutable because it is also borrowed as immutable
140
- --> $DIR/borrowck-pat-at-and-box.rs:85 :21
158
+ --> $DIR/borrowck-pat-at-and-box.rs:47 :21
141
159
|
142
160
LL | let ref a @ box ref mut b = Box::new(NC);
143
161
| ------------^^^^^^^^^
@@ -149,7 +167,7 @@ LL | drop(a);
149
167
| - immutable borrow later used here
150
168
151
169
error[E0502]: cannot borrow `_` as immutable because it is also borrowed as mutable
152
- --> $DIR/borrowck-pat-at-and-box.rs:91 :25
170
+ --> $DIR/borrowck-pat-at-and-box.rs:53 :25
153
171
|
154
172
LL | let ref mut a @ box ref b = Box::new(NC);
155
173
| ----------------^^^^^
@@ -161,7 +179,7 @@ LL | *a = Box::new(NC);
161
179
| -- mutable borrow later used here
162
180
163
181
error[E0502]: cannot borrow `_` as immutable because it is also borrowed as mutable
164
- --> $DIR/borrowck-pat-at-and-box.rs:105 :25
182
+ --> $DIR/borrowck-pat-at-and-box.rs:67 :25
165
183
|
166
184
LL | ref mut a @ box ref b => {
167
185
| ----------------^^^^^
@@ -173,7 +191,7 @@ LL | *a = Box::new(NC);
173
191
| -- mutable borrow later used here
174
192
175
193
error[E0382]: use of moved value
176
- --> $DIR/borrowck-pat-at-and-box.rs:25 :20
194
+ --> $DIR/borrowck-pat-at-and-box.rs:26 :20
177
195
|
178
196
LL | fn f1(a @ box &b: Box<&C>) {}
179
197
| ---------^
@@ -183,7 +201,7 @@ LL | fn f1(a @ box &b: Box<&C>) {}
183
201
| move occurs because value has type `std::boxed::Box<&C>`, which does not implement the `Copy` trait
184
202
185
203
error[E0382]: use of moved value
186
- --> $DIR/borrowck-pat-at-and-box.rs:29 :19
204
+ --> $DIR/borrowck-pat-at-and-box.rs:30 :19
187
205
|
188
206
LL | fn f2(a @ box b: Box<C>) {}
189
207
| --------^
@@ -193,7 +211,7 @@ LL | fn f2(a @ box b: Box<C>) {}
193
211
| move occurs because value has type `std::boxed::Box<C>`, which does not implement the `Copy` trait
194
212
195
213
error[E0502]: cannot borrow `_` as immutable because it is also borrowed as mutable
196
- --> $DIR/borrowck-pat-at-and-box.rs:97 :27
214
+ --> $DIR/borrowck-pat-at-and-box.rs:59 :27
197
215
|
198
216
LL | fn f5(ref mut a @ box ref b: Box<NC>) {
199
217
| ----------------^^^^^
@@ -204,7 +222,7 @@ LL | fn f5(ref mut a @ box ref b: Box<NC>) {
204
222
LL | *a = Box::new(NC);
205
223
| -- mutable borrow later used here
206
224
207
- error: aborting due to 22 previous errors
225
+ error: aborting due to 24 previous errors
208
226
209
227
Some errors have detailed explanations: E0007, E0009, E0382, E0502.
210
228
For more information about an error, try `rustc --explain E0007`.
0 commit comments