Using mod <name> in <name>.rs leads to "internal compiler error: unexpected failure" #4338
Labels
A-frontend
Area: Compiler frontend (errors, parsing and HIR)
A-resolve
Area: Name/path resolution done by `rustc_resolve` specifically
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
The following code snippet:
will result in the compiler throwing:
with the top line of the backtrace that the error told me to run being:
Removing the mod foo; statement fixes, and is seemingly because of the cyclic import that this causes. Is there a way that self-references using mod can be caught and handled nicely? With something like this sample it's easy to see the error and to debug, but I was chasing a typo in my mod statement for 5 minutes before I found it in my source...
The text was updated successfully, but these errors were encountered: