Closed
Description
Given the following code:
pub struct Foo {}
impl Foo {
#[doc(hidden)]
pub const FOO: i32 = 0;
}
The current output (on nightly) is:
warning: `#[doc(hidden)]` is ignored on trait impl items
--> src/lib.rs:4:5
|
4 | #[doc(hidden)]
| ^^^^^^^^^^^^^^ help: remove this attribute
|
= note: `#[warn(unused_attributes)]` on by default
= 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
This warning is incorrect because this is not a trait impl, but an inherent impl.
Tested with local nightly rustc 1.63.0-nightly (cd282d7f7 2022-05-18)
and Playground 2022-05-19 c0672870491e84362f76
.