Open
Description
A constant with #[allow(non_upper_case_globals)]
applied still generates a warning when used in a pattern, unless the match
also has the allow attribute. For example:
#[allow(non_upper_case_globals)]
mod keywords {
pub const If: u32 = 0;
pub const While: u32 = 1;
}
fn main() {
use keywords::*;
// the warning goes away with this attribute:
// #[allow(non_upper_case_globals)]
match 0 {
keywords::If => println!("if"),
While => println!("while"),
_ => println!("<unknown>"),
}
}