rust-lang / rust-lang/rust-clippy

Auto macro tests pass

Open
#4,965 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
13.5k
Forks
2.2k
Avg merge
2d 10h
Merged PRs (30d)
32

Description

Most often, macro processing in lints works on the level of not linting an item if it came from an [external] macro invocation. I am not completely sure it would be the same thing, but could we add an optional pass (like run-rustfix) that would take a source file, put its contents in an [external] macro_rules! and expand it back to source file and lint the expansion and do something depending on the output. It very well might be a performance hit, but I don't know how big.

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 tracing Clippy's existing macro-processing behavior and the run-rustfix pass mentioned in the issue. Determine whether wrapping a source file in an external macro_rules! and linting the expansion is feasible, how its output should be handled, and what performance impact it has; done would require a settled design and an agreed implementation path.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.