2018-06-23 23:46:41 +00:00
|
|
|
// run-rustfix
|
|
|
|
|
|
|
|
#![allow(non_snake_case)]
|
|
|
|
#![allow(dead_code)]
|
|
|
|
#![allow(unused_variables)]
|
|
|
|
|
|
|
|
#[derive(Copy, Clone)]
|
|
|
|
enum Foo {
|
|
|
|
Bar,
|
|
|
|
Baz
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Foo {
|
|
|
|
fn foo(&self) {
|
|
|
|
match self {
|
|
|
|
&
|
|
|
|
Foo::Bar if true
|
2022-11-08 15:24:06 +00:00
|
|
|
//~^ ERROR pattern binding `Bar` is named the same as one of the variants of the type `Foo`
|
2018-06-23 23:46:41 +00:00
|
|
|
=> println!("bar"),
|
|
|
|
&
|
|
|
|
Foo::Baz if false
|
2022-11-08 15:24:06 +00:00
|
|
|
//~^ ERROR pattern binding `Baz` is named the same as one of the variants of the type `Foo`
|
2018-06-23 23:46:41 +00:00
|
|
|
=> println!("baz"),
|
|
|
|
_ => ()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|