Skip to content

Commit

Permalink
Rollup merge of #41942 - tommyip:master, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Mark-Simulacrum authored May 12, 2017
2 parents 1a602ba + 7a03b4c commit f0fdb5c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/librustc_errors/diagnostic_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f0fdb5c

Please sign in to comment.