@@ -130,7 +130,7 @@ impl RegionVarBindings {
130
130
undo_log. get ( ) . len ( ) > 0
131
131
}
132
132
133
- pub fn start_snapshot ( & mut self ) -> uint {
133
+ pub fn start_snapshot ( & self ) -> uint {
134
134
debug ! ( "RegionVarBindings: start_snapshot()" ) ;
135
135
if self . in_snapshot ( ) {
136
136
{
@@ -146,15 +146,15 @@ impl RegionVarBindings {
146
146
}
147
147
}
148
148
149
- pub fn commit ( & mut self ) {
149
+ pub fn commit ( & self ) {
150
150
debug ! ( "RegionVarBindings: commit()" ) ;
151
151
let mut undo_log = self . undo_log . borrow_mut ( ) ;
152
152
while undo_log. get ( ) . len ( ) > 0 {
153
153
undo_log. get ( ) . pop ( ) ;
154
154
}
155
155
}
156
156
157
- pub fn rollback_to ( & mut self , snapshot : uint ) {
157
+ pub fn rollback_to ( & self , snapshot : uint ) {
158
158
debug ! ( "RegionVarBindings: rollback_to({})" , snapshot) ;
159
159
let mut undo_log = self . undo_log . borrow_mut ( ) ;
160
160
while undo_log. get ( ) . len ( ) > snapshot {
@@ -188,7 +188,7 @@ impl RegionVarBindings {
188
188
var_origins. get ( ) . len ( )
189
189
}
190
190
191
- pub fn new_region_var ( & mut self , origin : RegionVariableOrigin ) -> RegionVid {
191
+ pub fn new_region_var ( & self , origin : RegionVariableOrigin ) -> RegionVid {
192
192
let id = self . num_vars ( ) ;
193
193
let mut var_origins = self . var_origins . borrow_mut ( ) ;
194
194
var_origins. get ( ) . push ( origin) ;
@@ -204,13 +204,13 @@ impl RegionVarBindings {
204
204
return vid;
205
205
}
206
206
207
- pub fn new_skolemized ( & mut self , br : ty:: BoundRegion ) -> Region {
207
+ pub fn new_skolemized ( & self , br : ty:: BoundRegion ) -> Region {
208
208
let sc = self . skolemization_count . get ( ) ;
209
209
self . skolemization_count . set ( sc + 1 ) ;
210
210
ReInfer ( ReSkolemized ( sc, br) )
211
211
}
212
212
213
- pub fn new_bound ( & mut self , binder_id : ast:: NodeId ) -> Region {
213
+ pub fn new_bound ( & self , binder_id : ast:: NodeId ) -> Region {
214
214
// Creates a fresh bound variable for use in GLB computations.
215
215
// See discussion of GLB computation in the large comment at
216
216
// the top of this file for more details.
@@ -244,7 +244,7 @@ impl RegionVarBindings {
244
244
values. get ( ) . is_none ( )
245
245
}
246
246
247
- pub fn add_constraint ( & mut self ,
247
+ pub fn add_constraint ( & self ,
248
248
constraint : Constraint ,
249
249
origin : SubregionOrigin ) {
250
250
// cannot add constraints once regions are resolved
@@ -263,7 +263,7 @@ impl RegionVarBindings {
263
263
}
264
264
}
265
265
266
- pub fn make_subregion ( & mut self ,
266
+ pub fn make_subregion ( & self ,
267
267
origin : SubregionOrigin ,
268
268
sub : Region ,
269
269
sup : Region ) {
@@ -297,7 +297,7 @@ impl RegionVarBindings {
297
297
}
298
298
}
299
299
300
- pub fn lub_regions ( & mut self ,
300
+ pub fn lub_regions ( & self ,
301
301
origin : SubregionOrigin ,
302
302
a : Region ,
303
303
b : Region )
@@ -320,7 +320,7 @@ impl RegionVarBindings {
320
320
}
321
321
}
322
322
323
- pub fn glb_regions ( & mut self ,
323
+ pub fn glb_regions ( & self ,
324
324
origin : SubregionOrigin ,
325
325
a : Region ,
326
326
b : Region )
@@ -344,7 +344,7 @@ impl RegionVarBindings {
344
344
}
345
345
}
346
346
347
- pub fn resolve_var ( & mut self , rid : RegionVid ) -> ty:: Region {
347
+ pub fn resolve_var ( & self , rid : RegionVid ) -> ty:: Region {
348
348
let values = self . values . borrow ( ) ;
349
349
let v = match * values. get ( ) {
350
350
None => {
@@ -374,20 +374,20 @@ impl RegionVarBindings {
374
374
}
375
375
}
376
376
377
- fn combine_map < ' a > ( & ' a mut self , t : CombineMapType )
378
- -> & ' a mut RefCell < CombineMap > {
377
+ fn combine_map < ' a > ( & ' a self , t : CombineMapType )
378
+ -> & ' a RefCell < CombineMap > {
379
379
match t {
380
- Glb => & mut self . glbs ,
381
- Lub => & mut self . lubs ,
380
+ Glb => & self . glbs ,
381
+ Lub => & self . lubs ,
382
382
}
383
383
}
384
384
385
- pub fn combine_vars ( & mut self ,
385
+ pub fn combine_vars ( & self ,
386
386
t : CombineMapType ,
387
387
a : Region ,
388
388
b : Region ,
389
389
origin : SubregionOrigin ,
390
- relate: |this: & mut RegionVarBindings ,
390
+ relate: |this: & RegionVarBindings ,
391
391
old_r : Region ,
392
392
new_r : Region |)
393
393
-> Region {
@@ -418,7 +418,7 @@ impl RegionVarBindings {
418
418
ReInfer ( ReVar ( c) )
419
419
}
420
420
421
- pub fn vars_created_since_snapshot ( & mut self , snapshot : uint )
421
+ pub fn vars_created_since_snapshot ( & self , snapshot : uint )
422
422
-> ~[ RegionVid ] {
423
423
let undo_log = self . undo_log . borrow ( ) ;
424
424
undo_log. get ( ) . slice_from ( snapshot) . iter ( )
@@ -429,7 +429,7 @@ impl RegionVarBindings {
429
429
. collect ( )
430
430
}
431
431
432
- pub fn tainted ( & mut self , snapshot : uint , r0 : Region ) -> ~[ Region ] {
432
+ pub fn tainted ( & self , snapshot : uint , r0 : Region ) -> ~[ Region ] {
433
433
/*!
434
434
* Computes all regions that have been related to `r0` in any
435
435
* way since the snapshot `snapshot` was taken---`r0` itself
@@ -522,7 +522,7 @@ impl RegionVarBindings {
522
522
constraints, assuming such values can be found; if they cannot,
523
523
errors are reported.
524
524
*/
525
- pub fn resolve_regions ( & mut self ) -> OptVec < RegionResolutionError > {
525
+ pub fn resolve_regions ( & self ) -> OptVec < RegionResolutionError > {
526
526
debug ! ( "RegionVarBindings: resolve_regions()" ) ;
527
527
let mut errors = opt_vec:: Empty ;
528
528
let v = self . infer_variable_values ( & mut errors) ;
0 commit comments