Skip to content

Tracking Issue for future-incompatibility lint dollar_crate_in_matcher #155123

@nik-rev

Description

@nik-rev

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions