From d6efcbb760ae0a17ed05e843bdced7afee74695a Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Fri, 21 Jun 2024 13:58:06 +1000 Subject: Fix another assertion failure for some Expect diagnostics. Very similar to #126719. So much so that I added a new case to the test from that PR rather than creating a new one. --- compiler/rustc_errors/src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'compiler/rustc_errors/src') diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index 620f56c01e8..91112a57277 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -1456,10 +1456,10 @@ impl DiagCtxtInner { } if diagnostic.has_future_breakage() { - // Future breakages aren't emitted if they're `Level::Allow`, - // 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)); + // 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(_))); self.future_breakage_diagnostics.push(diagnostic.clone()); } -- cgit 1.4.1-3-g733a5