]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/traits/util.rs
Auto merge of #35856 - phimuemue:master, r=brson
[rust.git] / src / librustc / traits / util.rs
index 1954ce1993c5e0d71eeb5e604ed6606c68c9f204..2cefc2ad79646730cc9b9e07e3cc7be784fc6680 100644 (file)
@@ -23,9 +23,6 @@ fn anonymize_predicate<'a, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'tcx>,
         ty::Predicate::Trait(ref data) =>
             ty::Predicate::Trait(tcx.anonymize_late_bound_regions(data)),
 
-        ty::Predicate::Rfc1592(ref data) =>
-            ty::Predicate::Rfc1592(Box::new(anonymize_predicate(tcx, data))),
-
         ty::Predicate::Equate(ref data) =>
             ty::Predicate::Equate(tcx.anonymize_late_bound_regions(data)),
 
@@ -150,9 +147,6 @@ fn push(&mut self, predicate: &ty::Predicate<'tcx>) {
 
                 self.stack.extend(predicates);
             }
-            ty::Predicate::Rfc1592(..) => {
-                // Nothing to elaborate.
-            }
             ty::Predicate::WellFormed(..) => {
                 // Currently, we do not elaborate WF predicates,
                 // although we easily could.
@@ -386,7 +380,7 @@ pub fn trait_ref_for_builtin_bound(self,
             Ok(def_id) => {
                 Ok(ty::TraitRef {
                     def_id: def_id,
-                    substs: Substs::new_trait(self, vec![], vec![], param_ty)
+                    substs: Substs::new_trait(self, param_ty, &[])
                 })
             }
             Err(e) => {
@@ -401,12 +395,12 @@ pub fn predicate_for_trait_def(self,
         trait_def_id: DefId,
         recursion_depth: usize,
         param_ty: Ty<'tcx>,
-        ty_params: Vec<Ty<'tcx>>)
+        ty_params: &[Ty<'tcx>])
         -> PredicateObligation<'tcx>
     {
         let trait_ref = ty::TraitRef {
             def_id: trait_def_id,
-            substs: Substs::new_trait(self, ty_params, vec![], param_ty)
+            substs: Substs::new_trait(self, param_ty, ty_params)
         };
         predicate_for_trait_ref(cause, trait_ref, recursion_depth)
     }
@@ -496,7 +490,7 @@ pub fn closure_trait_ref_and_return_type(self,
         };
         let trait_ref = ty::TraitRef {
             def_id: fn_trait_def_id,
-            substs: Substs::new_trait(self, vec![arguments_tuple], vec![], self_ty),
+            substs: Substs::new_trait(self, self_ty, &[arguments_tuple]),
         };
         ty::Binder((trait_ref, sig.0.output))
     }