]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-19100.fixed
Auto merge of #54720 - davidtwco:issue-51191, r=nikomatsakis
[rust.git] / src / test / ui / issues / issue-19100.fixed
1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 // run-pass
12 // run-rustfix
13
14 #![allow(non_snake_case)]
15 #![allow(dead_code)]
16 #![allow(unused_variables)]
17
18 #[derive(Copy, Clone)]
19 enum Foo {
20     Bar,
21     Baz
22 }
23
24 impl Foo {
25     fn foo(&self) {
26         match self {
27             &
28 Foo::Bar if true
29 //~^ WARN pattern binding `Bar` is named the same as one of the variants of the type `Foo`
30 => println!("bar"),
31             &
32 Foo::Baz if false
33 //~^ WARN pattern binding `Baz` is named the same as one of the variants of the type `Foo`
34 => println!("baz"),
35 _ => ()
36         }
37     }
38 }
39
40 fn main() {}