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