Evolution of Rust Compiler Errors

https://news.ycombinator.com/rss Hits: 10
Summary

I recently attended RustWeek (which was totally awesome) and the talks by Alex Crichton (on the history of Rust) and Pietro Albini (on the importance of error messages) inspired me to do a little archaeology into the way Rust compiler messages have evolved over time. I wrote a script that downloaded all stable Rust releases all the way back to 1.0, executed each stable version of the compiler on a set of small programs containing an error and gathered the compiler standard (error) output. The widget below visualizes how the error messages evolved over time. You can use the select box to examine different Rust programs to see their error: Moved variable Wrong field Missing implementation Swapped arguments Wrong argument type Borrow check error Missing where bound Unused variable There are a couple of interesting things to note: First and foremost, the error messages are simply great. If you have used Rust previously, this probably isn’t too surprising. Even Rust 1.0.0 contained pretty solid error reporting, and it got much better over time. Rust 1.2.0 introduced numerical error codes. Rust 1.26.0 introduced colorful error messages. It sounds like a small change, but you can see what an improvement it makes! It also added the rustc --explain <error-code> hint. The error messages sometimes went a bit back and forth in different Rust versions, which is a bit funny. For example, the error: aborting due to 2 previous errors has switched to ...previous error(s) in 1.19.0 and then back to ...2 previous errors in 1.20.0, which seems like an unintended change in 1.19.0. Sometimes the difference is only in a single space, which is not even visible in the visualization above. The error spans are also continuously being improved between rustc versions. My favourite example is the Wrong field program change in 1.87.0. But I think that ultimately, the most interesting thing about this is the evolution process of these messages itself, which demonstrates that a lot of effort has to...

First seen: 2025-05-16 15:43

Last seen: 2025-05-17 00:45