Rollup merge of #91313 - petrochenkov:cratexp, r=Aaron1011
expand: Turn `ast::Crate` into a first class expansion target And stop creating a fake `mod` item for the crate root when expanding a crate, thus addressing FIXMEs left in https://github.com/rust-lang/rust/pull/82238, and making a step towards a proper support for crate-level macro attributes (cc #54726). I haven't added token collection support for the whole crate in this PR, maybe later. r? `@Aaron1011`
This commit is contained in:
commit
519a842c50
20 changed files with 203 additions and 159 deletions
|
@ -26,7 +26,7 @@ impl<'a> Parser<'a> {
|
|||
/// Parses a source module as a crate. This is the main entry point for the parser.
|
||||
pub fn parse_crate_mod(&mut self) -> PResult<'a, ast::Crate> {
|
||||
let (attrs, items, span) = self.parse_mod(&token::Eof)?;
|
||||
Ok(ast::Crate { attrs, items, span })
|
||||
Ok(ast::Crate { attrs, items, span, is_placeholder: None })
|
||||
}
|
||||
|
||||
/// Parses a `mod <foo> { ... }` or `mod <foo>;` item.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue