-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Closed
Labels
A-frontendArea: Compiler frontend (errors, parsing and HIR)Area: Compiler frontend (errors, parsing and HIR)A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Due to module loading parser has to do some not very appropriate for a parser things like
- expanding
cfg
s on modules (duplicated with expansion) - keeping the current filesystem position (duplicated with expansion)
We also don't really need to load those files until we need to incorporate their contents into NodeId
-entified AST, which happens during expansion.
The move will also mean never loading files in unconfigured code.
The loading is currently skipped only if cfg
is placed directly on the mod m;
, but not in other cases like
#[cfg(FALSE)]
mod m {
mod n; // Still loaded
}
matklad and Xanewokmatklad
Metadata
Metadata
Assignees
Labels
A-frontendArea: Compiler frontend (errors, parsing and HIR)Area: Compiler frontend (errors, parsing and HIR)A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.