Skip to content

Use EarlyPassLints from rustc (and clippy) #10971

Open
@HKalbasi

Description

Some lints in rustc work via implementing the EarlyPassLint trait. This trait only needs ast level data and not types or hir level data, so it should be easy to port it, I think.

If this kind of lint implementation (each lint provides some functions, for example check_expr, check_block, check_ident, ... function, that RA should call it for each changed expression, block, ...) is ok performance-wise for ide usage (I think a small change leads to small expressions become invalidated, but I'm not sure), reusing them from rustc and clippy would save some effort and bring some consistency between rustc and RA diagnostics. With future unification of RA and rustc, we can think about porting other lints as well.

  • list of rustc lints that implements EarlyPassLint: link
  • list of clippy lints that implements EarlyPassLint: link (Some of these lints are already implemented in RA, like redundant field name, we may want to select a few others)

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-diagnosticsdiagnostics / error reportingC-ArchitectureBig architectural things which we need to figure up-front (or suggestions for rewrites :0) )C-featureCategory: feature requestE-hardS-unactionableIssue requires feedback, design decisions or is blocked on other workfunA technically challenging issue with high impact

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions