@@ -12,7 +12,7 @@ use crate::{Module, ModuleOrUniformRoot, NameBinding, ParentScope, PathResult};
12
12
use crate :: { ResolutionError , Resolver , Segment , UseError } ;
13
13
14
14
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 } ;
16
16
use rustc_ast:: * ;
17
17
use rustc_data_structures:: fx:: { FxHashMap , FxHashSet , FxIndexMap } ;
18
18
use rustc_errors:: { codes:: * , Applicability , DiagArgValue , IntoDiagArg , StashKey } ;
@@ -3286,7 +3286,7 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
3286
3286
fn resolve_local ( & mut self , local : & ' ast Local ) {
3287
3287
debug ! ( "resolving local ({:?})" , local) ;
3288
3288
// Resolve the type.
3289
- walk_list ! ( self , visit_ty, & local. ty) ;
3289
+ visit_opt ! ( self , visit_ty, & local. ty) ;
3290
3290
3291
3291
// Resolve the initializer.
3292
3292
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> {
3485
3485
fn resolve_arm ( & mut self , arm : & ' ast Arm ) {
3486
3486
self . with_rib ( ValueNS , RibKind :: Normal , |this| {
3487
3487
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) ;
3490
3490
} ) ;
3491
3491
}
3492
3492
0 commit comments