Skip to content

Commit 3482d10

Browse files
author
Ariel Ben-Yehuda
committed
---
yaml --- r: 211701 b: refs/heads/auto c: 699fc80 h: refs/heads/master i: 211699: e81c628 v: v3
1 parent 5912cca commit 3482d10

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: c68e65251c86ffdb21aecec56ec45e303d952d79
13+
refs/heads/auto: 699fc80780b50d302a74475ff9240995d8117516
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/librustc/middle/traits/project.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,7 @@ fn confirm_impl_candidate<'cx,'tcx>(
859859
// there don't seem to be nicer accessors to these:
860860
let impl_or_trait_items_map = selcx.tcx().impl_or_trait_items.borrow();
861861

862+
// Look for the associated type in the impl
862863
for impl_item in &selcx.tcx().impl_items.borrow()[&impl_vtable.impl_def_id] {
863864
if let ty::TypeTraitItem(ref assoc_ty) = impl_or_trait_items_map[&impl_item.def_id()] {
864865
if assoc_ty.name == obligation.predicate.item_name {
@@ -868,6 +869,7 @@ fn confirm_impl_candidate<'cx,'tcx>(
868869
}
869870
}
870871

872+
// It is not in the impl - get the default from the trait.
871873
let trait_ref = obligation.predicate.trait_ref;
872874
for trait_item in ty::trait_items(selcx.tcx(), trait_ref.def_id).iter() {
873875
if let &ty::TypeTraitItem(ref assoc_ty) = trait_item {

0 commit comments

Comments
 (0)