The Rust compiler team is enabling the next-generation trait solver by default on the nightly channel starting August 22, after nearly four years of development, ahead of a planned stabilization in the coming months. This is described as the largest single change to the compiler since its initial release, replacing internals responsible for proving where-clauses and normalizing associated types. It fixes over 200 known GitHub issues, changes handling of impl Trait and associated types with higher-ranked lifetimes (affecting crates like bevy and minijinja), and brings major compile-time performance work, with the datafusion crate compiling more than 8x faster. Developers can test it via rustup update nightly and disable it with -Znext-solver=coherence, and are asked to report bugs, regressions, or bad diagnostics via a pinned GitHub issue.

6m read timeFrom blog.rust-lang.org
Post cover image
Table of contents
What can I do?What exactly does this mean?

Questions this post answers

How do I disable the next-generation trait solver on Rust nightly if it breaks my build?

Pass -Znext-solver=coherence to rustc, or set RUSTFLAGS=-Znext-solver=coherence, or add it to your project's .cargo/config.toml under rustflags for your target, for example rustflags = ["-Znext-solver=coherence"] under [target.x86_64-unknown-linux-gnu]. This reverts to the old trait solver behavior while keeping the rest of the nightly toolchain. daily.dev helps Rust developers keep pace with nightly toolchain changes like this one.

When does the new Rust trait solver become active on the nightly channel by default?

It becomes accessible on the nightly channel starting Saturday, August 22, though it was already enabled on the compiler's main branch beforehand. Developers could test it earlier by passing -Znext-solver=globally as a command-line argument before that date. Rust developers tracking nightly toolchain rollouts can follow updates like this on daily.dev.

What kind of compile-time performance impact does Rust's next-generation trait solver have?

Performance varies by crate: most of the top 20,000 crates.io crates show effectively the same compile times as the old solver, but trait-heavy crates can see large gains, such as the datafusion crate compiling more than 8x faster. Some previously severe outliers, once more than twice as slow, have improved substantially through recent optimization work, though a few crates remain slightly slower. Developers weighing a nightly Rust upgrade for compile speed can track results like these on daily.dev.

7K Impressions