1
Fork 0

rustc_errors: take self by value in DiagnosticBuilder::cancel.

This commit is contained in:
Eduard-Mihai Burtescu 2022-01-26 03:39:14 +00:00
parent 8562d6b752
commit 0b9d70cf6d
31 changed files with 176 additions and 146 deletions

View file

@ -911,10 +911,6 @@ impl HandlerInner {
// FIXME(eddyb) this should ideally take `diagnostic` by value.
fn emit_diagnostic(&mut self, diagnostic: &Diagnostic) {
if diagnostic.cancelled() {
return;
}
if diagnostic.level == Level::DelayedBug {
// FIXME(eddyb) this should check for `has_errors` and stop pushing
// once *any* errors were emitted (and truncate `delayed_span_bugs`
@ -1238,7 +1234,6 @@ pub enum Level {
Warning,
Note,
Help,
Cancelled,
FailureNote,
Allow,
}
@ -1266,7 +1261,7 @@ impl Level {
spec.set_fg(Some(Color::Cyan)).set_intense(true);
}
FailureNote => {}
Allow | Cancelled => unreachable!(),
Allow => unreachable!(),
}
spec
}
@ -1279,7 +1274,6 @@ impl Level {
Note => "note",
Help => "help",
FailureNote => "failure-note",
Cancelled => panic!("Shouldn't call on cancelled error"),
Allow => panic!("Shouldn't call on allowed error"),
}
}