Skip to content

Allow lints to declare that they're pure #59024

Open
@Manishearth

Description

Clippy and rustc both have a bunch of allow by default lints. Due to the way lint passes work, these have to be run even if never enabled, since lint passes may store state between check_foo calls.

Most lints don't do this, most lints are zero-sized.

It would be nice to allow LintPasses to declare that they are "pure", and have rustc omit allowed pure passes from the list of lint passes until enabled. This has some performance benefits but would also allow for incremental linting if we ever want that.

cc @Zoxc @oli-obk

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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-compilerRelevant to the compiler 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