about summary refs log tree commit diff
path: root/library/coretests
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-07-26 15:27:58 +0200
committerGitHub <noreply@github.com>2025-07-26 15:27:58 +0200
commitc9541a2bf86ed4d620abcf2f4eee3d0ce8e0e8cd (patch)
tree660cc4d0b85ebbc7009ab7ec09c1073e1bce6486 /library/coretests
parent8708f3cd1f96d226f6420a58ebdd61aa0bc08b0a (diff)
parent25ed28823a252a37fbbe8867bbc5e99a1b924801 (diff)
downloadrust-c9541a2bf86ed4d620abcf2f4eee3d0ce8e0e8cd.tar.gz
rust-c9541a2bf86ed4d620abcf2f4eee3d0ce8e0e8cd.zip
Rollup merge of #144331 - jplatte:matches-allow-non_exhaustive_omitted_patterns, r=Nadrieril
Disable non_exhaustive_omitted_patterns within matches! macro

Closes rust-lang/rust#117304.

I believe I can skip all of the bootstrap stuff mentioned in https://github.com/rust-lang/rust/issues/117304#issuecomment-1784414453 due to https://blog.rust-lang.org/inside-rust/2025/05/29/redesigning-the-initial-bootstrap-sequence/, right?

cc `@Jules-Bertholet`
Diffstat (limited to 'library/coretests')
-rw-r--r--library/coretests/tests/lib.rs1
-rw-r--r--library/coretests/tests/macros.rs6
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);
+}