@@ -439,7 +439,7 @@ struct Module {
439
439
//
440
440
// There will be an anonymous module created around `g` with the ID of the
441
441
// entry block for `f`.
442
- anonymous_children : @ mut HashMap < NodeId , @Module > ,
442
+ anonymous_children : RefCell < HashMap < NodeId , @Module > > ,
443
443
444
444
// The status of resolving each import in this module.
445
445
import_resolutions : @mut HashMap < Name , @mut ImportResolution > ,
@@ -471,7 +471,7 @@ impl Module {
471
471
children : @mut HashMap :: new ( ) ,
472
472
imports : @mut ~[ ] ,
473
473
external_module_children : RefCell :: new ( HashMap :: new ( ) ) ,
474
- anonymous_children : @ mut HashMap :: new ( ) ,
474
+ anonymous_children : RefCell :: new ( HashMap :: new ( ) ) ,
475
475
import_resolutions : @mut HashMap :: new ( ) ,
476
476
glob_count : Cell :: new ( 0 ) ,
477
477
resolved_import_count : Cell :: new ( 0 ) ,
@@ -1579,8 +1579,12 @@ impl Resolver {
1579
1579
AnonymousModuleKind ,
1580
1580
false ,
1581
1581
false ) ;
1582
- parent_module. anonymous_children . insert ( block_id, new_module) ;
1583
- ModuleReducedGraphParent ( new_module)
1582
+ {
1583
+ let mut anonymous_children = parent_module. anonymous_children
1584
+ . borrow_mut ( ) ;
1585
+ anonymous_children. get ( ) . insert ( block_id, new_module) ;
1586
+ ModuleReducedGraphParent ( new_module)
1587
+ }
1584
1588
} else {
1585
1589
parent
1586
1590
}
@@ -2031,7 +2035,8 @@ impl Resolver {
2031
2035
}
2032
2036
}
2033
2037
2034
- for ( _, & child_module) in module_. anonymous_children . iter ( ) {
2038
+ let anonymous_children = module_. anonymous_children . borrow ( ) ;
2039
+ for ( _, & child_module) in anonymous_children. get ( ) . iter ( ) {
2035
2040
self . resolve_imports_for_module_subtree ( child_module) ;
2036
2041
}
2037
2042
}
@@ -3201,7 +3206,8 @@ impl Resolver {
3201
3206
}
3202
3207
}
3203
3208
3204
- for ( _, & module_) in module_. anonymous_children . iter ( ) {
3209
+ let anonymous_children = module_. anonymous_children . borrow ( ) ;
3210
+ for ( _, & module_) in anonymous_children. get ( ) . iter ( ) {
3205
3211
self . report_unresolved_imports ( module_) ;
3206
3212
}
3207
3213
}
@@ -3261,7 +3267,8 @@ impl Resolver {
3261
3267
}
3262
3268
}
3263
3269
3264
- for ( _, & child_module) in module_. anonymous_children . iter ( ) {
3270
+ let anonymous_children = module_. anonymous_children . borrow ( ) ;
3271
+ for ( _, & child_module) in anonymous_children. get ( ) . iter ( ) {
3265
3272
self . record_exports_for_module_subtree ( child_module) ;
3266
3273
}
3267
3274
}
@@ -4142,7 +4149,10 @@ impl Resolver {
4142
4149
4143
4150
// Move down in the graph, if there's an anonymous module rooted here.
4144
4151
let orig_module = self . current_module ;
4145
- match self . current_module . anonymous_children . find ( & block. id ) {
4152
+ let anonymous_children = self . current_module
4153
+ . anonymous_children
4154
+ . borrow ( ) ;
4155
+ match anonymous_children. get ( ) . find ( & block. id ) {
4146
4156
None => { /* Nothing to do. */ }
4147
4157
Some ( & anonymous_module) => {
4148
4158
debug ! ( "(resolving block) found anonymous module, moving \
0 commit comments