Compiler bug disappears on clean build

Hi,

I've hit a compiler bug that disappears when I run cargo clean then cargo build. That's makes it impossible to check whether the bug is still around in nightly rust (I'm using 1.48.0), since building with another compiler re-builds all the artifacts. It's also difficult to get others to reproduce the problem! Any tips on how to deal with this?

Thanks very much, Michael

This looks like an incremental build problem. The only way I've found to solve this is to take a snapshot of everything (including the target dir), and then starting debugging, reloading this save whenever the bug disappears. Usually I do this by starting a new branch and committing regularly. Reverting to the previous commit when the problem disappears.

I don't think this will work across toolchain versions. At best the compiler will refuse to load it, at worst it will be unsound: ICE: incremental builds of rustc itself see state serialized by a different rustc · Issue #76720 · rust-lang/rust · GitHub. Either way it will be very difficult to tell an actual bug apart from the ABI being different.

1 Like

Normally I do this by looking for the line where the compiler panics and then searching for it in GitHub issues. Happy to hear other suggestions :slight_smile: