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

#![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)]?

I wouldn’t expect this to work properly — a type alias doesn’t substitute for the original type for all purposes. If you write a use instead, the documentation and links will work.

pub use FooHidden as Foo;