]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_hir_typeck/src/closure.rs
Rollup merge of #105100 - jhpratt:fix-docs, r=JohnTitor
[rust.git] / compiler / rustc_hir_typeck / src / closure.rs
index 33c87768ec1a373890d8f193011d0f747040f738..5d3419b3b6e66c16be7e11c09dc0d0630ef0454c 100644 (file)
@@ -79,16 +79,15 @@ fn check_closure(
 
         debug!(?bound_sig, ?liberated_sig);
 
+        let mut fcx = FnCtxt::new(self, self.param_env.without_const(), body.value.hir_id);
         let generator_types = check_fn(
-            self,
-            self.param_env.without_const(),
+            &mut fcx,
             liberated_sig,
             closure.fn_decl,
             expr_def_id,
             body,
             closure.movability,
-        )
-        .1;
+        );
 
         let parent_substs = InternalSubsts::identity_for_item(
             self.tcx,
@@ -797,10 +796,7 @@ fn closure_sigs(
     ) -> ClosureSignatures<'tcx> {
         let liberated_sig =
             self.tcx().liberate_late_bound_regions(expr_def_id.to_def_id(), bound_sig);
-        let liberated_sig = self.normalize(
-            body.value.span,
-            liberated_sig,
-        );
+        let liberated_sig = self.normalize(body.value.span, liberated_sig);
         ClosureSignatures { bound_sig, liberated_sig }
     }
 }