Skip to content

Commit 0e46759

Browse files
committed
Fix more new for_loops_over_fallibles hits in compiler.
1 parent ea549fd commit 0e46759

File tree

2 files changed

+3
-3
lines changed
  • compiler
    • rustc_hir_analysis/src/check
    • rustc_mir_build/src/build/matches

2 files changed

+3
-3
lines changed

compiler/rustc_hir_analysis/src/check/region.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//!
77
//! [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/borrow_check.html
88
9-
use rustc_ast::visit::walk_list;
9+
use rustc_ast::visit::visit_opt;
1010
use rustc_data_structures::fx::FxHashSet;
1111
use rustc_hir as hir;
1212
use rustc_hir::def_id::DefId;
@@ -168,7 +168,7 @@ fn resolve_block<'tcx>(visitor: &mut RegionResolutionVisitor<'tcx>, blk: &'tcx h
168168
hir::StmtKind::Expr(..) | hir::StmtKind::Semi(..) => visitor.visit_stmt(statement),
169169
}
170170
}
171-
walk_list!(visitor, visit_expr, &blk.expr);
171+
visit_opt!(visitor, visit_expr, &blk.expr);
172172
}
173173

174174
visitor.cx = prev_cx;

compiler/rustc_mir_build/src/build/matches/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -925,7 +925,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
925925
for subpattern in prefix.iter() {
926926
self.visit_primary_bindings(subpattern, pattern_user_ty.clone().index(), f);
927927
}
928-
for subpattern in slice {
928+
if let Some(subpattern) = slice {
929929
self.visit_primary_bindings(
930930
subpattern,
931931
pattern_user_ty.clone().subslice(from, to),

0 commit comments

Comments
 (0)