2016-12-11 16:01:12 +00:00
|
|
|
#![deny(unreachable_patterns)]
|
|
|
|
#![allow(unused_variables)]
|
|
|
|
#![allow(non_snake_case)]
|
|
|
|
|
2014-05-16 22:44:14 +00:00
|
|
|
pub enum E {
|
|
|
|
A,
|
|
|
|
B,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub mod b {
|
|
|
|
pub fn key(e: ::E) -> &'static str {
|
|
|
|
match e {
|
|
|
|
A => "A",
|
2022-11-08 15:24:06 +00:00
|
|
|
//~^ ERROR pattern binding `A` is named the same as one of the variants of the type `E`
|
2014-05-16 22:44:14 +00:00
|
|
|
B => "B", //~ ERROR: unreachable pattern
|
2022-11-08 15:24:06 +00:00
|
|
|
//~^ ERROR pattern binding `B` is named the same as one of the variants of the type `E`
|
2014-05-16 22:44:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|