]> git.lizzy.rs Git - rust.git/blob - tests/ui/mismatched_types/suggest-adding-or-removing-ref-for-binding-pattern.stderr
Rollup merge of #105526 - Xiretza:iter-from-generator-derive, r=scottmcm
[rust.git] / tests / ui / mismatched_types / suggest-adding-or-removing-ref-for-binding-pattern.stderr
1 error[E0409]: variable `y` is bound inconsistently across alternatives separated by `|`
2   --> $DIR/suggest-adding-or-removing-ref-for-binding-pattern.rs:11:43
3    |
4 LL |         Blah::A(_, x, ref y) | Blah::B(x, y) => {}
5    |                           - first binding ^ bound in different ways
6
7 error[E0409]: variable `y` is bound inconsistently across alternatives separated by `|`
8   --> $DIR/suggest-adding-or-removing-ref-for-binding-pattern.rs:17:43
9    |
10 LL |         Blah::A(_, x, y) | Blah::B(x, ref y) => {}
11    |                       - first binding     ^ bound in different ways
12
13 error[E0308]: mismatched types
14   --> $DIR/suggest-adding-or-removing-ref-for-binding-pattern.rs:11:43
15    |
16 LL |     match Blah::A(1, 1, 2) {
17    |           ---------------- this expression has type `Blah`
18 LL |         Blah::A(_, x, ref y) | Blah::B(x, y) => {}
19    |                       -----               ^ expected `&usize`, found `usize`
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 help: consider adding `ref`
25    |
26 LL |         Blah::A(_, x, ref y) | Blah::B(x, ref y) => {}
27    |                                           +++
28
29 error[E0308]: mismatched types
30   --> $DIR/suggest-adding-or-removing-ref-for-binding-pattern.rs:17:39
31    |
32 LL |     match Blah::A(1, 1, 2) {
33    |           ---------------- this expression has type `Blah`
34 LL |         Blah::A(_, x, y) | Blah::B(x, ref y) => {}
35    |                       -               ^^^^^ expected `usize`, found `&usize`
36    |                       |
37    |                       first introduced with type `usize` here
38    |
39    = note: in the same arm, a binding must have the same type in all alternatives
40 help: consider removing `ref`
41    |
42 LL -         Blah::A(_, x, y) | Blah::B(x, ref y) => {}
43 LL +         Blah::A(_, x, y) | Blah::B(x, y) => {}
44    |
45
46 error: aborting due to 4 previous errors
47
48 Some errors have detailed explanations: E0308, E0409.
49 For more information about an error, try `rustc --explain E0308`.