Skip to content

Commit 7d7eb97

Browse files
committed
Fix new for_loops_over_fallibles hits in compiler.
1 parent 4be041a commit 7d7eb97

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

compiler/rustc_builtin_macros/src/deriving/default.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use crate::deriving::generic::*;
33
use crate::errors;
44
use core::ops::ControlFlow;
55
use rustc_ast as ast;
6-
use rustc_ast::visit::walk_list;
6+
use rustc_ast::visit::visit_opt;
77
use rustc_ast::{attr, EnumDef, VariantData};
88
use rustc_expand::base::{Annotatable, DummyResult, ExtCtxt};
99
use rustc_span::symbol::Ident;
@@ -224,7 +224,7 @@ impl<'a, 'b> rustc_ast::visit::Visitor<'a> for DetectNonVariantDefaultAttr<'a, '
224224
self.visit_ident(v.ident);
225225
self.visit_vis(&v.vis);
226226
self.visit_variant_data(&v.data);
227-
walk_list!(self, visit_anon_const, &v.disr_expr);
227+
visit_opt!(self, visit_anon_const, &v.disr_expr);
228228
for attr in &v.attrs {
229229
rustc_ast::visit::walk_attribute(self, attr);
230230
}

compiler/rustc_resolve/src/late.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use crate::{Module, ModuleOrUniformRoot, NameBinding, ParentScope, PathResult};
1212
use crate::{ResolutionError, Resolver, Segment, UseError};
1313

1414
use rustc_ast::ptr::P;
15-
use rustc_ast::visit::{walk_list, AssocCtxt, BoundKind, FnCtxt, FnKind, Visitor};
15+
use rustc_ast::visit::{visit_opt, walk_list, AssocCtxt, BoundKind, FnCtxt, FnKind, Visitor};
1616
use rustc_ast::*;
1717
use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap};
1818
use rustc_errors::{codes::*, Applicability, DiagArgValue, IntoDiagArg, StashKey};
@@ -3286,7 +3286,7 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
32863286
fn resolve_local(&mut self, local: &'ast Local) {
32873287
debug!("resolving local ({:?})", local);
32883288
// Resolve the type.
3289-
walk_list!(self, visit_ty, &local.ty);
3289+
visit_opt!(self, visit_ty, &local.ty);
32903290

32913291
// Resolve the initializer.
32923292
if let Some((init, els)) = local.kind.init_else_opt() {
@@ -3485,8 +3485,8 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
34853485
fn resolve_arm(&mut self, arm: &'ast Arm) {
34863486
self.with_rib(ValueNS, RibKind::Normal, |this| {
34873487
this.resolve_pattern_top(&arm.pat, PatternSource::Match);
3488-
walk_list!(this, visit_expr, &arm.guard);
3489-
walk_list!(this, visit_expr, &arm.body);
3488+
visit_opt!(this, visit_expr, &arm.guard);
3489+
visit_opt!(this, visit_expr, &arm.body);
34903490
});
34913491
}
34923492

0 commit comments

Comments
 (0)