Restrict macro invocations in `#[doc]` attributes to eager builtin invocations
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 2.9k
- Forks
- 231
- Avg merge
- 19h 55m
- Merged PRs (30d)
- 67
Description
Macros like concat!(), include_str!() etc are allowed in Rust 1.49, but not all builtin macros or user defined ones. This limitation was lifted in Rust 1.51.
Even if our implementation will probably handle this from the get-go, we should keep a list of the allowed macros for doc attributes and restrict any invocation not part of that list. That work can probably be done in the EarlyNameResolver class. @powerboat9 if you'd like to take care of it let me know and I can guide you if necessary.
Ccing @GuillaumeGomez who helped me figure out what was happening :)
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
Start by reading the EarlyNameResolver implementation and trace how macro invocations in #[doc] attributes are resolved. Identify the allowed eager builtin macros based on Rust 1.49 behavior, then ensure other invocations are rejected; done means the restriction matches that version's documented limitation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100