rust/compiler/rustc_resolve
Josh Triplett c99320156d Refactor lint buffering to avoid requiring a giant enum
Lint buffering currently relies on a giant enum `BuiltinLintDiag`
containing all the lints that might potentially get buffered. In
addition to being an unwieldy enum in a central crate, this also makes
`rustc_lint_defs` a build bottleneck: it depends on various types from
various crates (with a steady pressure to add more), and many crates
depend on it.

Having all of these variants in a separate crate also prevents detecting
when a variant becomes unused, which we can do with a dedicated type
defined and used in the same crate.

Refactor this to use a dyn trait, to allow using `LintDiagnostic` types
directly.

This requires boxing, but all of this is already on the slow path
(emitting an error).

Because the existing `BuiltinLintDiag` requires some additional types in
order to decorate some variants, which are only available later in
`rustc_lint`, use an enum `DecorateDiagCompat` to handle both the `dyn
LintDiagnostic` case and the `BuiltinLintDiag` case.
2025-08-22 01:59:56 -07:00
..
src Refactor lint buffering to avoid requiring a giant enum 2025-08-22 01:59:56 -07:00
Cargo.toml Rollup merge of #144746 - petrochenkov:extpreltidy, r=b-naber 2025-08-04 11:24:39 +10:00
messages.ftl Rollup merge of #145166 - makai410:teach-pub-crate, r=lcnr 2025-08-19 19:42:08 +08:00