@@ -49,13 +49,12 @@ pub fn trans_impl(ccx: @mut CrateContext,
4949 name : ast:: ident ,
5050 methods : & [ @ast:: method ] ,
5151 generics : & ast:: Generics ,
52- self_ty : Option < ty:: t > ,
5352 id : ast:: node_id ) {
5453 let _icx = push_ctxt ( "impl::trans_impl" ) ;
5554 let tcx = ccx. tcx ;
5655
57- debug ! ( "trans_impl(path=%s, name=%s, self_ty=%s, id=%?)" ,
58- path. repr( tcx) , name. repr( tcx) , self_ty . repr ( tcx ) , id) ;
56+ debug ! ( "trans_impl(path=%s, name=%s, id=%?)" ,
57+ path. repr( tcx) , name. repr( tcx) , id) ;
5958
6059 if !generics. ty_params . is_empty ( ) { return ; }
6160 let sub_path = vec:: append_one ( path, path_name ( name) ) ;
@@ -65,24 +64,10 @@ pub fn trans_impl(ccx: @mut CrateContext,
6564 let path = vec : : append_one( /*bad*/ copy sub_path,
6665 path_name( method. ident) ) ;
6766
68- let param_substs_opt;
69- match self_ty {
70- None => param_substs_opt = None,
71- Some( self_ty) => {
72- param_substs_opt = Some ( @param_substs {
73- tys : ~[ ] ,
74- vtables : None ,
75- type_param_defs : @~[ ] ,
76- self_ty : Some ( self_ty)
77- } ) ;
78- }
79- }
80-
8167 trans_method( ccx,
8268 path,
8369 * method,
84- param_substs_opt,
85- self_ty,
70+ None ,
8671 llfn,
8772 ast_util:: local_def( id) ) ;
8873 }
@@ -98,17 +83,13 @@ Translates a (possibly monomorphized) method body.
9883- `method`: the AST node for the method
9984- `param_substs`: if this is a generic method, the current values for
10085 type parameters and so forth, else none
101- - `base_self_ty`: optionally, the explicit self type for this method. This
102- will be none if this is not a default method and must always be present
103- if this is a default method.
10486- `llfn`: the LLVM ValueRef for the method
10587- `impl_id`: the node ID of the impl this method is inside
10688*/
10789pub fn trans_method ( ccx : @mut CrateContext ,
10890 path : path ,
10991 method : & ast:: method ,
11092 param_substs : Option < @param_substs > ,
111- base_self_ty: Option < ty:: t > ,
11293 llfn : ValueRef ,
11394 impl_id : ast:: def_id ) {
11495 // figure out how self is being passed
@@ -119,18 +100,14 @@ pub fn trans_method(ccx: @mut CrateContext,
119100 _ => {
120101 // determine the (monomorphized) type that `self` maps to for
121102 // this method
122- let self_ty = match base_self_ty {
123- None => ty:: node_id_to_type( ccx. tcx, method. self_id) ,
124- Some ( provided_self_ty) => provided_self_ty,
125- } ;
103+ let self_ty = ty:: node_id_to_type ( ccx. tcx , method. self_id ) ;
126104 let self_ty = match param_substs {
127105 None => self_ty,
128106 Some ( @param_substs { tys : ref tys, _} ) => {
129107 ty:: subst_tps ( ccx. tcx , * tys, None , self_ty)
130108 }
131109 } ;
132- debug ! ( "calling trans_fn with base_self_ty %s, self_ty %s" ,
133- base_self_ty. repr( ccx. tcx) ,
110+ debug ! ( "calling trans_fn with self_ty %s" ,
134111 self_ty. repr( ccx. tcx) ) ;
135112 match method. explicit_self . node {
136113 ast:: sty_value => {
0 commit comments