intra-doc links: re-exports are not resolved properly. Unclear scope of re-exports(?) #78939
Labels
A-intra-doc-links
Area: Intra-doc links, the ability to link to items in docs by name
C-bug
Category: This is a bug.
E-needs-mcve
Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
I'm trying to migrate actix-http to
intra-doc
. The docs generated by re-export ofHeaderMap
doesn't have one of it's structs(GetAll
)linked properlyCode
There are two files involved:
src/header/map.rs
containing the definition andsrc/lib.rs
containing it's re-exports.src/header/map.rs
:src/lib.rs
:I expected to see:
the correct page linked for
GetAll
Instead
I saw [
GetAll
]Screenshot: https://i.imgur.com/fVPqaS4.png
My understanding of the problem:
The documentation string expects
GetAll
to be in the same scope-level(is that a word?:D) asHeaderMap
but 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
GetAll
scoped in the save level. But in the re-export,HeaderMap
andGetAll
have different scopes.HeaderMap
ishttp::HeaderMap
andGetAll
ishttp::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::GetAll
in insidemod http
(insrc/lib.rs
) fixes the issue though.Meta
rustc --version --verbose
:cc @jyn514
The text was updated successfully, but these errors were encountered: