@@ -192,7 +192,7 @@ impl<'self> LookupContext<'self> {
192
192
193
193
// Prepare the list of candidates
194
194
self.push_inherent_candidates(self_ty);
195
- self.push_extension_candidates(self_ty );
195
+ self.push_extension_candidates();
196
196
197
197
let mut enum_dids = ~[];
198
198
let mut self_ty = self_ty;
@@ -326,7 +326,7 @@ impl<'self> LookupContext<'self> {
326
326
}
327
327
}
328
328
329
- pub fn push_extension_candidates(&self, self_ty: ty::t ) {
329
+ pub fn push_extension_candidates(&self) {
330
330
// If the method being called is associated with a trait, then
331
331
// find all the impls of that trait. Each of those are
332
332
// candidates.
@@ -343,17 +343,8 @@ impl<'self> LookupContext<'self> {
343
343
for impl_infos.each |impl_info| {
344
344
self.push_candidates_from_impl(
345
345
self.extension_candidates, *impl_info);
346
- }
347
- }
348
346
349
- // Look for default methods.
350
- match self.tcx().provided_methods.find(trait_did) {
351
- Some(&methods) => {
352
- self.push_candidates_from_provided_methods(
353
- self.extension_candidates, self_ty, *trait_did,
354
- methods);
355
347
}
356
- None => {}
357
348
}
358
349
}
359
350
}
@@ -580,44 +571,6 @@ impl<'self> LookupContext<'self> {
580
571
});
581
572
}
582
573
583
- pub fn push_candidates_from_provided_methods(&self,
584
- candidates:
585
- &mut ~[Candidate],
586
- self_ty: ty::t,
587
- trait_def_id: def_id,
588
- methods:
589
- &mut ~[@ProvidedMethodInfo])
590
- {
591
- debug!("(pushing candidates from provided methods) considering trait \
592
- id %d:%d",
593
- trait_def_id.crate,
594
- trait_def_id.node);
595
-
596
- for methods.each |provided_method_info| {
597
- if provided_method_info.method_info.ident != self.m_name { loop; }
598
-
599
- debug!("(pushing candidates from provided methods) adding \
600
- candidate");
601
-
602
- let method = ty::method(self.tcx(),
603
- provided_method_info.method_info.did);
604
-
605
- // FIXME #4099 (?) Needs to support generics.
606
- let dummy_substs = substs {
607
- self_r: None,
608
- self_ty: None,
609
- tps: ~[]
610
- };
611
-
612
- candidates.push(Candidate {
613
- rcvr_ty: self_ty,
614
- rcvr_substs: dummy_substs,
615
- method_ty: method,
616
- origin: method_static(provided_method_info.method_info.did)
617
- });
618
- }
619
- }
620
-
621
574
// ______________________________________________________________________
622
575
// Candidate selection (see comment at start of file)
623
576
0 commit comments