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.
This commit is contained in:
parent
e19ccb71c8
commit
7a03b4c75a
@ -99,7 +99,10 @@ impl<'a> DiagnosticBuilder<'a> {
|
|||||||
|
|
||||||
self.handler.emitter.borrow_mut().emit(&self);
|
self.handler.emitter.borrow_mut().emit(&self);
|
||||||
self.cancel();
|
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() {
|
// if self.is_fatal() {
|
||||||
// panic!(FatalError);
|
// panic!(FatalError);
|
||||||
|
Loading…
Reference in New Issue
Block a user