@@ -201,27 +201,17 @@ impl methods for lookup {
201
201
// Check whether this impl has a method with the right name.
202
202
for im. methods. find( { |m| m. ident == self . m_name} ) . each { |m|
203
203
204
- // determine the `self` with fresh variables for
205
- // each parameter:
206
- let { substs : self_substs , ty : self_ty } =
204
+ // determine the `self` of the impl with fresh
205
+ // variables for each parameter:
206
+ let { substs : impl_substs , ty : impl_ty } =
207
207
impl_self_ty( self . fcx, im. did) ;
208
208
209
- // Here "self" refers to the callee side...
210
- let self_ty =
211
- universally_quantify_from_sty(
212
- self . fcx, self . expr. span, [ self_ty] ,
213
- ty:: get( self_ty) . struct ) ;
214
-
215
- // ... and "ty" refers to the caller side.
216
- let ty = self . self_ty;
217
-
218
209
// if we can assign the caller to the callee, that's a
219
210
// potential match. Collect those in the vector.
220
- alt self. fcx. can_mk_subty( ty , self_ty ) {
211
+ alt self. fcx. can_mk_subty( self . self_ty , impl_ty ) {
221
212
result:: err( _) { /* keep looking */ }
222
213
result:: ok( _) {
223
- results += [ ( ty, self_ty, self_substs,
224
- m. n_tps, m. did) ] ;
214
+ results += [ ( impl_ty, impl_substs, m. n_tps, m. did) ] ;
225
215
}
226
216
}
227
217
}
@@ -237,7 +227,7 @@ impl methods for lookup {
237
227
// but I cannot for the life of me figure out how to
238
228
// annotate resolve to preserve this information.
239
229
for results. eachi { |i, result |
240
- let ( _, _, _, _ , did) = result;
230
+ let ( _, _, _, did) = result;
241
231
let span = if did. crate == ast:: local_crate {
242
232
alt check self . tcx( ) . items. get( did. node) {
243
233
ast_map:: node_method( m, _, _) { m. span }
@@ -253,8 +243,8 @@ impl methods for lookup {
253
243
}
254
244
}
255
245
256
- let ( ty , self_ty , self_substs , n_tps, did) = results[ 0 ] ;
257
- alt self. fcx. mk_subty( ty , self_ty ) {
246
+ let ( impl_ty , impl_substs , n_tps, did) = results[ 0 ] ;
247
+ alt self. fcx. mk_subty( self . self_ty , impl_ty ) {
258
248
result:: ok( _) { }
259
249
result:: err( _) {
260
250
self . tcx( ) . sess. span_bug(
@@ -264,7 +254,7 @@ impl methods for lookup {
264
254
}
265
255
let fty = self . ty_from_did( did) ;
266
256
ret some( self . write_mty_from_fty(
267
- self_substs , n_tps, fty,
257
+ impl_substs , n_tps, fty,
268
258
method_static( did) ) ) ;
269
259
}
270
260
}
0 commit comments