NewsCrawler.org

Optimizing Rust's new trait solver, explained from the basics

A plot of the wg-grammar benchmark from perf.rust-lang.org between may and august 2026
Image: donsz.nl

The article explains the new trait solver, a large part of the Rust compiler that the Rust project has been replacing. The new solver is set to land in Rust 1.102.0, and before it was stabilized, its performance was a major blocker. A trait solver checks whether a trait bound is satisfied, for example whether a type has the property needed to be cloned.[1]

The Chalk project started with its first commit on July 24, 2015, 72 days after Rust 1.0 was released. Chalk implemented the trait system with a PROLOG-like logic solver[2] and was later sunset in favor of the newer solver. In October 2022 the project to build the new solver began, with the goal of having fewer correctness bugs in the trait system.

The author, who has worked on the new solver full-time for about a year, focuses on its performance, while lcnr leads its stabilization. The text is a written version of his EuroRust 2026 talk, given on October 15, 2026, and it is meant to be understood without prior knowledge. The article also notes a bug open since May 28, 2015, which abuses implied bounds to turn a short lifetime into 'static.

Video from the article: Optimizing rustc's Next Trait Solver - Jana Dönszelmann | EuroRust 2026 · Watch on YouTube

Repository Rust github.com

The Rust programming language: a systems language focused on reliable and efficient software, with its compiler in this repository.

Stars: 122,444Forks: 16,623License: Apache-2.0Updated:

Read the original donsz.nlDiscussion

Discussion

Commenters mostly praised the written version of the talk, which had been shared earlier only as a video. One commenter asked the author to explain why negative trait bounds will never be stabilized, as said in the Q&A, and another criticized the page for loading the video before the text.

Sources

Terms

  1. Prolog — A logic programming language that finds answers by checking known facts and rules.

Published: First seen: Читать по-русски

Open as a page