Skip to content

Use annotate-snippets as the default emitter #947

@Muscraft

Description

@Muscraft

Proposal

annotate-snippets has been the default emitter on nightly for nearly a month (2025-11-07), and has proven to be capable of being Rust's default diagnostic emitter. In the time that it has been on nightly, there have only been four issues related to it:

  • #148643, #148684, and #148732 were all caused by a typo/bad copy-paste, which uncovered a second bug relating to spans crossing file boundaries. #148735 addressed both bugs.
  • #149304 was caused by out-of-bounds spans coming from lossy UTF-8 conversion getting passed to annotate-snippets. This issue was fixed by #149321

Given the good track record so far, I would like to propose that annotate-snippets be used as the default emitter on stable. I do not foresee there being many more issues, mainly because annotate-snippets shares much of its internals with Rust's current emitter. If any more problems do come up, they would be at worst an ICE, and would more than likely happen during error reporting, when the compilation is probably failing anyway.

Note: This will miss the upcoming branch for 1.93.0, which means it will get another ~6 weeks of testing on nightly

Mentors or Reviewers

I (@Muscraft) am currently maintaining annotate-snippets and will happily handle any changes/fixes that need to be made.

Process

The main points of the Major Change Process are as follows:

  • File an issue describing the proposal.
  • A compiler team member who is knowledgeable in the area can second by writing @rustbot second or kickoff a team FCP with @rfcbot fcp $RESOLUTION.
  • Once an MCP is seconded, the Final Comment Period begins.
    • Final Comment Period lasts for 10 days after all outstanding concerns are solved.
    • Outstanding concerns will block the Final Comment Period from finishing. Once all concerns are resolved, the 10 day countdown is restarted.
    • If no concerns are raised after 10 days since the resolution of the last outstanding concern, the MCP is considered approved.

You can read more about Major Change Proposals on forge.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-compilerAdd this label so rfcbot knows to poll the compiler teammajor-changeA proposal to make a major change to rustcmajor-change-acceptedA major change proposal that was acceptedto-announceAnnounce this issue on triage meeting

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions