@@ -4,179 +4,253 @@ error[E0308]: mismatched types
44LL | match Blah::A(1, 1, 2) {
55 | ---------------- this expression has type `main::Blah`
66LL | 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
812
913error[E0308]: mismatched types
1014 --> $DIR/or-patterns-binding-type-mismatch.rs:17:44
1115 |
1216LL | match Some(Blah::A(1, 1, 2)) {
1317 | ---------------------- this expression has type `std::option::Option<main::Blah>`
1418LL | 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
1624
1725error[E0308]: mismatched types
1826 --> $DIR/or-patterns-binding-type-mismatch.rs:21:19
1927 |
2028LL | match (0u8, 1u16) {
2129 | ----------- this expression has type `(u8, u16)`
2230LL | (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
2436
2537error[E0308]: mismatched types
2638 --> $DIR/or-patterns-binding-type-mismatch.rs:21:22
2739 |
2840LL | match (0u8, 1u16) {
2941 | ----------- this expression has type `(u8, u16)`
3042LL | (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
3248
3349error[E0308]: mismatched types
3450 --> $DIR/or-patterns-binding-type-mismatch.rs:26:41
3551 |
3652LL | match Some((0u8, Some((1u16, 2u32)))) {
3753 | ------------------------------- this expression has type `std::option::Option<(u8, std::option::Option<(u16, u32)>)>`
3854LL | 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
4060
4161error[E0308]: mismatched types
4262 --> $DIR/or-patterns-binding-type-mismatch.rs:26:50
4363 |
4464LL | match Some((0u8, Some((1u16, 2u32)))) {
4565 | ------------------------------- this expression has type `std::option::Option<(u8, std::option::Option<(u16, u32)>)>`
4666LL | 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
4872
4973error[E0308]: mismatched types
5074 --> $DIR/or-patterns-binding-type-mismatch.rs:26:59
5175 |
5276LL | match Some((0u8, Some((1u16, 2u32)))) {
5377 | ------------------------------- this expression has type `std::option::Option<(u8, std::option::Option<(u16, u32)>)>`
5478LL | 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
5684
5785error[E0308]: mismatched types
5886 --> $DIR/or-patterns-binding-type-mismatch.rs:26:62
5987 |
6088LL | match Some((0u8, Some((1u16, 2u32)))) {
6189 | ------------------------------- this expression has type `std::option::Option<(u8, std::option::Option<(u16, u32)>)>`
6290LL | 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
6494
6595error[E0308]: mismatched types
6696 --> $DIR/or-patterns-binding-type-mismatch.rs:34:42
6797 |
6898LL | 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
72105
73106error[E0308]: mismatched types
74107 --> $DIR/or-patterns-binding-type-mismatch.rs:38:47
75108 |
76109LL | 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
80116
81117error[E0308]: mismatched types
82118 --> $DIR/or-patterns-binding-type-mismatch.rs:42:22
83119 |
84120LL | 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
88127
89128error[E0308]: mismatched types
90129 --> $DIR/or-patterns-binding-type-mismatch.rs:42:25
91130 |
92131LL | 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
96138
97139error[E0308]: mismatched types
98140 --> $DIR/or-patterns-binding-type-mismatch.rs:47:44
99141 |
100142LL | 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
102146...
103147LL | = Some((0u8, Some((1u16, 2u32))))
104148 | ------------------------------- 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
105151
106152error[E0308]: mismatched types
107153 --> $DIR/or-patterns-binding-type-mismatch.rs:47:53
108154 |
109155LL | 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
111159...
112160LL | = Some((0u8, Some((1u16, 2u32))))
113161 | ------------------------------- 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
114164
115165error[E0308]: mismatched types
116166 --> $DIR/or-patterns-binding-type-mismatch.rs:47:62
117167 |
118168LL | 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
120172...
121173LL | = Some((0u8, Some((1u16, 2u32))))
122174 | ------------------------------- 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
123177
124178error[E0308]: mismatched types
125179 --> $DIR/or-patterns-binding-type-mismatch.rs:47:65
126180 |
127181LL | 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`
129183...
130184LL | = Some((0u8, Some((1u16, 2u32))))
131185 | ------------------------------- 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
132188
133189error[E0308]: mismatched types
134190 --> $DIR/or-patterns-binding-type-mismatch.rs:55:39
135191 |
136192LL | 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
140199
141200error[E0308]: mismatched types
142201 --> $DIR/or-patterns-binding-type-mismatch.rs:58:19
143202 |
144203LL | 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
148210
149211error[E0308]: mismatched types
150212 --> $DIR/or-patterns-binding-type-mismatch.rs:58:22
151213 |
152214LL | 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
156221
157222error[E0308]: mismatched types
158223 --> $DIR/or-patterns-binding-type-mismatch.rs:62:42
159224 |
160225LL | 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
164232
165233error[E0308]: mismatched types
166234 --> $DIR/or-patterns-binding-type-mismatch.rs:65:22
167235 |
168236LL | 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
172243
173244error[E0308]: mismatched types
174245 --> $DIR/or-patterns-binding-type-mismatch.rs:65:25
175246 |
176247LL | 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
180254
181255error: aborting due to 22 previous errors
182256
0 commit comments