Skip to content

Commit 9a6d960

Browse files
committed
---
yaml --- r: 22012 b: refs/heads/snap-stage3 c: 9c6ae65 h: refs/heads/master v: v3
1 parent fef3a52 commit 9a6d960

File tree

6 files changed

+17
-15
lines changed

6 files changed

+17
-15
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: e430a699f2c60890d9b86069fd0c68a70ece7120
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: c675cd396d729ad7e427abd370489767a0db6ab6
4+
refs/heads/snap-stage3: 9c6ae658658a48c4686a0f09be5cf6a3f45e0fb5
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/libsyntax/ast.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,8 @@ type crate_ =
265265
config: crate_cfg};
266266

267267
enum crate_directive_ {
268-
cdir_src_mod(ident, ~[attribute]),
269-
cdir_dir_mod(ident, ~[@crate_directive], ~[attribute]),
268+
cdir_src_mod(visibility, ident, ~[attribute]),
269+
cdir_dir_mod(visibility, ident, ~[@crate_directive], ~[attribute]),
270270

271271
// NB: cdir_view_item is *not* processed by the rest of the compiler, the
272272
// attached view_items are sunk into the crate's module during parsing,

branches/snap-stage3/src/libsyntax/fold.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,12 @@ fn noop_fold_crate(c: crate_, fld: ast_fold) -> crate_ {
162162
fn noop_fold_crate_directive(cd: crate_directive_, fld: ast_fold) ->
163163
crate_directive_ {
164164
return match cd {
165-
cdir_src_mod(id, attrs) => {
166-
cdir_src_mod(fld.fold_ident(id), /* FIXME (#2543) */ copy attrs)
165+
cdir_src_mod(vis, id, attrs) => {
166+
cdir_src_mod(vis, fld.fold_ident(id),
167+
/* FIXME (#2543) */ copy attrs)
167168
}
168-
cdir_dir_mod(id, cds, attrs) => {
169-
cdir_dir_mod(fld.fold_ident(id),
169+
cdir_dir_mod(vis, id, cds, attrs) => {
170+
cdir_dir_mod(vis, fld.fold_ident(id),
170171
vec::map(cds, |x| fld.fold_crate_directive(*x)),
171172
/* FIXME (#2543) */ copy attrs)
172173
}

branches/snap-stage3/src/libsyntax/parse/eval.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ fn eval_crate_directive(cx: ctx, cdir: @ast::crate_directive, prefix: &Path,
8585
&view_items: ~[@ast::view_item],
8686
&items: ~[@ast::item]) {
8787
match cdir.node {
88-
ast::cdir_src_mod(id, attrs) => {
88+
ast::cdir_src_mod(vis, id, attrs) => {
8989
let file_path = Path(cdir_path_opt(
9090
cx.sess.interner.get(id) + ~".rs", attrs));
9191
let full_path = if file_path.is_absolute {
@@ -103,13 +103,13 @@ fn eval_crate_directive(cx: ctx, cdir: @ast::crate_directive, prefix: &Path,
103103

104104
let i = p0.mk_item(cdir.span.lo, cdir.span.hi,
105105
/* FIXME (#2543) */ copy id,
106-
ast::item_mod(m0), ast::public, mod_attrs);
106+
ast::item_mod(m0), vis, mod_attrs);
107107
// Thread defids, chpos and byte_pos through the parsers
108108
cx.sess.chpos = r0.chpos;
109109
cx.sess.byte_pos = cx.sess.byte_pos + r0.pos;
110110
vec::push(items, i);
111111
}
112-
ast::cdir_dir_mod(id, cdirs, attrs) => {
112+
ast::cdir_dir_mod(vis, id, cdirs, attrs) => {
113113
let path = Path(cdir_path_opt(*cx.sess.interner.get(id), attrs));
114114
let full_path = if path.is_absolute {
115115
copy path
@@ -123,7 +123,7 @@ fn eval_crate_directive(cx: ctx, cdir: @ast::crate_directive, prefix: &Path,
123123
attrs: vec::append(attrs, a0),
124124
id: cx.sess.next_id,
125125
node: ast::item_mod(m0),
126-
vis: ast::public,
126+
vis: vis,
127127
span: cdir.span};
128128
cx.sess.next_id += 1;
129129
vec::push(items, i);

branches/snap-stage3/src/libsyntax/parse/parser.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3601,6 +3601,7 @@ impl parser {
36013601
let expect_mod = vec::len(outer_attrs) > 0u;
36023602

36033603
let lo = self.span.lo;
3604+
let vis = self.parse_visibility();
36043605
if expect_mod || self.is_keyword(~"mod") {
36053606

36063607
self.expect_keyword(~"mod");
@@ -3611,7 +3612,7 @@ impl parser {
36113612
token::SEMI => {
36123613
let mut hi = self.span.hi;
36133614
self.bump();
3614-
return spanned(lo, hi, cdir_src_mod(id, outer_attrs));
3615+
return spanned(lo, hi, cdir_src_mod(vis, id, outer_attrs));
36153616
}
36163617
// mod x = "foo_dir" { ...directives... }
36173618
token::LBRACE => {
@@ -3624,7 +3625,7 @@ impl parser {
36243625
let mut hi = self.span.hi;
36253626
self.expect(token::RBRACE);
36263627
return spanned(lo, hi,
3627-
cdir_dir_mod(id, cdirs, mod_attrs));
3628+
cdir_dir_mod(vis, id, cdirs, mod_attrs));
36283629
}
36293630
_ => self.unexpected()
36303631
}

branches/snap-stage3/src/libsyntax/visit.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ fn visit_crate<E>(c: crate, e: E, v: vt<E>) {
9696

9797
fn visit_crate_directive<E>(cd: @crate_directive, e: E, v: vt<E>) {
9898
match cd.node {
99-
cdir_src_mod(_, _) => (),
100-
cdir_dir_mod(_, cdirs, _) => for cdirs.each |cdir| {
99+
cdir_src_mod(_, _, _) => (),
100+
cdir_dir_mod(_, _, cdirs, _) => for cdirs.each |cdir| {
101101
visit_crate_directive(*cdir, e, v);
102102
},
103103
cdir_view_item(vi) => v.visit_view_item(vi, e, v),

0 commit comments

Comments
 (0)