@@ -4,179 +4,253 @@ error[E0308]: mismatched types
4
4
LL | match Blah::A(1, 1, 2) {
5
5
| ---------------- this expression has type `main::Blah`
6
6
LL | Blah::A(_, x, y) | Blah::B(x, y) => {}
7
- | ^ expected `usize`, found `isize`
7
+ | - ^ expected `usize`, found `isize`
8
+ | |
9
+ | first introduced with type `usize` here
10
+ |
11
+ = note: in the same arm, a binding must have the same type in all alternatives
8
12
9
13
error[E0308]: mismatched types
10
14
--> $DIR/or-patterns-binding-type-mismatch.rs:17:44
11
15
|
12
16
LL | match Some(Blah::A(1, 1, 2)) {
13
17
| ---------------------- this expression has type `std::option::Option<main::Blah>`
14
18
LL | Some(Blah::A(_, x, y) | Blah::B(x, y)) => {}
15
- | ^ expected `usize`, found `isize`
19
+ | - ^ expected `usize`, found `isize`
20
+ | |
21
+ | first introduced with type `usize` here
22
+ |
23
+ = note: in the same arm, a binding must have the same type in all alternatives
16
24
17
25
error[E0308]: mismatched types
18
26
--> $DIR/or-patterns-binding-type-mismatch.rs:21:19
19
27
|
20
28
LL | match (0u8, 1u16) {
21
29
| ----------- this expression has type `(u8, u16)`
22
30
LL | (x, y) | (y, x) => {}
23
- | ^ expected `u16`, found `u8`
31
+ | - ^ expected `u16`, found `u8`
32
+ | |
33
+ | first introduced with type `u16` here
34
+ |
35
+ = note: in the same arm, a binding must have the same type in all alternatives
24
36
25
37
error[E0308]: mismatched types
26
38
--> $DIR/or-patterns-binding-type-mismatch.rs:21:22
27
39
|
28
40
LL | match (0u8, 1u16) {
29
41
| ----------- this expression has type `(u8, u16)`
30
42
LL | (x, y) | (y, x) => {}
31
- | ^ expected `u8`, found `u16`
43
+ | - ^ expected `u8`, found `u16`
44
+ | |
45
+ | first introduced with type `u8` here
46
+ |
47
+ = note: in the same arm, a binding must have the same type in all alternatives
32
48
33
49
error[E0308]: mismatched types
34
50
--> $DIR/or-patterns-binding-type-mismatch.rs:26:41
35
51
|
36
52
LL | match Some((0u8, Some((1u16, 2u32)))) {
37
53
| ------------------------------- this expression has type `std::option::Option<(u8, std::option::Option<(u16, u32)>)>`
38
54
LL | Some((x, Some((y, z)))) | Some((y, Some((x, z) | (z, x)))) => {}
39
- | ^ expected `u16`, found `u8`
55
+ | - ^ expected `u16`, found `u8`
56
+ | |
57
+ | first introduced with type `u16` here
58
+ |
59
+ = note: in the same arm, a binding must have the same type in all alternatives
40
60
41
61
error[E0308]: mismatched types
42
62
--> $DIR/or-patterns-binding-type-mismatch.rs:26:50
43
63
|
44
64
LL | match Some((0u8, Some((1u16, 2u32)))) {
45
65
| ------------------------------- this expression has type `std::option::Option<(u8, std::option::Option<(u16, u32)>)>`
46
66
LL | Some((x, Some((y, z)))) | Some((y, Some((x, z) | (z, x)))) => {}
47
- | ^ expected `u8`, found `u16`
67
+ | - ^ expected `u8`, found `u16`
68
+ | |
69
+ | first introduced with type `u8` here
70
+ |
71
+ = note: in the same arm, a binding must have the same type in all alternatives
48
72
49
73
error[E0308]: mismatched types
50
74
--> $DIR/or-patterns-binding-type-mismatch.rs:26:59
51
75
|
52
76
LL | match Some((0u8, Some((1u16, 2u32)))) {
53
77
| ------------------------------- this expression has type `std::option::Option<(u8, std::option::Option<(u16, u32)>)>`
54
78
LL | Some((x, Some((y, z)))) | Some((y, Some((x, z) | (z, x)))) => {}
55
- | ^ expected `u32`, found `u16`
79
+ | - ^ expected `u32`, found `u16`
80
+ | |
81
+ | first introduced with type `u32` here
82
+ |
83
+ = note: in the same arm, a binding must have the same type in all alternatives
56
84
57
85
error[E0308]: mismatched types
58
86
--> $DIR/or-patterns-binding-type-mismatch.rs:26:62
59
87
|
60
88
LL | match Some((0u8, Some((1u16, 2u32)))) {
61
89
| ------------------------------- this expression has type `std::option::Option<(u8, std::option::Option<(u16, u32)>)>`
62
90
LL | Some((x, Some((y, z)))) | Some((y, Some((x, z) | (z, x)))) => {}
63
- | ^ expected `u8`, found `u32`
91
+ | - first introduced with type `u8` here ^ expected `u8`, found `u32`
92
+ |
93
+ = note: in the same arm, a binding must have the same type in all alternatives
64
94
65
95
error[E0308]: mismatched types
66
96
--> $DIR/or-patterns-binding-type-mismatch.rs:34:42
67
97
|
68
98
LL | if let Blah::A(_, x, y) | Blah::B(x, y) = Blah::A(1, 1, 2) {
69
- | ^ ---------------- this expression has type `main::Blah`
70
- | |
71
- | expected `usize`, found `isize`
99
+ | - ^ ---------------- this expression has type `main::Blah`
100
+ | | |
101
+ | | expected `usize`, found `isize`
102
+ | first introduced with type `usize` here
103
+ |
104
+ = note: in the same arm, a binding must have the same type in all alternatives
72
105
73
106
error[E0308]: mismatched types
74
107
--> $DIR/or-patterns-binding-type-mismatch.rs:38:47
75
108
|
76
109
LL | if let Some(Blah::A(_, x, y) | Blah::B(x, y)) = Some(Blah::A(1, 1, 2)) {
77
- | ^ ---------------------- this expression has type `std::option::Option<main::Blah>`
78
- | |
79
- | expected `usize`, found `isize`
110
+ | - ^ ---------------------- this expression has type `std::option::Option<main::Blah>`
111
+ | | |
112
+ | | expected `usize`, found `isize`
113
+ | first introduced with type `usize` here
114
+ |
115
+ = note: in the same arm, a binding must have the same type in all alternatives
80
116
81
117
error[E0308]: mismatched types
82
118
--> $DIR/or-patterns-binding-type-mismatch.rs:42:22
83
119
|
84
120
LL | if let (x, y) | (y, x) = (0u8, 1u16) {
85
- | ^ ----------- this expression has type `(u8, u16)`
86
- | |
87
- | expected `u16`, found `u8`
121
+ | - ^ ----------- this expression has type `(u8, u16)`
122
+ | | |
123
+ | | expected `u16`, found `u8`
124
+ | first introduced with type `u16` here
125
+ |
126
+ = note: in the same arm, a binding must have the same type in all alternatives
88
127
89
128
error[E0308]: mismatched types
90
129
--> $DIR/or-patterns-binding-type-mismatch.rs:42:25
91
130
|
92
131
LL | if let (x, y) | (y, x) = (0u8, 1u16) {
93
- | ^ ----------- this expression has type `(u8, u16)`
94
- | |
95
- | expected `u8`, found `u16`
132
+ | - ^ ----------- this expression has type `(u8, u16)`
133
+ | | |
134
+ | | expected `u8`, found `u16`
135
+ | first introduced with type `u8` here
136
+ |
137
+ = note: in the same arm, a binding must have the same type in all alternatives
96
138
97
139
error[E0308]: mismatched types
98
140
--> $DIR/or-patterns-binding-type-mismatch.rs:47:44
99
141
|
100
142
LL | if let Some((x, Some((y, z)))) | Some((y, Some((x, z) | (z, x))))
101
- | ^ expected `u16`, found `u8`
143
+ | - ^ expected `u16`, found `u8`
144
+ | |
145
+ | first introduced with type `u16` here
102
146
...
103
147
LL | = Some((0u8, Some((1u16, 2u32))))
104
148
| ------------------------------- this expression has type `std::option::Option<(u8, std::option::Option<(u16, u32)>)>`
149
+ |
150
+ = note: in the same arm, a binding must have the same type in all alternatives
105
151
106
152
error[E0308]: mismatched types
107
153
--> $DIR/or-patterns-binding-type-mismatch.rs:47:53
108
154
|
109
155
LL | if let Some((x, Some((y, z)))) | Some((y, Some((x, z) | (z, x))))
110
- | ^ expected `u8`, found `u16`
156
+ | - ^ expected `u8`, found `u16`
157
+ | |
158
+ | first introduced with type `u8` here
111
159
...
112
160
LL | = Some((0u8, Some((1u16, 2u32))))
113
161
| ------------------------------- this expression has type `std::option::Option<(u8, std::option::Option<(u16, u32)>)>`
162
+ |
163
+ = note: in the same arm, a binding must have the same type in all alternatives
114
164
115
165
error[E0308]: mismatched types
116
166
--> $DIR/or-patterns-binding-type-mismatch.rs:47:62
117
167
|
118
168
LL | if let Some((x, Some((y, z)))) | Some((y, Some((x, z) | (z, x))))
119
- | ^ expected `u32`, found `u16`
169
+ | - ^ expected `u32`, found `u16`
170
+ | |
171
+ | first introduced with type `u32` here
120
172
...
121
173
LL | = Some((0u8, Some((1u16, 2u32))))
122
174
| ------------------------------- this expression has type `std::option::Option<(u8, std::option::Option<(u16, u32)>)>`
175
+ |
176
+ = note: in the same arm, a binding must have the same type in all alternatives
123
177
124
178
error[E0308]: mismatched types
125
179
--> $DIR/or-patterns-binding-type-mismatch.rs:47:65
126
180
|
127
181
LL | if let Some((x, Some((y, z)))) | Some((y, Some((x, z) | (z, x))))
128
- | ^ expected `u8`, found `u32`
182
+ | - first introduced with type `u8` here ^ expected `u8`, found `u32`
129
183
...
130
184
LL | = Some((0u8, Some((1u16, 2u32))))
131
185
| ------------------------------- this expression has type `std::option::Option<(u8, std::option::Option<(u16, u32)>)>`
186
+ |
187
+ = note: in the same arm, a binding must have the same type in all alternatives
132
188
133
189
error[E0308]: mismatched types
134
190
--> $DIR/or-patterns-binding-type-mismatch.rs:55:39
135
191
|
136
192
LL | let Blah::A(_, x, y) | Blah::B(x, y) = Blah::A(1, 1, 2);
137
- | ^ ---------------- this expression has type `main::Blah`
138
- | |
139
- | expected `usize`, found `isize`
193
+ | - ^ ---------------- this expression has type `main::Blah`
194
+ | | |
195
+ | | expected `usize`, found `isize`
196
+ | first introduced with type `usize` here
197
+ |
198
+ = note: a binding must have the same type in all alternatives
140
199
141
200
error[E0308]: mismatched types
142
201
--> $DIR/or-patterns-binding-type-mismatch.rs:58:19
143
202
|
144
203
LL | let (x, y) | (y, x) = (0u8, 1u16);
145
- | ^ ----------- this expression has type `(u8, u16)`
146
- | |
147
- | expected `u16`, found `u8`
204
+ | - ^ ----------- this expression has type `(u8, u16)`
205
+ | | |
206
+ | | expected `u16`, found `u8`
207
+ | first introduced with type `u16` here
208
+ |
209
+ = note: a binding must have the same type in all alternatives
148
210
149
211
error[E0308]: mismatched types
150
212
--> $DIR/or-patterns-binding-type-mismatch.rs:58:22
151
213
|
152
214
LL | let (x, y) | (y, x) = (0u8, 1u16);
153
- | ^ ----------- this expression has type `(u8, u16)`
154
- | |
155
- | expected `u8`, found `u16`
215
+ | - ^ ----------- this expression has type `(u8, u16)`
216
+ | | |
217
+ | | expected `u8`, found `u16`
218
+ | first introduced with type `u8` here
219
+ |
220
+ = note: a binding must have the same type in all alternatives
156
221
157
222
error[E0308]: mismatched types
158
223
--> $DIR/or-patterns-binding-type-mismatch.rs:62:42
159
224
|
160
225
LL | fn f1((Blah::A(_, x, y) | Blah::B(x, y)): Blah) {}
161
- | ^ ---- expected due to this
162
- | |
163
- | expected `usize`, found `isize`
226
+ | - ^ ---- expected due to this
227
+ | | |
228
+ | | expected `usize`, found `isize`
229
+ | first introduced with type `usize` here
230
+ |
231
+ = note: a binding must have the same type in all alternatives
164
232
165
233
error[E0308]: mismatched types
166
234
--> $DIR/or-patterns-binding-type-mismatch.rs:65:22
167
235
|
168
236
LL | fn f2(((x, y) | (y, x)): (u8, u16)) {}
169
- | ^ --------- expected due to this
170
- | |
171
- | expected `u16`, found `u8`
237
+ | - ^ --------- expected due to this
238
+ | | |
239
+ | | expected `u16`, found `u8`
240
+ | first introduced with type `u16` here
241
+ |
242
+ = note: a binding must have the same type in all alternatives
172
243
173
244
error[E0308]: mismatched types
174
245
--> $DIR/or-patterns-binding-type-mismatch.rs:65:25
175
246
|
176
247
LL | fn f2(((x, y) | (y, x)): (u8, u16)) {}
177
- | ^ --------- expected due to this
178
- | |
179
- | expected `u8`, found `u16`
248
+ | - ^ --------- expected due to this
249
+ | | |
250
+ | | expected `u8`, found `u16`
251
+ | first introduced with type `u8` here
252
+ |
253
+ = note: a binding must have the same type in all alternatives
180
254
181
255
error: aborting due to 22 previous errors
182
256
0 commit comments