Change:
The warning by claims that on an impl item is ignored by rustdoc, but it isn't necessarily. The warning says: which is not true in the following repro: This warning is a false positive. Rustdoc does pay attention to this attribute. For the code above, the rendered documentation of and looks like: <table<tr<td<img src="https://user-" height="185"</td<td<img src="https://user-" height="300"</td</tr</tableAfter removing the supposedly unused attribute and rendering again, the "nasty uninteresting type" that we wanted not shown is going to get rendered on both pages: <table<tr<td<img src="https://user-" height="185"</td<td<img src="https://user-" height="300"</td</tr</table( : <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
My bad, I did not notice that at all . I can adjust the lint once it's decided how we are going to proceed with my changes in general (see / blocked on ). claim
In summary, on methods in trait impl blocks does not lead to any visual changes in the documentation whereas on associated types and constants, it hides the implementation (or “the thing to the right of the ”). This weirdly deviates from my (former) personal mental model of how is supposed to work and be used. As far as I know, in all other cases, it leads to items, impl blocks, fields (“names” or “declarations”) not being shown. Here, however, the “name” keeps being shown, only the “value” is hidden. Hiding an inherent assoc item for example, hides the item completely. “Hiding” a trait impl item is, in my opinion, currently handled inconsistently by rustdoc and shouldn't lead to any visual changes (or rather “shouldn't be allowed”). Out of curiosity, @ dtolnay, how / why do you use this feature? Do you use it to reduce visual clutter? Edit: Ah, well, I overlooked the top right picture. So in some cases the item is indeed entirely hidden, not just the value.
Should I remove the lint entirely or should I adjust ?
Just wanted to add that this is also affecting , but in a different way: <img width="500" src="https://user-"The isn't there at all without the : <img width="500" src="https://user-"Based on the above, this isn't correct: it actually hides the entire thing, at least for associated constants.
In your case, it's inherent associated items being accidentally flagged which is which was meaning the most recent nightly should not have your issue anymore. Sorry for the inconvenience. The longer I look this lint, the less I like it.

Discussion:
//! conflicts between multiple such attributes attached to the same //! item. <del> use rustc_ast::tokenstream::DelimSpan; use rustc_ast::{ast, AttrStyle, Attribute, Lit, LitKind, MacArgs, MetaItemKind, NestedMetaItem}; </del> <ins> use rustc_ast::{ast, AttrStyle, Attribute, Lit, LitKind, MetaItemKind, NestedMetaItem}; </ins> use rustc_data_structures::fx::FxHashMap; use rustc_errors::{pluralize, struct_span_err, Applicability, MultiSpan}; use rustc_expand::base::resolve_path;

} } <del> /// Checks `#[doc(hidden)]` attributes. Returns `true` if valid. fn check_doc_hidden( &self, attr: &Attribute, meta_index: usize, meta: &NestedMetaItem, hir_id: HirId, target: Target, ) -> bool { if let Target::AssocConst | Target::AssocTy | Target::Method(MethodKind::Trait { body: true }) = target { let parent_hir_id = self.tcx.hir().get_parent_item(hir_id); let containing_item = self.tcx.hir().expect_item(parent_hir_id); if let hir::ItemKind::Impl(hir::Impl { of_trait: Some(_), .. }) = containing_item.kind { let meta_items = attr.meta_item_list().unwrap(); let (span, replacement_span) = if meta_items.len() == 1 { (attr.span, attr.span) } else { let meta_span = meta.span(); ( meta_span, meta_span.until(match meta_items.get(meta_index + 1) { Some(next_item) => next_item.span(), None => match attr.get_normal_item().args { MacArgs::Delimited(DelimSpan { close, .. }, ..) => close, _ => unreachable!(), }, }), ) }; // FIXME: #[doc(hidden)] was previously erroneously allowed on trait impl items, // so for backward compatibility only emit a warning and do not mark it as invalid. self.tcx.struct_span_lint_hir(UNUSED_ATTRIBUTES, hir_id, span, |lint| { lint.build("`#[doc(hidden)]` is ignored on trait impl items") .warn( "this was previously accepted by the compiler but is  being phased out; it will become a hard error in  a future release!", ) .note( "whether the impl item is `doc(hidden)` or not  entirely depends on the corresponding trait item", ) .span_suggestion( replacement_span, "remove this attribute", "", Applicability::MachineApplicable, ) .emit(); }); } } true } </del> /// Checks that an attribute is *not* used at the crate level. Returns `true` if valid. fn check_attr_not_crate_level( &self,

