Skip to content
Permalink
Browse files

fix bad logic

  • Loading branch information...
estebank committed Mar 7, 2019
1 parent c41ddf1 commit a7563a30c0576761a0770b196e9effbaaf846be8
Showing with 4 additions and 3 deletions.
  1. +3 −1 src/librustc_errors/diagnostic_builder.rs
  2. +1 −2 src/librustc_errors/lib.rs
@@ -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;
}
@@ -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;
}

0 comments on commit a7563a3

Please sign in to comment.
You can’t perform that action at this time.