rust-lang / rust-lang/rust-clippy

New style lint: Warn for non_camel_case_types of ty capture in macro_rules

Open
#4,940 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-lint L-style T-macros
Dominant language
Rust
Stars
13.5k
Forks
2.2k
Avg merge
2d 10h
Merged PRs (30d)
32

Description

For example:

macro_rules! foo {
    ($int_ty:ty) => {
//    ^^^^^^ help: convert the identifier to upper camel case: `IntTy`
        <$int_ty>::max_value()
    };
}

const BAR: u32 = foo!(u32);

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 reproducing the issue's macro_rules example and confirm that the ty capture is not warned about by the non_camel_case_types lint. Trace how this lint handles identifiers in macro definitions, then make the example produce the suggested IntTy warning and verify the resulting lint behavior with the relevant tests.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.