Skip to content

Tracking Issue for LintDiagnostic migration #153099

@JonathanBrouwer

Description

@JonathanBrouwer

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

TODO list

  • See if we can remove the span argument from opt_span_diag_lint Migration of LintDiagnostic - part 4 #153091 (comment)
    • 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

Metadata

Metadata

Labels

A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFC

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions