Skip to content

Commit 011eab6

Browse files
committed
---
yaml --- r: 6616 b: refs/heads/master c: e056ffa h: refs/heads/master v: v3
1 parent 2571c70 commit 011eab6

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 799690bea0dbcf427bf7a9a813fec163eedf217d
2+
refs/heads/master: e056ffa17d8dad336a3f8380d3d23f282f7f067d

trunk/src/comp/driver/rustc.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,10 @@ fn inject_libcore_reference(sess: session::session,
123123
let vi1 = spanned(ast::view_item_use("core", [], n1));
124124
let vi2 = spanned(ast::view_item_import_glob(@["core"], n2));
125125

126-
let cd1 = spanned(ast::cdir_view_item(vi1));
127-
let cd2 = spanned(ast::cdir_view_item(vi2));
126+
let vis = [vi1, vi2] + crate.node.module.view_items;
128127

129-
let cdirs = [cd1, cd2] + crate.node.directives;
130-
131-
ret @{node: {directives: cdirs with crate.node} with *crate }
128+
ret @{node: {module: { view_items: vis with crate.node.module }
129+
with crate.node} with *crate }
132130
}
133131

134132

trunk/src/comp/syntax/ast.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,14 @@ type crate_ =
6060
tag crate_directive_ {
6161
cdir_src_mod(ident, [attribute]);
6262
cdir_dir_mod(ident, [@crate_directive], [attribute]);
63+
64+
// NB: cdir_view_item is *not* processed by the rest of the compiler; the
65+
// attached view_items are sunk into the crate's module during parsing,
66+
// and processed (resolved, imported, etc.) there. This tag-variant exists
67+
// only to preserve the view items in order in case we decide to
68+
// pretty-print crates in the future.
6369
cdir_view_item(@view_item);
70+
6471
cdir_syntax(@path);
6572
}
6673

0 commit comments

Comments
 (0)