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 can be worked around on your end by either:
- upgrading to 1.52.1, if you have not yet done so (which will disable
incremental for you), or
- deleting your incremental compilation cache (e.g. by running
cargo clean), or
- forcing incremental compilation to be disabled, by setting
CARGO_INCREMENTAL=0 in your environment or build.incremental to false in the config.toml.
We recommend that users of 1.52.0 upgrade to 1.52.1, which disables incremental
compilation.
We do not recommend that users of 1.52.0 downgrade to an earlier version of Rust in response to this problem. As noted above, there is at least one instance of a silent miscompilation caused by incremental compilation that was not caught until we added the fingerprint checking.
If a user is willing to deal with the incremental verification ICE’s, and wishes
to opt back into the 1.52.0 behavior, they may set RUSTC_FORCE_INCREMENTAL to
1 in their environment. The Rust compiler will then respect the
-Cincremental option passed by Cargo, and things will work as before, though
with the added verification. Note that this flag does not enable incremental if
it has not already been separately enabled (whether by Cargo or otherwise).
If you are currently using a toolchain prior to 1.52.0, and wish to continue
doing so, we recommend that you disable incremental compilation to avoid hitting
silent miscompilations.
On all Rust builds since incremental has landed, it has been a major
improvement to compile times for many users, and has only improved over time. We
acknowledge that the workarounds presented here and recommendations are painful,
and will be working hard to ensure the situation is as temporary as possible.