about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/comp/front/parser.rs6
-rw-r--r--src/test/run-pass/item-attributes.rs6
2 files changed, 11 insertions, 1 deletions
diff --git a/src/comp/front/parser.rs b/src/comp/front/parser.rs
index f1121c814aa..33ddcc6d57d 100644
--- a/src/comp/front/parser.rs
+++ b/src/comp/front/parser.rs
@@ -2285,7 +2285,11 @@ fn parse_native_view(&parser p) -> vec[@ast::view_item] {
 
 fn parse_crate_from_source_file(&parser p) -> @ast::crate {
     auto lo = p.get_lo_pos();
-    auto m = parse_mod_items(p, token::EOF, []);
+    // FIXME (issue #487): Do something with these attrs
+    auto crate_attrs = parse_inner_attrs_and_next(p);
+    auto first_item_outer_attrs = crate_attrs._1;
+    auto m = parse_mod_items(p, token::EOF,
+                             first_item_outer_attrs);
     let vec[@ast::crate_directive] cdirs = [];
     ret @spanned(lo, p.get_lo_pos(), rec(directives=cdirs, module=m));
 }
diff --git a/src/test/run-pass/item-attributes.rs b/src/test/run-pass/item-attributes.rs
index f9a8c613486..667e537ca37 100644
--- a/src/test/run-pass/item-attributes.rs
+++ b/src/test/run-pass/item-attributes.rs
@@ -1,5 +1,11 @@
 // xfail-stage0
 
+// These are attributes of the implicit crate. Really this just needs to parse
+// for completeness since .rs files linked from .rc files support this
+// notation to specify their module's attributes
+#[attr1 = "val"];
+#[attr2 = "val"];
+
 // These are are attributes of the following mod
 #[attr1 = "val"]
 #[attr2 = "val"]