提交 7aee9f7b 编写于 作者: B Brian Anderson

rustc: Fix a bug in cdir attribute parsing

The first attribute of the first mod was being applied to every mod.
上级 3e303af8
......@@ -2515,9 +2515,11 @@ fn parse_crate_directives(p: parser, term: token::token,
}
let cdirs: [@ast::crate_directive] = [];
let first_outer_attr = first_outer_attr;
while p.peek() != term {
let cdir = @parse_crate_directive(p, first_outer_attr);
cdirs += [cdir];
first_outer_attr = [];
}
ret cdirs;
}
......
// Regression test for a problem with the first mod attribute
// being applied to every mod
#[cfg(target_os = "linux")]
mod hello;
#[cfg(target_os = "macos")]
mod hello;
#[cfg(target_os = "win32")]
mod hello;
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册