Skip to content

Commit 8909073

Browse files
committed
---
yaml --- r: 147661 b: refs/heads/try2 c: f759fe1 h: refs/heads/master i: 147659: 587cc56 v: v3
1 parent fe97b05 commit 8909073

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 0c3950d8a827793fa04c8f633baddecc92a87404
8+
refs/heads/try2: f759fe15a1f796f0c9f201891aa642e2eadd5d42
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/librustc/middle/region.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ The region maps encode information about region relationships.
5353
pub struct RegionMaps {
5454
priv scope_map: RefCell<HashMap<ast::NodeId, ast::NodeId>>,
5555
priv free_region_map: RefCell<HashMap<FreeRegion, ~[FreeRegion]>>,
56-
priv cleanup_scopes: HashSet<ast::NodeId>
56+
priv cleanup_scopes: RefCell<HashSet<ast::NodeId>>,
5757
}
5858

5959
#[deriving(Clone)]
@@ -105,7 +105,8 @@ impl RegionMaps {
105105
//! not know which operators are overloaded until that point,
106106
//! and only overloaded operators result in cleanup scopes.
107107
108-
self.cleanup_scopes.insert(scope_id);
108+
let mut cleanup_scopes = self.cleanup_scopes.borrow_mut();
109+
cleanup_scopes.get().insert(scope_id);
109110
}
110111

111112
pub fn opt_encl_scope(&self, id: ast::NodeId) -> Option<ast::NodeId> {
@@ -126,14 +127,16 @@ impl RegionMaps {
126127
}
127128

128129
pub fn is_cleanup_scope(&self, scope_id: ast::NodeId) -> bool {
129-
self.cleanup_scopes.contains(&scope_id)
130+
let cleanup_scopes = self.cleanup_scopes.borrow();
131+
cleanup_scopes.get().contains(&scope_id)
130132
}
131133

132134
pub fn cleanup_scope(&self, expr_id: ast::NodeId) -> ast::NodeId {
133135
//! Returns the scope when temps in expr will be cleaned up
134136
135137
let mut id = self.encl_scope(expr_id);
136-
while !self.cleanup_scopes.contains(&id) {
138+
let cleanup_scopes = self.cleanup_scopes.borrow();
139+
while !cleanup_scopes.get().contains(&id) {
137140
id = self.encl_scope(id);
138141
}
139142
return id;
@@ -507,7 +510,7 @@ pub fn resolve_crate(sess: Session,
507510
let region_maps = @mut RegionMaps {
508511
scope_map: RefCell::new(HashMap::new()),
509512
free_region_map: RefCell::new(HashMap::new()),
510-
cleanup_scopes: HashSet::new(),
513+
cleanup_scopes: RefCell::new(HashSet::new()),
511514
};
512515
let cx = Context {parent: None,
513516
var_parent: None};

0 commit comments

Comments
 (0)