Skip to content

Commit

Permalink
fix bad logic
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Mar 7, 2019
1 parent c41ddf1 commit a7563a3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/librustc_errors/diagnostic_builder.rs
Expand Up @@ -103,7 +103,9 @@ impl<'a> DiagnosticBuilder<'a> {
/// Buffers the diagnostic for later emission, unless handler
/// has disabled such buffering.
pub fn buffer(mut self, buffered_diagnostics: &mut Vec<Diagnostic>) {
if self.handler.flags.dont_buffer_diagnostics || self.handler.treat_err_as_bug() {
if self.handler.flags.dont_buffer_diagnostics ||
self.handler.flags.treat_err_as_bug.is_some()
{
self.emit();
return;
}
Expand Down
3 changes: 1 addition & 2 deletions src/librustc_errors/lib.rs
Expand Up @@ -657,8 +657,7 @@ impl Handler {
1 => "aborting due to previous error".to_string(),
_ => format!("aborting due to {} previous errors", self.err_count())
};
let err_as_bug = self.flags.treat_err_as_bug.unwrap_or(0);
if self.err_count() >= err_as_bug {
if self.treat_err_as_bug() {
return;
}

Expand Down

0 comments on commit a7563a3

Please sign in to comment.