@@ -178,7 +178,7 @@ pub struct CrateDebugContext {
178
178
priv current_debug_location : DebugLocation ,
179
179
priv created_files : RefCell < HashMap < ~str , DIFile > > ,
180
180
priv created_types : RefCell < HashMap < uint , DIType > > ,
181
- priv namespace_map : HashMap < ~[ ast:: Ident ] , @NamespaceTreeNode > ,
181
+ priv namespace_map : RefCell < HashMap < ~[ ast:: Ident ] , @NamespaceTreeNode > > ,
182
182
// This collection is used to assert that composite types (structs, enums, ...) have their
183
183
// members only set once:
184
184
priv composite_types_completed : HashSet < DIType > ,
@@ -197,7 +197,7 @@ impl CrateDebugContext {
197
197
current_debug_location : UnknownLocation ,
198
198
created_files : RefCell :: new ( HashMap :: new ( ) ) ,
199
199
created_types : RefCell :: new ( HashMap :: new ( ) ) ,
200
- namespace_map : HashMap :: new ( ) ,
200
+ namespace_map : RefCell :: new ( HashMap :: new ( ) ) ,
201
201
composite_types_completed : HashSet :: new ( ) ,
202
202
} ;
203
203
}
@@ -2819,7 +2819,10 @@ fn namespace_for_item(cx: &mut CrateContext,
2819
2819
let ident = path_element. ident ( ) ;
2820
2820
current_key. push ( ident) ;
2821
2821
2822
- let existing_node = debug_context ( cx) . namespace_map . find_copy ( & current_key) ;
2822
+ let existing_node = {
2823
+ let namespace_map = debug_context ( cx) . namespace_map . borrow ( ) ;
2824
+ namespace_map. get ( ) . find_copy ( & current_key)
2825
+ } ;
2823
2826
let current_node = match existing_node {
2824
2827
Some ( existing_node) => existing_node,
2825
2828
None => {
@@ -2847,7 +2850,11 @@ fn namespace_for_item(cx: &mut CrateContext,
2847
2850
parent : parent_node,
2848
2851
} ;
2849
2852
2850
- debug_context ( cx) . namespace_map . insert ( current_key. clone ( ) , node) ;
2853
+ {
2854
+ let mut namespace_map = debug_context ( cx) . namespace_map
2855
+ . borrow_mut ( ) ;
2856
+ namespace_map. get ( ) . insert ( current_key. clone ( ) , node) ;
2857
+ }
2851
2858
2852
2859
node
2853
2860
}
0 commit comments