rust-lang / rust-lang/rust

Tracking Issue for future-incompatibility lint `dollar_crate_in_matcher`

Open
#155,123 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-macros C-future-incompatibility C-tracking-issue T-compiler T-lang
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

This is the tracking issue for the dollar_crate_in_matcher future-compatibility warning and other related errors. The goal of this page is to describe why this change was made and how you can fix code that is affected by it. It also provides a place to ask questions or register a complaint if you feel the change should not be made. For more information on the policy around future-compatibility warnings, see our breaking change policy guidelines.

What is the warning for?

Usage of $crate in matcher.

Why was this change made?

$crate is inconsistent with the behavior of other keywords in matchers, namely that other keywords work like any other identifier, and are currently not reserved in this position.

Example
#![deny(dollar_crate_in_matcher)]

macro_rules! m {
    ($crate) => {};
}
Recommendations

Do not use $crate in matcher.

When will this warning become a hard error?

Unknown

Steps
  • Implement the lint
  • Raise lint level to deny
  • Change the lint to report in dependencies
  • Switch to a hard error
Implementation history

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 reading the tracking issue's warning example, recommendations, checklist, and the implementation history in PR #155121. The work is complete when the listed lint milestones are addressed, including implementation, lint-level changes, dependency reporting, and the eventual hard error.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.