diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2021-12-01 20:57:43 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-01 20:57:43 +0100 |
| commit | 519a842c501cc8fefce3fb14ddcbcded7d66c4e6 (patch) | |
| tree | 6d1ad786d94b25a054af659833559cd606315154 /compiler/rustc_parse/src/parser | |
| parent | 9f1f42897d0e0ae580f2e49a1b46fad27b60990e (diff) | |
| parent | 141c6cc78ece04fb8330b2c28a42c025500d2d0e (diff) | |
| download | rust-519a842c501cc8fefce3fb14ddcbcded7d66c4e6.tar.gz rust-519a842c501cc8fefce3fb14ddcbcded7d66c4e6.zip | |
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`
Diffstat (limited to 'compiler/rustc_parse/src/parser')
| -rw-r--r-- | compiler/rustc_parse/src/parser/item.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/item.rs b/compiler/rustc_parse/src/parser/item.rs index 24a8df49ac7..cbeaf675be4 100644 --- a/compiler/rustc_parse/src/parser/item.rs +++ b/compiler/rustc_parse/src/parser/item.rs @@ -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. |
