]> git.lizzy.rs Git - rust.git/blob - tests/ui/mismatched_types/suggest-adding-or-removing-ref-for-binding-pattern.fixed
Rollup merge of #107700 - jyn514:tools-builder, r=Mark-Simulacrum
[rust.git] / tests / ui / mismatched_types / suggest-adding-or-removing-ref-for-binding-pattern.fixed
1 // run-rustfix
2 #![allow(dead_code, unused_variables)]
3
4 fn main() {
5     enum Blah {
6         A(isize, isize, usize),
7         B(isize, usize),
8     }
9
10     match Blah::A(1, 1, 2) {
11         Blah::A(_, x, ref y) | Blah::B(x, ref y) => {}
12         //~^ ERROR mismatched types
13         //~| ERROR variable `y` is bound inconsistently across alternatives separated by `|`
14     }
15
16     match Blah::A(1, 1, 2) {
17         Blah::A(_, x, y) | Blah::B(x, y) => {}
18         //~^ ERROR mismatched types
19         //~| variable `y` is bound inconsistently across alternatives separated by `|`
20     }
21 }