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.
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user