Skip to content

Commit ec53797

Browse files
author
Ariel Ben-Yehuda
committed
---
yaml --- r: 225323 b: refs/heads/stable c: 699fc80 h: refs/heads/master i: 225321: 3157664 225319: 2c718b1 v: v3
1 parent 3e6c916 commit ec53797

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
@@ -29,6 +29,6 @@ refs/heads/tmp: e5d90d98402475b6e154ce216f9efcb80da1a747
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: 1fe32ca12c51afcd761d9962f51a74ff0d07a591
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: c68e65251c86ffdb21aecec56ec45e303d952d79
32+
refs/heads/stable: 699fc80780b50d302a74475ff9240995d8117516
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b

branches/stable/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)