@@ -147,46 +147,13 @@ pub fn trans_method_callee(bcx: @mut Block,
147
147
mentry: typeck:: method_map_entry)
148
148
-> Callee {
149
149
let _icx = push_ctxt( "impl::trans_method_callee" ) ;
150
- let tcx = bcx. tcx( ) ;
151
150
152
151
debug ! ( "trans_method_callee(callee_id=%?, this=%s, mentry=%s)" ,
153
152
callee_id,
154
153
bcx. expr_to_str( this) ,
155
154
mentry. repr( bcx. tcx( ) ) ) ;
156
155
157
- // Replace method_self with method_static here.
158
- let mut origin = mentry. origin;
159
- match origin {
160
- typeck : : method_super( trait_id, method_index) => {
161
- // <self_ty> is the self type for this method call
162
- let self_ty = node_id_type( bcx, this. id) ;
163
- // <impl_id> is the ID of the implementation of
164
- // trait <trait_id> for type <self_ty>
165
- let impl_id = ty:: bogus_get_impl_id_from_ty( tcx, trait_id, self_ty) ;
166
- // Get the supertrait's methods
167
- let supertrait_method_def_ids = ty:: trait_method_def_ids( tcx, trait_id) ;
168
- // Make sure to fail with a readable error message if
169
- // there's some internal error here
170
- if !( method_index < supertrait_method_def_ids. len( ) ) {
171
- tcx. sess. bug( "trans_method_callee: supertrait method \
172
- index is out of bounds") ;
173
- }
174
- // Get the method name using the method index in the origin
175
- let method_name =
176
- ty:: method( tcx, supertrait_method_def_ids[ method_index] ) . ident;
177
- // Now that we know the impl ID, we can look up the method
178
- // ID from its name
179
- origin = typeck:: method_static(
180
- method_with_name( bcx. ccx( ) , impl_id, method_name) ) ;
181
- }
182
- typeck:: method_self( * ) |
183
- typeck:: method_static( * ) | typeck:: method_param( * ) |
184
- typeck:: method_trait( * ) => { }
185
- }
186
-
187
- debug!( "origin=%?", origin) ;
188
-
189
- match origin {
156
+ match mentry. origin {
190
157
typeck : : method_static( did) => {
191
158
let callee_fn = callee:: trans_fn_ref( bcx, did, callee_id) ;
192
159
let mut temp_cleanups = ~[ ] ;
@@ -210,7 +177,8 @@ pub fn trans_method_callee(bcx: @mut Block,
210
177
} ) => {
211
178
match bcx. fcx. param_substs {
212
179
Some ( substs) => {
213
- let vtbl = find_vtable( bcx. tcx( ) , substs, p, b) ;
180
+ let vtbl = find_vtable( bcx. tcx( ) , substs,
181
+ p, b) ;
214
182
trans_monomorphized_callee( bcx, callee_id, this, mentry,
215
183
trait_id, off, vtbl)
216
184
}
@@ -219,25 +187,6 @@ pub fn trans_method_callee(bcx: @mut Block,
219
187
}
220
188
}
221
189
222
- typeck:: method_self( trait_id, method_index) => {
223
- match bcx. fcx. param_substs {
224
- Some ( @param_substs
225
- { self_vtables : Some ( vtbls) , _} ) => {
226
- let vtbl = vtbls[ 0 ] . clone( ) ;
227
- trans_monomorphized_callee( bcx,
228
- callee_id,
229
- this,
230
- mentry,
231
- trait_id,
232
- method_index,
233
- vtbl)
234
- }
235
- _ => {
236
- fail!( "trans_method_callee: missing self_vtable")
237
- }
238
- }
239
- }
240
-
241
190
typeck:: method_trait( _, off, store) => {
242
191
trans_trait_callee( bcx,
243
192
callee_id,
@@ -246,9 +195,6 @@ pub fn trans_method_callee(bcx: @mut Block,
246
195
store,
247
196
mentry. explicit_self)
248
197
}
249
- typeck:: method_super( * ) => {
250
- fail!( "method_super should have been handled above")
251
- }
252
198
}
253
199
}
254
200
@@ -403,9 +349,6 @@ pub fn trans_monomorphized_callee(bcx: @mut Block,
403
349
typeck:: vtable_param( * ) => {
404
350
fail ! ( "vtable_param left in monomorphized function's vtable substs" ) ;
405
351
}
406
- typeck:: vtable_self( * ) => {
407
- fail ! ( "vtable_self left in monomorphized function's vtable substs" ) ;
408
- }
409
352
} ;
410
353
411
354
}
0 commit comments