@@ -174,7 +174,11 @@ struct lookup {
174
174
( optional_inherent_methods, subtyping_mode) ;
175
175
176
176
// if we found anything, stop before trying borrows
177
- if self . candidates . len ( ) > 0 u { break ; }
177
+ if self . candidates . len ( ) > 0 u {
178
+ debug ! { "(checking method) found at least one inherent \
179
+ method; giving up looking now"} ;
180
+ break ;
181
+ }
178
182
179
183
// Again, look for inherent and extension methods, this time using
180
184
// assignability.
@@ -198,7 +202,11 @@ struct lookup {
198
202
( optional_inherent_methods, mutable_reference_mode) ;
199
203
200
204
// if we found anything, stop before attempting auto-deref.
201
- if self . candidates . len ( ) > 0 u { break ; }
205
+ if self . candidates . len ( ) > 0 u {
206
+ debug ! { "(checking method) found at least one inherent \
207
+ method; giving up looking now"} ;
208
+ break ;
209
+ }
202
210
203
211
// check whether we can autoderef and if so loop around again.
204
212
match ty:: deref ( self . tcx ( ) , self . self_ty , false ) {
@@ -210,7 +218,11 @@ struct lookup {
210
218
}
211
219
}
212
220
213
- if self. candidates. len( ) == 0 u { return none; }
221
+ if self. candidates. len( ) == 0 u {
222
+ debug!{ "( checking method) couldn' t find any candidate methods; \
223
+ returning none"} ;
224
+ return none;
225
+ }
214
226
215
227
if self . candidates. len( ) > 1 u {
216
228
self. tcx( ) . sess. span_err(
@@ -270,7 +282,7 @@ struct lookup {
270
282
}
271
283
272
284
fn add_candidates_from_param ( n : uint , did : ast:: def_id ) {
273
- debug ! { "candidates_from_param " } ;
285
+ debug ! { "add_candidates_from_param " } ;
274
286
275
287
let tcx = self . tcx ( ) ;
276
288
let mut trait_bnd_idx = 0 u; // count only trait bounds
@@ -320,7 +332,7 @@ struct lookup {
320
332
321
333
fn add_candidates_from_trait ( did : ast:: def_id , trait_substs : ty:: substs ) {
322
334
323
- debug ! { "method_from_trait " } ;
335
+ debug ! { "add_candidates_from_trait " } ;
324
336
325
337
let ms = * ty:: trait_methods ( self . tcx ( ) , did) ;
326
338
for ms. eachi |i, m| {
@@ -355,7 +367,7 @@ struct lookup {
355
367
356
368
fn add_candidates_from_class ( did : ast:: def_id , class_substs : ty:: substs ) {
357
369
358
- debug ! { "method_from_class " } ;
370
+ debug ! { "add_candidates_from_class " } ;
359
371
360
372
let ms = * ty:: trait_methods ( self . tcx ( ) , did) ;
361
373
0 commit comments