Rust 1.84 and the quiet rewrite underneath
The next-generation trait solver goes live for coherence checking. Most people will never notice, which is the point.
Rust 1.84 shipped today, and the headline item is a piece of plumbing that almost nobody will consciously interact with: the next-generation trait solver is now used for coherence checking.
If that sentence meant nothing to you, that is fine and arguably intended. Here is why it matters anyway.
what a trait solver does#
When you write impl Display for MyType, the compiler has to answer questions like: does this impl overlap with another one? Can this generic bound be satisfied? Is this associated type equal to that one? The component answering those questions is the trait solver, and the old one grew organically over a decade of Rust's life. It has known unsoundness holes, it has performance cliffs, and it has behaviors nobody can fully explain including the people who wrote it.
The new solver is a ground-up reimplementation with a proper handling of cycles, coinduction, and caching. Coherence checking — the "do these two impls conflict" question — is the first place it has been switched on by default, because coherence is a relatively contained problem where a regression shows up loudly at compile time rather than quietly at runtime.
what you might actually see#
A very small number of crates will now get errors they did not get before, because the old solver was accepting impls it should not have. That is a fix, not a regression, but it will feel like a regression if it happens to you. The release notes flag it.
Also in this release:
- Strict provenance APIs stabilize.
ptr::with_addr,ptr::addr,ptr::map_addrand friends. This is the vocabulary for expressing pointer arithmetic in a way that does not launder provenance through an integer, which matters enormously for Miri, for CHERI-style hardware, and for anyone whose code is going to be checked by a tool smarter than themselves. - Cargo respects the
rust-versionfield when resolving dependencies. The MSRV-aware resolver will now prefer a dependency version compatible with your declared minimum Rust version instead of picking the newest and detonating. This has been requested for years and quietly fixes a real papercut for anybody supporting older toolchains.
[package]
rust-version = "1.75" # cargo now actually uses this during resolutionthe pattern worth noticing#
Rust's release train has settled into a rhythm where the exciting user-facing features arrive in editions and the intervening six-week releases carry structural work. 1.84 is almost entirely structural. The new solver has been in development for something like three years and is being landed one surface at a time, with the more invasive switch — using it everywhere, not just coherence — still ahead.
That is how you replace a load-bearing component in a language with a stability guarantee. Slowly, in public, with the ability to flip back. It is unglamorous and it is the reason people trust the toolchain.
Rust 2024 edition lands with 1.85 next month, and that one will be noisy.
— Dom, January 9, 2025