Skip to content

Commit 9240a77

Browse files
committed
---
yaml --- r: 88885 b: refs/heads/snap-stage3 c: ba2e6c1 h: refs/heads/master i: 88883: ac7e598 v: v3
1 parent 2af76b1 commit 9240a77

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: deeca5d586bfaa4aa60246f671a8d611d38f6248
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 2e46ac6449a48948cefeec2fa74032ff528f7871
4+
refs/heads/snap-stage3: ba2e6c1e9516ecf01378e4e54fd857e069535826
55
refs/heads/try: b160761e35efcd1207112b3b782c06633cf441a8
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/librustc/middle/ty.rs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ struct ctxt_ {
308308
tcache: type_cache,
309309
rcache: creader_cache,
310310
short_names_cache: RefCell<HashMap<t, @str>>,
311-
needs_unwind_cleanup_cache: @mut HashMap<t, bool>,
311+
needs_unwind_cleanup_cache: RefCell<HashMap<t, bool>>,
312312
tc_cache: @mut HashMap<uint, TypeContents>,
313313
ast_ty_to_ty_cache: @mut HashMap<NodeId, ast_ty_to_ty_cache_entry>,
314314
enum_var_cache: @mut HashMap<DefId, @~[@VariantInfo]>,
@@ -994,7 +994,7 @@ pub fn mk_ctxt(s: session::Session,
994994
tcache: @mut HashMap::new(),
995995
rcache: mk_rcache(),
996996
short_names_cache: RefCell::new(HashMap::new()),
997-
needs_unwind_cleanup_cache: new_ty_hash(),
997+
needs_unwind_cleanup_cache: RefCell::new(HashMap::new()),
998998
tc_cache: @mut HashMap::new(),
999999
ast_ty_to_ty_cache: @mut HashMap::new(),
10001000
enum_var_cache: @mut HashMap::new(),
@@ -1668,15 +1668,21 @@ pub fn type_needs_drop(cx: ctxt, ty: t) -> bool {
16681668
// that only contain scalars and shared boxes can avoid unwind
16691669
// cleanups.
16701670
pub fn type_needs_unwind_cleanup(cx: ctxt, ty: t) -> bool {
1671-
match cx.needs_unwind_cleanup_cache.find(&ty) {
1672-
Some(&result) => return result,
1673-
None => ()
1671+
{
1672+
let needs_unwind_cleanup_cache = cx.needs_unwind_cleanup_cache
1673+
.borrow();
1674+
match needs_unwind_cleanup_cache.get().find(&ty) {
1675+
Some(&result) => return result,
1676+
None => ()
1677+
}
16741678
}
16751679

16761680
let mut tycache = HashSet::new();
16771681
let needs_unwind_cleanup =
16781682
type_needs_unwind_cleanup_(cx, ty, &mut tycache, false);
1679-
cx.needs_unwind_cleanup_cache.insert(ty, needs_unwind_cleanup);
1683+
let mut needs_unwind_cleanup_cache = cx.needs_unwind_cleanup_cache
1684+
.borrow_mut();
1685+
needs_unwind_cleanup_cache.get().insert(ty, needs_unwind_cleanup);
16801686
return needs_unwind_cleanup;
16811687
}
16821688

0 commit comments

Comments
 (0)