Rustdoc fails to follow path after re-export. #72056
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.
requires-nightly
This issue requires a nightly compiler in some way.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
When re-exporting modules from another crate, documentation for this crate does not follow rust paths correctly.
A simple workspace to showcase the issue:
foo
crate, with afoo
module and aFoo
struct in this module. Thefoo
module has documentation linking to theFoo
struct.bar
crate which depends onfoo
with the linepub use foo::*;
From there, compiling documentation will:
foo
, correctly resolve theFoo
link.bar
, incorrectly resolve the link in the re-exportedfoo
module.Here is a screenshot from the doc page for the
foo
module from thefoo
crate:And here is the documentation for the
foo
module re-exported in thebar
crate:Here is a zip with the entire workspace ready to compile: rustdoc example.zip
I also tried using
self::Foo
,crate::foo::Foo
, for the same result.Apart from this simple example, this can happen with "facade" crates that re-export all or a subset of an other crate, and expect documentation to transparently work.
The text was updated successfully, but these errors were encountered: