Rustdoc source links should link into expanded macros rather than to the macro invocation
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
This is a followup from discussing PR #137229 on reddit.
Specially that PR added the ability to (unstably) expand macros in rustdoc source view. A great next step would be to have links from the docs to the source to go into the expanded macro. For example: the methods on u32 currently point to the macro invocation but could point into the expanded macro. This would make it a lot easier to see the source for the integer types and other types where it macros are used to define the impl blocks.
Cc @GuillaumeGomez
@rustbot label -C-bug
(Please fix the labels, I couldn't find a suitable template for this, so I selected rustdoc bug.)
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 reviewing PR #137229 and the rustdoc source-view macro-expansion behavior it introduced. Trace how links for u32 methods are generated and compare their current macro-invocation targets with expanded-macro locations. Done means documentation links enter the relevant expanded macro rather than the invocation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers, documentation
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100