]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/middle/ty/mod.rs
Implement default method inheritance.
[rust.git] / src / librustc / middle / ty / mod.rs
index c336fd558bd563fa119caccc5dbdd3fd2ee36b9f..7fa20f2135ae1d56f790f62b1fe6c7b29f9f513c 100644 (file)
@@ -2719,28 +2719,4 @@ pub fn with_freevars<T, F>(&self, fid: NodeId, f: F) -> T where
             Some(d) => f(&d[..])
         }
     }
-
-    pub fn make_substs_for_receiver_types(&self,
-                                          trait_ref: &ty::TraitRef<'tcx>,
-                                          method: &ty::Method<'tcx>)
-                                          -> subst::Substs<'tcx>
-    {
-        /*!
-         * Substitutes the values for the receiver's type parameters
-         * that are found in method, leaving the method's type parameters
-         * intact.
-         */
-
-        let meth_tps: Vec<Ty> =
-            method.generics.types.get_slice(subst::FnSpace)
-                  .iter()
-                  .map(|def| self.mk_param_from_def(def))
-                  .collect();
-        let meth_regions: Vec<ty::Region> =
-            method.generics.regions.get_slice(subst::FnSpace)
-                  .iter()
-                  .map(|def| def.to_early_bound_region())
-                  .collect();
-        trait_ref.substs.clone().with_method(meth_tps, meth_regions)
-    }
 }