rust-lang / rust-lang/rust-clippy
macro_rules blocks shouldn't allow fragment specifiers
Open
Nobody has claimed this yet.
A-lint
C-an-interesting-project
L-correctness
T-AST
- Dominant language
- Rust
- Stars
- 13.5k
- Forks
- 2.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 32
Description
I often make this mistake, and it's tricky to debug while being VERY unlikely to be what is wanted.
macro_rules! x { ($a:expr) => {$a:expr} }
This should be:
macro_rules! x { ($a:expr) => {$a} }
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating Clippy's handling of macro_rules! definitions and how existing lints test macro syntax. Add coverage for the two examples in the issue, with the first reported and the second accepted; the work is done when the regression tests pass and the mistaken fragment specifier is diagnosed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100