Closed
Description
This code compiles without errors:
#![allow(unused_variables)]
#![allow(non_snake_case)]
#![allow(unreachable_patterns)]
#![allow(dead_code)]
#![deny(warnings)]
enum Foo {
Bar,
Baz,
}
fn fn1(e: Foo) {
match e {
Bar => {},
Baz => {},
}
}
fn main() {}
With the following output:
Compiling playground v0.0.1 (/playground)
warning[E0170]: pattern binding `Bar` is named the same as one of the variants of the type `Foo`
--> src/main.rs:14:9
|
14 | Bar => {},
| ^^^ help: to match on the variant, qualify the path: `Foo::Bar`
warning[E0170]: pattern binding `Baz` is named the same as one of the variants of the type `Foo`
--> src/main.rs:16:9
|
16 | Baz => {},
| ^^^ help: to match on the variant, qualify the path: `Foo::Baz`
Finished dev [unoptimized + debuginfo] target(s) in 0.37s
Running `target/debug/playground`
However, the #[deny(warnings)]
should make it fail.