]> git.lizzy.rs Git - rust.git/blob - src/test/ui/pattern/issue-14221.rs
Rollup merge of #105555 - krasimirgg:llvm-int-opt-2, r=cuviper
[rust.git] / src / test / ui / pattern / issue-14221.rs
1 #![deny(unreachable_patterns)]
2 #![allow(unused_variables)]
3 #![allow(non_snake_case)]
4
5 pub enum E {
6     A,
7     B,
8 }
9
10 pub mod b {
11     pub fn key(e: ::E) -> &'static str {
12         match e {
13             A => "A",
14 //~^ WARN pattern binding `A` is named the same as one of the variants of the type `E`
15             B => "B", //~ ERROR: unreachable pattern
16 //~^ WARN pattern binding `B` is named the same as one of the variants of the type `E`
17         }
18     }
19 }
20
21 fn main() {}