Skip to content

Commit 05b2cb8

Browse files
lhtbrson
authored andcommitted
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 2253ed5 commit 05b2cb8

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
@@ -2478,7 +2478,9 @@ fn parse_crate_directive(p: parser, first_outer_attr: [ast::attribute]) ->
24782478
let file_opt =
24792479
alt p.peek() {
24802480
token::EQ. { p.bump(); some(parse_str(p)) }
2481-
_ { none }
2481+
_ {
2482+
attr::get_meta_item_value_str_by_name(outer_attrs, "path")
2483+
}
24822484
};
24832485
alt p.peek() {
24842486
// mod x = "foo.rs";

0 commit comments

Comments
 (0)