Change:
<p align="center"<img width="400" src=""</pI would prefer if only the negative impl signature were rendered here (and any doc comment on the negative impl). Not even a collapsed-by-default accordion to show the trait's contents. The reader can click the trait's name to see what is in it if they need. Having associated items of a negative impl rendered is inconvenient because something like <kbdCTRL+F</kbdfor "fn position" will land the reader deep in the middle of the big impl showing them APIs that their type does not have. Example of this occurring in standard library documentation:  Mentioning tracking issue.

Discussion:
.map(|did| tcx.provided_trait_methods(did).map(|meth| meth.name).collect()) .unwrap_or_default() } <ins> pub(crate) fn is_negative_trait_impl(&self) -> bool { matches!(self.polarity, ty::ImplPolarity::Negative) } </ins> } #[derive(Clone, Debug)]

f.write_str(" ")?; if let Some(ref ty) = self.trait_ { <del> match self.polarity { ty::ImplPolarity::Positive | ty::ImplPolarity::Reservation => {} ty::ImplPolarity::Negative => write!(f, "!")?, </del> <ins> if self.is_negative_trait_impl() { write!(f, "!")?; </ins> } ty.print(cx).fmt(f)?; write!(f, " for ")?;

let mut impl_items = Buffer::empty_from(w); let mut default_impl_items = Buffer::empty_from(w); <ins> let impl_ = i.inner_impl(); </ins> <del> for trait_item in &i.inner_impl().items { doc_impl_item( &mut default_impl_items, &mut impl_items, cx, trait_item, if trait_.is_some() { &i.impl_item } else { parent }, link, render_mode, false, trait_, rendering_params, ); </del> <ins> if !impl_.is_negative_trait_impl() { for trait_item in &impl_.items { doc_impl_item( &mut default_impl_items, &mut impl_items, cx, trait_item, if trait_.is_some() { &i.impl_item } else { parent }, link, render_mode, false, trait_, rendering_params, ); } </ins> } fn render_default_items(

// We don't emit documentation for default items if they appear in the // Implementations on Foreign Types or Implementors sections. if rendering_params.show_default_items { <del> if let Some(t) = trait_ { </del> <ins> if let Some(t) = trait_ && !impl_.is_negative_trait_impl() { </ins> render_default_items( &mut default_impl_items, &mut impl_items, cx, t, <del> i.inner_impl(), </del> <ins> impl_, </ins> &i.impl_item, render_mode, rendering_params,

} if let Some(ref dox) = i.impl_item.opt_doc_value() { <del> if trait_.is_none() && i.inner_impl().items.is_empty() { </del> <ins> if trait_.is_none() && impl_.items.is_empty() { </ins> w.write_str( "<div class="item-info"> <div class="stab empty-impl">This impl block contains no items.</div>

<ins> // This test ensures that negative impls don't have items listed inside them. #![feature(negative_impls)] #![crate_name = "foo"] pub struct Thing; //@ has 'foo/struct.Thing.html' // We check the full path to ensure there is no `<details>` element. //@ has - '//div[@id="trait-implementations-list"]/section[@id="impl-Iterator-for-Thing"]/h3'  // 'impl !Iterator for Thing' impl !Iterator for Thing {} // This struct will allow us to compare both paths. pub struct Witness; //@ has 'foo/struct.Witness.html' //@ has - '//div[@id="trait-implementations-list"]/details//section[@id="impl-Iterator-for-Witness"]/h3'  // 'impl Iterator for Witness' impl Iterator for Witness { type Item = u8; fn next(&mut self) -> Option<Self::Item> { None } } </ins>