Skip to content

Commit a1b680e

Browse files
committed
---
yaml --- r: 30839 b: refs/heads/incoming c: 7b0ed94 h: refs/heads/master i: 30837: 59d27af 30835: e65ff78 30831: df06755 v: v3
1 parent 0bef3f6 commit a1b680e

File tree

3 files changed

+23
-6
lines changed

3 files changed

+23
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
9-
refs/heads/incoming: 4eb5177d8c0bc6de0383ea1376115ba630627c34
9+
refs/heads/incoming: 7b0ed94bdc6f42f0abed2ee2e293e3800725eaeb
1010
refs/heads/dist-snap: 2f32a1581f522e524009138b33b1c7049ced668d
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/src/rustc/middle/resolve.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,6 +1063,7 @@ impl Resolver {
10631063
for enum_definition.variants.each |variant| {
10641064
self.build_reduced_graph_for_variant(*variant,
10651065
local_def(item.id),
1066+
privacy,
10661067
new_parent,
10671068
visitor);
10681069
}
@@ -1156,17 +1157,20 @@ impl Resolver {
11561157
// type and/or value namespaces.
11571158
fn build_reduced_graph_for_variant(variant: variant,
11581159
item_id: def_id,
1160+
+parent_privacy: Privacy,
11591161
parent: ReducedGraphParent,
11601162
&&visitor: vt<ReducedGraphParent>) {
11611163

1162-
let legacy = match parent {
1163-
ModuleReducedGraphParent(m) => m.legacy_exports
1164-
};
1165-
11661164
let ident = variant.node.name;
11671165
let (child, _) = self.add_child(ident, parent, ~[ValueNS],
11681166
variant.span);
1169-
let privacy = self.visibility_to_privacy(variant.node.vis, legacy);
1167+
1168+
let privacy;
1169+
match variant.node.vis {
1170+
public => privacy = Public,
1171+
private => privacy = Private,
1172+
inherited => privacy = parent_privacy
1173+
}
11701174

11711175
match variant.node.kind {
11721176
tuple_variant_kind(_) => {
@@ -1188,6 +1192,7 @@ impl Resolver {
11881192
variant.span);
11891193
for enum_definition.variants.each |variant| {
11901194
self.build_reduced_graph_for_variant(*variant, item_id,
1195+
parent_privacy,
11911196
parent, visitor);
11921197
}
11931198
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
mod a {
2+
pub enum Foo {
3+
Bar,
4+
Baz,
5+
Boo
6+
}
7+
}
8+
9+
fn main() {
10+
let x = a::Bar;
11+
}
12+

0 commit comments

Comments
 (0)