about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMichael Sullivan <sully@msully.net>2013-06-19 18:03:02 -0700
committerMichael Sullivan <sully@msully.net>2013-06-25 10:17:33 -0700
commit13e5f0ebdfa7305e8449a585aa8e9837703f1f96 (patch)
tree9ca741b5c286f3eb8d0e8f6aa072d7ed5be63086 /src
parent5e26808141592354a4c9ab28a7e2190e9acf8942 (diff)
downloadrust-13e5f0ebdfa7305e8449a585aa8e9837703f1f96.tar.gz
rust-13e5f0ebdfa7305e8449a585aa8e9837703f1f96.zip
Remove some essentially dead code in method handling.
Diffstat (limited to 'src')
-rw-r--r--src/librustc/middle/trans/base.rs2
-rw-r--r--src/librustc/middle/trans/meth.rs33
-rw-r--r--src/librustc/middle/trans/monomorphize.rs4
3 files changed, 8 insertions, 31 deletions
diff --git a/src/librustc/middle/trans/base.rs b/src/librustc/middle/trans/base.rs
index 0e322c187af..526e4859415 100644
--- a/src/librustc/middle/trans/base.rs
+++ b/src/librustc/middle/trans/base.rs
@@ -2110,7 +2110,7 @@ pub fn trans_item(ccx: @mut CrateContext, item: &ast::item) {
       }
       ast::item_impl(ref generics, _, _, ref ms) => {
         meth::trans_impl(ccx, /*bad*/copy *path, item.ident, *ms,
-                         generics, None, item.id);
+                         generics, item.id);
       }
       ast::item_mod(ref m) => {
         trans_mod(ccx, m);
diff --git a/src/librustc/middle/trans/meth.rs b/src/librustc/middle/trans/meth.rs
index 0b68ae5ee17..92a588700bb 100644
--- a/src/librustc/middle/trans/meth.rs
+++ b/src/librustc/middle/trans/meth.rs
@@ -49,13 +49,12 @@ pub fn trans_impl(ccx: @mut CrateContext,
                   name: ast::ident,
                   methods: &[@ast::method],
                   generics: &ast::Generics,
-                  self_ty: Option<ty::t>,
                   id: ast::node_id) {
     let _icx = push_ctxt("impl::trans_impl");
     let tcx = ccx.tcx;
 
-    debug!("trans_impl(path=%s, name=%s, self_ty=%s, id=%?)",
-           path.repr(tcx), name.repr(tcx), self_ty.repr(tcx), id);
+    debug!("trans_impl(path=%s, name=%s, id=%?)",
+           path.repr(tcx), name.repr(tcx), id);
 
     if !generics.ty_params.is_empty() { return; }
     let sub_path = vec::append_one(path, path_name(name));
@@ -65,24 +64,10 @@ pub fn trans_impl(ccx: @mut CrateContext,
             let path = vec::append_one(/*bad*/copy sub_path,
                                        path_name(method.ident));
 
-            let param_substs_opt;
-            match self_ty {
-                None => param_substs_opt = None,
-                Some(self_ty) => {
-                    param_substs_opt = Some(@param_substs {
-                        tys: ~[],
-                        vtables: None,
-                        type_param_defs: @~[],
-                        self_ty: Some(self_ty)
-                    });
-                }
-            }
-
             trans_method(ccx,
                          path,
                          *method,
-                         param_substs_opt,
-                         self_ty,
+                         None,
                          llfn,
                          ast_util::local_def(id));
         }
@@ -98,9 +83,6 @@ Translates a (possibly monomorphized) method body.
 - `method`: the AST node for the method
 - `param_substs`: if this is a generic method, the current values for
   type parameters and so forth, else none
-- `base_self_ty`: optionally, the explicit self type for this method. This
-  will be none if this is not a default method and must always be present
-  if this is a default method.
 - `llfn`: the LLVM ValueRef for the method
 - `impl_id`: the node ID of the impl this method is inside
 */
@@ -108,7 +90,6 @@ pub fn trans_method(ccx: @mut CrateContext,
                     path: path,
                     method: &ast::method,
                     param_substs: Option<@param_substs>,
-                    base_self_ty: Option<ty::t>,
                     llfn: ValueRef,
                     impl_id: ast::def_id) {
     // figure out how self is being passed
@@ -119,18 +100,14 @@ pub fn trans_method(ccx: @mut CrateContext,
       _ => {
         // determine the (monomorphized) type that `self` maps to for
         // this method
-        let self_ty = match base_self_ty {
-            None => ty::node_id_to_type(ccx.tcx, method.self_id),
-            Some(provided_self_ty) => provided_self_ty,
-        };
+        let self_ty = ty::node_id_to_type(ccx.tcx, method.self_id);
         let self_ty = match param_substs {
             None => self_ty,
             Some(@param_substs {tys: ref tys, _}) => {
                 ty::subst_tps(ccx.tcx, *tys, None, self_ty)
             }
         };
-        debug!("calling trans_fn with base_self_ty %s, self_ty %s",
-               base_self_ty.repr(ccx.tcx),
+        debug!("calling trans_fn with self_ty %s",
                self_ty.repr(ccx.tcx));
         match method.explicit_self.node {
           ast::sty_value => {
diff --git a/src/librustc/middle/trans/monomorphize.rs b/src/librustc/middle/trans/monomorphize.rs
index 4f4bbf84a72..1ffe26e3aff 100644
--- a/src/librustc/middle/trans/monomorphize.rs
+++ b/src/librustc/middle/trans/monomorphize.rs
@@ -233,14 +233,14 @@ pub fn monomorphic_fn(ccx: @mut CrateContext,
             Some(override_impl_did) => impl_did = override_impl_did
         }
 
-        meth::trans_method(ccx, pt, mth, psubsts, None, d, impl_did);
+        meth::trans_method(ccx, pt, mth, psubsts, d, impl_did);
         d
       }
       ast_map::node_trait_method(@ast::provided(mth), _, pt) => {
         let d = mk_lldecl();
         set_inline_hint_if_appr(/*bad*/copy mth.attrs, d);
         debug!("monomorphic_fn impl_did_opt is %?", impl_did_opt);
-        meth::trans_method(ccx, /*bad*/copy *pt, mth, psubsts, None, d,
+        meth::trans_method(ccx, /*bad*/copy *pt, mth, psubsts, d,
                            impl_did_opt.get());
         d
       }