Prefer item-local tainting checks over global error count checks
This commit is contained in:
parent
9d5da39b3a
commit
a5d37238a1
@ -708,7 +708,7 @@ fn check_expr_break(
|
||||
// else an error would have been flagged by the
|
||||
// `loops` pass for using break with an expression
|
||||
// where you are not supposed to.
|
||||
assert!(expr_opt.is_none() || self.dcx().has_errors().is_some());
|
||||
assert!(expr_opt.is_none() || self.tainted_by_errors().is_some());
|
||||
}
|
||||
|
||||
// If we encountered a `break`, then (no surprise) it may be possible to break from the
|
||||
|
@ -1652,7 +1652,7 @@ pub fn check_stmt(&self, stmt: &'tcx hir::Stmt<'tcx>) {
|
||||
|
||||
self.warn_if_unreachable(stmt.hir_id, stmt.span, "statement");
|
||||
|
||||
// Hide the outer diverging and `has_errors` flags.
|
||||
// Hide the outer diverging flags.
|
||||
let old_diverges = self.diverges.replace(Diverges::Maybe);
|
||||
|
||||
match stmt.kind {
|
||||
|
Loading…
Reference in New Issue
Block a user