Skip to content

Commit be32b96

Browse files
committed
---
yaml --- r: 94542 b: refs/heads/try c: 214d6bc h: refs/heads/master v: v3
1 parent ae42598 commit be32b96

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
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: f15f9388dc62e61681e52c455adc46a48257fa6a
5+
refs/heads/try: 214d6bc34aa0d581a504c906b88b9bcb8583a3c0
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

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

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ struct ctxt_ {
290290
methods: RefCell<HashMap<DefId, @Method>>,
291291

292292
// Maps from a trait def-id to a list of the def-ids of its methods
293-
trait_method_def_ids: @mut HashMap<DefId, @~[DefId]>,
293+
trait_method_def_ids: RefCell<HashMap<DefId, @~[DefId]>>,
294294

295295
// A cache for the trait_methods() routine
296296
trait_methods_cache: @mut HashMap<DefId, @~[@Method]>,
@@ -999,7 +999,7 @@ pub fn mk_ctxt(s: session::Session,
999999
ast_ty_to_ty_cache: @mut HashMap::new(),
10001000
enum_var_cache: @mut HashMap::new(),
10011001
methods: RefCell::new(HashMap::new()),
1002-
trait_method_def_ids: @mut HashMap::new(),
1002+
trait_method_def_ids: RefCell::new(HashMap::new()),
10031003
trait_methods_cache: @mut HashMap::new(),
10041004
impl_trait_cache: @mut HashMap::new(),
10051005
ty_param_defs: @mut HashMap::new(),
@@ -3610,9 +3610,13 @@ pub fn method(cx: ctxt, id: ast::DefId) -> @Method {
36103610
}
36113611

36123612
pub fn trait_method_def_ids(cx: ctxt, id: ast::DefId) -> @~[DefId] {
3613-
lookup_locally_or_in_crate_store(
3614-
"trait_method_def_ids", id, cx.trait_method_def_ids,
3615-
|| @csearch::get_trait_method_def_ids(cx.cstore, id))
3613+
let mut trait_method_def_ids = cx.trait_method_def_ids.borrow_mut();
3614+
lookup_locally_or_in_crate_store("trait_method_def_ids",
3615+
id,
3616+
trait_method_def_ids.get(),
3617+
|| {
3618+
@csearch::get_trait_method_def_ids(cx.cstore, id)
3619+
})
36163620
}
36173621

36183622
pub fn impl_trait_ref(cx: ctxt, id: ast::DefId) -> Option<@TraitRef> {

branches/try/src/librustc/middle/typeck/collect.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,9 @@ pub fn ensure_trait_methods(ccx: &CrateCtxt,
226226
});
227227

228228
let trait_def_id = local_def(trait_id);
229-
tcx.trait_method_def_ids.insert(trait_def_id, method_def_ids);
229+
let mut trait_method_def_ids = tcx.trait_method_def_ids
230+
.borrow_mut();
231+
trait_method_def_ids.get().insert(trait_def_id, method_def_ids);
230232
}
231233
_ => { /* Ignore things that aren't traits */ }
232234
}

0 commit comments

Comments
 (0)