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
|
2022-11-08 09:24:06 -06:00
|
|
|
//~^ ERROR pattern binding `Bar` is named the same as one of the variants of the type `Foo`
|
2014-11-20 09:57:36 -06:00
|
|
|
=> println!("bar"),
|
|
|
|
&
|
|
|
|
Baz if false
|
2022-11-08 09:24:06 -06:00
|
|
|
//~^ ERROR pattern binding `Baz` is named the same as one of the variants of the type `Foo`
|
2014-11-20 09:57:36 -06:00
|
|
|
=> println!("baz"),
|
|
|
|
_ => ()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|