Skip to content

Commit 80c1ad8

Browse files
committed
---
yaml --- r: 94671 b: refs/heads/try c: bc1ea78 h: refs/heads/master i: 94669: c7367d2 94667: 22e4b9b 94663: dc48d60 94655: 72a5da8 v: v3
1 parent 39661e7 commit 80c1ad8

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
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: b5b403abcc2f3a3fed2ef154f2aeffc479cfcfc2
5+
refs/heads/try: bc1ea7887c1815164af8b3cf301d42c2a7a0b9ab
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/librustc/middle/borrowck/check_loans.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,10 @@ impl<'a> CheckLoanCtxt<'a> {
419419
derefs: deref_count
420420
};
421421
debug!("Inserting write guard at {:?}", key);
422-
this.bccx.write_guard_map.insert(key);
422+
let mut write_guard_map = this.bccx
423+
.write_guard_map
424+
.borrow_mut();
425+
write_guard_map.get().insert(key);
423426
}
424427

425428
_ => {}

branches/try/src/librustc/middle/borrowck/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ pub fn check_crate(
8282
moved_variables_set: moved_variables_set,
8383
capture_map: capture_map,
8484
root_map: root_map(),
85-
write_guard_map: @mut HashSet::new(),
85+
write_guard_map: @RefCell::new(HashSet::new()),
8686
stats: @mut BorrowStats {
8787
loaned_paths_same: 0,
8888
loaned_paths_imm: 0,
@@ -217,7 +217,7 @@ pub struct root_map_key {
217217

218218
// A set containing IDs of expressions of gc'd type that need to have a write
219219
// guard.
220-
pub type write_guard_map = @mut HashSet<root_map_key>;
220+
pub type write_guard_map = @RefCell<HashSet<root_map_key>>;
221221

222222
pub type BckResult<T> = Result<T, BckError>;
223223

branches/try/src/librustc/middle/const_eval.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ pub fn lookup_variant_by_id(tcx: ty::ctxt,
123123
root_map: @RefCell::new(HashMap::new()),
124124
method_map: @mut HashMap::new(),
125125
vtable_map: @RefCell::new(HashMap::new()),
126-
write_guard_map: @mut HashSet::new(),
126+
write_guard_map: @RefCell::new(HashSet::new()),
127127
capture_map: @RefCell::new(HashMap::new())
128128
};
129129
let e = match csearch::maybe_get_item_ast(tcx, enum_def,
@@ -173,7 +173,7 @@ pub fn lookup_const_by_id(tcx: ty::ctxt,
173173
root_map: @RefCell::new(HashMap::new()),
174174
method_map: @mut HashMap::new(),
175175
vtable_map: @RefCell::new(HashMap::new()),
176-
write_guard_map: @mut HashSet::new(),
176+
write_guard_map: @RefCell::new(HashSet::new()),
177177
capture_map: @RefCell::new(HashMap::new())
178178
};
179179
let e = match csearch::maybe_get_item_ast(tcx, def_id,

branches/try/src/librustc/middle/trans/write_guard.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ pub fn root_and_write_guard(datum: &Datum,
5656
// Perform the write guard, if necessary.
5757
//
5858
// (Note: write-guarded values are always boxes)
59-
if ccx.maps.write_guard_map.contains(&key) {
59+
let write_guard_map = ccx.maps.write_guard_map.borrow();
60+
if write_guard_map.get().contains(&key) {
6061
perform_write_guard(datum, bcx, span)
6162
} else {
6263
bcx

0 commit comments

Comments
 (0)