Skip to content

Commit 3ccf29f

Browse files
committed
---
yaml --- r: 187213 b: refs/heads/try c: 7e38213 h: refs/heads/master i: 187211: 149f76f v: v3
1 parent 9dcfa1d commit 3ccf29f

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: b4c965ee803a4521d8b4575f634e036f93e408f3
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 3a96d6a9818fe2affc98a187fb1065120458cee9
5-
refs/heads/try: d523acb495eaacd76d4297362c98c571cae87089
5+
refs/heads/try: 7e382132a57953e09bbb4e41152107032d69a2cf
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/librustc/middle/traits/select.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1149,7 +1149,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
11491149
});
11501150
}
11511151

1152-
if self.tcx().default_trait_impls.borrow().contains(&def_id) {
1152+
if ty::trait_has_default_impl(self.tcx(), def_id) {
11531153
candidates.vec.push(DefaultTraitCandidate(def_id.clone()))
11541154
}
11551155

branches/try/src/librustc/middle/ty.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,7 @@ pub struct ctxt<'tcx> {
758758
pub trait_impls: RefCell<DefIdMap<Rc<RefCell<Vec<ast::DefId>>>>>,
759759

760760
/// Maps a trait onto a list of *default* trait implementations
761-
pub default_trait_impls: RefCell<DefIdSet>,
761+
default_trait_impls: RefCell<DefIdSet>,
762762

763763
/// Maps a DefId of a type to a list of its inherent impls.
764764
/// Contains implementations of methods that are inherent to a type.
@@ -5999,6 +5999,10 @@ pub fn item_variances(tcx: &ctxt, item_id: ast::DefId) -> Rc<ItemVariances> {
59995999
|| Rc::new(csearch::get_item_variances(&tcx.sess.cstore, item_id)))
60006000
}
60016001

6002+
pub fn trait_has_default_impl(tcx: &ctxt, trait_def_id: DefId) -> bool {
6003+
tcx.default_trait_impls.borrow().contains(&trait_def_id)
6004+
}
6005+
60026006
/// Records a trait-to-implementation mapping.
60036007
pub fn record_default_trait_implementation(tcx: &ctxt, trait_def_id: DefId) {
60046008

0 commit comments

Comments
 (0)