Commit graph

4 commits

Author SHA1 Message Date
Vadim Petrochenkov
8d5109aa6e compiletest: Support matching on diagnostics without a span 2025-03-25 17:33:09 +03:00
Esteban Küber
27420c69d8 Silence use foo::Bar; error if Bar isn't found in foo and foo.rs has parse errors 2024-12-10 18:18:03 +00:00
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
Esteban Küber
3f52583c6a Add test for resolve errors caused by mod with parse errors 2024-12-10 18:00:11 +00:00