]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_typeck/check/regionck.rs
Auto merge of #42396 - venkatagiri:remove_lifetime_extn, r=arielb1
[rust.git] / src / librustc_typeck / check / regionck.rs
index 33fbc006e4e1fa417992fbc1909f37bee2b9b4f8..b66e311f04c6bbac5265f3f0b9b63edb2db2c9d2 100644 (file)
@@ -386,7 +386,8 @@ fn relate_free_regions(&mut self,
         for &ty in fn_sig_tys {
             let ty = self.resolve_type(ty);
             debug!("relate_free_regions(t={:?})", ty);
-            let implied_bounds = ty::wf::implied_bounds(self, body_id, ty, span);
+            let implied_bounds =
+                ty::wf::implied_bounds(self, self.fcx.param_env, body_id, ty, span);
 
             // Record any relations between free regions that we observe into the free-region-map.
             self.free_region_map.relate_free_regions_from_implied_bounds(&implied_bounds);
@@ -911,7 +912,7 @@ fn check_safety_of_rvalue_destructor_if_necessary(&mut self,
                                                      cmt: mc::cmt<'tcx>,
                                                      span: Span) {
         match cmt.cat {
-            Categorization::Rvalue(region, _) => {
+            Categorization::Rvalue(region) => {
                 match *region {
                     ty::ReScope(rvalue_scope) => {
                         let typ = self.resolve_type(cmt.ty);
@@ -1029,7 +1030,7 @@ fn link_fn_args(&self, body_scope: CodeExtent, args: &[hir::Arg]) {
             let arg_ty = self.node_ty(arg.id);
             let re_scope = self.tcx.mk_region(ty::ReScope(body_scope));
             let arg_cmt = mc.cat_rvalue(
-                arg.id, arg.pat.span, re_scope, re_scope, arg_ty);
+                arg.id, arg.pat.span, re_scope, arg_ty);
             debug!("arg_ty={:?} arg_cmt={:?} arg={:?}",
                    arg_ty,
                    arg_cmt,
@@ -1545,8 +1546,8 @@ fn projection_bound(&self,
                declared_bounds, projection_ty);
 
         // see the extensive comment in projection_must_outlive
-
-        let ty = self.tcx.mk_projection(projection_ty.trait_ref, projection_ty.item_name);
+        let item_name = projection_ty.item_name(self.tcx);
+        let ty = self.tcx.mk_projection(projection_ty.trait_ref, item_name);
         let recursive_bound = self.recursive_type_bound(span, ty);
 
         VerifyBound::AnyRegion(declared_bounds).or(recursive_bound)
@@ -1612,9 +1613,9 @@ fn declared_projection_bounds_from_trait(&self,
     {
         debug!("projection_bounds(projection_ty={:?})",
                projection_ty);
-
+        let item_name = projection_ty.item_name(self.tcx);
         let ty = self.tcx.mk_projection(projection_ty.trait_ref.clone(),
-                                        projection_ty.item_name);
+                                        item_name);
 
         // Say we have a projection `<T as SomeTrait<'a>>::SomeType`. We are interested
         // in looking for a trait definition like:
@@ -1652,7 +1653,7 @@ fn declared_projection_bounds_from_trait(&self,
                     let (outlives, _) =
                         self.replace_late_bound_regions_with_fresh_var(
                             span,
-                            infer::AssocTypeProjection(projection_ty.item_name),
+                            infer::AssocTypeProjection(projection_ty.item_name(self.tcx)),
                             &outlives);
 
                     debug!("projection_bounds: outlives={:?} (3)",
@@ -1660,7 +1661,7 @@ fn declared_projection_bounds_from_trait(&self,
 
                     // check whether this predicate applies to our current projection
                     let cause = self.fcx.misc(span);
-                    match self.eq_types(false, &cause, ty, outlives.0) {
+                    match self.at(&cause, self.fcx.param_env).eq(outlives.0, ty) {
                         Ok(ok) => {
                             self.register_infer_ok_obligations(ok);
                             Ok(outlives.1)