Skip to content

Commit 5dd0431

Browse files
committed
Tighten the assertion in downgrade_to_delayed_bug.
I.e. `Bug` and `Fatal` level diagnostics are never downgraded.
1 parent e8c3cbf commit 5dd0431

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_errors/src/diagnostic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ impl Diagnostic {
306306
#[track_caller]
307307
pub fn downgrade_to_delayed_bug(&mut self) {
308308
assert!(
309-
self.is_error(),
309+
matches!(self.level, Level::Error | Level::DelayedBug(_)),
310310
"downgrade_to_delayed_bug: cannot downgrade {:?} to DelayedBug: not an error",
311311
self.level
312312
);

0 commit comments

Comments
 (0)