Factor write_ty out of check_expr_closure
This commit is contained in:
parent
144b8cf5db
commit
21720641dc
@ -70,8 +70,6 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
|
||||
self.parameter_environment.free_substs,
|
||||
upvar_tys);
|
||||
|
||||
let ty = self.write_ty(expr.id, closure_type);
|
||||
|
||||
let fn_sig = self.tcx.liberate_late_bound_regions(
|
||||
self.tcx.region_maps.call_site_extent(expr.id, body.id), &fn_ty.sig);
|
||||
let fn_sig =
|
||||
@ -94,7 +92,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
|
||||
None => { }
|
||||
}
|
||||
|
||||
ty
|
||||
closure_type
|
||||
}
|
||||
|
||||
fn deduce_expectations_from_expected_type(&self, expected_ty: Ty<'tcx>)
|
||||
|
@ -3531,7 +3531,8 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
|
||||
self.write_ty(expr.id, result_ty)
|
||||
}
|
||||
hir::ExprClosure(capture, ref decl, ref body, _) => {
|
||||
self.check_expr_closure(expr, capture, &decl, &body, expected)
|
||||
let ty = self.check_expr_closure(expr, capture, &decl, &body, expected);
|
||||
self.write_ty(id, ty)
|
||||
}
|
||||
hir::ExprBlock(ref b) => {
|
||||
self.check_block_with_expected(&b, expected);
|
||||
|
Loading…
x
Reference in New Issue
Block a user