@@ -595,7 +595,7 @@ pub enum IntParameter {
595
595
596
596
/// Flags to track why we are rendering.
597
597
#[ repr( C ) ]
598
- #[ derive( Debug , Copy , PartialEq , Eq , Clone , PartialOrd , Ord , Hash , Default , Deserialize , MallocSizeOf , Serialize ) ]
598
+ #[ derive( Copy , PartialEq , Eq , Clone , PartialOrd , Ord , Hash , Default , Deserialize , MallocSizeOf , Serialize ) ]
599
599
pub struct RenderReasons ( u32 ) ;
600
600
601
601
bitflags ! {
@@ -633,13 +633,23 @@ bitflags! {
633
633
}
634
634
}
635
635
636
+ impl core:: fmt:: Debug for RenderReasons {
637
+ fn fmt ( & self , f : & mut core:: fmt:: Formatter ) -> core:: fmt:: Result {
638
+ if self . is_empty ( ) {
639
+ write ! ( f, "{:#x}" , Self :: empty( ) . bits( ) )
640
+ } else {
641
+ bitflags:: parser:: to_writer ( self , f)
642
+ }
643
+ }
644
+ }
645
+
636
646
impl RenderReasons {
637
647
pub const NUM_BITS : u32 = 17 ;
638
648
}
639
649
640
650
/// Flags to enable/disable various builtin debugging tools.
641
651
#[ repr( C ) ]
642
- #[ derive( Debug , Copy , PartialEq , Eq , Clone , PartialOrd , Ord , Hash , Default , Deserialize , MallocSizeOf , Serialize ) ]
652
+ #[ derive( Copy , PartialEq , Eq , Clone , PartialOrd , Ord , Hash , Default , Deserialize , MallocSizeOf , Serialize ) ]
643
653
pub struct DebugFlags ( u32 ) ;
644
654
645
655
bitflags ! {
@@ -713,6 +723,16 @@ bitflags! {
713
723
}
714
724
}
715
725
726
+ impl core:: fmt:: Debug for DebugFlags {
727
+ fn fmt ( & self , f : & mut core:: fmt:: Formatter ) -> core:: fmt:: Result {
728
+ if self . is_empty ( ) {
729
+ write ! ( f, "{:#x}" , Self :: empty( ) . bits( ) )
730
+ } else {
731
+ bitflags:: parser:: to_writer ( self , f)
732
+ }
733
+ }
734
+ }
735
+
716
736
/// Information specific to a primitive type that
717
737
/// uniquely identifies a primitive template by key.
718
738
#[ derive( Debug , Clone , Eq , MallocSizeOf , PartialEq , Hash , Serialize , Deserialize ) ]
0 commit comments