-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add docs for intra-doc-links #73810
Add docs for intra-doc-links #73810
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
62cbca2
to
22595a0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should mention which scope is used to resolve the links: the parent module of the item. In the case of macros this is the crate root; in the case of re-exports it is the original module; in the case of impls I believe it's the parent of the type (but not sure).
@jyn514 isn't it just the def site scope? I don't think there's any special scoping here |
Sure, it's obvious to us because we implemented it, but it's not obvious to everyone else. See e.g. #72243 which is a bug report that macros aren't resolved using lexical scope instead of resolution scope. |
@jyn514 Oh, I do consider that special scoping, I wasn't aware of that. For everything else it's just the def site scope though. I think we can mention that |
22595a0
to
058b72e
Compare
Added a note. We'll be deprecating macro_rules anyway so I don't think we should do much more here |
For example, in the following code all of the links will link to the rustdoc page for `Bar`: | ||
|
||
```rust | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this empty line.
Overall, it is nice. Could you also add the fact that using |
Fixes #66000