Standalone `$` is accepted as a token in declarative macros.
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
I tried this code:
macro_rules! foo {
($) => {}
}
I expected to see this happen: an error because a standalone $ doesn't match any of the grammar rules from the reference
Instead, this happened: the code compiles, you can successfully invoke the macro like this foo!($);
Meta
Latest stable on the playground (1.93.1)
Also on the nightly verson:
Nightly version: 1.95.0-nightly
(2026-02-24 859951e3c7c9d0322c39)
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
Reproduce the declarative macro example in the linked Rust Playground and compare it with the referenced macro-by-example grammar. Trace the parser behavior for a standalone $; done means the invalid token is rejected consistently with the documented grammar and the behavior is covered by an appropriate compiler test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100