Lints should be initialized via derived Default wherever possible #60181
Labels
A-lint
Area: Lints (warnings about flaws in source code) such as unused_mut.
C-cleanup
Category: PRs that clean code up or issues documenting cleanup.
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
As mentioned in this PR #60152 all the lints implementing
new
to just returnSelf
with empty/default values should use#[derive(Default)]
instead to achieve semantic compression.Example of such a lint
https://github.com/rust-lang/rust/blob/master/src/librustc_lint/builtin.rs#L553
Lint is then instantiated here
https://github.com/rust-lang/rust/blob/master/src/librustc_lint/lib.rs#L135
The text was updated successfully, but these errors were encountered: