Dev

Rust types team moves forward on next-gen trait solver


The Rust types team has made significant progress on the next-generation trait solver, according to a June 26 blog post.

Work done to stabilize the use of the next-generation trait solver in coherence checking surfaced small behavior regressions and hangs, which caused delays. But the team is close to compiling the standard library and the compiler with the new solver enabled everywhere. They expect a long tail of minor issues and behavioral differences from the existing implementation. There also are open design questions that will need to be resolved prior to stabilizing the new implementation. The goal is to use the next-generation trait solver everywhere by default.

Announced in January 2023, the Rust types team deals with parts of the Rust language and compiler involving the type system including type checking, trait solving, and borrow checking. Goals include working to make the type system sound, fast, consistent, and extensible. Priorities of the types team include making the type system sound, fast, consistent, and extensible. The types team is a subteam of the language and compiler teams.

The Rust types team also reports it has stabilized async-fn in traits and return-position impl Trait in traits in Rust 1.75. Improvements have been made in the way generators and async functions are represented in the type system. Designing the next-generation trait solver surfaced issues and future compatibility challenges of the type-alias implementation using the old trait solver. Work is being done to rework the design and implementation.

Multiple longstanding unsound issues were fixed, the most notable being unsoundness of type checking of trait impls. This subtle issue caused the team to accept methods pertaining to the function signature. The team, meanwhile, is categorizing remaining open issues and integrating them into long planning.

Copyright © 2024 IDG Communications, Inc.



READ SOURCE

This website uses cookies. By continuing to use this site, you accept our use of cookies.