Some(ty) => self.deduce_expectations_from_expected_type(ty),
None => (None, None),
};
- let body = self.tcx.hir.body(body_id);
+ let body = self.tcx.hir().body(body_id);
self.check_closure(expr, expected_kind, decl, body, gen, expected_sig)
}
opt_kind, expected_sig
);
- let expr_def_id = self.tcx.hir.local_def_id(expr.id);
+ let expr_def_id = self.tcx.hir().local_def_id(expr.id);
let ClosureSignatures {
bound_sig,
ty::Predicate::ObjectSafe(..) => None,
ty::Predicate::ConstEvaluatable(..) => None,
- // NB: This predicate is created by breaking down a
+ // N.B., this predicate is created by breaking down a
// `ClosureType: FnFoo()` predicate, where
// `ClosureType` represents some `Closure`. It can't
// possibly be referring to the current closure,
// Create a `PolyFnSig`. Note the oddity that late bound
// regions appearing free in `expected_sig` are now bound up
// in this binder we are creating.
- assert!(!expected_sig.sig.has_regions_bound_above(ty::INNERMOST));
+ assert!(!expected_sig.sig.has_vars_bound_above(ty::INNERMOST));
let bound_sig = ty::Binder::bind(self.tcx.mk_fn_sig(
expected_sig.sig.inputs().iter().cloned(),
expected_sig.sig.output(),
body: &hir::Body,
expected_sig: ExpectedSig<'tcx>,
) -> ClosureSignatures<'tcx> {
- let expr_map_node = self.tcx.hir.get_if_local(expr_def_id).unwrap();
+ let expr_map_node = self.tcx.hir().get_if_local(expr_def_id).unwrap();
let expected_args: Vec<_> = expected_sig
.sig
.inputs()
// `liberated_sig` is E'.
{
// Instantiate (this part of..) S to S', i.e., with fresh variables.
- let (supplied_ty, _) = self.infcx.replace_late_bound_regions_with_fresh_var(
+ let (supplied_ty, _) = self.infcx.replace_bound_vars_with_fresh_vars(
hir_ty.span,
LateBoundRegionConversionTime::FnCall,
&ty::Binder::bind(supplied_ty),
);
}
- let (supplied_output_ty, _) = self.infcx.replace_late_bound_regions_with_fresh_var(
+ let (supplied_output_ty, _) = self.infcx.replace_bound_vars_with_fresh_vars(
decl.output.span(),
LateBoundRegionConversionTime::FnCall,
&supplied_sig.output(),