-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
intra-doc links: re-exports are not resolved properly. Unclear scope of re-exports(?) #78939
Copy link
Copy link
Closed
Labels
A-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by nameArea: Intra-doc links, the ability to link to items in docs by nameC-bugCategory: This is a bug.Category: This is a bug.E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleT-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by nameArea: Intra-doc links, the ability to link to items in docs by nameC-bugCategory: This is a bug.Category: This is a bug.E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleT-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
I'm trying to migrate actix-http to
intra-doc. The docs generated by re-export ofHeaderMapdoesn't have one of it's structs(GetAll)linked properlyCode
There are two files involved:
src/header/map.rscontaining the definition andsrc/lib.rscontaining it's re-exports.src/header/map.rs:src/lib.rs:I expected to see:
the correct page linked for
GetAllInstead
I saw [
GetAll]Screenshot: https://i.imgur.com/fVPqaS4.png
My understanding of the problem:
The documentation string expects
GetAllto be in the same scope-level(is that a word?:D) asHeaderMapbut when re-exporting, these scope-levels can't be guaranteed.In my case, two documentation pages are generated: one at the place of definition and the other at the re-export. The definition page works fine because it has
GetAllscoped in the save level. But in the re-export,HeaderMapandGetAllhave different scopes.HeaderMapishttp::HeaderMapandGetAllishttp::header::map::GetAll(re-exported scope) orcrate::header::map::GetAll. The documentation string breaks in the re-export because of it.Re-exporting
crate::header::map::GetAllin insidemod http(insrc/lib.rs) fixes the issue though.Meta
rustc --version --verbose:cc @jyn514