Skip to content

Commit f9fdc5a

Browse files
committed
---
yaml --- r: 24239 b: refs/heads/master c: 7b0ed94 h: refs/heads/master i: 24237: 2ab281d 24235: d447431 24231: 87d90f8 24223: df1a418 v: v3
1 parent d9ea726 commit f9fdc5a

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
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 4eb5177d8c0bc6de0383ea1376115ba630627c34
2+
refs/heads/master: 7b0ed94bdc6f42f0abed2ee2e293e3800725eaeb
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be

trunk/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)