@@ -24,7 +24,7 @@ use middle::graph::{Direction, NodeIndex};
24
24
use util:: common:: indenter;
25
25
use util:: ppaux:: { Repr } ;
26
26
27
- use std:: cell:: RefCell ;
27
+ use std:: cell:: { Cell , RefCell } ;
28
28
use std:: hashmap:: { HashMap , HashSet } ;
29
29
use std:: uint;
30
30
use std:: vec;
@@ -92,7 +92,7 @@ pub struct RegionVarBindings {
92
92
constraints : RefCell < HashMap < Constraint , SubregionOrigin > > ,
93
93
lubs : CombineMap ,
94
94
glbs : CombineMap ,
95
- skolemization_count : uint ,
95
+ skolemization_count : Cell < uint > ,
96
96
bound_count : uint ,
97
97
98
98
// The undo log records actions that might later be undone.
@@ -118,7 +118,7 @@ pub fn RegionVarBindings(tcx: ty::ctxt) -> RegionVarBindings {
118
118
constraints : RefCell :: new ( HashMap :: new ( ) ) ,
119
119
lubs : HashMap :: new ( ) ,
120
120
glbs : HashMap :: new ( ) ,
121
- skolemization_count : 0 ,
121
+ skolemization_count : Cell :: new ( 0 ) ,
122
122
bound_count : 0 ,
123
123
undo_log : ~[ ]
124
124
}
@@ -188,8 +188,8 @@ impl RegionVarBindings {
188
188
}
189
189
190
190
pub fn new_skolemized ( & mut self , br : ty:: BoundRegion ) -> Region {
191
- let sc = self . skolemization_count ;
192
- self . skolemization_count += 1 ;
191
+ let sc = self . skolemization_count . get ( ) ;
192
+ self . skolemization_count . set ( sc + 1 ) ;
193
193
ReInfer ( ReSkolemized ( sc, br) )
194
194
}
195
195
0 commit comments