Skip to content

Intra-doc links not resolved in workspace with proc-macro #11628

Open
@AaronKutch

Description

@AaronKutch

Problem

There are doc links that sometimes refuse to work, I found a reproducible way of witnessing it.

Steps

Make sure rust-analyzer is not running for reproducibility. clone doc-bug, run cargo clean and cargo doc --open at the root of the workspace. Click on the awint_macros crate in the "Crates" list and scroll all the way to the bottom of the lib docs (I can't reduce further because it causes the problem to go away). There is a broken doc link with the literal text [awint_macro_internals::awint_macro_inlawi] towards the bottom.

Then, go to the source code awint/awint_macros/src/lib.rs and make some dummy change like adding a "// hello" comment somewhere. Run just cargo doc and refresh, now the doc link is no longer broken.

Possible Solution(s)

No response

Notes

It probably has to do with cargo-doc getting confused when there are multiple transitive dependencies and multiple reexports of items. Recompiling sometimes breaks or fixes it strangely.

Version

cargo 1.69.0-nightly (985d561f0 2023-01-20)
release: 1.69.0-nightly
commit-hash: 985d561f0bb9b76ec043a2b12511790ec7a2b954
commit-date: 2023-01-20
host: x86_64-pc-windows-msvc
libgit2: 1.5.1 (sys:0.16.1 vendored)
libcurl: 7.86.0-DEV (sys:0.4.59+curl-7.86.0 vendored ssl:Schannel)
os: Windows 10.0.19045 (Windows 10 Home) [64-bit]

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bugCommand-docE-hardExperience: HardS-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions