rust-lang / rust-lang/rust

Tracking Issue for `LintDiagnostic` migration

Open
#153,099 6 comments 0 reactions 2 assignees View on GitHub

@GuillaumeGomez is already working on this.

Since Feb 25, 2026.

A-lints C-tracking-issue
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

This is a tracking issue for the LintDiagnostic migration that @GuillaumeGomez and I are doing.
Mostly meant to be a place we can put ideas and keep track of what is left to do.

Implementation history
Removing BuiltinLintDiag
Removing AttributeLintKind
Cleanup
TODO list
  • See if we can remove the span argument from opt_span_diag_lint https://github.com/rust-lang/rust/pull/153091#discussion_r2854619230
    • Possible but because of lint_level, we will need to update Diagnostic::into_diag so that it looks like:
      fn into_diag<F: FnOnce(Span) -> bool>(self, dcx: DiagCtxtHandle<'a>, level: Level) -> Option<Diag<'a, G>>
      
      That will allow to return early on and in particular skip Ty translation into diagnostic message, which would call DiagCtxt::set_must_produce_diag, forcing the Diag to be emitted. So before it's even possible, we need to ensure that the Diag will actually be emitted, and if not, we return early with None.
  • See if we can get rid of BuiltinLintDiag in favour of a boxed diagnostic of some kind
  • See if we can undo the perf regression in decorate_builtin_lint, maybe by using boxed diagnostics everywhere

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.