Description
For users hitting this bug: please read this blog post which discusses what you can do. An excerpt is below:
The Internal Compiler Error asks you to report a bug, and if you can do so, we still want that information. We want to know about the cases that are failing.
But regardless of whether or not you file a bug, the problem here can be resolved by either:
- deleting your incremental compilation cache (e.g. by running
cargo clean
for the whole project orcargo clean -p crate-causing-the-error
), or - force incremental compilation to be disabled, by setting
CARGO_INCREMENTAL=0
in your environment or settingbuild.incremental
tofalse
in your$HOME/.cargo/config.toml
file (which might also be called$HOME/.cargo/config
) by adding this:
build.incremental = 'false'
We recommend that users of 1.52.0 disable incremental compilation, to avoid running into this problem.
We do not recommend that users of 1.52.0 downgrade to an earlier version of Rust in response to this problem. There is at least one instance of a silent miscompilation caused by incremental compilation that was not caught until we added the fingerprint checking.
I believe the (new) ICEs as a result of improved error detection in the incremental code will land in 1.53 onto stable, which is in 6 weeks. We are unlikely to fix all of the fallout (i.e. all bugs, at least 25 of which are currently open, though some are duplicates) by that time and be willing to backport the fixes. I suspect we are also unlikely to want to disable the new assertions; they are catching known unsoundness. I am opening this issue to discuss possible alternatives, which are hopefully more user friendly than the current ICE.
I think one direct improvement is to adjust the panic/assert on encountering this to be a proper compile error, which can tell the user that they should (for example) delete the incremental directory and invoke the compiler again. This is already a significant improvement over the current message, I suspect. We can still ask that they file a bug report.
We should also consider if it's worth considering applying performance-hurting mitigations; it seems definitely true we can drop incremental support on beta/stable until these bugs are fixed, but perhaps a smaller hammer is also viable.
Table of ICEs:
Issue | Query name | Has MCVE | PR fixing issue | fixed in 1.5x? | PR adding regression test | Done |
---|---|---|---|---|---|---|
#83259 | predicates_of |
✅ | #84233 | 1.53 | #84233 | ✅ |
proc_macro_decls_static |
N/A | |||||
#83126 | extern_mod_stmt_cnum |
mcve-83126 | #83153 | 1.52 | None yet | ❌ |
#85197 | optimized_mir |
mcve-85197 | #85211 | 1.54 | #85211 | ✅ |
#84225 | exported_symbols |
? | #84226 | 1.53 | None yet | ❌ |
#85019 | item_children |
? | #83901 | 1.54 | None yet | ❌ |
#83538 | evaluate_obligation (EvaluatedToOk and EvaluatedToOkModuloRegions ) |
✅ | #85186 | 1.54 | #85186 | ✅ |
#84963 | evaluate_obligation (OverflowError ) |
✅ | None yet | ? | None yet | ❌ |
native_libraries |
? | #85702 | 1.54 | #85702 | ✅ | |
#85360 | evaluate_obligation | ✅ | #85868 | 1.56 | #91065 | ✅ |
cc @Aaron1011 (driver of fixing the bugs, I believe)
cc @pnkfelix @wesleywiser (T-compiler leads)
cc @rust-lang/release for awareness
Activity