Add regression test for matches! + non_exhaustive_omitted_patterns lint

This commit is contained in:
Jonas Platte 2025-07-23 14:34:32 +02:00
parent 8a1b20ed60
commit 0e30629600
No known key found for this signature in database
GPG key ID: 7D261D771D915378
2 changed files with 7 additions and 0 deletions

View file

@ -76,6 +76,7 @@
#![feature(min_specialization)]
#![feature(never_type)]
#![feature(next_index)]
#![feature(non_exhaustive_omitted_patterns_lint)]
#![feature(numfmt)]
#![feature(pattern)]
#![feature(pointer_is_aligned_to)]

View file

@ -213,3 +213,9 @@ fn _expression() {
}
);
}
#[deny(non_exhaustive_omitted_patterns)]
fn _matches_does_not_trigger_non_exhaustive_omitted_patterns_lint(o: core::sync::atomic::Ordering) {
// Ordering is a #[non_exhaustive] enum from a separate crate
let _m = matches!(o, core::sync::atomic::Ordering::Relaxed);
}