]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_typeck/check/closure.rs
Various minor/cosmetic improvements to code
[rust.git] / src / librustc_typeck / check / closure.rs
index fb7c237a536bdd70cb1be8fae07dd5a82f67d452..be15503e47906e7e68ba5452b51010627f453628 100644 (file)
@@ -64,7 +64,7 @@ pub fn check_expr_closure(
             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)
     }
 
@@ -82,7 +82,7 @@ fn check_closure(
             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,
@@ -266,7 +266,7 @@ fn deduce_expectations_from_obligations(
                     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,
@@ -460,7 +460,7 @@ fn sig_of_closure_with_expectation(
         // 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(),
@@ -496,7 +496,7 @@ fn sig_of_closure_with_mismatched_number_of_arguments(
         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()
@@ -564,7 +564,7 @@ fn check_supplied_sig_against_expectation(
             // `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),
@@ -605,7 +605,7 @@ fn check_supplied_sig_against_expectation(
                 );
             }
 
-            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(),