Rollup merge of #69838 - Centril:expand-module, r=petrochenkov
Expansion-driven outline module parsing
After this PR, the parser will not do any conditional compilation or loading of external module files when `mod foo;` is encountered. Instead, the parser only leaves `mod foo;` in place in the AST, with no items filled in. Expansion later kicks in and will load the actual files and do the parsing. This entails that the following is now valid:
```rust
#[cfg(FALSE)]
mod foo {
mod bar {
mod baz; // `foo/bar/baz.rs` doesn't exist, but no error!
}
}
```
Fixes https://github.com/rust-lang/rust/issues/64197.
r? @petrochenkov
This commit is contained in:
commit
23b79d83f2
47 changed files with 601 additions and 593 deletions
|
|
@ -1,8 +1,8 @@
|
|||
error[E0583]: file not found for module `module_that_doesnt_exist`
|
||||
--> $DIR/E0583.rs:1:5
|
||||
--> $DIR/E0583.rs:1:1
|
||||
|
|
||||
LL | mod module_that_doesnt_exist;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: to create the module `module_that_doesnt_exist`, create file "$DIR/module_that_doesnt_exist.rs"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue