diff options
| author | Michael Goulet <michael@errs.io> | 2024-08-11 12:10:36 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-08-11 12:25:39 -0400 |
| commit | c361c924a08c2e34c705ec3ee1ad2099315338d8 (patch) | |
| tree | baf77b91e85e7f6ef791733caa6ca797b4093b39 /compiler/rustc_errors/src | |
| parent | 68d2e8a66e0003178baf7dd9bbc62dc76f54a1af (diff) | |
| download | rust-c361c924a08c2e34c705ec3ee1ad2099315338d8.tar.gz rust-c361c924a08c2e34c705ec3ee1ad2099315338d8.zip | |
Use assert_matches around the compiler
Diffstat (limited to 'compiler/rustc_errors/src')
| -rw-r--r-- | compiler/rustc_errors/src/lib.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index ceebcd46a6f..48fdc644e8d 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -10,6 +10,7 @@ #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] #![doc(rust_logo)] #![feature(array_windows)] +#![feature(assert_matches)] #![feature(associated_type_defaults)] #![feature(box_into_inner)] #![feature(box_patterns)] @@ -28,6 +29,7 @@ extern crate self as rustc_errors; +use std::assert_matches::assert_matches; use std::backtrace::{Backtrace, BacktraceStatus}; use std::borrow::Cow; use std::cell::Cell; @@ -1490,7 +1492,7 @@ impl DiagCtxtInner { // Future breakages aren't emitted if they're `Level::Allow` or // `Level::Expect`, but they still need to be constructed and // stashed below, so they'll trigger the must_produce_diag check. - assert!(matches!(diagnostic.level, Error | Warning | Allow | Expect(_))); + assert_matches!(diagnostic.level, Error | Warning | Allow | Expect(_)); self.future_breakage_diagnostics.push(diagnostic.clone()); } |
