Change:
<!-- 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: I expected the documentation for the type alias to show the method and the implementation of . Instead, the type alias does not show the method . It does however show the implementation of . ! By publicly exposing through , the documentation of on the alias is documented as I expected, but then is publicly reachable, which in my case is unwanted due to being an internal implementation detail. This also works when making the statement , which gets the docs to look like I expected them to. ! <!-- If you're using the stable version of the compiler, you should also check if the bug also exists in the beta or nightly versions. --: Thanks for helping me figure out why what I was expecting wasn't happening though it looked like it should.
I think it's ok to document an impl on a reexported if the reexported item is not doc hidden. I'll send a fix in the next weeks.

Discussion:
| clean::TraitItem(..) | clean::FunctionItem(..) | clean::VariantItem(..) <del> | clean::MethodItem(..) </del> | clean::ForeignFunctionItem(..) | clean::ForeignStaticItem(..) | clean::ConstantItem(..) | clean::UnionItem(..) <del> | clean::AssocConstItem(..) | clean::AssocTypeItem(..) </del> | clean::TraitAliasItem(..) | clean::MacroItem(..) | clean::ForeignTypeItem => {

} } <ins> clean::MethodItem(..) | clean::AssocConstItem(..) | clean::AssocTypeItem(..) => { let item_id = i.item_id; if item_id.is_local() && !self.effective_visibilities.is_reachable(self.tcx, item_id.expect_def_id()) { debug!("Stripper: stripping {:?} {:?}", i.type_(), i.name); return None; } } </ins> clean::StructFieldItem(..) => { if i.visibility(self.tcx) != Some(Visibility::Public) { return Some(strip_item(i));

&& imp.items.iter().all(|i| { let item_id = i.item_id; item_id.is_local() <del> && !is_item_reachable( self.tcx, self.is_json_output, &self.cache.effective_visibilities, item_id, ) </del> <ins> && !self .cache .effective_visibilities .is_reachable(self.tcx, item_id.expect_def_id()) </ins> }) { <ins> debug!("ImplStripper: no public item; removing {imp:?}"); </ins> return None; } else if imp.items.is_empty() && i.doc_value().is_empty() { <ins> debug!("ImplStripper: no item and no doc; removing {imp:?}"); </ins> return None; } }

&& !imp.for_.is_assoc_ty() && !self.should_keep_impl(&i, did) { <del> debug!("ImplStripper: impl item for stripped type; removing"); </del> <ins> debug!("ImplStripper: impl item for stripped type; removing {imp:?}"); </ins> return None; } if let Some(did) = imp.trait_.as_ref().map(|t| t.def_id()) && !self.should_keep_impl(&i, did) { <del> debug!("ImplStripper: impl item for stripped trait; removing"); </del> <ins> debug!("ImplStripper: impl item for stripped trait; removing {imp:?}"); </ins> return None; } if let Some(generics) = imp.trait_.as_ref().and_then(|t| t.generics()) {

if let Some(did) = typaram.def_id(self.cache) && !self.should_keep_impl(&i, did) { <del> debug!("ImplStripper: stripped item in trait's generics; removing impl"); </del> <ins> debug!("ImplStripper: stripped item in trait's generics; removing {imp:?}"); </ins> return None; } }

pub trait Pattern<'a> {} <ins> impl Pattern<'_> for () {} </ins> pub trait Trait<const N: usize> {} // @has async_fn/fn.const_generics.html // @has - '//pre[@class="rust item-decl"]' 'pub async fn const_generics<const N: usize>(_: impl Trait<N>)'

// regression test for #63037 // @has async_fn/fn.elided.html // @has - '//pre[@class="rust item-decl"]' 'pub async fn elided(foo: &str) -> &str' <del> pub async fn elided(foo: &str) -> &str {} </del> <ins> pub async fn elided(foo: &str) -> &str { "" } </ins> // This should really be shown as written, but for implementation reasons it's difficult. // See `impl Clean for TyKind::Ref`. // @has async_fn/fn.user_elided.html // @has - '//pre[@class="rust item-decl"]' 'pub async fn user_elided(foo: &str) -> &str' <del> pub async fn user_elided(foo: &'_ str) -> &str {} </del> <ins> pub async fn user_elided(foo: &'_ str) -> &str { "" } </ins> // @has async_fn/fn.static_trait.html // @has - '//pre[@class="rust item-decl"]' 'pub async fn static_trait(foo: &str) -> Box<dyn Bar>' <del> pub async fn static_trait(foo: &str) -> Box<dyn Bar> {} </del> <ins> pub async fn static_trait(foo: &str) -> Box<dyn Bar> { Box::new(()) } </ins> // @has async_fn/fn.lifetime_for_trait.html // @has - '//pre[@class="rust item-decl"]' "pub async fn lifetime_for_trait(foo: &str) -> Box<dyn Bar + '_>" <del> pub async fn lifetime_for_trait(foo: &str) -> Box<dyn Bar + '_> {} </del> <ins> pub async fn lifetime_for_trait(foo: &str) -> Box<dyn Bar + '_> { Box::new(()) } </ins> // @has async_fn/fn.elided_in_input_trait.html // @has - '//pre[@class="rust item-decl"]' "pub async fn elided_in_input_trait(t: impl Pattern<'_>)" pub async fn elided_in_input_trait(t: impl Pattern<'_>) {}

impl Foo { // @has async_fn/struct.Foo.html // @has - '//*[@class="method"]' 'pub async fn complicated_lifetimes( &self, context: &impl Bar ) -> impl Iterator<Item = &usize>' <del> pub async fn complicated_lifetimes(&self, context: &impl Bar) -> impl Iterator<Item = &usize> {} </del> <ins> pub async fn complicated_lifetimes(&self, context: &impl Bar) -> impl Iterator<Item = &usize> { [0].iter() } </ins> // taken from `tokio` as an example of a method that was particularly bad before // @has - '//*[@class="method"]' "pub async fn readable<T>(&self) -> Result<AsyncFdReadyGuard<'_, T>, ()>" <del> pub async fn readable<T>(&self) -> Result<AsyncFdReadyGuard<'_, T>, ()> {} </del> <ins> pub async fn readable<T>(&self) -> Result<AsyncFdReadyGuard<'_, T>, ()> { Err(()) } </ins> // @has - '//*[@class="method"]' "pub async fn mut_self(&mut self)" pub async fn mut_self(&mut self) {} }

// test named lifetimes, just in case // @has async_fn/fn.named.html // @has - '//pre[@class="rust item-decl"]' "pub async fn named<'a, 'b>(foo: &'a str) -> &'b str" <del> pub async fn named<'a, 'b>(foo: &'a str) -> &'b str {} </del> <ins> pub async fn named<'a, 'b>(foo: &'a str) -> &'b str { "" } </ins> // @has async_fn/fn.named_trait.html // @has - '//pre[@class="rust item-decl"]' "pub async fn named_trait<'a, 'b>(foo: impl Pattern<'a>) -> impl Pattern<'b>" pub async fn named_trait<'a, 'b>(foo: impl Pattern<'a>) -> impl Pattern<'b> {}

<ins> #![crate_name = "foo"] // @has 'foo/index.html' // There should be only `type A`. // @count - '//*[@class="item-table"]//*[@class="item-name"]' 1 // @has - '//*[@class="item-name"]/a[@href="type.A.html"]' 'A' mod foo { pub struct S; } use foo::S; pub type A = S; // @has 'foo/type.A.html' // @has - '//*[@id="method.default"]/h4' 'fn default() -> Self' impl Default for A { fn default() -> Self { S } } // @has - '//*[@id="method.a"]/h4' 'pub fn a(&self)' impl A { pub fn a(&self) {} } </ins>