diff options
| author | Jonas Platte <jplatte+git@posteo.de> | 2025-07-23 14:34:32 +0200 | 
|---|---|---|
| committer | Jonas Platte <jplatte+git@posteo.de> | 2025-07-23 14:35:44 +0200 | 
| commit | 0e30629600d442f480c6bed29cc4bbe04b0ce926 (patch) | |
| tree | 4deb6ecd3d2b01cccabd33152d7b70fa1303921a | |
| parent | 8a1b20ed6021d9e871c60e112dbf136699c87fab (diff) | |
| download | rust-0e30629600d442f480c6bed29cc4bbe04b0ce926.tar.gz rust-0e30629600d442f480c6bed29cc4bbe04b0ce926.zip  | |
Add regression test for matches! + non_exhaustive_omitted_patterns lint
| -rw-r--r-- | library/coretests/tests/lib.rs | 1 | ||||
| -rw-r--r-- | library/coretests/tests/macros.rs | 6 | 
2 files changed, 7 insertions, 0 deletions
diff --git a/library/coretests/tests/lib.rs b/library/coretests/tests/lib.rs index 4cfac9ecc2a..c5bfd1574e2 100644 --- a/library/coretests/tests/lib.rs +++ b/library/coretests/tests/lib.rs @@ -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)] diff --git a/library/coretests/tests/macros.rs b/library/coretests/tests/macros.rs index 1c6aa90dfbc..50b5eb63e43 100644 --- a/library/coretests/tests/macros.rs +++ b/library/coretests/tests/macros.rs @@ -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); +}  | 
