Skip to content

Commit 6e875e8

Browse files
committed
---
yaml --- r: 147623 b: refs/heads/try2 c: bc1ea78 h: refs/heads/master i: 147621: 793c399 147619: 69e09d7 147615: b09e38d v: v3
1 parent 58e1c1e commit 6e875e8

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
@@ -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: b5b403abcc2f3a3fed2ef154f2aeffc479cfcfc2
8+
refs/heads/try2: bc1ea7887c1815164af8b3cf301d42c2a7a0b9ab
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/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/try2/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/try2/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/try2/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)