fork/rust
git clone https://git.julia.blue/fork/rust
8d69840ab92
1.43.1
1// run-pass 2// run-rustfix 3 4#![allow(non_snake_case)] 5#![allow(dead_code)] 6#![allow(unused_variables)] 7 8#[derive(Copy, Clone)] 9enum Foo { 10 Bar, 11 Baz 12} 13 14impl Foo { 15 fn foo(&self) { 16 match self { 17 & 18Foo::Bar if true 19//~^ WARN pattern binding `Bar` is named the same as one of the variants of the type `Foo` 20=> println!("bar"), 21 & 22Foo::Baz if false 23//~^ WARN pattern binding `Baz` is named the same as one of the variants of the type `Foo` 24=> println!("baz"), 25_ => () 26 } 27 } 28} 29 30fn main() {}