mirror of https://github.com/rust-lang/rust.git
Rollup merge of #41942 - tommyip:master, r=Mark-Simulacrum
Fix unexpected panic with the -Z treat-err-as-bug option This fix an issue where the compiler panics even if there is no error when passed with the `-Z treat-err-as-bug` option. Fixes #35886. r? @Mark-Simulacrum
This commit is contained in:
commit
c17811cce3
|
@ -99,7 +99,10 @@ impl<'a> DiagnosticBuilder<'a> {
|
|||
|
||||
self.handler.emitter.borrow_mut().emit(&self);
|
||||
self.cancel();
|
||||
self.handler.panic_if_treat_err_as_bug();
|
||||
|
||||
if self.level == Level::Error {
|
||||
self.handler.panic_if_treat_err_as_bug();
|
||||
}
|
||||
|
||||
// if self.is_fatal() {
|
||||
// panic!(FatalError);
|
||||
|
|
Loading…
Reference in New Issue