]>
Commit | Line | Data |
---|---|---|
7cac9316 | 1 | // run-pass |
8faf50e0 | 2 | // run-rustfix |
7cac9316 | 3 | |
9e0c209e SL |
4 | #![allow(non_snake_case)] |
5 | #![allow(dead_code)] | |
6 | #![allow(unused_variables)] | |
7 | ||
c34b1796 | 8 | #[derive(Copy, Clone)] |
1a4d82fc JJ |
9 | enum Foo { |
10 | Bar, | |
11 | Baz | |
12 | } | |
13 | ||
1a4d82fc JJ |
14 | impl Foo { |
15 | fn foo(&self) { | |
16 | match self { | |
17 | & | |
18 | Bar if true | |
19 | //~^ WARN pattern binding `Bar` is named the same as one of the variants of the type `Foo` | |
1a4d82fc JJ |
20 | => println!("bar"), |
21 | & | |
22 | Baz if false | |
23 | //~^ WARN pattern binding `Baz` is named the same as one of the variants of the type `Foo` | |
1a4d82fc JJ |
24 | => println!("baz"), |
25 | _ => () | |
26 | } | |
27 | } | |
28 | } | |
29 | ||
30 | fn main() {} |