2017-05-13 04:54:50 -05:00
|
|
|
// run-pass
|
2018-06-23 18:46:41 -05:00
|
|
|
// run-rustfix
|
2017-05-13 04:54:50 -05:00
|
|
|
|
2016-08-22 18:51:37 -05:00
|
|
|
#![allow(non_snake_case)]
|
|
|
|
#![allow(dead_code)]
|
|
|
|
#![allow(unused_variables)]
|
|
|
|
|
2015-03-30 08:38:27 -05:00
|
|
|
#[derive(Copy, Clone)]
|
2014-11-20 09:57:36 -06:00
|
|
|
enum Foo {
|
|
|
|
Bar,
|
|
|
|
Baz
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Foo {
|
|
|
|
fn foo(&self) {
|
|
|
|
match self {
|
|
|
|
&
|
|
|
|
Bar if true
|
|
|
|
//~^ WARN pattern binding `Bar` is named the same as one of the variants of the type `Foo`
|
|
|
|
=> println!("bar"),
|
|
|
|
&
|
|
|
|
Baz if false
|
|
|
|
//~^ WARN pattern binding `Baz` is named the same as one of the variants of the type `Foo`
|
|
|
|
=> println!("baz"),
|
|
|
|
_ => ()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|