trailofbits / trailofbits/dylint

Allow simultaneous usage of `EarlyLintPass` and `LateLintPass`

Open
#1,908 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Rust
Stars
661
Forks
61
Avg merge
22h 13m
Merged PRs (30d)
28

Description

I've seen this pattern in some clippy lints, and I don't have any idea what the reason for this "restriction" is.

Why do I ask?
I am writing now a lint that checks the path value from dropshot::endpoint which is proc-macro-attribute and warns when a user tries to use bad patterns, e.g., passes the ID value in json instead of the path. In EarlyLintPass I have access to ast, where the attribute is located. But I don't have access to hir type info to check argument types for some pattern similar to passing the ID value in json. Whereas LateLintPass has the opposite situation.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining the EarlyLintPass and LateLintPass APIs and how proc-macro-attribute cases expose AST and HIR information. Determine the constraints behind using both passes together, then define completion as supporting the dropshot::endpoint lint use case with access to the required AST location and HIR type information.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.