Skip to content

Consider more fine grained grouping for built-in lints #45615

Open
@petrochenkov

Description

@petrochenkov

Copying the comment from #45424 (comment):

I've also audited the remaining ungrouped lints.
In principle new lint groups can be created for them, but it looks like fine-grained lint grouping didn't find its use even in clippy, so I didn't do anything.

Unused++.
These can also be quite reasonably added into the unused group, but less obviously than those I added into it in this PR.

STABLE_FEATURES
RENAMED_AND_REMOVED_LINTS
UNKNOWN_LINTS
UNUSED_COMPARISONS

Bad style++.
Probably can be added into the bad_style group, but it currently consists only of casing-related lints.

NON_SHORTHAND_FIELD_PATTERNS
WHILE_TRUE

Future compatibility++.
Errors that are reported as lints for some reasons unknown to me.
See the question in #45424 (comment) as well.

CONST_ERR // ?
UNKNOWN_CRATE_TYPES // Deny-by-default
NO_MANGLE_CONST_ITEMS // Deny-by-default
NO_MANGLE_GENERIC_ITEMS

Restrictions.
Something generally reasonable that can be prohibited if necessary.

BOX_POINTERS // Allow-by-default
UNSAFE_CODE // Allow-by-default
UNSTABLE_FEATURES // Allow-by-default
MISSING_DOCS // Allow-by-default
MISSING_COPY_IMPLEMENTATIONS // Allow-by-default
MISSING_DEBUG_IMPLEMENTATIONS // Allow-by-default

Pedantic.
Something not bad enough to always report/fix.

UNUSED_RESULTS // Allow-by-default
UNUSED_IMPORT_BRACES // Allow-by-default
UNUSED_QUALIFICATIONS // Allow-by-default
TRIVIAL_CASTS // Allow-by-default
TRIVIAL_NUMERIC_CASTS // Allow-by-default
VARIANT_SIZE_DIFFERENCES // Allow-by-default
UNIONS_WITH_DROP_FIELDS

Obvious mistakes.
Prevent foot shooting, some can become hard errors in principle.

OVERFLOWING_LITERALS
EXCEEDING_BITSHIFTS // Deny-by-default
UNCONDITIONAL_RECURSION
MUTABLE_TRANSMUTES // Deny-by-default
IMPROPER_CTYPES
PLUGIN_AS_LIBRARY
PRIVATE_NO_MANGLE_FNS
PRIVATE_NO_MANGLE_STATICS

General purpose lints.

WARNINGS
DEPRECATED

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-enhancementCategory: An issue proposing an enhancement or a PR with one.T-langRelevant to the language team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions