Paul Krill
Editor at Large

Rust types team moves forward on next-gen trait solver

news
Jul 2, 20242 mins

Team reports getting close to compiling the standard library and the compiler with the new solver enabled everywhere.

rust king iron bronze crown royal queen
Credit: Gratisography

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.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author