about summary refs log tree commit diff
path: root/compiler/rustc_errors/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-06-21 09:12:38 +0200
committerGitHub <noreply@github.com>2024-06-21 09:12:38 +0200
commitd86736c9be8c06988470dc90d086d12d9cbcd1bb (patch)
tree3d7d46c076a16743d963263914b749a97c889863 /compiler/rustc_errors/src
parentf577d808b7701cd76a8906b83a1edd839555a5f2 (diff)
parentd6efcbb760ae0a17ed05e843bdced7afee74695a (diff)
downloadrust-d86736c9be8c06988470dc90d086d12d9cbcd1bb.tar.gz
rust-d86736c9be8c06988470dc90d086d12d9cbcd1bb.zip
Rollup merge of #126774 - nnethercote:fix-126751, r=oli-obk
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.

r? `@oli-obk`
Diffstat (limited to 'compiler/rustc_errors/src')
-rw-r--r--compiler/rustc_errors/src/lib.rs8
1 files changed, 4 insertions, 4 deletions
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());
         }