From df5262b19ca4fde16bc1a15eecb7438f0ecdbe42 Mon Sep 17 00:00:00 2001 From: Charles Lew Date: Wed, 31 May 2023 22:46:00 +0800 Subject: [PATCH] Add `#[doc(hidden)]` on derive generated items. (#189) --- derive/src/traits.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/derive/src/traits.rs b/derive/src/traits.rs index 767fb80..ec6afd9 100644 --- a/derive/src/traits.rs +++ b/derive/src/traits.rs @@ -538,6 +538,7 @@ fn generate_assert_no_padding(input: &DeriveInput) -> Result { }; Ok(quote_spanned! {span => const _: fn() = || { + #[doc(hidden)] struct TypeWithoutPadding([u8; #size_sum]); let _ = ::core::mem::transmute::<#struct_type, TypeWithoutPadding>; };}) @@ -554,6 +555,7 @@ fn generate_fields_are_trait( let field_types = get_field_types(&fields); Ok(quote_spanned! {span => #(const _: fn() = || { #[allow(clippy::missing_const_for_fn)] + #[doc(hidden)] fn check #impl_generics () #where_clause { fn assert_impl() {} assert_impl::<#field_types>();