Skip to content

Commit fd4744c

Browse files
committed
---
yaml --- r: 94666 b: refs/heads/try c: bef2353 h: refs/heads/master v: v3
1 parent f0cbeab commit fd4744c

File tree

2 files changed

+9
-5
lines changed

2 files changed

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

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ struct IrMaps {
250250
live_node_map: RefCell<HashMap<NodeId, LiveNode>>,
251251
variable_map: RefCell<HashMap<NodeId, Variable>>,
252252
capture_info_map: RefCell<HashMap<NodeId, @~[CaptureInfo]>>,
253-
var_kinds: ~[VarKind],
253+
var_kinds: RefCell<~[VarKind]>,
254254
lnks: ~[LiveNodeKind],
255255
}
256256

@@ -267,7 +267,7 @@ fn IrMaps(tcx: ty::ctxt,
267267
live_node_map: RefCell::new(HashMap::new()),
268268
variable_map: RefCell::new(HashMap::new()),
269269
capture_info_map: RefCell::new(HashMap::new()),
270-
var_kinds: ~[],
270+
var_kinds: RefCell::new(~[]),
271271
lnks: ~[],
272272
}
273273
}
@@ -297,7 +297,10 @@ impl IrMaps {
297297

298298
pub fn add_variable(&mut self, vk: VarKind) -> Variable {
299299
let v = Variable(self.num_vars.get());
300-
self.var_kinds.push(vk);
300+
{
301+
let mut var_kinds = self.var_kinds.borrow_mut();
302+
var_kinds.get().push(vk);
303+
}
301304
self.num_vars.set(self.num_vars.get() + 1);
302305

303306
match vk {
@@ -325,7 +328,8 @@ impl IrMaps {
325328
}
326329

327330
pub fn variable_name(&mut self, var: Variable) -> @str {
328-
match self.var_kinds[*var] {
331+
let var_kinds = self.var_kinds.borrow();
332+
match var_kinds.get()[*var] {
329333
Local(LocalInfo { ident: nm, .. }) | Arg(_, nm) => {
330334
self.tcx.sess.str_of(nm)
331335
},

0 commit comments

Comments
 (0)