fix bad logic
This commit is contained in:
parent
c41ddf1773
commit
a7563a30c0
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user