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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
317 B
Rust
Raw Normal View History

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