From bdd1b85f951fa93eb7693527fc42de0f259e7598 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Tue, 20 Oct 2020 13:40:18 -0300 Subject: [PATCH] Rename within_fn_param to outermost_fn_param_pat --- compiler/rustc_typeck/src/check/gather_locals.rs | 16 ++++++++-------- 1 file 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 b2e5e3fe6044..f1bbe8b6d6bc 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>) -> 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.