Skip to content

Commit 639c8b6

Browse files
committed
---
yaml --- r: 185747 b: refs/heads/auto c: 7e38213 h: refs/heads/master i: 185745: a1fb3fe 185743: 22cc06c v: v3
1 parent cb8fbb7 commit 639c8b6

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
@@ -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: d523acb495eaacd76d4297362c98c571cae87089
13+
refs/heads/auto: 7e382132a57953e09bbb4e41152107032d69a2cf
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

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