Skip to content

Commit 4eb87fd

Browse files
committed
---
yaml --- r: 97009 b: refs/heads/dist-snap c: a1ee381 h: refs/heads/master i: 97007: 8facb4f v: v3
1 parent 00afc04 commit 4eb87fd

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: c274a6888410ce3e357e014568b43310ed787d36
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 752283889ca8da16dc2efc093bbc1094b034444c
9+
refs/heads/dist-snap: a1ee3810b82e4947d872c6d74c9d246fe4d2853d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/librustc/middle/resolve.rs

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

32+
use std::cell::Cell;
3233
use std::uint;
3334
use std::hashmap::{HashMap, HashSet};
3435
use std::util;
@@ -416,7 +417,7 @@ enum ModuleKind {
416417
struct Module {
417418
parent_link: ParentLink,
418419
def_id: Option<DefId>,
419-
kind: ModuleKind,
420+
kind: Cell<ModuleKind>,
420421
is_public: bool,
421422

422423
children: @mut HashMap<Name, @mut NameBindings>,
@@ -463,11 +464,11 @@ impl Module {
463464
kind: ModuleKind,
464465
external: bool,
465466
is_public: bool)
466-
-> Module {
467+
-> Module {
467468
Module {
468469
parent_link: parent_link,
469470
def_id: def_id,
470-
kind: kind,
471+
kind: Cell::new(kind),
471472
is_public: is_public,
472473
children: @mut HashMap::new(),
473474
imports: @mut ~[],
@@ -581,7 +582,7 @@ impl NameBindings {
581582
type_span: None,
582583
})
583584
}
584-
Some(module_def) => module_def.kind = kind,
585+
Some(module_def) => module_def.kind.set(kind),
585586
}
586587
}
587588
}
@@ -1238,7 +1239,7 @@ impl Resolver {
12381239
// It already exists
12391240
Some(&child) if child.get_module_if_available()
12401241
.is_some() &&
1241-
child.get_module().kind ==
1242+
child.get_module().kind.get() ==
12421243
ImplModuleKind => {
12431244
ModuleReducedGraphParent(child.get_module())
12441245
}
@@ -1805,7 +1806,7 @@ impl Resolver {
18051806

18061807
// Mark it as an impl module if
18071808
// necessary.
1808-
type_module.kind = ImplModuleKind;
1809+
type_module.kind.set(ImplModuleKind);
18091810
}
18101811
Some(_) | None => {
18111812
let parent_link =
@@ -2649,7 +2650,7 @@ impl Resolver {
26492650
// import, do not allow traits and impls
26502651
// to be selected.
26512652
match (name_search_type,
2652-
module_def.kind) {
2653+
module_def.kind.get()) {
26532654
(ImportSearch, TraitModuleKind) |
26542655
(ImportSearch, ImplModuleKind) => {
26552656
self.resolve_error(
@@ -2879,7 +2880,7 @@ impl Resolver {
28792880
ModuleParentLink(parent_module_node, _) => {
28802881
match search_through_modules {
28812882
DontSearchThroughModules => {
2882-
match search_module.kind {
2883+
match search_module.kind.get() {
28832884
NormalModuleKind => {
28842885
// We stop the search here.
28852886
debug!("(resolving item in lexical \
@@ -2987,7 +2988,7 @@ impl Resolver {
29872988
NoParentLink => return None,
29882989
ModuleParentLink(new_module, _) |
29892990
BlockParentLink(new_module, _) => {
2990-
match new_module.kind {
2991+
match new_module.kind.get() {
29912992
NormalModuleKind => return Some(new_module),
29922993
ExternModuleKind |
29932994
TraitModuleKind |
@@ -3004,7 +3005,7 @@ impl Resolver {
30043005
fn get_nearest_normal_module_parent_or_self(&mut self,
30053006
module_: @mut Module)
30063007
-> @mut Module {
3007-
match module_.kind {
3008+
match module_.kind.get() {
30083009
NormalModuleKind => return module_,
30093010
ExternModuleKind |
30103011
TraitModuleKind |
@@ -4702,7 +4703,7 @@ impl Resolver {
47024703
(def, last_private.or(lp))
47034704
}
47044705
};
4705-
match containing_module.kind {
4706+
match containing_module.kind.get() {
47064707
TraitModuleKind | ImplModuleKind => {
47074708
match self.method_map.find(&ident.name) {
47084709
Some(s) => {

0 commit comments

Comments
 (0)