Debugging Trait Errors as Logic Programs
Gavin Gray, Will Crichton

TL;DR
This paper introduces a trait debugger for Rust that extracts and visualizes proof trees from the trait solver to improve diagnosis of complex trait errors, addressing scalability issues in compiler diagnostics.
Contribution
The paper presents a novel interactive trait debugger that visualizes proof trees to help developers diagnose trait errors in Rust more effectively.
Findings
Proof trees can be extracted from the trait solver.
Interactive visualization aids in debugging trait errors.
The tool improves diagnostic clarity for complex trait constraints.
Abstract
Rust uses traits to define units of shared behavior. Trait constraints build up an implicit set of first-order hereditary Harrop clauses which is executed by a powerful logic programming engine in the trait system. But that power comes at a cost: the number of traits in Rust libraries is increasing, which puts a growing burden on the trait system to help programmers diagnose errors. Beyond a certain size of trait constraints, compiler diagnostics fall off the edge of a complexity cliff, leading to useless error messages. Crate maintainers have created ad-hoc solutions to diagnose common domain-specific errors, but the problem of diagnosing trait errors in general is still open. We propose a trait debugger as a means of getting developers the information necessary to diagnose trait errors in any domain and at any scale. Our proposed tool will extract proof trees from the trait solver,…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Logic, programming, and type systems · Software Testing and Debugging Techniques
