Skip to content

Commit 8e0290d

Browse files
committed
---
yaml --- r: 63249 b: refs/heads/snap-stage3 c: 5835158 h: refs/heads/master i: 63247: e9e9027 v: v3
1 parent cd03a6a commit 8e0290d

File tree

2 files changed

+3
-50
lines changed

2 files changed

+3
-50
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: a159f856d54c507052d24a026ccc8a568aa454f3
4+
refs/heads/snap-stage3: 5835158170cd4cb0abc0518de37d67b3f887ad2e
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/librustc/middle/typeck/check/method.rs

Lines changed: 2 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ impl<'self> LookupContext<'self> {
192192

193193
// Prepare the list of candidates
194194
self.push_inherent_candidates(self_ty);
195-
self.push_extension_candidates(self_ty);
195+
self.push_extension_candidates();
196196

197197
let mut enum_dids = ~[];
198198
let mut self_ty = self_ty;
@@ -326,7 +326,7 @@ impl<'self> LookupContext<'self> {
326326
}
327327
}
328328

329-
pub fn push_extension_candidates(&self, self_ty: ty::t) {
329+
pub fn push_extension_candidates(&self) {
330330
// If the method being called is associated with a trait, then
331331
// find all the impls of that trait. Each of those are
332332
// candidates.
@@ -343,17 +343,8 @@ impl<'self> LookupContext<'self> {
343343
for impl_infos.each |impl_info| {
344344
self.push_candidates_from_impl(
345345
self.extension_candidates, *impl_info);
346-
}
347-
}
348346

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);
355347
}
356-
None => {}
357348
}
358349
}
359350
}
@@ -580,44 +571,6 @@ impl<'self> LookupContext<'self> {
580571
});
581572
}
582573

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-
621574
// ______________________________________________________________________
622575
// Candidate selection (see comment at start of file)
623576

0 commit comments

Comments
 (0)