Skip to content

Commit 9f48d4e

Browse files
committed
---
yaml --- r: 94709 b: refs/heads/try c: f759fe1 h: refs/heads/master i: 94707: f2b19cc v: v3
1 parent a09be6c commit 9f48d4e

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
@@ -2,7 +2,7 @@
22
refs/heads/master: 0da105a8b7b6b1e0568e8ff20f6ff4b13cc7ecc2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d3e57dca68fde4effdda3e4ae2887aa535fcd6
5-
refs/heads/try: 0c3950d8a827793fa04c8f633baddecc92a87404
5+
refs/heads/try: f759fe15a1f796f0c9f201891aa642e2eadd5d42
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/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)