Suppress bad unused_attributes lint on doc(hidden) attr

warning: `#[doc(hidden)]` is ignored on trait impl items
       --> src/extern_type.rs:194:17
        |
    194 |                   #[doc(hidden)]
        |                   ^^^^^^^^^^^^^^ help: remove this attribute
    ...
    202 | / impl_extern_type! {
    203 | |     [Trivial]
    204 | |     bool = "bool"
    205 | |     u8 = "std::uint8_t"
    ...   |
    223 | |     CxxString = "std::string"
    224 | | }
        | |_- in this macro invocation
        |
        = 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
        = note: this warning originates in the macro `impl_extern_type` (in Nightly builds, run with -Z macro-backtrace for more info)
This commit is contained in:
David Tolnay 2022-05-09 21:29:38 -07:00
parent 0b878ccec4
commit af2620ca03
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -191,6 +191,7 @@ macro_rules! impl_extern_type {
$($( $($(
$(#[$($attr)*])* $(#[$($attr)*])*
unsafe impl ExternType for $ty { unsafe impl ExternType for $ty {
#[allow(unused_attributes)] // incorrect lint; this doc(hidden) attr *is* respected by rustdoc
#[doc(hidden)] #[doc(hidden)]
type Id = crate::type_id!($cxxpath); type Id = crate::type_id!($cxxpath);
type Kind = $kind; type Kind = $kind;