Skip to content

Commit 0a0ce8d

Browse files
committed
librustc: De-@mut RegionVarBindings::skolemization_count
1 parent 9f4cfe2 commit 0a0ce8d

File tree

1 file changed

+5
-5
lines changed
  • src/librustc/middle/typeck/infer/region_inference

1 file changed

+5
-5
lines changed

src/librustc/middle/typeck/infer/region_inference/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use middle::graph::{Direction, NodeIndex};
2424
use util::common::indenter;
2525
use util::ppaux::{Repr};
2626

27-
use std::cell::RefCell;
27+
use std::cell::{Cell, RefCell};
2828
use std::hashmap::{HashMap, HashSet};
2929
use std::uint;
3030
use std::vec;
@@ -92,7 +92,7 @@ pub struct RegionVarBindings {
9292
constraints: RefCell<HashMap<Constraint, SubregionOrigin>>,
9393
lubs: CombineMap,
9494
glbs: CombineMap,
95-
skolemization_count: uint,
95+
skolemization_count: Cell<uint>,
9696
bound_count: uint,
9797

9898
// The undo log records actions that might later be undone.
@@ -118,7 +118,7 @@ pub fn RegionVarBindings(tcx: ty::ctxt) -> RegionVarBindings {
118118
constraints: RefCell::new(HashMap::new()),
119119
lubs: HashMap::new(),
120120
glbs: HashMap::new(),
121-
skolemization_count: 0,
121+
skolemization_count: Cell::new(0),
122122
bound_count: 0,
123123
undo_log: ~[]
124124
}
@@ -188,8 +188,8 @@ impl RegionVarBindings {
188188
}
189189

190190
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);
193193
ReInfer(ReSkolemized(sc, br))
194194
}
195195

0 commit comments

Comments
 (0)