@@ -14,16 +14,16 @@ pub(super) struct GatherLocalsVisitor<'a, 'tcx> {
1414 // params are special cases of pats, but we want to handle them as
1515 // *distinct* cases. so track when we are hitting a pat *within* an fn
1616 // param.
17- within_fn_param : bool ,
17+ outermost_fn_param_pat : bool ,
1818}
1919
2020impl < ' a , ' tcx > GatherLocalsVisitor < ' a , ' tcx > {
2121 pub ( super ) fn new (
2222 fcx : & ' a FnCtxt < ' a , ' tcx > ,
2323 parent_id : hir:: HirId ,
24- within_fn_param : bool ,
24+ outermost_fn_param_pat : bool ,
2525 ) -> Self {
26- Self { fcx, parent_id, within_fn_param }
26+ Self { fcx, parent_id, outermost_fn_param_pat }
2727 }
2828
2929 fn assign ( & mut self , span : Span , nid : hir:: HirId , ty_opt : Option < LocalTy < ' tcx > > ) -> Ty < ' tcx > {
@@ -98,17 +98,17 @@ impl<'a, 'tcx> Visitor<'tcx> for GatherLocalsVisitor<'a, 'tcx> {
9898 }
9999
100100 fn visit_param ( & mut self , param : & ' tcx hir:: Param < ' tcx > ) {
101- let old_within_fn_param = mem:: replace ( & mut self . within_fn_param , true ) ;
101+ let old_outermost_fn_param_pat = mem:: replace ( & mut self . outermost_fn_param_pat , true ) ;
102102 intravisit:: walk_param ( self , param) ;
103- self . within_fn_param = old_within_fn_param ;
103+ self . outermost_fn_param_pat = old_outermost_fn_param_pat ;
104104 }
105105
106106 // Add pattern bindings.
107107 fn visit_pat ( & mut self , p : & ' tcx hir:: Pat < ' tcx > ) {
108108 if let PatKind :: Binding ( _, _, ident, _) = p. kind {
109109 let var_ty = self . assign ( p. span , p. hir_id , None ) ;
110110
111- if self . within_fn_param {
111+ if self . outermost_fn_param_pat {
112112 if !self . fcx . tcx . features ( ) . unsized_fn_params {
113113 self . fcx . require_type_is_sized (
114114 var_ty,
@@ -129,9 +129,9 @@ impl<'a, 'tcx> Visitor<'tcx> for GatherLocalsVisitor<'a, 'tcx> {
129129 var_ty
130130 ) ;
131131 }
132- let old_within_fn_param = mem:: replace ( & mut self . within_fn_param , false ) ;
132+ let old_outermost_fn_param_pat = mem:: replace ( & mut self . outermost_fn_param_pat , false ) ;
133133 intravisit:: walk_pat ( self , p) ;
134- self . within_fn_param = old_within_fn_param ;
134+ self . outermost_fn_param_pat = old_outermost_fn_param_pat ;
135135 }
136136
137137 // Don't descend into the bodies of nested closures.
0 commit comments