Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Hide outermost_fn_param_pat, it's an internal detail
  • Loading branch information
spastorino committed Oct 27, 2020
1 parent f0fe0a6 commit 89eac50
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_typeck/src/check/check.rs
Expand Up @@ -105,7 +105,7 @@ pub(super) fn check_fn<'a, 'tcx>(

let outer_def_id = tcx.closure_base_def_id(hir.local_def_id(fn_id).to_def_id()).expect_local();
let outer_hir_id = hir.local_def_id_to_hir_id(outer_def_id);
GatherLocalsVisitor::new(&fcx, outer_hir_id, false).visit_body(body);
GatherLocalsVisitor::new(&fcx, outer_hir_id).visit_body(body);

// C-variadic fns also have a `VaList` input that's not listed in `fn_sig`
// (as it's created inside the body itself, not passed in from outside).
Expand Down
8 changes: 2 additions & 6 deletions compiler/rustc_typeck/src/check/gather_locals.rs
Expand Up @@ -18,12 +18,8 @@ pub(super) struct GatherLocalsVisitor<'a, 'tcx> {
}

impl<'a, 'tcx> GatherLocalsVisitor<'a, 'tcx> {
pub(super) fn new(
fcx: &'a FnCtxt<'a, 'tcx>,
parent_id: hir::HirId,
outermost_fn_param_pat: bool,
) -> Self {
Self { fcx, parent_id, outermost_fn_param_pat }
pub(super) fn new(fcx: &'a FnCtxt<'a, 'tcx>, parent_id: hir::HirId) -> Self {
Self { fcx, parent_id, outermost_fn_param_pat: false }
}

fn assign(&mut self, span: Span, nid: hir::HirId, ty_opt: Option<LocalTy<'tcx>>) -> Ty<'tcx> {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_typeck/src/check/mod.rs
Expand Up @@ -553,7 +553,7 @@ fn typeck_with_fallback<'tcx>(
};

// Gather locals in statics (because of block expressions).
GatherLocalsVisitor::new(&fcx, id, false).visit_body(body);
GatherLocalsVisitor::new(&fcx, id).visit_body(body);

fcx.check_expr_coercable_to_type(&body.value, revealed_ty, None);

Expand Down

0 comments on commit 89eac50

Please sign in to comment.