rust/compiler/rustc_expand
Esteban Küber 69fb612608 Keep track of parse errors in mods and don't emit resolve errors for paths involving them
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.
2024-12-10 18:17:24 +00:00
..
src Keep track of parse errors in mods and don't emit resolve errors for paths involving them 2024-12-10 18:17:24 +00:00
Cargo.toml Move some tests from rustc_expand to rustc_parse. 2024-05-06 09:06:02 +10:00
messages.ftl Tweak expand_incomplete_parse warning. 2024-10-28 14:12:45 +11:00