An Interactive Debugger for Rust Trait Errors

Gavin Gray, Will Crichton, Shriram Krishnamurthi

ACM SIGPLAN Conference on Programming Language Design and Implementation, 2025

Abstract

Compiler diagnostics for type inference failures are notoriously bad, and type classes only make the problem worse. By introducing a complex search process during inference, type classes can lead to wholly inscrutable or useless errors. We describe a system, ARGUS, for interactively visualizing type class inferences to help programmers debug inference failures, applied specifically to Rust’s trait system. The core insight of ARGUS is to avoid the traditional model of compiler diagnostics as one-size-fits-all, instead providing the programmer with different views on the search tree corresponding to different debugging goals. ARGUS carefully uses defaults to improve debugging productivity, including interface design (e.g., not showing full paths of types by default) and heuristics (e.g., sorting obligations based on the expected complexity of fixing them). We evaluated ARGUS in a user study where N = 25 participants debugged type inference failures in realistic Rust programs, finding that participants using ARGUS correctly localized 2.2× as many faults and localized 3.3× faster compared to not using ARGUS.

Blog

See our post for a quick overview.

Paper

PDF


These papers may differ in formatting from the versions that appear in print. They are made available only to support the rapid dissemination of results; the printed versions, not these, should be considered definitive. The copyrights belong to their respective owners.