Help wanted: broken intra-doc link to method on pub type alias when the underlying stuff is `#[doc(hidden)]`

⚓ Rust    📅 2026-07-12    👤 surdeus    👁️ 1      

surdeus

#![cfg_attr(docsrs, feature(doc_cfg))]

#[doc(hidden)]
pub struct FooHidden {}

pub type Foo = FooHidden;

impl Foo {
    pub fn foo() {}

    /// See [`foo`].
    ///
    /// [`foo`]: Self::foo
    pub fn bar() {}
}

This is the minimum example, just build docs with cargo docs-rs (cargo rustdoc -Zunstable-options -Zrustdoc-map --lib --target=x86_64-unknown-linux-gnu --config='build.rustdocflags=["-Zunstable-options", "--cfg=docsrs", "--extern-html-root-takes-precedence"]' --config='doc.extern-map.registries.crates-io="https://docs.rs"' --verbose) and the generated link to Foo::foo is broken:

If I remove #[doc(hidden)], it works:

Q: is it an expected behaviour? If so, what should I do to make the intra-doc link work when the underlying stuff is #[doc(hidden)]?

1 post - 1 participant

Read full topic

🏷️ Rust_feed