Skip to content

Commit f55bb61

Browse files
committed
rustc: Accepts path attributes for crate directives
Temporarily allow path specified in either as attribute or in AST, like: #[path = "mymod.rs"] mod mymod = "mymod.rs"; This is a transitional commit to avoid creating a stage1 snapshot.
1 parent a936f78 commit f55bb61

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/comp/syntax/parse/parser.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2505,7 +2505,9 @@ fn parse_crate_directive(p: parser, first_outer_attr: [ast::attribute]) ->
25052505
let file_opt =
25062506
alt p.peek() {
25072507
token::EQ. { p.bump(); some(parse_str(p)) }
2508-
_ { none }
2508+
_ {
2509+
attr::get_meta_item_value_str_by_name(outer_attrs, "path")
2510+
}
25092511
};
25102512
alt p.peek() {
25112513
// mod x = "foo.rs";

0 commit comments

Comments
 (0)