let mut is_valid = true; if let Some(mi) = attr.meta() && let Some(list) = mi.meta_item_list() { <del> for (meta_index, meta) in list.into_iter().enumerate() { </del> <ins> for meta in list { </ins> if let Some(i_meta) = meta.meta_item() { match i_meta.name_or_empty() { sym::alias

is_valid = false; } <del> sym::hidden if !self.check_doc_hidden(attr, meta_index, meta, hir_id, target, ) => { is_valid = false; } </del> // no_default_passes: deprecated // passes: deprecated // plugins: removed, but rustdoc warns about it itself

<del> #![feature(inherent_associated_types)] #![allow(dead_code, incomplete_features)] #![crate_type = "lib"] #![deny(unused_attributes)] // run-rustfix pub trait Trait { type It; const IT: (); fn it0(); fn it1(); fn it2(); } pub struct Implementor; impl Implementor { #[doc(hidden)] // no error type Inh = (); #[doc(hidden)] // no error const INH: () = (); #[doc(hidden)] // no error fn inh() {} } impl Trait for Implementor { type It = (); //~^^ ERROR `#[doc(hidden)]` is ignored //~|  WARNING this was previously accepted const IT: () = (); //~^^ ERROR `#[doc(hidden)]` is ignored //~|  WARNING this was previously accepted #[doc(alias = "aka")] fn it0() {} //~^^ ERROR `#[doc(hidden)]` is ignored //~|  WARNING this was previously accepted #[doc(alias = "this", )] fn it1() {} //~^^ ERROR `#[doc(hidden)]` is ignored //~|  WARNING this was previously accepted #[doc()] fn it2() {} //~^^ ERROR `#[doc(hidden)]` is ignored //~|  WARNING this was previously accepted //~|  ERROR `#[doc(hidden)]` is ignored //~|  WARNING this was previously accepted } </del>

<del> #![feature(inherent_associated_types)] #![allow(dead_code, incomplete_features)] #![crate_type = "lib"] #![deny(unused_attributes)] // run-rustfix pub trait Trait { type It; const IT: (); fn it0(); fn it1(); fn it2(); } pub struct Implementor; impl Implementor { #[doc(hidden)] // no error type Inh = (); #[doc(hidden)] // no error const INH: () = (); #[doc(hidden)] // no error fn inh() {} } impl Trait for Implementor { #[doc(hidden)] type It = (); //~^^ ERROR `#[doc(hidden)]` is ignored //~|  WARNING this was previously accepted #[doc(hidden)] const IT: () = (); //~^^ ERROR `#[doc(hidden)]` is ignored //~|  WARNING this was previously accepted #[doc(hidden, alias = "aka")] fn it0() {} //~^^ ERROR `#[doc(hidden)]` is ignored //~|  WARNING this was previously accepted #[doc(alias = "this", hidden,)] fn it1() {} //~^^ ERROR `#[doc(hidden)]` is ignored //~|  WARNING this was previously accepted #[doc(hidden, hidden)] fn it2() {} //~^^ ERROR `#[doc(hidden)]` is ignored //~|  WARNING this was previously accepted //~|  ERROR `#[doc(hidden)]` is ignored //~|  WARNING this was previously accepted } </del>

<del> error: `#[doc(hidden)]` is ignored on trait impl items --> $DIR/unused-attr-doc-hidden.rs:29:5 | LL |     #[doc(hidden)] |     ^^^^^^^^^^^^^^ help: remove this attribute | note: the lint level is defined here --> $DIR/unused-attr-doc-hidden.rs:4:9 | LL | #![deny(unused_attributes)] |         ^^^^^^^^^^^^^^^^^ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: whether the impl item is `doc(hidden)` or not entirely depends on the corresponding trait item error: `#[doc(hidden)]` is ignored on trait impl items --> $DIR/unused-attr-doc-hidden.rs:34:5 | LL |     #[doc(hidden)] |     ^^^^^^^^^^^^^^ help: remove this attribute | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: whether the impl item is `doc(hidden)` or not entirely depends on the corresponding trait item error: `#[doc(hidden)]` is ignored on trait impl items --> $DIR/unused-attr-doc-hidden.rs:39:11 | LL |     #[doc(hidden, alias = "aka")] |           ^^^^^^-- |           | |           help: remove this attribute | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: whether the impl item is `doc(hidden)` or not entirely depends on the corresponding trait item error: `#[doc(hidden)]` is ignored on trait impl items --> $DIR/unused-attr-doc-hidden.rs:44:27 | LL |     #[doc(alias = "this", hidden,)] |                           ^^^^^^- |                           | |                           help: remove this attribute | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: whether the impl item is `doc(hidden)` or not entirely depends on the corresponding trait item error: `#[doc(hidden)]` is ignored on trait impl items --> $DIR/unused-attr-doc-hidden.rs:49:11 | LL |     #[doc(hidden, hidden)] |           ^^^^^^-- |           | |           help: remove this attribute | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: whether the impl item is `doc(hidden)` or not entirely depends on the corresponding trait item error: `#[doc(hidden)]` is ignored on trait impl items --> $DIR/unused-attr-doc-hidden.rs:49:19 | LL |     #[doc(hidden, hidden)] |                   ^^^^^^ help: remove this attribute | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: whether the impl item is `doc(hidden)` or not entirely depends on the corresponding trait item error: aborting due to 6 previous errors </del>