]> git.lizzy.rs Git - rust.git/blob - tests/ui/resolve/resolve-inconsistent-binding-mode.rs
Rollup merge of #106244 - atouchet:readme3, r=workingjubilee
[rust.git] / tests / ui / resolve / resolve-inconsistent-binding-mode.rs
1 enum Opts {
2     A(isize),
3     B(isize),
4     C(isize),
5 }
6
7 fn matcher1(x: Opts) {
8     match x {
9         Opts::A(ref i) | Opts::B(i) => {}
10         //~^ ERROR variable `i` is bound inconsistently
11         //~^^ ERROR mismatched types
12         Opts::C(_) => {}
13     }
14 }
15
16 fn matcher2(x: Opts) {
17     match x {
18         Opts::A(ref i) | Opts::B(i) => {}
19         //~^ ERROR variable `i` is bound inconsistently
20         //~^^ ERROR mismatched types
21         Opts::C(_) => {}
22     }
23 }
24
25 fn matcher4(x: Opts) {
26     match x {
27         Opts::A(ref mut i) | Opts::B(ref i) => {}
28         //~^ ERROR variable `i` is bound inconsistently
29         //~^^ ERROR mismatched types
30         Opts::C(_) => {}
31     }
32 }
33
34 fn matcher5(x: Opts) {
35     match x {
36         Opts::A(ref i) | Opts::B(ref i) => {}
37         Opts::C(_) => {}
38     }
39 }
40
41 fn main() {}