@@ -249,7 +249,7 @@ struct IrMaps {
249
249
num_vars : Cell < uint > ,
250
250
live_node_map : RefCell < HashMap < NodeId , LiveNode > > ,
251
251
variable_map : RefCell < HashMap < NodeId , Variable > > ,
252
- capture_info_map : HashMap < NodeId , @~[ CaptureInfo ] > ,
252
+ capture_info_map : RefCell < HashMap < NodeId , @~[ CaptureInfo ] > > ,
253
253
var_kinds : ~[ VarKind ] ,
254
254
lnks : ~[ LiveNodeKind ] ,
255
255
}
@@ -266,7 +266,7 @@ fn IrMaps(tcx: ty::ctxt,
266
266
num_vars : Cell :: new ( 0 ) ,
267
267
live_node_map : RefCell :: new ( HashMap :: new ( ) ) ,
268
268
variable_map : RefCell :: new ( HashMap :: new ( ) ) ,
269
- capture_info_map : HashMap :: new ( ) ,
269
+ capture_info_map : RefCell :: new ( HashMap :: new ( ) ) ,
270
270
var_kinds : ~[ ] ,
271
271
lnks : ~[ ] ,
272
272
}
@@ -334,11 +334,13 @@ impl IrMaps {
334
334
}
335
335
336
336
pub fn set_captures(&mut self, node_id: NodeId, cs: ~[CaptureInfo]) {
337
- self.capture_info_map.insert(node_id, @cs);
337
+ let mut capture_info_map = self.capture_info_map.borrow_mut();
338
+ capture_info_map.get().insert(node_id, @cs);
338
339
}
339
340
340
341
pub fn captures(&mut self, expr: &Expr) -> @~[CaptureInfo] {
341
- match self.capture_info_map.find(&expr.id) {
342
+ let capture_info_map = self.capture_info_map.borrow();
343
+ match capture_info_map.get().find(&expr.id) {
342
344
Some(&caps) => caps,
343
345
None => {
344
346
self.tcx.sess.span_bug(expr.span, " no registered caps") ;
0 commit comments