Hide outermost_fn_param_pat, it's an internal detail

This commit is contained in:
Santiago Pastorino 2020-10-20 21:56:29 -03:00
parent f0fe0a6eba
commit 89eac50a87
No known key found for this signature in database
GPG Key ID: 8131A24E0C79EFAF
3 changed files with 4 additions and 8 deletions

View File

@ -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).

View File

@ -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> {

View File

@ -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);