@@ -49,13 +49,12 @@ pub fn trans_impl(ccx: @mut CrateContext,
49
49
name : ast:: ident ,
50
50
methods : & [ @ast:: method ] ,
51
51
generics : & ast:: Generics ,
52
- self_ty : Option < ty:: t > ,
53
52
id : ast:: node_id ) {
54
53
let _icx = push_ctxt ( "impl::trans_impl" ) ;
55
54
let tcx = ccx. tcx ;
56
55
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) ;
59
58
60
59
if !generics. ty_params . is_empty ( ) { return ; }
61
60
let sub_path = vec:: append_one ( path, path_name ( name) ) ;
@@ -65,24 +64,10 @@ pub fn trans_impl(ccx: @mut CrateContext,
65
64
let path = vec : : append_one( /*bad*/ copy sub_path,
66
65
path_name( method. ident) ) ;
67
66
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
-
81
67
trans_method( ccx,
82
68
path,
83
69
* method,
84
- param_substs_opt,
85
- self_ty,
70
+ None ,
86
71
llfn,
87
72
ast_util:: local_def( id) ) ;
88
73
}
@@ -98,17 +83,13 @@ Translates a (possibly monomorphized) method body.
98
83
- `method`: the AST node for the method
99
84
- `param_substs`: if this is a generic method, the current values for
100
85
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.
104
86
- `llfn`: the LLVM ValueRef for the method
105
87
- `impl_id`: the node ID of the impl this method is inside
106
88
*/
107
89
pub fn trans_method ( ccx : @mut CrateContext ,
108
90
path : path ,
109
91
method : & ast:: method ,
110
92
param_substs : Option < @param_substs > ,
111
- base_self_ty: Option < ty:: t > ,
112
93
llfn : ValueRef ,
113
94
impl_id : ast:: def_id ) {
114
95
// figure out how self is being passed
@@ -119,18 +100,14 @@ pub fn trans_method(ccx: @mut CrateContext,
119
100
_ => {
120
101
// determine the (monomorphized) type that `self` maps to for
121
102
// 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 ) ;
126
104
let self_ty = match param_substs {
127
105
None => self_ty,
128
106
Some ( @param_substs { tys : ref tys, _} ) => {
129
107
ty:: subst_tps ( ccx. tcx , * tys, None , self_ty)
130
108
}
131
109
} ;
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" ,
134
111
self_ty. repr( ccx. tcx) ) ;
135
112
match method. explicit_self . node {
136
113
ast:: sty_value => {
0 commit comments