Skip to content

Don't run allowed lints #74704

Description

@jyn514

First noticed in https://rust-lang.zulipchat.com/#narrow/stream/247081-t-compiler.2Fperformance/topic/Output.20of.20.60collector.20eprintln.60/near/204875468. If a lint is allowed, there is no need to run the lint pass. This could have large performance improvements for any crate where all lints are allowed (e.g. any dependency compiled by cargo, which uses --cap-lints allow).

As a first pass this could check for --cap-lints allow and run no lints if so. In the future it could skip individual lints. Rustc would have to be careful not to skip lints that are #![allow]ed at the crate level but re-enabled for individual items.

The implementation would look similar to what I did in #73566 - override the query provider for lint_mod so that it doesn't run lints at all.

Activity

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

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.I-compiletimeIssue: Problems and improvements with respect to compile times.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