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:
parent
a9c8887c7d
commit
d6efcbb760
3 changed files with 28 additions and 6 deletions
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue