about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2021-10-17 19:32:34 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2021-11-28 15:48:55 +0800
commit141c6cc78ece04fb8330b2c28a42c025500d2d0e (patch)
treee018a0cf0be39dee3946397bef2ea965210a72f8 /compiler/rustc_parse/src/parser
parent4919988fe1765e51232558647f2260fff3544658 (diff)
downloadrust-141c6cc78ece04fb8330b2c28a42c025500d2d0e.tar.gz
rust-141c6cc78ece04fb8330b2c28a42c025500d2d0e.zip
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.
Diffstat (limited to 'compiler/rustc_parse/src/parser')
-rw-r--r--compiler/rustc_parse/src/parser/item.rs2
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.