@@ -717,17 +717,18 @@ pub fn new_mark_internal(m:Mrk, tail:SyntaxContext,table:&mut SCTable)
717
717
// flow-sensitivity. Results in two lookups on a hash table hit.
718
718
// also applies to new_rename_internal, below.
719
719
// let try_lookup = table.mark_memo.find(&key);
720
- match table. mark_memo . contains_key ( & key) {
720
+ let mut mark_memo = table. mark_memo . borrow_mut ( ) ;
721
+ match mark_memo. get ( ) . contains_key ( & key) {
721
722
false => {
722
723
let new_idx = {
723
724
let mut table = table. table . borrow_mut ( ) ;
724
725
idx_push ( table. get ( ) , Mark ( m, tail) )
725
726
} ;
726
- table . mark_memo . insert ( key, new_idx) ;
727
+ mark_memo. get ( ) . insert ( key, new_idx) ;
727
728
new_idx
728
729
}
729
730
true => {
730
- match table . mark_memo . find ( & key) {
731
+ match mark_memo. get ( ) . find ( & key) {
731
732
None => fail ! ( "internal error: key disappeared 2013042901" ) ,
732
733
Some ( idxptr) => { * idxptr}
733
734
}
@@ -771,7 +772,7 @@ pub fn new_rename_internal(id:Ident, to:Name, tail:SyntaxContext, table: &mut SC
771
772
pub fn new_sctable_internal ( ) -> SCTable {
772
773
SCTable {
773
774
table : RefCell :: new ( ~[ EmptyCtxt , IllegalCtxt ] ) ,
774
- mark_memo : HashMap :: new ( ) ,
775
+ mark_memo : RefCell :: new ( HashMap :: new ( ) ) ,
775
776
rename_memo : HashMap :: new ( )
776
777
}
777
778
}
0 commit comments