Next-generation trait solver - Rust Project Goals (original) (raw)

Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Rust Project Goals

Next-generation trait solver

Summary

Continue work towards the stabilization of -Znext-solver=globally, collecting and resolving remaining blockers. Extend its use in lints and rustdoc.

Motivation

The next-generation trait solver is intended to fully replace the existing type system components responsible for proving trait bounds, normalizing associated types, and much more. This should fix many long-standing (soundness) bugs, enable future type system improvements, and improve compile-times. It's tracking issue is #107374(https://github.com/rust-lang/rust/issues/107374).

The status quo

There are multiple type system unsoundnesses blocked on the next-generation trait solver: project board. Desirable features such as coinductive trait semantics and perfect derive, where-bounds on binders, and better handling of higher-ranked bounds and types are also stalled due to shortcomings of the existing implementation.

Fixing these issues in the existing implementation is prohibitively difficult as the required changes are interconnected and require major changes to the underlying structure of the trait solver. The Types Team therefore decided to rewrite the trait solver in-tree, and has been working on it since EOY 2022.

The next six months

The "shiny future" we are working towards

Design axioms

In order of importance, the next-generation trait solver should be:

Ownership and team asks

Owner: lcnr

Add'l implementation work: Michael Goulet

Support needed from the project

Outputs and milestones

See next few steps :3 while we don't expect to fully stabilize the new solver this year, we expect to get quite close.

Frequently asked questions

What do I do with this space?

This is a good place to elaborate on your reasoning above -- for example, why did you put the design axioms in the order that you did? It's also a good place to put the answers to any questions that come up during discussion. The expectation is that this FAQ section will grow as the goal is discussed and eventually should contain a complete summary of the points raised along the way.