<!-- Thank you for filing a bug report! 🐛 Please provide a short summary of the bug, along with any information you feel relevant to replicating the bug. --> I tried this code: ```rust pub trait Trait { #[doc(hidden)] fn f(); } pub struct S; impl Trait for S { fn f() {} } ``` I expected to see this happen: Rustdoc does not show `f` in the documentation for `S`. Instead, this happened:  Since `f` is properly hidden in the documentation for `Trait`, the link for `f` is broken. ### Meta `rustc --version --verbose`: ``` rustc 1.57.0-nightly (ac2d9fc50 2021-09-21) ``` _Originally posted by @rust-log-analyzer in https://github.com/rust-lang/rust/issues/89167#issuecomment-924613564_ <!-- TRIAGEBOT_START --> <!-- TRIAGEBOT_ASSIGN_START --> <!-- TRIAGEBOT_ASSIGN_DATA_START$${"user":"hkmatsumoto"}$$TRIAGEBOT_ASSIGN_DATA_END --> <!-- TRIAGEBOT_ASSIGN_END --> <!-- TRIAGEBOT_END -->