-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
rustdoc intra links: Module-level doc uses parent module's namespace instead of own #55364
Comments
I definitely agree with the motivation. One issue is what about outer-doc comments on a module? /// See either [foo] or [bar].
pub mod sub {
/// See [bar]
pub fn foo() {}
/// See [foo]
pub fn bar() {}
} I'm not sure if they're distinguishable to |
They are distinguishable, I recall I knowingly skipped this when implementing this feature because it was tricky to get right and I wasn't sure which way we wanted it to work. |
…nisheart,GuillaumeGomez rustdoc: Resolve module-level doc references more locally Module level docs should resolve intra-doc links as locally as possible. As such, this commit alters the heuristic for finding intra-doc links such that we attempt to resolve names mentioned in *inner* documentation comments within the (sub-)module rather that from the context of its parent. I'm hoping that this fixes rust-lang#55364 though right now I'm not sure it's the right fix. r? @GuillaumeGomez
I don't know if this is an accidental regression, or an intentional change, but this used to resolve.
I argue that module-level docs should have the same namespace as the module they are referring to, since referring to the items of the documented module is much more common than referring to items in the parent module.
Ref #43466
The text was updated successfully, but these errors were encountered: