2017-05-13 09:54:50 +00:00
|
|
|
// run-pass
|
2018-06-23 23:46:41 +00:00
|
|
|
// run-rustfix
|
2017-05-13 09:54:50 +00:00
|
|
|
|
2016-08-22 23:51:37 +00:00
|
|
|
#![allow(non_snake_case)]
|
|
|
|
#![allow(dead_code)]
|
|
|
|
#![allow(unused_variables)]
|
|
|
|
|
2015-03-30 13:38:27 +00:00
|
|
|
#[derive(Copy, Clone)]
|
2014-11-20 15:57:36 +00: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() {}
|