Tracking Issue for `LintDiagnostic` migration
Open
@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
- The original PR that was split up: https://github.com/rust-lang/rust/pull/152811
- https://github.com/rust-lang/rust/pull/152933
- https://github.com/rust-lang/rust/pull/153016
- https://github.com/rust-lang/rust/pull/153051
- https://github.com/rust-lang/rust/pull/153091
- https://github.com/rust-lang/rust/pull/153152
- https://github.com/rust-lang/rust/pull/153352
- https://github.com/rust-lang/rust/pull/153401
- https://github.com/rust-lang/rust/pull/153452
- https://github.com/rust-lang/rust/pull/153509
- https://github.com/rust-lang/rust/pull/153621
- https://github.com/rust-lang/rust/pull/153787
- https://github.com/rust-lang/rust/pull/153820
Removing BuiltinLintDiag
- https://github.com/rust-lang/rust/pull/154120
- https://github.com/rust-lang/rust/pull/154224
- https://github.com/rust-lang/rust/pull/154303
- https://github.com/rust-lang/rust/pull/154336
- https://github.com/rust-lang/rust/pull/154376
- https://github.com/rust-lang/rust/pull/154912
Removing AttributeLintKind
- https://github.com/rust-lang/rust/pull/154432
- https://github.com/rust-lang/rust/pull/155504
- https://github.com/rust-lang/rust/pull/155529
- https://github.com/rust-lang/rust/pull/155560
- https://github.com/rust-lang/rust/pull/155590
- https://github.com/rust-lang/rust/pull/155661
- https://github.com/rust-lang/rust/pull/155706
- https://github.com/rust-lang/rust/pull/155760
Cleanup
- https://github.com/rust-lang/rust/pull/155936
- https://github.com/rust-lang/rust/pull/155949
- https://github.com/rust-lang/rust/pull/156002
TODO list
- See if we can remove the span argument from
opt_span_diag_linthttps://github.com/rust-lang/rust/pull/153091#discussion_r2854619230- Possible but because of
lint_level, we will need to updateDiagnostic::into_diagso that it looks like:
That will allow to return early on and in particular skipfn into_diag<F: FnOnce(Span) -> bool>(self, dcx: DiagCtxtHandle<'a>, level: Level) -> Option<Diag<'a, G>>Tytranslation into diagnostic message, which would callDiagCtxt::set_must_produce_diag, forcing theDiagto be emitted. So before it's even possible, we need to ensure that theDiagwill actually be emitted, and if not, we return early withNone.
- Possible but because of
- See if we can get rid of
BuiltinLintDiagin 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.