diff --git a/pdl-compiler/src/backends/rust/preamble.rs b/pdl-compiler/src/backends/rust/preamble.rs index b7607f7..bc64817 100644 --- a/pdl-compiler/src/backends/rust/preamble.rs +++ b/pdl-compiler/src/backends/rust/preamble.rs @@ -62,7 +62,7 @@ pub fn generate(path: &Path) -> proc_macro2::TokenStream { /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. - #[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] + #[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { @@ -71,6 +71,12 @@ pub fn generate(path: &Path) -> proc_macro2::TokenStream { &self.0 } } + + impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } + } } } diff --git a/pdl-compiler/tests/generated/custom_field_declaration_big_endian.rs b/pdl-compiler/tests/generated/custom_field_declaration_big_endian.rs index d47bc81..79810e9 100644 --- a/pdl-compiler/tests/generated/custom_field_declaration_big_endian.rs +++ b/pdl-compiler/tests/generated/custom_field_declaration_big_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, Copy, Hash, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[cfg_attr(feature = "serde", serde(from = "u32", into = "u32"))] diff --git a/pdl-compiler/tests/generated/custom_field_declaration_little_endian.rs b/pdl-compiler/tests/generated/custom_field_declaration_little_endian.rs index d47bc81..79810e9 100644 --- a/pdl-compiler/tests/generated/custom_field_declaration_little_endian.rs +++ b/pdl-compiler/tests/generated/custom_field_declaration_little_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, Copy, Hash, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[cfg_attr(feature = "serde", serde(from = "u32", into = "u32"))] diff --git a/pdl-compiler/tests/generated/enum_declaration_big_endian.rs b/pdl-compiler/tests/generated/enum_declaration_big_endian.rs index 02b472d..dcff08e 100644 --- a/pdl-compiler/tests/generated/enum_declaration_big_endian.rs +++ b/pdl-compiler/tests/generated/enum_declaration_big_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[repr(u64)] #[derive(Debug, Clone, Copy, Hash, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] diff --git a/pdl-compiler/tests/generated/enum_declaration_little_endian.rs b/pdl-compiler/tests/generated/enum_declaration_little_endian.rs index 02b472d..dcff08e 100644 --- a/pdl-compiler/tests/generated/enum_declaration_little_endian.rs +++ b/pdl-compiler/tests/generated/enum_declaration_little_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[repr(u64)] #[derive(Debug, Clone, Copy, Hash, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] diff --git a/pdl-compiler/tests/generated/packet_decl_24bit_enum_array_big_endian.rs b/pdl-compiler/tests/generated/packet_decl_24bit_enum_array_big_endian.rs index 3c21f40..bc23fe1 100644 --- a/pdl-compiler/tests/generated/packet_decl_24bit_enum_array_big_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_24bit_enum_array_big_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[repr(u64)] #[derive(Debug, Clone, Copy, Hash, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] diff --git a/pdl-compiler/tests/generated/packet_decl_24bit_enum_array_little_endian.rs b/pdl-compiler/tests/generated/packet_decl_24bit_enum_array_little_endian.rs index e06e098..8b0d488 100644 --- a/pdl-compiler/tests/generated/packet_decl_24bit_enum_array_little_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_24bit_enum_array_little_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[repr(u64)] #[derive(Debug, Clone, Copy, Hash, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] diff --git a/pdl-compiler/tests/generated/packet_decl_24bit_enum_big_endian.rs b/pdl-compiler/tests/generated/packet_decl_24bit_enum_big_endian.rs index b14bced..50551cb 100644 --- a/pdl-compiler/tests/generated/packet_decl_24bit_enum_big_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_24bit_enum_big_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[repr(u64)] #[derive(Debug, Clone, Copy, Hash, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] diff --git a/pdl-compiler/tests/generated/packet_decl_24bit_enum_little_endian.rs b/pdl-compiler/tests/generated/packet_decl_24bit_enum_little_endian.rs index 9d60ca5..63472b9 100644 --- a/pdl-compiler/tests/generated/packet_decl_24bit_enum_little_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_24bit_enum_little_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[repr(u64)] #[derive(Debug, Clone, Copy, Hash, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] diff --git a/pdl-compiler/tests/generated/packet_decl_24bit_scalar_array_big_endian.rs b/pdl-compiler/tests/generated/packet_decl_24bit_scalar_array_big_endian.rs index 5fae84e..b4a1dc9 100644 --- a/pdl-compiler/tests/generated/packet_decl_24bit_scalar_array_big_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_24bit_scalar_array_big_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct FooData { diff --git a/pdl-compiler/tests/generated/packet_decl_24bit_scalar_array_little_endian.rs b/pdl-compiler/tests/generated/packet_decl_24bit_scalar_array_little_endian.rs index b7b20f9..55fcbeb 100644 --- a/pdl-compiler/tests/generated/packet_decl_24bit_scalar_array_little_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_24bit_scalar_array_little_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct FooData { diff --git a/pdl-compiler/tests/generated/packet_decl_24bit_scalar_big_endian.rs b/pdl-compiler/tests/generated/packet_decl_24bit_scalar_big_endian.rs index 43f4749..41810d2 100644 --- a/pdl-compiler/tests/generated/packet_decl_24bit_scalar_big_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_24bit_scalar_big_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct FooData { diff --git a/pdl-compiler/tests/generated/packet_decl_24bit_scalar_little_endian.rs b/pdl-compiler/tests/generated/packet_decl_24bit_scalar_little_endian.rs index 26576e4..b4a6196 100644 --- a/pdl-compiler/tests/generated/packet_decl_24bit_scalar_little_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_24bit_scalar_little_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct FooData { diff --git a/pdl-compiler/tests/generated/packet_decl_64bit_enum_array_big_endian.rs b/pdl-compiler/tests/generated/packet_decl_64bit_enum_array_big_endian.rs index 8f37cd7..b2d5bb3 100644 --- a/pdl-compiler/tests/generated/packet_decl_64bit_enum_array_big_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_64bit_enum_array_big_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[repr(u64)] #[derive(Debug, Clone, Copy, Hash, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] diff --git a/pdl-compiler/tests/generated/packet_decl_64bit_enum_array_little_endian.rs b/pdl-compiler/tests/generated/packet_decl_64bit_enum_array_little_endian.rs index 9d47865..89168b1 100644 --- a/pdl-compiler/tests/generated/packet_decl_64bit_enum_array_little_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_64bit_enum_array_little_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[repr(u64)] #[derive(Debug, Clone, Copy, Hash, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] diff --git a/pdl-compiler/tests/generated/packet_decl_64bit_enum_big_endian.rs b/pdl-compiler/tests/generated/packet_decl_64bit_enum_big_endian.rs index 0d14272..87981f4 100644 --- a/pdl-compiler/tests/generated/packet_decl_64bit_enum_big_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_64bit_enum_big_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[repr(u64)] #[derive(Debug, Clone, Copy, Hash, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] diff --git a/pdl-compiler/tests/generated/packet_decl_64bit_enum_little_endian.rs b/pdl-compiler/tests/generated/packet_decl_64bit_enum_little_endian.rs index e8113e7..8070e09 100644 --- a/pdl-compiler/tests/generated/packet_decl_64bit_enum_little_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_64bit_enum_little_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[repr(u64)] #[derive(Debug, Clone, Copy, Hash, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] diff --git a/pdl-compiler/tests/generated/packet_decl_64bit_scalar_array_big_endian.rs b/pdl-compiler/tests/generated/packet_decl_64bit_scalar_array_big_endian.rs index bf7437c..b2fdc19 100644 --- a/pdl-compiler/tests/generated/packet_decl_64bit_scalar_array_big_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_64bit_scalar_array_big_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct FooData { diff --git a/pdl-compiler/tests/generated/packet_decl_64bit_scalar_array_little_endian.rs b/pdl-compiler/tests/generated/packet_decl_64bit_scalar_array_little_endian.rs index e4e689b..64ce0b5 100644 --- a/pdl-compiler/tests/generated/packet_decl_64bit_scalar_array_little_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_64bit_scalar_array_little_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct FooData { diff --git a/pdl-compiler/tests/generated/packet_decl_64bit_scalar_big_endian.rs b/pdl-compiler/tests/generated/packet_decl_64bit_scalar_big_endian.rs index 7d3e260..0fd7562 100644 --- a/pdl-compiler/tests/generated/packet_decl_64bit_scalar_big_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_64bit_scalar_big_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct FooData { diff --git a/pdl-compiler/tests/generated/packet_decl_64bit_scalar_little_endian.rs b/pdl-compiler/tests/generated/packet_decl_64bit_scalar_little_endian.rs index 425606a..73d7d56 100644 --- a/pdl-compiler/tests/generated/packet_decl_64bit_scalar_little_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_64bit_scalar_little_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct FooData { diff --git a/pdl-compiler/tests/generated/packet_decl_8bit_enum_array_big_endian.rs b/pdl-compiler/tests/generated/packet_decl_8bit_enum_array_big_endian.rs index ffe9ac4..126aef0 100644 --- a/pdl-compiler/tests/generated/packet_decl_8bit_enum_array_big_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_8bit_enum_array_big_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[repr(u64)] #[derive(Debug, Clone, Copy, Hash, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] diff --git a/pdl-compiler/tests/generated/packet_decl_8bit_enum_array_little_endian.rs b/pdl-compiler/tests/generated/packet_decl_8bit_enum_array_little_endian.rs index ffe9ac4..126aef0 100644 --- a/pdl-compiler/tests/generated/packet_decl_8bit_enum_array_little_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_8bit_enum_array_little_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[repr(u64)] #[derive(Debug, Clone, Copy, Hash, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] diff --git a/pdl-compiler/tests/generated/packet_decl_8bit_enum_big_endian.rs b/pdl-compiler/tests/generated/packet_decl_8bit_enum_big_endian.rs index fc9f9df..c70529f 100644 --- a/pdl-compiler/tests/generated/packet_decl_8bit_enum_big_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_8bit_enum_big_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[repr(u64)] #[derive(Debug, Clone, Copy, Hash, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] diff --git a/pdl-compiler/tests/generated/packet_decl_8bit_enum_little_endian.rs b/pdl-compiler/tests/generated/packet_decl_8bit_enum_little_endian.rs index fc9f9df..c70529f 100644 --- a/pdl-compiler/tests/generated/packet_decl_8bit_enum_little_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_8bit_enum_little_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[repr(u64)] #[derive(Debug, Clone, Copy, Hash, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] diff --git a/pdl-compiler/tests/generated/packet_decl_8bit_scalar_array_big_endian.rs b/pdl-compiler/tests/generated/packet_decl_8bit_scalar_array_big_endian.rs index 21ae1c8..3346437 100644 --- a/pdl-compiler/tests/generated/packet_decl_8bit_scalar_array_big_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_8bit_scalar_array_big_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct FooData { diff --git a/pdl-compiler/tests/generated/packet_decl_8bit_scalar_array_little_endian.rs b/pdl-compiler/tests/generated/packet_decl_8bit_scalar_array_little_endian.rs index 21ae1c8..3346437 100644 --- a/pdl-compiler/tests/generated/packet_decl_8bit_scalar_array_little_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_8bit_scalar_array_little_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct FooData { diff --git a/pdl-compiler/tests/generated/packet_decl_8bit_scalar_big_endian.rs b/pdl-compiler/tests/generated/packet_decl_8bit_scalar_big_endian.rs index c255207..8f75306 100644 --- a/pdl-compiler/tests/generated/packet_decl_8bit_scalar_big_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_8bit_scalar_big_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct FooData { diff --git a/pdl-compiler/tests/generated/packet_decl_8bit_scalar_little_endian.rs b/pdl-compiler/tests/generated/packet_decl_8bit_scalar_little_endian.rs index c255207..8f75306 100644 --- a/pdl-compiler/tests/generated/packet_decl_8bit_scalar_little_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_8bit_scalar_little_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct FooData { diff --git a/pdl-compiler/tests/generated/packet_decl_array_dynamic_count_big_endian.rs b/pdl-compiler/tests/generated/packet_decl_array_dynamic_count_big_endian.rs index 6656d64..1fbe473 100644 --- a/pdl-compiler/tests/generated/packet_decl_array_dynamic_count_big_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_array_dynamic_count_big_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct FooData { diff --git a/pdl-compiler/tests/generated/packet_decl_array_dynamic_count_little_endian.rs b/pdl-compiler/tests/generated/packet_decl_array_dynamic_count_little_endian.rs index 09acc32..a98a3cb 100644 --- a/pdl-compiler/tests/generated/packet_decl_array_dynamic_count_little_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_array_dynamic_count_little_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct FooData { diff --git a/pdl-compiler/tests/generated/packet_decl_array_dynamic_size_big_endian.rs b/pdl-compiler/tests/generated/packet_decl_array_dynamic_size_big_endian.rs index aa1ca6b..134d7ba 100644 --- a/pdl-compiler/tests/generated/packet_decl_array_dynamic_size_big_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_array_dynamic_size_big_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct FooData { diff --git a/pdl-compiler/tests/generated/packet_decl_array_dynamic_size_little_endian.rs b/pdl-compiler/tests/generated/packet_decl_array_dynamic_size_little_endian.rs index 0e3f946..16606e9 100644 --- a/pdl-compiler/tests/generated/packet_decl_array_dynamic_size_little_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_array_dynamic_size_little_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct FooData { diff --git a/pdl-compiler/tests/generated/packet_decl_array_unknown_element_width_dynamic_count_big_endian.rs b/pdl-compiler/tests/generated/packet_decl_array_unknown_element_width_dynamic_count_big_endian.rs index 248d22e..79c351b 100644 --- a/pdl-compiler/tests/generated/packet_decl_array_unknown_element_width_dynamic_count_big_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_array_unknown_element_width_dynamic_count_big_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Foo { diff --git a/pdl-compiler/tests/generated/packet_decl_array_unknown_element_width_dynamic_count_little_endian.rs b/pdl-compiler/tests/generated/packet_decl_array_unknown_element_width_dynamic_count_little_endian.rs index 67597af..b6ff713 100644 --- a/pdl-compiler/tests/generated/packet_decl_array_unknown_element_width_dynamic_count_little_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_array_unknown_element_width_dynamic_count_little_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Foo { diff --git a/pdl-compiler/tests/generated/packet_decl_array_unknown_element_width_dynamic_size_big_endian.rs b/pdl-compiler/tests/generated/packet_decl_array_unknown_element_width_dynamic_size_big_endian.rs index bc9ea6a..e1fa3ef 100644 --- a/pdl-compiler/tests/generated/packet_decl_array_unknown_element_width_dynamic_size_big_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_array_unknown_element_width_dynamic_size_big_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Foo { diff --git a/pdl-compiler/tests/generated/packet_decl_array_unknown_element_width_dynamic_size_little_endian.rs b/pdl-compiler/tests/generated/packet_decl_array_unknown_element_width_dynamic_size_little_endian.rs index d420a4a..6755f15 100644 --- a/pdl-compiler/tests/generated/packet_decl_array_unknown_element_width_dynamic_size_little_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_array_unknown_element_width_dynamic_size_little_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Foo { diff --git a/pdl-compiler/tests/generated/packet_decl_array_with_padding_big_endian.rs b/pdl-compiler/tests/generated/packet_decl_array_with_padding_big_endian.rs index c5e8a96..1873a0e 100644 --- a/pdl-compiler/tests/generated/packet_decl_array_with_padding_big_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_array_with_padding_big_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Foo { diff --git a/pdl-compiler/tests/generated/packet_decl_array_with_padding_little_endian.rs b/pdl-compiler/tests/generated/packet_decl_array_with_padding_little_endian.rs index 3b7d10b..672224d 100644 --- a/pdl-compiler/tests/generated/packet_decl_array_with_padding_little_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_array_with_padding_little_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Foo { diff --git a/pdl-compiler/tests/generated/packet_decl_child_packets_big_endian.rs b/pdl-compiler/tests/generated/packet_decl_child_packets_big_endian.rs index 671d3d4..1eae6ce 100644 --- a/pdl-compiler/tests/generated/packet_decl_child_packets_big_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_child_packets_big_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[repr(u64)] #[derive(Debug, Clone, Copy, Hash, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] diff --git a/pdl-compiler/tests/generated/packet_decl_child_packets_little_endian.rs b/pdl-compiler/tests/generated/packet_decl_child_packets_little_endian.rs index 4107888..3aa5be1 100644 --- a/pdl-compiler/tests/generated/packet_decl_child_packets_little_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_child_packets_little_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[repr(u64)] #[derive(Debug, Clone, Copy, Hash, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] diff --git a/pdl-compiler/tests/generated/packet_decl_complex_scalars_big_endian.rs b/pdl-compiler/tests/generated/packet_decl_complex_scalars_big_endian.rs index f8fb814..5d3b7d3 100644 --- a/pdl-compiler/tests/generated/packet_decl_complex_scalars_big_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_complex_scalars_big_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct FooData { diff --git a/pdl-compiler/tests/generated/packet_decl_complex_scalars_little_endian.rs b/pdl-compiler/tests/generated/packet_decl_complex_scalars_little_endian.rs index a3e110c..86aa9ed 100644 --- a/pdl-compiler/tests/generated/packet_decl_complex_scalars_little_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_complex_scalars_little_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct FooData { diff --git a/pdl-compiler/tests/generated/packet_decl_custom_field_big_endian.rs b/pdl-compiler/tests/generated/packet_decl_custom_field_big_endian.rs index ef94aa6..40848bc 100644 --- a/pdl-compiler/tests/generated/packet_decl_custom_field_big_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_custom_field_big_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, Copy, Hash, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[cfg_attr(feature = "serde", serde(try_from = "u32", into = "u32"))] diff --git a/pdl-compiler/tests/generated/packet_decl_custom_field_little_endian.rs b/pdl-compiler/tests/generated/packet_decl_custom_field_little_endian.rs index f0d197a..109d905 100644 --- a/pdl-compiler/tests/generated/packet_decl_custom_field_little_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_custom_field_little_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, Copy, Hash, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[cfg_attr(feature = "serde", serde(try_from = "u32", into = "u32"))] diff --git a/pdl-compiler/tests/generated/packet_decl_empty_big_endian.rs b/pdl-compiler/tests/generated/packet_decl_empty_big_endian.rs index 1a3d410..4c3ef98 100644 --- a/pdl-compiler/tests/generated/packet_decl_empty_big_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_empty_big_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct FooData {} diff --git a/pdl-compiler/tests/generated/packet_decl_empty_little_endian.rs b/pdl-compiler/tests/generated/packet_decl_empty_little_endian.rs index 1a3d410..4c3ef98 100644 --- a/pdl-compiler/tests/generated/packet_decl_empty_little_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_empty_little_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct FooData {} diff --git a/pdl-compiler/tests/generated/packet_decl_fixed_enum_field_big_endian.rs b/pdl-compiler/tests/generated/packet_decl_fixed_enum_field_big_endian.rs index 96f5908..d9047e6 100644 --- a/pdl-compiler/tests/generated/packet_decl_fixed_enum_field_big_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_fixed_enum_field_big_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[repr(u64)] #[derive(Debug, Clone, Copy, Hash, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] diff --git a/pdl-compiler/tests/generated/packet_decl_fixed_enum_field_little_endian.rs b/pdl-compiler/tests/generated/packet_decl_fixed_enum_field_little_endian.rs index 1bfd105..d908036 100644 --- a/pdl-compiler/tests/generated/packet_decl_fixed_enum_field_little_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_fixed_enum_field_little_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[repr(u64)] #[derive(Debug, Clone, Copy, Hash, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] diff --git a/pdl-compiler/tests/generated/packet_decl_fixed_scalar_field_big_endian.rs b/pdl-compiler/tests/generated/packet_decl_fixed_scalar_field_big_endian.rs index 159a2a0..54c0b5f 100644 --- a/pdl-compiler/tests/generated/packet_decl_fixed_scalar_field_big_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_fixed_scalar_field_big_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct FooData { diff --git a/pdl-compiler/tests/generated/packet_decl_fixed_scalar_field_little_endian.rs b/pdl-compiler/tests/generated/packet_decl_fixed_scalar_field_little_endian.rs index d48e3f5..b074eb4 100644 --- a/pdl-compiler/tests/generated/packet_decl_fixed_scalar_field_little_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_fixed_scalar_field_little_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct FooData { diff --git a/pdl-compiler/tests/generated/packet_decl_grand_children_big_endian.rs b/pdl-compiler/tests/generated/packet_decl_grand_children_big_endian.rs index 8a81b00..7f89844 100644 --- a/pdl-compiler/tests/generated/packet_decl_grand_children_big_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_grand_children_big_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[repr(u64)] #[derive(Debug, Clone, Copy, Hash, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] diff --git a/pdl-compiler/tests/generated/packet_decl_grand_children_little_endian.rs b/pdl-compiler/tests/generated/packet_decl_grand_children_little_endian.rs index e90b502..c0abd6a 100644 --- a/pdl-compiler/tests/generated/packet_decl_grand_children_little_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_grand_children_little_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[repr(u64)] #[derive(Debug, Clone, Copy, Hash, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] diff --git a/pdl-compiler/tests/generated/packet_decl_mask_scalar_value_big_endian.rs b/pdl-compiler/tests/generated/packet_decl_mask_scalar_value_big_endian.rs index 2843d60..bc571f9 100644 --- a/pdl-compiler/tests/generated/packet_decl_mask_scalar_value_big_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_mask_scalar_value_big_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct FooData { diff --git a/pdl-compiler/tests/generated/packet_decl_mask_scalar_value_little_endian.rs b/pdl-compiler/tests/generated/packet_decl_mask_scalar_value_little_endian.rs index 48cd3cc..fa68813 100644 --- a/pdl-compiler/tests/generated/packet_decl_mask_scalar_value_little_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_mask_scalar_value_little_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct FooData { diff --git a/pdl-compiler/tests/generated/packet_decl_mixed_scalars_enums_big_endian.rs b/pdl-compiler/tests/generated/packet_decl_mixed_scalars_enums_big_endian.rs index dea4b35..ab84669 100644 --- a/pdl-compiler/tests/generated/packet_decl_mixed_scalars_enums_big_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_mixed_scalars_enums_big_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[repr(u64)] #[derive(Debug, Clone, Copy, Hash, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] diff --git a/pdl-compiler/tests/generated/packet_decl_mixed_scalars_enums_little_endian.rs b/pdl-compiler/tests/generated/packet_decl_mixed_scalars_enums_little_endian.rs index 91b2406..77d8658 100644 --- a/pdl-compiler/tests/generated/packet_decl_mixed_scalars_enums_little_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_mixed_scalars_enums_little_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[repr(u64)] #[derive(Debug, Clone, Copy, Hash, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] diff --git a/pdl-compiler/tests/generated/packet_decl_parent_with_alias_child_big_endian.rs b/pdl-compiler/tests/generated/packet_decl_parent_with_alias_child_big_endian.rs index a1a5704..2e583ec 100644 --- a/pdl-compiler/tests/generated/packet_decl_parent_with_alias_child_big_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_parent_with_alias_child_big_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[repr(u64)] #[derive(Debug, Clone, Copy, Hash, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] diff --git a/pdl-compiler/tests/generated/packet_decl_parent_with_alias_child_little_endian.rs b/pdl-compiler/tests/generated/packet_decl_parent_with_alias_child_little_endian.rs index a1a5704..2e583ec 100644 --- a/pdl-compiler/tests/generated/packet_decl_parent_with_alias_child_little_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_parent_with_alias_child_little_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[repr(u64)] #[derive(Debug, Clone, Copy, Hash, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] diff --git a/pdl-compiler/tests/generated/packet_decl_parent_with_no_payload_big_endian.rs b/pdl-compiler/tests/generated/packet_decl_parent_with_no_payload_big_endian.rs index ab0c2b9..2b32e89 100644 --- a/pdl-compiler/tests/generated/packet_decl_parent_with_no_payload_big_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_parent_with_no_payload_big_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[repr(u64)] #[derive(Debug, Clone, Copy, Hash, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] diff --git a/pdl-compiler/tests/generated/packet_decl_parent_with_no_payload_little_endian.rs b/pdl-compiler/tests/generated/packet_decl_parent_with_no_payload_little_endian.rs index ab0c2b9..2b32e89 100644 --- a/pdl-compiler/tests/generated/packet_decl_parent_with_no_payload_little_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_parent_with_no_payload_little_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[repr(u64)] #[derive(Debug, Clone, Copy, Hash, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] diff --git a/pdl-compiler/tests/generated/packet_decl_payload_field_unknown_size_big_endian.rs b/pdl-compiler/tests/generated/packet_decl_payload_field_unknown_size_big_endian.rs index f4eee5d..dfea86f 100644 --- a/pdl-compiler/tests/generated/packet_decl_payload_field_unknown_size_big_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_payload_field_unknown_size_big_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum FooDataChild { diff --git a/pdl-compiler/tests/generated/packet_decl_payload_field_unknown_size_little_endian.rs b/pdl-compiler/tests/generated/packet_decl_payload_field_unknown_size_little_endian.rs index 5f53aa0..4ab73ee 100644 --- a/pdl-compiler/tests/generated/packet_decl_payload_field_unknown_size_little_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_payload_field_unknown_size_little_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum FooDataChild { diff --git a/pdl-compiler/tests/generated/packet_decl_payload_field_unknown_size_terminal_big_endian.rs b/pdl-compiler/tests/generated/packet_decl_payload_field_unknown_size_terminal_big_endian.rs index 8ac719c..1a745ae 100644 --- a/pdl-compiler/tests/generated/packet_decl_payload_field_unknown_size_terminal_big_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_payload_field_unknown_size_terminal_big_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum FooDataChild { diff --git a/pdl-compiler/tests/generated/packet_decl_payload_field_unknown_size_terminal_little_endian.rs b/pdl-compiler/tests/generated/packet_decl_payload_field_unknown_size_terminal_little_endian.rs index db3cc09..5fb6831 100644 --- a/pdl-compiler/tests/generated/packet_decl_payload_field_unknown_size_terminal_little_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_payload_field_unknown_size_terminal_little_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum FooDataChild { diff --git a/pdl-compiler/tests/generated/packet_decl_payload_field_variable_size_big_endian.rs b/pdl-compiler/tests/generated/packet_decl_payload_field_variable_size_big_endian.rs index 6265c32..93dd598 100644 --- a/pdl-compiler/tests/generated/packet_decl_payload_field_variable_size_big_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_payload_field_variable_size_big_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum FooDataChild { diff --git a/pdl-compiler/tests/generated/packet_decl_payload_field_variable_size_little_endian.rs b/pdl-compiler/tests/generated/packet_decl_payload_field_variable_size_little_endian.rs index 7255939..686015e 100644 --- a/pdl-compiler/tests/generated/packet_decl_payload_field_variable_size_little_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_payload_field_variable_size_little_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum FooDataChild { diff --git a/pdl-compiler/tests/generated/packet_decl_reserved_field_big_endian.rs b/pdl-compiler/tests/generated/packet_decl_reserved_field_big_endian.rs index c12fcf8..0d298cf 100644 --- a/pdl-compiler/tests/generated/packet_decl_reserved_field_big_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_reserved_field_big_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct FooData {} diff --git a/pdl-compiler/tests/generated/packet_decl_reserved_field_little_endian.rs b/pdl-compiler/tests/generated/packet_decl_reserved_field_little_endian.rs index c12fcf8..0d298cf 100644 --- a/pdl-compiler/tests/generated/packet_decl_reserved_field_little_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_reserved_field_little_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct FooData {} diff --git a/pdl-compiler/tests/generated/packet_decl_simple_scalars_big_endian.rs b/pdl-compiler/tests/generated/packet_decl_simple_scalars_big_endian.rs index 4377ad0..032f9a8 100644 --- a/pdl-compiler/tests/generated/packet_decl_simple_scalars_big_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_simple_scalars_big_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct FooData { diff --git a/pdl-compiler/tests/generated/packet_decl_simple_scalars_little_endian.rs b/pdl-compiler/tests/generated/packet_decl_simple_scalars_little_endian.rs index 019925b..01d919c 100644 --- a/pdl-compiler/tests/generated/packet_decl_simple_scalars_little_endian.rs +++ b/pdl-compiler/tests/generated/packet_decl_simple_scalars_little_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct FooData { diff --git a/pdl-compiler/tests/generated/payload_with_size_modifier_big_endian.rs b/pdl-compiler/tests/generated/payload_with_size_modifier_big_endian.rs index b7e2d39..4716c36 100644 --- a/pdl-compiler/tests/generated/payload_with_size_modifier_big_endian.rs +++ b/pdl-compiler/tests/generated/payload_with_size_modifier_big_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum TestDataChild { diff --git a/pdl-compiler/tests/generated/payload_with_size_modifier_little_endian.rs b/pdl-compiler/tests/generated/payload_with_size_modifier_little_endian.rs index b7e2d39..4716c36 100644 --- a/pdl-compiler/tests/generated/payload_with_size_modifier_little_endian.rs +++ b/pdl-compiler/tests/generated/payload_with_size_modifier_little_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum TestDataChild { diff --git a/pdl-compiler/tests/generated/preamble.rs b/pdl-compiler/tests/generated/preamble.rs index 45e8e48..ab77b58 100644 --- a/pdl-compiler/tests/generated/preamble.rs +++ b/pdl-compiler/tests/generated/preamble.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,3 +18,8 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} diff --git a/pdl-compiler/tests/generated/reserved_identifier_big_endian.rs b/pdl-compiler/tests/generated/reserved_identifier_big_endian.rs index 2f24a26..5f5292d 100644 --- a/pdl-compiler/tests/generated/reserved_identifier_big_endian.rs +++ b/pdl-compiler/tests/generated/reserved_identifier_big_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct TestData { diff --git a/pdl-compiler/tests/generated/reserved_identifier_little_endian.rs b/pdl-compiler/tests/generated/reserved_identifier_little_endian.rs index 2f24a26..5f5292d 100644 --- a/pdl-compiler/tests/generated/reserved_identifier_little_endian.rs +++ b/pdl-compiler/tests/generated/reserved_identifier_little_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct TestData { diff --git a/pdl-compiler/tests/generated/struct_decl_complex_scalars_big_endian.rs b/pdl-compiler/tests/generated/struct_decl_complex_scalars_big_endian.rs index 80dcae2..42b0858 100644 --- a/pdl-compiler/tests/generated/struct_decl_complex_scalars_big_endian.rs +++ b/pdl-compiler/tests/generated/struct_decl_complex_scalars_big_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Foo { diff --git a/pdl-compiler/tests/generated/struct_decl_complex_scalars_little_endian.rs b/pdl-compiler/tests/generated/struct_decl_complex_scalars_little_endian.rs index a67410b..a8c3f7a 100644 --- a/pdl-compiler/tests/generated/struct_decl_complex_scalars_little_endian.rs +++ b/pdl-compiler/tests/generated/struct_decl_complex_scalars_little_endian.rs @@ -10,7 +10,7 @@ use pdl_runtime::{DecodeError, EncodeError, Packet}; /// in situations where the value needs to be validated. /// Users can freely deref the value, but only the backend /// may create it. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Private(T); impl std::ops::Deref for Private { type Target = T; @@ -18,6 +18,11 @@ impl std::ops::Deref for Private { &self.0 } } +impl std::fmt::Debug for Private { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + T::fmt(&self.0, f) + } +} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Foo {