Skip to content

Commit 92512d1

Browse files
committed
---
yaml --- r: 96983 b: refs/heads/dist-snap c: 519db34 h: refs/heads/master i: 96981: f57ad4d 96979: 6a6b305 96975: f39da74 v: v3
1 parent 621fd70 commit 92512d1

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
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: b5aa6eb69fce2a1cda2e12b770d5242ea14a3a3d
9+
refs/heads/dist-snap: 519db347229376dd4f7e08df38dd85ae3a43c9ed
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/librustc/middle/trans/base.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -439,16 +439,19 @@ pub fn get_tydesc_simple(ccx: &mut CrateContext, t: ty::t) -> ValueRef {
439439
}
440440

441441
pub fn get_tydesc(ccx: &mut CrateContext, t: ty::t) -> @mut tydesc_info {
442-
match ccx.tydescs.find(&t) {
443-
Some(&inf) => {
444-
return inf;
442+
{
443+
let tydescs = ccx.tydescs.borrow();
444+
match tydescs.get().find(&t) {
445+
Some(&inf) => return inf,
446+
_ => { }
445447
}
446-
_ => { }
447448
}
448449

449450
ccx.stats.n_static_tydescs += 1u;
450451
let inf = glue::declare_tydesc(ccx, t);
451-
ccx.tydescs.insert(t, inf);
452+
453+
let mut tydescs = ccx.tydescs.borrow_mut();
454+
tydescs.get().insert(t, inf);
452455
return inf;
453456
}
454457

branches/dist-snap/src/librustc/middle/trans/context.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pub struct CrateContext {
5252
reachable: @mut HashSet<ast::NodeId>,
5353
item_symbols: RefCell<HashMap<ast::NodeId, ~str>>,
5454
link_meta: LinkMeta,
55-
tydescs: HashMap<ty::t, @mut tydesc_info>,
55+
tydescs: RefCell<HashMap<ty::t, @mut tydesc_info>>,
5656
// Set when running emit_tydescs to enforce that no more tydescs are
5757
// created.
5858
finished_tydescs: bool,
@@ -188,7 +188,7 @@ impl CrateContext {
188188
reachable: reachable,
189189
item_symbols: RefCell::new(HashMap::new()),
190190
link_meta: link_meta,
191-
tydescs: HashMap::new(),
191+
tydescs: RefCell::new(HashMap::new()),
192192
finished_tydescs: false,
193193
external: HashMap::new(),
194194
external_srcs: HashMap::new(),

branches/dist-snap/src/librustc/middle/trans/glue.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -696,8 +696,8 @@ pub fn emit_tydescs(ccx: &mut CrateContext) {
696696
// As of this point, allow no more tydescs to be created.
697697
ccx.finished_tydescs = true;
698698
let glue_fn_ty = Type::generic_glue_fn(ccx).ptr_to();
699-
let tyds = &mut ccx.tydescs;
700-
for (_, &val) in tyds.iter() {
699+
let mut tyds = ccx.tydescs.borrow_mut();
700+
for (_, &val) in tyds.get().iter() {
701701
let ti = val;
702702

703703
// Each of the glue functions needs to be cast to a generic type

0 commit comments

Comments
 (0)