
When we expand a `mod foo;` and parse `foo.rs`, we now track whether that file had an unrecovered parse error that reached the end of the file. If so, we keep that information around. When resolving a path like `foo::bar`, we do not emit any errors for "`bar` not found in `foo`", as we know that the parse error might have caused `bar` to not be parsed and accounted for. When this happens in an existing project, every path referencing `foo` would be an irrelevant compile error. Instead, we now skip emitting anything until `foo.rs` is fixed. Tellingly enough, we didn't have any test for errors caused by `mod` expansion. Fix #97734.
8 lines
274 B
Text
8 lines
274 B
Text
error: circular modules: $DIR/circular_modules_main.rs -> $DIR/circular_modules_hello.rs -> $DIR/circular_modules_main.rs
|
|
--> $DIR/circular_modules_hello.rs:4:1
|
|
|
|
|
LL | mod circular_modules_main;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: aborting due to 1 previous error
|
|
|