next-trait-solver

Analyze Rust's trait solver architecture, evaluation loop, and candidate assembly.

2|1|Updated Apr 27, 2026
One-click install
npx skills add https://github.com/nikomatsakis/sage-dev --skill next-trait-solver
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: next-trait-solver
Source: https://github.com/nikomatsakis/sage-dev/tree/main/.agents/skills/next-trait-solver
Command: npx skills add https://github.com/nikomatsakis/sage-dev --skill next-trait-solver

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides comprehensive insights into rustc's next-generation trait solver, aiding in the understanding and development of trait resolution, type normalization, and coherence checking in Rust.

Core Features & Use Cases

  • Understanding Trait Solver: Offers an in-depth look at rustc_next_trait_solver and rustc_type_ir crates.
  • Implementation Guidance: Helps in designing or implementing trait resolution, type normalization, and associated type normalization.
  • Use Case: A developer looking to implement an alternative Rust frontend or analysis tool would find this Skill invaluable for understanding the solver's inner workings.

Quick Start

Use the next-trait-solver skill to learn about the architecture of rustc's trait solver and how it works under the hood.

Frequently Asked Questions about next-trait-solver

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How does the Rust trait solver architecture work under the hood?

The Rust trait solver architecture operates through an evaluation loop, candidate assembly, and canonicalization to resolve traits and discharge obligations. It provides the internal mechanisms needed for type normalization and coherence checking.

What is canonicalization in Rust's next-generation trait solver?

Canonicalization in the Rust trait solver is the process of extracting and isolating unknown variables to enable caching and reusing query results during trait resolution. It allows the evaluation loop to process obligations generically.

How do I implement type normalization for an alternative Rust frontend?

To implement type normalization for an alternative Rust frontend, you must understand the rustc_next_trait_solver and rustc_type_ir crates. This Skill details how associated type normalization and trait resolution are executed within the solver.

Can I use this trait solver analysis for Rustc coherence checking?

Yes, this analysis is tailored for developers involved in Rustc coherence checking and obligation discharge. It details how the evaluation loop assembles candidates to validate trait implementations.

What is the best way to understand candidate assembly in the Rust trait solver?

The best way to understand candidate assembly is by examining the evaluation loop within rustc's next-generation trait solver. The architecture reveals how potential candidates are gathered and evaluated to satisfy trait obligations.