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
|
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`
|
2014-11-20 15:57:36 +00:00
|
|
|
=> println!("bar"),
|
|
|
|
&
|
|
|
|
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`
|
2014-11-20 15:57:36 +00:00
|
|
|
=> println!("baz"),
|
|
|
|
_ => ()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|