about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSantiago Pastorino <spastorino@gmail.com>2020-10-20 13:40:18 -0300
committerSantiago Pastorino <spastorino@gmail.com>2020-10-27 14:45:39 -0300
commitbdd1b85f951fa93eb7693527fc42de0f259e7598 (patch)
treefcef09957b4a861d431aaeaece808cfb21053c51
parentca41681bf0d5175dd39a91e97aca28b007241a29 (diff)
downloadrust-bdd1b85f951fa93eb7693527fc42de0f259e7598.tar.gz
rust-bdd1b85f951fa93eb7693527fc42de0f259e7598.zip
Rename within_fn_param to outermost_fn_param_pat
-rw-r--r--compiler/rustc_typeck/src/check/gather_locals.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/compiler/rustc_typeck/src/check/gather_locals.rs b/compiler/rustc_typeck/src/check/gather_locals.rs
index b2e5e3fe604..f1bbe8b6d6b 100644
--- a/compiler/rustc_typeck/src/check/gather_locals.rs
+++ b/compiler/rustc_typeck/src/check/gather_locals.rs
@@ -14,16 +14,16 @@ pub(super) struct GatherLocalsVisitor<'a, 'tcx> {
     // params are special cases of pats, but we want to handle them as
     // *distinct* cases. so track when we are hitting a pat *within* an fn
     // param.
-    within_fn_param: bool,
+    outermost_fn_param_pat: bool,
 }
 
 impl<'a, 'tcx> GatherLocalsVisitor<'a, 'tcx> {
     pub(super) fn new(
         fcx: &'a FnCtxt<'a, 'tcx>,
         parent_id: hir::HirId,
-        within_fn_param: bool,
+        outermost_fn_param_pat: bool,
     ) -> Self {
-        Self { fcx, parent_id, within_fn_param }
+        Self { fcx, parent_id, outermost_fn_param_pat }
     }
 
     fn assign(&mut self, span: Span, nid: hir::HirId, ty_opt: Option<LocalTy<'tcx>>) -> Ty<'tcx> {
@@ -98,9 +98,9 @@ impl<'a, 'tcx> Visitor<'tcx> for GatherLocalsVisitor<'a, 'tcx> {
     }
 
     fn visit_param(&mut self, param: &'tcx hir::Param<'tcx>) {
-        let old_within_fn_param = mem::replace(&mut self.within_fn_param, true);
+        let old_outermost_fn_param_pat = mem::replace(&mut self.outermost_fn_param_pat, true);
         intravisit::walk_param(self, param);
-        self.within_fn_param = old_within_fn_param;
+        self.outermost_fn_param_pat = old_outermost_fn_param_pat;
     }
 
     // Add pattern bindings.
@@ -108,7 +108,7 @@ impl<'a, 'tcx> Visitor<'tcx> for GatherLocalsVisitor<'a, 'tcx> {
         if let PatKind::Binding(_, _, ident, _) = p.kind {
             let var_ty = self.assign(p.span, p.hir_id, None);
 
-            if self.within_fn_param {
+            if self.outermost_fn_param_pat {
                 if !self.fcx.tcx.features().unsized_fn_params {
                     self.fcx.require_type_is_sized(
                         var_ty,
@@ -129,9 +129,9 @@ impl<'a, 'tcx> Visitor<'tcx> for GatherLocalsVisitor<'a, 'tcx> {
                 var_ty
             );
         }
-        let old_within_fn_param = mem::replace(&mut self.within_fn_param, false);
+        let old_outermost_fn_param_pat = mem::replace(&mut self.outermost_fn_param_pat, false);
         intravisit::walk_pat(self, p);
-        self.within_fn_param = old_within_fn_param;
+        self.outermost_fn_param_pat = old_outermost_fn_param_pat;
     }
 
     // Don't descend into the bodies of nested closures.