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