@@ -69,12 +69,12 @@ struct RegionResolutionVisitor {
69
69
sess : Session ,
70
70
71
71
// Generated maps:
72
- region_maps : @mut RegionMaps ,
72
+ region_maps : @RegionMaps ,
73
73
}
74
74
75
75
76
76
impl RegionMaps {
77
- pub fn relate_free_regions ( & mut self , sub : FreeRegion , sup : FreeRegion ) {
77
+ pub fn relate_free_regions ( & self , sub : FreeRegion , sup : FreeRegion ) {
78
78
let mut free_region_map = self . free_region_map . borrow_mut ( ) ;
79
79
match free_region_map. get ( ) . find_mut ( & sub) {
80
80
Some ( sups) => {
@@ -91,15 +91,15 @@ impl RegionMaps {
91
91
free_region_map. get ( ) . insert ( sub, ~[ sup] ) ;
92
92
}
93
93
94
- pub fn record_parent ( & mut self , sub : ast:: NodeId , sup : ast:: NodeId ) {
94
+ pub fn record_parent ( & self , sub : ast:: NodeId , sup : ast:: NodeId ) {
95
95
debug ! ( "record_parent(sub={:?}, sup={:?})" , sub, sup) ;
96
96
assert ! ( sub != sup) ;
97
97
98
98
let mut scope_map = self . scope_map . borrow_mut ( ) ;
99
99
scope_map. get ( ) . insert ( sub, sup) ;
100
100
}
101
101
102
- pub fn record_cleanup_scope ( & mut self , scope_id : ast:: NodeId ) {
102
+ pub fn record_cleanup_scope ( & self , scope_id : ast:: NodeId ) {
103
103
//! Records that a scope is a CLEANUP SCOPE. This is invoked
104
104
//! from within regionck. We wait until regionck because we do
105
105
//! not know which operators are overloaded until that point,
@@ -504,10 +504,8 @@ impl Visitor<Context> for RegionResolutionVisitor {
504
504
}
505
505
}
506
506
507
- pub fn resolve_crate ( sess : Session ,
508
- crate : & ast:: Crate ) -> @mut RegionMaps
509
- {
510
- let region_maps = @mut RegionMaps {
507
+ pub fn resolve_crate ( sess : Session , crate : & ast:: Crate ) -> @RegionMaps {
508
+ let region_maps = @RegionMaps {
511
509
scope_map : RefCell :: new ( HashMap :: new ( ) ) ,
512
510
free_region_map : RefCell :: new ( HashMap :: new ( ) ) ,
513
511
cleanup_scopes : RefCell :: new ( HashSet :: new ( ) ) ,
0 commit comments