"Macros by example" page mixes language and macro_rules input syntax definitions
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 68/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- rust
- Domain
- compilers, documentation
Research direction
Start with the Macros by example page and compare its MacroRules syntax section with the distinction described in the issue. Separate the language syntax from the syntax accepted inside macro_rules! while preserving the existing content, and verify that the reference no longer implies the demonstrated valid Rust is syntactically invalid.
Written by the indexing model from the issue text.
Description
My understanding is the reference's syntax sections should represent what is syntactically valid Rust. However, given the current syntax on the Macros by example page it implies the following code is syntactically invalid.
#[cfg(false)]
macro_rules! name {
struct Demo;
}
This in fact compiles fine. The macro_rules! acts as a normal macro call where the body is allowed to be any token stream. This means in the reference the MacroRules should actually be Token*.
I propose the reference be changed so that this page splits the syntax for the language vs the syntax inside macro_rules! calls. This way no content is lost, but the distinction is shown.
- Dominant language
- Rust
- Stars
- 1.6k
- Forks
- 609
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 7
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing 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.
More from rust-lang/reference
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
rust-lang/reference#2371 · 3 comments ·
Maintainers usually reply within 1 day
-
A-const-eval A-undefined-behavior
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
rust-lang/reference#2266 · 1 comment ·
Maintainers usually reply within 1 day
-
A-resolve
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
All issues in rust-lang/reference
Similar issues
-
discover: `sudo RTK_DISABLED=$VAR …` is not detected as a bypass when `sudo` is a transparent prefixOpenarea:cli bug good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
skill:code-review
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
component:sight
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
agentic-os-org/ANOLISA#4115 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
rivet-dev/rivet#5819 · 1 comment ·
Maintainers usually reply within 1 day
-
A-io-database bug needs triage python
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day