Skip to content

Commit 205bfac

Browse files
committed
---
yaml --- r: 96955 b: refs/heads/dist-snap c: 02f13ad h: refs/heads/master i: 96953: ade3878 96951: 963b8f4 v: v3
1 parent 31acaf2 commit 205bfac

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
@@ -6,7 +6,7 @@ refs/heads/try: c274a6888410ce3e357e014568b43310ed787d36
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 214d6bc34aa0d581a504c906b88b9bcb8583a3c0
9+
refs/heads/dist-snap: 02f13adaa34fea513ea6d3b48e8f47eff93e47a7
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/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/dist-snap/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)