Skip to content

Commit f88e5ac

Browse files
authored
Merge pull request #176 from lcnr/main
next solver 2025h1
2 parents 50ef1db + 128287e commit f88e5ac

File tree

1 file changed

+91
-0
lines changed

1 file changed

+91
-0
lines changed

src/2025h1/next-solver.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Next-generation trait solver
2+
3+
| Metadata | |
4+
| --- | --- |
5+
| Owner(s) | @lcnr |
6+
| Teams | [types] |
7+
| Status | Proposed |
8+
| Tracking issue | [rust-lang/rust-project-goals#113] |
9+
10+
11+
## Summary
12+
13+
Continue work towards the stabilization of `-Znext-solver=globally`, collecting and resolving remaining blockers. Extend its use in lints and rustdoc.
14+
15+
## Motivation
16+
17+
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).
18+
19+
### The status quo
20+
21+
There are multiple type system unsoundnesses blocked on the next-generation trait solver: [project board][unsoundnesses]. 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.
22+
23+
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.
24+
25+
### The next six months
26+
27+
- resolve remaining issues affecting our compile-time benchmarks
28+
- fix the failing tests by 'properly' resolving the underlying issues
29+
- `wg-grammar`
30+
- `projection-caching`
31+
- `nalgebra-0.33.0`
32+
- improve performance
33+
- avoid exponential performance hits in all benchmarks
34+
- get most benchmarks to be neutral or improvements
35+
- go through the most popular crates on crates.io and fix any encountered issues
36+
- move additional lints and rustdoc to use the new solver by default
37+
- publicly ask for testing of `-Znext-solver=globally` once that's useful
38+
39+
40+
### The "shiny future" we are working towards
41+
42+
- we are able to remove the existing trait solver implementation and significantly cleanup the type system in general, e.g. removing most `normalize` in the caller by handling unnormalized types in the trait system
43+
- all remaining type system unsoundnesses are fixed
44+
- many future type system improvements are unblocked and get implemented
45+
- the type system is more performant, resulting in better compile times
46+
47+
## Design axioms
48+
49+
In order of importance, the next-generation trait solver should be:
50+
- sound: the new trait solver is sound and its design enables us to fix all known type system unsoundnesses
51+
- backwards-compatible: the breakage caused by the switch to the new solver should be minimal
52+
- maintainable: the implementation is maintainable, extensible, and approachable to new contributors
53+
- performant: the implementation is efficient, improving compile-times
54+
55+
[da]: ../about/design_axioms.md
56+
57+
## Ownership and team asks
58+
59+
**Owner:** @lcnr
60+
61+
Add'l implementation work: @compiler-errors
62+
63+
| Subgoal | Owner(s) or team(s) | Notes |
64+
| ----------------------------------------------- | ----------------------------- | ----- |
65+
| Discussion and moral support | ![Team][] [types] | |
66+
| Work towards stabilization | | |
67+
| ↳ Implementation | @lcnr, @compiler-errors | |
68+
| ↳ Standard reviews | ![Team][] [types] | |
69+
| ↳ FCP decisions on necessary refactorings | ![Team][] [types][] | |
70+
71+
### Support needed from the project
72+
73+
* [Types] team
74+
* review design decisions
75+
* provide technical feedback and suggestion
76+
77+
## Outputs and milestones
78+
79+
See next few steps :3
80+
81+
### Outputs
82+
83+
### Milestones
84+
85+
## Frequently asked questions
86+
87+
### What do I do with this space?
88+
89+
*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.*
90+
91+
[unsoundnesses]: https://github.com/orgs/rust-lang/projects/44

0 commit comments

Comments
 (0)