Skip to content

Commit 8bee1e0

Browse files
committed
---
yaml --- r: 23752 b: refs/heads/master c: 0a852e0 h: refs/heads/master v: v3
1 parent 499cf9c commit 8bee1e0

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
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: 9097410b433c0d7c7dca8f9296161b3074a8d21e
2+
refs/heads/master: 0a852e0da0503b3abcc2dd0b0858f64e3f4dc6b0
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: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,23 +1091,24 @@ struct Resolver {
10911091
let atom = variant.node.name;
10921092
let (child, _) = self.add_child(atom, parent, ~[ValueNS],
10931093
variant.span);
1094+
let privacy = self.visibility_to_privacy(variant.node.vis);
10941095

10951096
match variant.node.kind {
10961097
tuple_variant_kind(_) => {
1097-
(*child).define_value(Public,
1098+
(*child).define_value(privacy,
10981099
def_variant(item_id,
10991100
local_def(variant.node.id)),
11001101
variant.span);
11011102
}
11021103
struct_variant_kind(_) => {
1103-
(*child).define_type(Public,
1104+
(*child).define_type(privacy,
11041105
def_variant(item_id,
11051106
local_def(variant.node.id)),
11061107
variant.span);
11071108
self.structs.insert(local_def(variant.node.id), false);
11081109
}
11091110
enum_variant_kind(enum_definition) => {
1110-
(*child).define_type(Public,
1111+
(*child).define_type(privacy,
11111112
def_ty(local_def(variant.node.id)),
11121113
variant.span);
11131114
for enum_definition.variants.each |variant| {
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
mod a {
2+
enum Waffle {
3+
Belgian,
4+
Brussels,
5+
priv Liege
6+
}
7+
}
8+
9+
fn main() {
10+
let x = a::Liege; //~ ERROR unresolved name
11+
}

0 commit comments

Comments
 (0)