Skip to content

Commit 748a967

Browse files
committed
---
yaml --- r: 94543 b: refs/heads/try c: 02f13ad h: refs/heads/master i: 94541: ae42598 94539: 1d01124 94535: 73b2825 94527: 359573f v: v3
1 parent be32b96 commit 748a967

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
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: 0da105a8b7b6b1e0568e8ff20f6ff4b13cc7ecc2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d3e57dca68fde4effdda3e4ae2887aa535fcd6
5-
refs/heads/try: 214d6bc34aa0d581a504c906b88b9bcb8583a3c0
5+
refs/heads/try: 02f13adaa34fea513ea6d3b48e8f47eff93e47a7
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/librustc/metadata/encoder.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,8 @@ fn encode_reexported_static_trait_methods(ecx: &EncodeContext,
463463
ebml_w: &mut writer::Encoder,
464464
exp: &middle::resolve::Export2)
465465
-> bool {
466-
match ecx.tcx.trait_methods_cache.find(&exp.def_id) {
466+
let trait_methods_cache = ecx.tcx.trait_methods_cache.borrow();
467+
match trait_methods_cache.get().find(&exp.def_id) {
467468
Some(methods) => {
468469
for &m in methods.iter() {
469470
if m.explicit_self == ast::sty_static {

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ struct ctxt_ {
293293
trait_method_def_ids: RefCell<HashMap<DefId, @~[DefId]>>,
294294

295295
// A cache for the trait_methods() routine
296-
trait_methods_cache: @mut HashMap<DefId, @~[@Method]>,
296+
trait_methods_cache: RefCell<HashMap<DefId, @~[@Method]>>,
297297

298298
impl_trait_cache: @mut HashMap<ast::DefId, Option<@ty::TraitRef>>,
299299

@@ -1000,7 +1000,7 @@ pub fn mk_ctxt(s: session::Session,
10001000
enum_var_cache: @mut HashMap::new(),
10011001
methods: RefCell::new(HashMap::new()),
10021002
trait_method_def_ids: RefCell::new(HashMap::new()),
1003-
trait_methods_cache: @mut HashMap::new(),
1003+
trait_methods_cache: RefCell::new(HashMap::new()),
10041004
impl_trait_cache: @mut HashMap::new(),
10051005
ty_param_defs: @mut HashMap::new(),
10061006
adjustments: @mut HashMap::new(),
@@ -3591,12 +3591,13 @@ pub fn trait_method(cx: ctxt, trait_did: ast::DefId, idx: uint) -> @Method {
35913591

35923592

35933593
pub fn trait_methods(cx: ctxt, trait_did: ast::DefId) -> @~[@Method] {
3594-
match cx.trait_methods_cache.find(&trait_did) {
3594+
let mut trait_methods_cache = cx.trait_methods_cache.borrow_mut();
3595+
match trait_methods_cache.get().find(&trait_did) {
35953596
Some(&methods) => methods,
35963597
None => {
35973598
let def_ids = ty::trait_method_def_ids(cx, trait_did);
35983599
let methods = @def_ids.map(|d| ty::method(cx, *d));
3599-
cx.trait_methods_cache.insert(trait_did, methods);
3600+
trait_methods_cache.get().insert(trait_did, methods);
36003601
methods
36013602
}
36023603
}

0 commit comments

Comments
 (0)