Warn when lint level is set on a match arm

This commit is contained in:
Nadrieril 2023-10-23 18:55:04 +02:00
parent 2d9af160af
commit 17c7d21650

View file

@ -9,12 +9,12 @@ fn repeat() -> ! {
}
pub fn f(x: Ordering) {
#[deny(non_exhaustive_omitted_patterns)]
match x {
Ordering::Relaxed => println!("relaxed"),
Ordering::Release => println!("release"),
Ordering::Acquire => println!("acquire"),
Ordering::AcqRel | Ordering::SeqCst => repeat(),
#[deny(non_exhaustive_omitted_patterns)]
_ => repeat(),
}
}