]> git.lizzy.rs Git - rust.git/blob - src/test/ui/or-patterns/or-patterns-binding-type-mismatch.stderr
Merge remote-tracking branch 'upstream/master' into impl-16351-nightly
[rust.git] / src / test / ui / or-patterns / or-patterns-binding-type-mismatch.stderr
1 error[E0308]: mismatched types
2   --> $DIR/or-patterns-binding-type-mismatch.rs:11:39
3    |
4 LL |     match Blah::A(1, 1, 2) {
5    |           ---------------- this expression has type `Blah`
6 LL |         Blah::A(_, x, y) | Blah::B(x, y) => {}
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
12
13 error[E0308]: mismatched types
14   --> $DIR/or-patterns-binding-type-mismatch.rs:15:44
15    |
16 LL |     match Some(Blah::A(1, 1, 2)) {
17    |           ---------------------- this expression has type `Option<Blah>`
18 LL |         Some(Blah::A(_, x, y) | Blah::B(x, y)) => {}
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
24
25 error[E0308]: mismatched types
26   --> $DIR/or-patterns-binding-type-mismatch.rs:19:19
27    |
28 LL |     match (0u8, 1u16) {
29    |           ----------- this expression has type `(u8, u16)`
30 LL |         (x, y) | (y, x) => {}
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
36
37 error[E0308]: mismatched types
38   --> $DIR/or-patterns-binding-type-mismatch.rs:19:22
39    |
40 LL |     match (0u8, 1u16) {
41    |           ----------- this expression has type `(u8, u16)`
42 LL |         (x, y) | (y, x) => {}
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
48
49 error[E0308]: mismatched types
50   --> $DIR/or-patterns-binding-type-mismatch.rs:24:41
51    |
52 LL |     match Some((0u8, Some((1u16, 2u32)))) {
53    |           ------------------------------- this expression has type `Option<(u8, Option<(u16, u32)>)>`
54 LL |         Some((x, Some((y, z)))) | Some((y, Some((x, z) | (z, x)))) => {}
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
60
61 error[E0308]: mismatched types
62   --> $DIR/or-patterns-binding-type-mismatch.rs:24:50
63    |
64 LL |     match Some((0u8, Some((1u16, 2u32)))) {
65    |           ------------------------------- this expression has type `Option<(u8, Option<(u16, u32)>)>`
66 LL |         Some((x, Some((y, z)))) | Some((y, Some((x, z) | (z, x)))) => {}
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
72
73 error[E0308]: mismatched types
74   --> $DIR/or-patterns-binding-type-mismatch.rs:24:59
75    |
76 LL |     match Some((0u8, Some((1u16, 2u32)))) {
77    |           ------------------------------- this expression has type `Option<(u8, Option<(u16, u32)>)>`
78 LL |         Some((x, Some((y, z)))) | Some((y, Some((x, z) | (z, x)))) => {}
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
84
85 error[E0308]: mismatched types
86   --> $DIR/or-patterns-binding-type-mismatch.rs:24:62
87    |
88 LL |     match Some((0u8, Some((1u16, 2u32)))) {
89    |           ------------------------------- this expression has type `Option<(u8, Option<(u16, u32)>)>`
90 LL |         Some((x, Some((y, z)))) | Some((y, Some((x, z) | (z, x)))) => {}
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
94
95 error[E0308]: mismatched types
96   --> $DIR/or-patterns-binding-type-mismatch.rs:32:42
97    |
98 LL |     if let Blah::A(_, x, y) | Blah::B(x, y) = Blah::A(1, 1, 2) {
99    |                          -               ^    ---------------- this expression has type `Blah`
100    |                          |               |
101    |                          |               expected `usize`, found `isize`
102    |                          first introduced with type `usize` here
103    |
104    = note: a binding must have the same type in all alternatives
105
106 error[E0308]: mismatched types
107   --> $DIR/or-patterns-binding-type-mismatch.rs:36:47
108    |
109 LL |     if let Some(Blah::A(_, x, y) | Blah::B(x, y)) = Some(Blah::A(1, 1, 2)) {
110    |                               -               ^     ---------------------- this expression has type `Option<Blah>`
111    |                               |               |
112    |                               |               expected `usize`, found `isize`
113    |                               first introduced with type `usize` here
114    |
115    = note: a binding must have the same type in all alternatives
116
117 error[E0308]: mismatched types
118   --> $DIR/or-patterns-binding-type-mismatch.rs:40:22
119    |
120 LL |     if let (x, y) | (y, x) = (0u8, 1u16) {
121    |                -     ^       ----------- this expression has type `(u8, u16)`
122    |                |     |
123    |                |     expected `u16`, found `u8`
124    |                first introduced with type `u16` here
125    |
126    = note: a binding must have the same type in all alternatives
127
128 error[E0308]: mismatched types
129   --> $DIR/or-patterns-binding-type-mismatch.rs:40:25
130    |
131 LL |     if let (x, y) | (y, x) = (0u8, 1u16) {
132    |             -           ^    ----------- this expression has type `(u8, u16)`
133    |             |           |
134    |             |           expected `u8`, found `u16`
135    |             first introduced with type `u8` here
136    |
137    = note: a binding must have the same type in all alternatives
138
139 error[E0308]: mismatched types
140   --> $DIR/or-patterns-binding-type-mismatch.rs:45:44
141    |
142 LL |     if let Some((x, Some((y, z)))) | Some((y, Some((x, z) | (z, x))))
143    |                           -                ^ expected `u16`, found `u8`
144    |                           |
145    |                           first introduced with type `u16` here
146 ...
147 LL |     = Some((0u8, Some((1u16, 2u32))))
148    |       ------------------------------- this expression has type `Option<(u8, Option<(u16, u32)>)>`
149    |
150    = note: a binding must have the same type in all alternatives
151
152 error[E0308]: mismatched types
153   --> $DIR/or-patterns-binding-type-mismatch.rs:45:53
154    |
155 LL |     if let Some((x, Some((y, z)))) | Some((y, Some((x, z) | (z, x))))
156    |                  -                                  ^ expected `u8`, found `u16`
157    |                  |
158    |                  first introduced with type `u8` here
159 ...
160 LL |     = Some((0u8, Some((1u16, 2u32))))
161    |       ------------------------------- this expression has type `Option<(u8, Option<(u16, u32)>)>`
162    |
163    = note: a binding must have the same type in all alternatives
164
165 error[E0308]: mismatched types
166   --> $DIR/or-patterns-binding-type-mismatch.rs:45:62
167    |
168 LL |     if let Some((x, Some((y, z)))) | Some((y, Some((x, z) | (z, x))))
169    |                              -                               ^ expected `u32`, found `u16`
170    |                              |
171    |                              first introduced with type `u32` here
172 ...
173 LL |     = Some((0u8, Some((1u16, 2u32))))
174    |       ------------------------------- this expression has type `Option<(u8, Option<(u16, u32)>)>`
175    |
176    = note: a binding must have the same type in all alternatives
177
178 error[E0308]: mismatched types
179   --> $DIR/or-patterns-binding-type-mismatch.rs:45:65
180    |
181 LL |     if let Some((x, Some((y, z)))) | Some((y, Some((x, z) | (z, x))))
182    |                  - first introduced with type `u8` here         ^ expected `u8`, found `u32`
183 ...
184 LL |     = Some((0u8, Some((1u16, 2u32))))
185    |       ------------------------------- this expression has type `Option<(u8, Option<(u16, u32)>)>`
186    |
187    = note: a binding must have the same type in all alternatives
188
189 error[E0308]: mismatched types
190   --> $DIR/or-patterns-binding-type-mismatch.rs:53:40
191    |
192 LL |     let (Blah::A(_, x, y) | Blah::B(x, y)) = Blah::A(1, 1, 2);
193    |                        -               ^     ---------------- this expression has type `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
199
200 error[E0308]: mismatched types
201   --> $DIR/or-patterns-binding-type-mismatch.rs:56:20
202    |
203 LL |     let ((x, y) | (y, x)) = (0u8, 1u16);
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
210
211 error[E0308]: mismatched types
212   --> $DIR/or-patterns-binding-type-mismatch.rs:56:23
213    |
214 LL |     let ((x, y) | (y, x)) = (0u8, 1u16);
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
221
222 error[E0308]: mismatched types
223   --> $DIR/or-patterns-binding-type-mismatch.rs:60:42
224    |
225 LL |     fn f1((Blah::A(_, x, y) | Blah::B(x, y)): Blah) {}
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
232
233 error[E0308]: mismatched types
234   --> $DIR/or-patterns-binding-type-mismatch.rs:63:22
235    |
236 LL |     fn f2(((x, y) | (y, x)): (u8, u16)) {}
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
243
244 error[E0308]: mismatched types
245   --> $DIR/or-patterns-binding-type-mismatch.rs:63:25
246    |
247 LL |     fn f2(((x, y) | (y, x)): (u8, 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
254
255 error: aborting due to 22 previous errors
256
257 For more information about this error, try `rustc --explain E0308`.