mirror of
https://github.com/Lokathor/bytemuck.git
synced 2024-11-25 08:12:26 +00:00
parent
eeb6e9dd53
commit
7ef8801cff
@ -485,6 +485,7 @@ fn generate_checked_bit_pattern_struct(
|
|||||||
|
|
||||||
Ok((
|
Ok((
|
||||||
quote! {
|
quote! {
|
||||||
|
#[doc = #GENERATED_TYPE_DOCUMENTATION]
|
||||||
#repr
|
#repr
|
||||||
#[derive(Clone, Copy, #crate_name::AnyBitPattern)]
|
#[derive(Clone, Copy, #crate_name::AnyBitPattern)]
|
||||||
#derive_dbg
|
#derive_dbg
|
||||||
@ -652,6 +653,7 @@ fn generate_checked_bit_pattern_enum_with_fields(
|
|||||||
|
|
||||||
Ok((
|
Ok((
|
||||||
quote! {
|
quote! {
|
||||||
|
#[doc = #GENERATED_TYPE_DOCUMENTATION]
|
||||||
#[derive(::core::clone::Clone, ::core::marker::Copy, #crate_name::AnyBitPattern)]
|
#[derive(::core::clone::Clone, ::core::marker::Copy, #crate_name::AnyBitPattern)]
|
||||||
#derive_dbg
|
#derive_dbg
|
||||||
#bits_repr
|
#bits_repr
|
||||||
@ -703,6 +705,7 @@ fn generate_checked_bit_pattern_enum_with_fields(
|
|||||||
|
|
||||||
Ok((
|
Ok((
|
||||||
quote! {
|
quote! {
|
||||||
|
#[doc = #GENERATED_TYPE_DOCUMENTATION]
|
||||||
#[derive(::core::clone::Clone, ::core::marker::Copy, #crate_name::CheckedBitPattern)]
|
#[derive(::core::clone::Clone, ::core::marker::Copy, #crate_name::CheckedBitPattern)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
#vis struct #bits_ty(#(#fields),*);
|
#vis struct #bits_ty(#(#fields),*);
|
||||||
@ -775,6 +778,7 @@ fn generate_checked_bit_pattern_enum_with_fields(
|
|||||||
|
|
||||||
Ok((
|
Ok((
|
||||||
quote! {
|
quote! {
|
||||||
|
#[doc = #GENERATED_TYPE_DOCUMENTATION]
|
||||||
#[derive(::core::clone::Clone, ::core::marker::Copy, #crate_name::AnyBitPattern)]
|
#[derive(::core::clone::Clone, ::core::marker::Copy, #crate_name::AnyBitPattern)]
|
||||||
#bits_repr
|
#bits_repr
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
@ -1263,3 +1267,6 @@ pub fn bytemuck_crate_name(input: &DeriveInput) -> TokenStream {
|
|||||||
|
|
||||||
return crate_name;
|
return crate_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const GENERATED_TYPE_DOCUMENTATION: &str =
|
||||||
|
" `bytemuck`-generated type for internal purposes only.";
|
||||||
|
Loading…
Reference in New Issue
Block a user