Login
You're viewing the fosstodon.org public feed.
  • Nov 18, 2026, 4:28 AM

    This work was envisioned several years ago, discussed endlessly between different people in the project, gathering requirements and trying to come up with a useful design. In a very real sense, this really started with @soph's work over a decade ago, when she led the work to overhaul the design vocabulary of Rust diagnostics blog.rust-lang.org/2016/08/10/. Her original work still looms and underpins everything that has come since, and the flexibility of that design allowed for separating the semantic content of errors from their rendering, which meant that changing how things *look* doesn't require any changes to `rustc`. The work we've already done in evolving the content of diagnostics, like shown in kobzol.github.io/rust/rustc/20 and that you could see for yourself by running git.donsz.nl/jana/errorversion, already does the heavy lifting.

    I recall starting conversations about having an output suitable using assistive technologies like screen-readers on almost every RustConf and RustWeek I've attended, specially spending time with @epage and @muscraft hunched over laptops on cardboard tables or arguing over tikka masala and beers on what the best design could be. There's plenty of prior art, but one example is from @zkat's Miette, another diagnostic renderer for Rust: toot.cat/@zkat/115584770971710. I *believe* they are the ones that came up with the `NO_GRAPHICS=1` environment flag, mimicking `NO_COLOR=1` no-color.org/.

    #RustLang #Rust

    💬 1🔄 9⭐ 16

Replies

  • Nov 18, 2026, 4:30 AM

    This was also partly made possible by the use of annotate-snippets-rs. crates.io/crates/annotate-snip

    That crate effectively started life as a copy of `rustc`'s own home grown renderer, quirks and all. Manish Goregaokar made the effort of introducing it as a dependency in `rustc` with the objective of eventually deprecating the custom one. But that objective remained elusive for years. It turns out that making a general purpose renderer is hard, and in the meantime I kept adding custom behavior into `rustc`'s renderer to account for the myriad corner cases that terminals expose us to (reminder that `rustc` separates Unicode families—for good reasons play.rust-lang.org/?version=st). But after @muscraft took over the project, progress accelerated significantly. Little by little he whittled away all of the differences, all the corner cases and hacks and cruft that had accumulated over the years, significantly improved the codebase, to the point that we could switch `rustc` to use annotate-snippets-rs exclusively. Today, the `rustc` renderer has been removed, and All Is Right With The World.

    Having the renderer in a separate repo meant that iterating on designs didn't require recompiling *all of `rustc`*, and that experiments could be done independently of what `rustc` needed.

    #RustLang #Rust

    💬 1🔄 0⭐ 6
  • Nov 18, 2026, 4:30 AM

    These efforts culminated in a rapid-fire sequence of PRs. Support in annotate-snippets-rs landed in github.com/rust-lang/annotate-.

    The Rust Compiler Team approval happened in github.com/rust-lang/compiler-. `rustc` support landed in github.com/rust-lang/rust/pull. `cargo` support landed in github.com/rust-lang/cargo/pul. And as of a couple of hours ago, all of these pieces landed on nightly. The tracking issue for stabilizing this new output is at github.com/rust-lang/rust/issu, but that will require some bake time, and addressing any issues that will innevitably come up.

    As additional context, this work is also similar to the Unicode-art output that is also in nightly. That one was, if anything, easier: all it had to do was add some logic for the more expressive power of Unicode Box Drawing characters over ASCII, but the output didn't *fundamentally* change. It is barely a face-lift.

    #RustLang #Rust

    💬 1🔄 0⭐ 4
  • Nov 18, 2026, 4:31 AM

    Overall, I'm really happy with the results. Scott did a great job evolving the design beyond what I'd originally envisioned, and had a lot of patience receiving my nitpicks and requests for improvements before a single PR had even landed anywhere.

    I want to reiterate my request for feedback and my sincere apology this took so long.

    #RustLang #Rust #a11y #Accessibility

    💬 2🔄 0⭐ 14
  • 💬 1🔄 2⭐ 2
  • Nov 18, 2026, 5:02 AM

    @muscraft @ekuber Okay, while we're talking. Is there a reason it's indented? It doesn't bother me much and could actually be a convenient shortcut thanks to NVDA add-ons like indent nav, but am wondering if the two spaces before the location of an error is for any particular reason? (yes, I notice every character, haha).

    💬 1🔄 0⭐ 2
  • Nov 18, 2026, 5:14 AM

    @TheQuinbox @muscraft Part of the thought is similar to it also supporting color: we expect people who just want less verbose output to also use this. Visually it helps people scanning see a hierarchy. We were also hoping that it would help tooling notice structure from the indentation, which from the sound of it it would? And yes, I am impressed. I think that even most sighted people might not even notice the 1 or 2 char leading whitespace 😁

    💬 3🔄 0⭐ 2
  • 💬 0🔄 0⭐ 4
  • Nov 18, 2026, 12:18 PM

    @ekuber @TheQuinbox @muscraft A principle for all of us that I want to emphasize is that this is for screen readers. We will only improve things for other use cases so long as they don't compromise our screen reader support.

    💬 0🔄 0⭐ 4
  • 💬 0🔄 0⭐ 1
  • Nov 18, 2026, 5:31 AM

    @ekuber Iterating closely on design before merging code pays off immensely for usability. It will be interesting to see how other compiled languages handle similar terminal constraints.

    💬 1🔄 0⭐ 1
  • 💬 0🔄 0⭐ 3