Skip to content

Commit 15e49b9

Browse files
committed
---
yaml --- r: 94713 b: refs/heads/try c: 620be92 h: refs/heads/master i: 94711: a84d035 v: v3
1 parent 3f6da6a commit 15e49b9

File tree

5 files changed

+15
-8
lines changed

5 files changed

+15
-8
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: 5a9c37b7f53cf6dfb1f540c87e3a1d04f5d704ba
5+
refs/heads/try: 620be9235dbbb2f57462761bcfe0bebb8e2bbece
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/librustc/metadata/creader.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use metadata::cstore;
1515
use metadata::decoder;
1616
use metadata::loader;
1717

18+
use std::cell::RefCell;
1819
use std::hashmap::HashMap;
1920
use syntax::ast;
2021
use syntax::abi;
@@ -347,5 +348,5 @@ fn resolve_crate_deps(e: &mut Env, cdata: &[u8]) -> cstore::cnum_map {
347348
}
348349
}
349350
}
350-
return @mut cnum_map;
351+
return @RefCell::new(cnum_map);
351352
}

branches/try/src/librustc/metadata/cstore.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use syntax::parse::token::ident_interner;
2424
// local crate numbers (as generated during this session). Each external
2525
// crate may refer to types in other external crates, and each has their
2626
// own crate numbers.
27-
pub type cnum_map = @mut HashMap<ast::CrateNum, ast::CrateNum>;
27+
pub type cnum_map = @RefCell<HashMap<ast::CrateNum, ast::CrateNum>>;
2828

2929
pub enum MetadataBlob {
3030
MetadataVec(~[u8]),

branches/try/src/librustc/metadata/decoder.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,9 +1197,15 @@ pub fn translate_def_id(cdata: Cmd, did: ast::DefId) -> ast::DefId {
11971197
return ast::DefId { crate: cdata.cnum, node: did.node };
11981198
}
11991199

1200-
match cdata.cnum_map.find(&did.crate) {
1201-
option::Some(&n) => ast::DefId { crate: n, node: did.node },
1202-
option::None => fail!("didn't find a crate in the cnum_map")
1200+
let cnum_map = cdata.cnum_map.borrow();
1201+
match cnum_map.get().find(&did.crate) {
1202+
Some(&n) => {
1203+
ast::DefId {
1204+
crate: n,
1205+
node: did.node,
1206+
}
1207+
}
1208+
None => fail!("didn't find a crate in the cnum_map")
12031209
}
12041210
}
12051211

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ pub fn check_crate(
8383
capture_map: capture_map,
8484
root_map: root_map(),
8585
write_guard_map: @RefCell::new(HashSet::new()),
86-
stats: @mut BorrowStats {
86+
stats: @BorrowStats {
8787
loaned_paths_same: Cell::new(0),
8888
loaned_paths_imm: Cell::new(0),
8989
stable_paths: Cell::new(0),
@@ -172,7 +172,7 @@ pub struct BorrowckCtxt {
172172
write_guard_map: write_guard_map,
173173

174174
// Statistics:
175-
stats: @mut BorrowStats
175+
stats: @BorrowStats
176176
}
177177

178178
pub struct BorrowStats {

0 commit comments

Comments
 (0)