rust/tests/ui/lint/lint-match-arms.rs

19 lines
317 B
Rust
Raw Normal View History

2019-03-30 18:00:07 -05:00
fn deny_on_arm() {
match 0 {
#[deny(unused_variables)]
2020-01-22 17:57:38 -06:00
//~^ NOTE the lint level is defined here
2019-03-30 18:00:07 -05:00
y => (),
//~^ ERROR unused variable
}
}
#[deny(unused_variables)]
fn allow_on_arm() {
match 0 {
#[allow(unused_variables)]
y => (), // OK
}
}
fn main() {}