about summary refs log tree commit diff
path: root/compiler/rustc_errors/src/lib.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-06-21 13:58:06 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2024-06-21 14:29:25 +1000
commitd6efcbb760ae0a17ed05e843bdced7afee74695a (patch)
tree8b3e8dc1ce589c4607229ae1eea737478bfd0a07 /compiler/rustc_errors/src/lib.rs
parenta9c8887c7d548abc6c3e87f7d6fa02a0e95880bd (diff)
downloadrust-d6efcbb760ae0a17ed05e843bdced7afee74695a.tar.gz
rust-d6efcbb760ae0a17ed05e843bdced7afee74695a.zip
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.
Diffstat (limited to 'compiler/rustc_errors/src/lib.rs')
-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());
         }