Unfortunately it’s far more complicated than just the versions of the library. The internals forum thread I linked goes into more details, but in short:
Rust doesn’t (yet) have a stable ABI (binary interface), so the compilation results can be different based on compiler version, optimisation flags, statically included files, target platform and position of the moon.
A proper cache must account for all of that, and cargo’s directory structure currently only looks at target platform and debug-vs-release.
I.e. after a
rustup update your cache needs to know to NOT reuse things. Otherwise the errors that result can be absolutely Byzantine to debug (along the lines of “why does
println("hello") cause a segfault?!?”)