@@ -56,155 +56,19 @@ LL | if let Some(&Some(&mut _)) = &mut Some(&Some(0)) {
56
56
found mutable reference `&mut _`
57
57
58
58
error[E0308]: mismatched types
59
- --> $DIR/pattern-errors.rs:50:17
60
- |
61
- LL | if let Some(&Some(Some(&mut x))) = &Some(Some(&mut Some(0))) {
62
- | ^^^^^^^^^^^^^^^^^^^ ------------------------- this expression has type `&Option<Option<&mut Option<{integer}>>>`
63
- | |
64
- | expected `Option<&mut Option<{integer}>>`, found `&_`
65
- |
66
- = note: expected enum `Option<&mut Option<{integer}>>`
67
- found reference `&_`
68
-
69
- error[E0308]: mismatched types
70
- --> $DIR/pattern-errors.rs:57:17
59
+ --> $DIR/pattern-errors.rs:56:17
71
60
|
72
61
LL | if let Some(&mut Some(x)) = &Some(Some(0)) {
73
- | ^^^^^^^^^^^^ -------------- this expression has type `&Option<Option<{integer}>>`
74
- | |
75
- | expected `Option<{integer}>`, found `&mut _`
76
- |
77
- = note: expected enum `Option<{integer}>`
78
- found mutable reference `&mut _`
79
-
80
- error[E0308]: mismatched types
81
- --> $DIR/pattern-errors.rs:66:11
82
- |
83
- LL | let &[&mut x] = &&mut [0];
84
- | ^^^^^^ --------- this expression has type `&&mut [{integer}; 1]`
85
- | |
86
- | expected integer, found `&mut _`
87
- |
88
- = note: expected type `{integer}`
89
- found mutable reference `&mut _`
90
- note: to declare a mutable binding use: `mut x`
91
- --> $DIR/pattern-errors.rs:66:11
92
- |
93
- LL | let &[&mut x] = &&mut [0];
94
- | ^^^^^^
95
- help: consider removing `&mut` from the pattern
96
- |
97
- LL - let &[&mut x] = &&mut [0];
98
- LL + let &[x] = &&mut [0];
99
- |
100
-
101
- error[E0308]: mismatched types
102
- --> $DIR/pattern-errors.rs:73:11
103
- |
104
- LL | let &[&mut x] = &mut &mut [0];
105
- | ^^^^^^ ------------- this expression has type `&mut &mut [{integer}; 1]`
106
- | |
107
- | expected integer, found `&mut _`
108
- |
109
- = note: expected type `{integer}`
110
- found mutable reference `&mut _`
111
- note: to declare a mutable binding use: `mut x`
112
- --> $DIR/pattern-errors.rs:73:11
113
- |
114
- LL | let &[&mut x] = &mut &mut [0];
115
- | ^^^^^^
116
- help: consider removing `&mut` from the pattern
117
- |
118
- LL - let &[&mut x] = &mut &mut [0];
119
- LL + let &[x] = &mut &mut [0];
120
- |
121
-
122
- error[E0308]: mismatched types
123
- --> $DIR/pattern-errors.rs:80:11
124
- |
125
- LL | let &[&mut ref x] = &&mut [0];
126
- | ^^^^^^^^^^ --------- this expression has type `&&mut [{integer}; 1]`
127
- | |
128
- | expected integer, found `&mut _`
129
- |
130
- = note: expected type `{integer}`
131
- found mutable reference `&mut _`
132
- note: to declare a mutable binding use: `mut x`
133
- --> $DIR/pattern-errors.rs:80:11
134
- |
135
- LL | let &[&mut ref x] = &&mut [0];
136
- | ^^^^^^^^^^
137
- help: consider removing `&mut` from the pattern
138
- |
139
- LL - let &[&mut ref x] = &&mut [0];
140
- LL + let &[ref x] = &&mut [0];
141
- |
142
-
143
- error[E0308]: mismatched types
144
- --> $DIR/pattern-errors.rs:87:11
145
- |
146
- LL | let &[&mut ref x] = &mut &mut [0];
147
- | ^^^^^^^^^^ ------------- this expression has type `&mut &mut [{integer}; 1]`
148
- | |
149
- | expected integer, found `&mut _`
150
- |
151
- = note: expected type `{integer}`
152
- found mutable reference `&mut _`
153
- note: to declare a mutable binding use: `mut x`
154
- --> $DIR/pattern-errors.rs:87:11
155
- |
156
- LL | let &[&mut ref x] = &mut &mut [0];
157
- | ^^^^^^^^^^
158
- help: consider removing `&mut` from the pattern
159
- |
160
- LL - let &[&mut ref x] = &mut &mut [0];
161
- LL + let &[ref x] = &mut &mut [0];
162
- |
163
-
164
- error[E0308]: mismatched types
165
- --> $DIR/pattern-errors.rs:94:11
166
- |
167
- LL | let &[&mut mut x] = &&mut [0];
168
- | ^^^^^^^^^^ --------- this expression has type `&&mut [{integer}; 1]`
169
- | |
170
- | expected integer, found `&mut _`
171
- |
172
- = note: expected type `{integer}`
173
- found mutable reference `&mut _`
174
- note: to declare a mutable binding use: `mut x`
175
- --> $DIR/pattern-errors.rs:94:11
176
- |
177
- LL | let &[&mut mut x] = &&mut [0];
178
- | ^^^^^^^^^^
179
- help: consider removing `&mut` from the pattern
180
- |
181
- LL - let &[&mut mut x] = &&mut [0];
182
- LL + let &[mut x] = &&mut [0];
183
- |
184
-
185
- error[E0308]: mismatched types
186
- --> $DIR/pattern-errors.rs:101:11
187
- |
188
- LL | let &[&mut mut x] = &mut &mut [0];
189
- | ^^^^^^^^^^ ------------- this expression has type `&mut &mut [{integer}; 1]`
190
- | |
191
- | expected integer, found `&mut _`
192
- |
193
- = note: expected type `{integer}`
194
- found mutable reference `&mut _`
195
- note: to declare a mutable binding use: `mut x`
196
- --> $DIR/pattern-errors.rs:101:11
197
- |
198
- LL | let &[&mut mut x] = &mut &mut [0];
199
- | ^^^^^^^^^^
200
- help: consider removing `&mut` from the pattern
62
+ | ^^^^^
201
63
|
202
- LL - let &[&mut mut x] = &mut &mut [0];
203
- LL + let &[ mut x] = &mut &mut [0];
64
+ = note: cannot match inherited `&` with ` &mut` pattern
65
+ help: replace this `& mut` pattern with `&`
204
66
|
67
+ LL | if let Some(&Some(x)) = &Some(Some(0)) {
68
+ | ~
205
69
206
70
error[E0308]: mismatched types
207
- --> $DIR/pattern-errors.rs:122 :11
71
+ --> $DIR/pattern-errors.rs:114 :11
208
72
|
209
73
LL | let [&&mut x] = &[&mut 0];
210
74
| ^^^^^^ --------- this expression has type `&[&mut {integer}; 1]`
@@ -220,7 +84,7 @@ LL + let [&x] = &[&mut 0];
220
84
|
221
85
222
86
error[E0308]: mismatched types
223
- --> $DIR/pattern-errors.rs:129 :11
87
+ --> $DIR/pattern-errors.rs:121 :11
224
88
|
225
89
LL | let [&&mut x] = &mut [&mut 0];
226
90
| ^^^^^^ ------------- this expression has type `&mut [&mut {integer}; 1]`
@@ -236,7 +100,7 @@ LL + let [&x] = &mut [&mut 0];
236
100
|
237
101
238
102
error[E0308]: mismatched types
239
- --> $DIR/pattern-errors.rs:136 :11
103
+ --> $DIR/pattern-errors.rs:128 :11
240
104
|
241
105
LL | let [&&mut ref x] = &[&mut 0];
242
106
| ^^^^^^^^^^ --------- this expression has type `&[&mut {integer}; 1]`
@@ -252,7 +116,7 @@ LL + let [&ref x] = &[&mut 0];
252
116
|
253
117
254
118
error[E0308]: mismatched types
255
- --> $DIR/pattern-errors.rs:143 :11
119
+ --> $DIR/pattern-errors.rs:135 :11
256
120
|
257
121
LL | let [&&mut ref x] = &mut [&mut 0];
258
122
| ^^^^^^^^^^ ------------- this expression has type `&mut [&mut {integer}; 1]`
@@ -268,7 +132,7 @@ LL + let [&ref x] = &mut [&mut 0];
268
132
|
269
133
270
134
error[E0308]: mismatched types
271
- --> $DIR/pattern-errors.rs:150 :11
135
+ --> $DIR/pattern-errors.rs:142 :11
272
136
|
273
137
LL | let [&&mut mut x] = &[&mut 0];
274
138
| ^^^^^^^^^^ --------- this expression has type `&[&mut {integer}; 1]`
@@ -284,7 +148,7 @@ LL + let [&mut x] = &[&mut 0];
284
148
|
285
149
286
150
error[E0308]: mismatched types
287
- --> $DIR/pattern-errors.rs:157 :11
151
+ --> $DIR/pattern-errors.rs:149 :11
288
152
|
289
153
LL | let [&&mut mut x] = &mut [&mut 0];
290
154
| ^^^^^^^^^^ ------------- this expression has type `&mut [&mut {integer}; 1]`
@@ -300,7 +164,7 @@ LL + let [&mut x] = &mut [&mut 0];
300
164
|
301
165
302
166
error[E0308]: mismatched types
303
- --> $DIR/pattern-errors.rs:172 :15
167
+ --> $DIR/pattern-errors.rs:164 :15
304
168
|
305
169
LL | let [&mut &x] = &[&mut 0];
306
170
| ^^ --------- this expression has type `&[&mut {integer}; 1]`
@@ -316,7 +180,7 @@ LL + let [&mut x] = &[&mut 0];
316
180
|
317
181
318
182
error[E0308]: mismatched types
319
- --> $DIR/pattern-errors.rs:178 :15
183
+ --> $DIR/pattern-errors.rs:170 :15
320
184
|
321
185
LL | let [&mut &ref x] = &[&mut 0];
322
186
| ^^^^^^ --------- this expression has type `&[&mut {integer}; 1]`
@@ -332,7 +196,7 @@ LL + let [&mut ref x] = &[&mut 0];
332
196
|
333
197
334
198
error[E0308]: mismatched types
335
- --> $DIR/pattern-errors.rs:184 :15
199
+ --> $DIR/pattern-errors.rs:176 :15
336
200
|
337
201
LL | let [&mut &(mut x)] = &[&mut 0];
338
202
| ^^^^^^^^ --------- this expression has type `&[&mut {integer}; 1]`
@@ -347,6 +211,6 @@ LL - let [&mut &(mut x)] = &[&mut 0];
347
211
LL + let [&mut mut x)] = &[&mut 0];
348
212
|
349
213
350
- error: aborting due to 21 previous errors
214
+ error: aborting due to 14 previous errors
351
215
352
216
For more information about this error, try `rustc --explain E0308`.
0 commit comments