一句话:Argus 将 Rust trait 推断失败的搜索树交互式可视化,按不同调试目标提供多视图,显著提升错误定位效率。
在支持类型类(trait)的语言中,类型推断失败时的编译器诊断往往晦涩甚至无用,因为推断过程中引入了复杂的搜索。Argus 将 trait 推断的搜索树交互式可视化,帮助程序员调试推断失败。其核心洞察是摒弃“一刀切”的诊断模式,针对不同调试目标(如定位冲突的 impl、追踪 obligation 的来源)提供不同视图;并通过界面默认值与启发式提升调试效率,例如默认不显示类型的完整路径、按预期修复复杂度对 obligation 排序。作者在真实 Rust 程序上开展 N=25 的用户研究,结果显示使用 Argus 的被试正确定位的故障数量是不使用时的 2.2 倍,定位速度提升 3.3 倍。
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 .
@article{paperbot3075,
title = {An Interactive Debugger for Rust Trait Errors},
author = {Gavin Gray and Will Crichton and Shriram Krishnamurthi},
journal = {Proceedings of the ACM on Programming Languages},
volume = {9},
number = {PLDI},
year = {2025},
doi = {10.1145/3729302}
}