You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#![allow(unused_variables)]#![allow(non_snake_case)]#![allow(unreachable_patterns)]#![allow(dead_code)]#![deny(warnings)]enumFoo{Bar,Baz,}fnfn1(e:Foo){match e {Bar => {},Baz => {},}}fnmain(){}
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.
Activity
Auto merge of #67770 - Centril:reduce-diversity-2, r=petrochenkov