Prefer to use has_errors
to err_count
This commit is contained in:
parent
f693d339f1
commit
30b6c59f24
7 changed files with 19 additions and 25 deletions
|
@ -352,7 +352,7 @@ pub struct HandlerFlags {
|
|||
|
||||
impl Drop for Handler {
|
||||
fn drop(&mut self) {
|
||||
if self.err_count() == 0 {
|
||||
if !self.has_errors() {
|
||||
let mut bugs = self.delayed_span_bugs.borrow_mut();
|
||||
let has_bugs = !bugs.is_empty();
|
||||
for bug in bugs.drain(..) {
|
||||
|
@ -705,10 +705,9 @@ impl Handler {
|
|||
}
|
||||
|
||||
pub fn abort_if_errors(&self) {
|
||||
if self.err_count() == 0 {
|
||||
return;
|
||||
if self.has_errors() {
|
||||
FatalError.raise();
|
||||
}
|
||||
FatalError.raise();
|
||||
}
|
||||
pub fn emit(&self, msp: &MultiSpan, msg: &str, lvl: Level) {
|
||||
if lvl == Warning && !self.flags.can_emit_warnings {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue