rustdoc fails to build an intra doc link when linking through 3 crates without explicit use #92910
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.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
With three crates:
When building doc for crate A, the intra doc link will not work without a warning.
This is what's happening in Bevy on the doc for
DefaultPlugins
(bevyengine/bevy#3654).I managed to write a UI test reproducing the issue: mockersf@1c4d478
Test failure message

The link is not replaced, even though rustdoc was able to correctly link the struct in the definition.If I uncomment the `extern crate` in the reexported crate (crate B from above), the link works
Ideally I would like the link to work. I'm guessing it's something about the external crate not being in context for link resolution when it's not explicitly used, but it seems it is later on as the link is correct for the struct definition. I tried to follow the code to where the context could be different between the two but didn't manage to find it.
If it's not possible, would it be OK to issue a warning?
Meta
Reproduced with rust 1.57, 1.58, nightly 1bd4fdc 2022-01-12 and 256721e
The text was updated successfully, but these errors were encountered: