1
Fork 0
rust/compiler/rustc_expand/src
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
..
mbe Prepare for invisible delimiters. 2024-11-21 08:22:11 +11:00
base.rs ensure that all publicly reachable const fn have const stability info 2024-11-10 10:16:26 +01:00
build.rs Auto merge of #131723 - matthiaskrgr:rollup-krcslig, r=matthiaskrgr 2024-10-15 11:50:31 +00:00
config.rs Introduce Enabled{Lang,Lib}Feature 2024-10-25 10:30:37 +08:00
errors.rs Tweak expand_incomplete_parse warning. 2024-10-28 14:12:45 +11:00
expand.rs 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
lib.rs Add warn(unreachable_pub) to rustc_expand. 2024-08-27 12:40:38 +10:00
mbe.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
module.rs 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
placeholders.rs Introduce default_field_values feature 2024-12-09 21:55:01 +00:00
proc_macro.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
proc_macro_server.rs Introduce InvisibleOrigin on invisible delimiters. 2024-11-21 08:16:54 +11:00