How to hide `automatically generated` documentation items

The is a re-opening of the question

Suppose my only source code is src/lib.rs (see below). If I run cargo doc I get a huge number of items below Auto Trait Implementations and Blanket Implementations . How to I suppress these automatically generate items ?

//! cargo_test documentation

/// MyInt documentation
pub struct MyInt {
   pub value : u32 ,
}
/// MyInt + MyInt documentation
impl std::ops::Add<MyInt> for MyInt {
   type Output = MyInt;
   fn add(self, rhs : MyInt) -> MyInt {
      MyInt {
         value : self.value + rhs.value,
      }
   }
}

Auto trait implementations are sometimes absolutely necessary to understand how a library can be used (particularly when threads are involved). Even if you find a way to hide them, please do not.

first of all, these sections are placed at the last position, after the manual trait impls, in order to make them less intrusive. auto traits are all one-liners because they are marker traits, and the blanket impls are wrapped in <details> html tags and collapsed on load, so I don't think suppressing these sections makes a significant difference in terms of readability.

but if you insist, you can use css to hide them, it's just html after all. (I don't think you can prevent rustdoc from generating them, though).

there's an --extend-css command line option for this. this will append the custom css to all the theme css files. alternatively, you can also use a custom theme (with the --theme command line option), instead of modifying the existing ones, so you can toggle the visibility by simply switching themes.

however, the format of rustdoc output is undocumented, the relevant id and class of the html elements can only be found in the source code.

for example, the section of auto trait implementations and blanket implementations are rendered here: