Skip to content

Commit d095384

Browse files
committed
---
yaml --- r: 147612 b: refs/heads/try2 c: f73dee1 h: refs/heads/master v: v3
1 parent 1fb425c commit d095384

File tree

5 files changed

+12
-10
lines changed

5 files changed

+12
-10
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: c5f07cfc1adfb23523c986b1c7e1b099ebbd8605
8+
refs/heads/try2: f73dee17fc787cbcf022c74ec17d00329ddfe223
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/librustc/driver/driver.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,7 @@ pub fn phase_3_run_analysis_passes(sess: Session,
272272
method_map, ty_cx));
273273

274274
let maps = (external_exports, last_private_map);
275-
let exported_items =
276-
time(time_passes, "privacy checking", maps, |(a, b)|
275+
let exported_items = time(time_passes, "privacy checking", maps, |(a, b)|
277276
middle::privacy::check_crate(ty_cx, &method_map, &exp_map2,
278277
a, b, crate));
279278

branches/try2/src/librustc/metadata/encoder.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,8 @@ fn encode_reexports(ecx: &EncodeContext,
556556
id: NodeId,
557557
path: &[ast_map::path_elt]) {
558558
debug!("(encoding info for module) encoding reexports for {}", id);
559-
match ecx.reexports2.find(&id) {
559+
let reexports2 = ecx.reexports2.borrow();
560+
match reexports2.get().find(&id) {
560561
Some(ref exports) => {
561562
debug!("(encoding info for module) found reexports for {}", id);
562563
for exp in exports.iter() {

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,9 @@ impl<'a> Visitor<()> for EmbargoVisitor<'a> {
293293
// This code is here instead of in visit_item so that the
294294
// crate module gets processed as well.
295295
if self.prev_exported {
296-
assert!(self.exp_map2.contains_key(&id), "wut {:?}", id);
297-
for export in self.exp_map2.get(&id).iter() {
296+
let exp_map2 = self.exp_map2.borrow();
297+
assert!(exp_map2.get().contains_key(&id), "wut {:?}", id);
298+
for export in exp_map2.get().get(&id).iter() {
298299
if is_local(export.def_id) && export.reexport {
299300
self.reexports.insert(export.def_id.node);
300301
}

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use syntax::opt_vec::OptVec;
2929
use syntax::visit;
3030
use syntax::visit::Visitor;
3131

32-
use std::cell::Cell;
32+
use std::cell::{Cell, RefCell};
3333
use std::uint;
3434
use std::hashmap::{HashMap, HashSet};
3535
use std::util;
@@ -50,7 +50,7 @@ pub type TraitMap = HashMap<NodeId,@mut ~[DefId]>;
5050

5151
// This is the replacement export map. It maps a module to all of the exports
5252
// within.
53-
pub type ExportMap2 = @mut HashMap<NodeId, ~[Export2]>;
53+
pub type ExportMap2 = @RefCell<HashMap<NodeId, ~[Export2]>>;
5454

5555
pub struct Export2 {
5656
name: @str, // The name of the target.
@@ -808,7 +808,7 @@ fn Resolver(session: Session,
808808
namespaces: ~[ TypeNS, ValueNS ],
809809

810810
def_map: @mut HashMap::new(),
811-
export_map2: @mut HashMap::new(),
811+
export_map2: @RefCell::new(HashMap::new()),
812812
trait_map: HashMap::new(),
813813
used_imports: HashSet::new(),
814814
external_exports: HashSet::new(),
@@ -3249,7 +3249,8 @@ impl Resolver {
32493249
self.add_exports_for_module(&mut exports2, module_);
32503250
match module_.def_id.get() {
32513251
Some(def_id) => {
3252-
self.export_map2.insert(def_id.node, exports2);
3252+
let mut export_map2 = self.export_map2.borrow_mut();
3253+
export_map2.get().insert(def_id.node, exports2);
32533254
debug!("(computing exports) writing exports for {} (some)",
32543255
def_id.node);
32553256
}

0 commit comments

Comments
 (0)