Add FCW to disallow $crate in macro transcriber#155121
Open
nik-rev wants to merge 1 commit intorust-lang:mainfrom
Open
Add FCW to disallow $crate in macro transcriber#155121nik-rev wants to merge 1 commit intorust-lang:mainfrom
$crate in macro transcriber#155121nik-rev wants to merge 1 commit intorust-lang:mainfrom
Conversation
Collaborator
|
r? @JohnTitor rustbot has assigned @JohnTitor. Use Why was this reviewer chosen?The reviewer was selected based on:
|
4 tasks
d27f291 to
67232bd
Compare
Contributor
Author
|
@rustbot label +I-lang-nominated |
This comment has been minimized.
This comment has been minimized.
Co-authored-by: @CAD97
67232bd to
30cb21b
Compare
Member
|
The list before the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a new warn-by-default future incompatibility lint that lints on usage of
$crateinside of a transcriber.Tracking Issue: #155123
Reason:
Example:
This shows the strange property of
$cratein a transcriber: thecall!macro is defined insidelib.rs, so the$cratetoken belongs tolib.rs. Yet, despite that, it still matches against the$cratetoken produced inside ofmain.rs.Expected behavior:
$crate: without a fragment specifier, error indicating that a fragment specifier is missing$crate:tt: with a fragment specifier, error indicating that$crateis a reserved identifier that cannot be used as the name of a metavariable.Explanation and example is from #99037
History:
Previous PR: #99447, which received no response from the author, so I'm picking it up
Issue: #99037
CC @CAD97