@@ -458,12 +458,18 @@ impl<'a, Ty> TyAndLayout<'a, Ty> {
458
458
459
459
/// Information about how to pass an argument to,
460
460
/// or return a value from, a function, under some ABI.
461
- #[ derive( PartialEq , Eq , Hash , Debug , HashStable_Generic ) ]
461
+ #[ derive( PartialEq , Eq , Hash , HashStable_Generic ) ]
462
462
pub struct ArgAbi < ' a , Ty > {
463
463
pub layout : TyAndLayout < ' a , Ty > ,
464
464
pub mode : PassMode ,
465
465
}
466
466
467
+ impl < ' a , Ty : fmt:: Debug + fmt:: Display > fmt:: Debug for ArgAbi < ' a , Ty > {
468
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
469
+ f. debug_struct ( "ArgAbi" ) . field ( "layout" , & self . layout ) . field ( "mode" , & self . mode ) . finish ( )
470
+ }
471
+ }
472
+
467
473
impl < ' a , Ty > ArgAbi < ' a , Ty > {
468
474
pub fn new (
469
475
cx : & impl HasDataLayout ,
@@ -605,7 +611,7 @@ pub enum Conv {
605
611
///
606
612
/// I will do my best to describe this structure, but these
607
613
/// comments are reverse-engineered and may be inaccurate. -NDM
608
- #[ derive( PartialEq , Eq , Hash , Debug , HashStable_Generic ) ]
614
+ #[ derive( PartialEq , Eq , Hash , HashStable_Generic ) ]
609
615
pub struct FnAbi < ' a , Ty > {
610
616
/// The LLVM types of each argument.
611
617
pub args : Box < [ ArgAbi < ' a , Ty > ] > ,
@@ -626,6 +632,19 @@ pub struct FnAbi<'a, Ty> {
626
632
pub can_unwind : bool ,
627
633
}
628
634
635
+ impl < ' a , Ty : fmt:: Debug + fmt:: Display > fmt:: Debug for FnAbi < ' a , Ty > {
636
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
637
+ f. debug_struct ( "FnAbi" )
638
+ . field ( "args" , & self . args )
639
+ . field ( "ret" , & self . ret )
640
+ . field ( "c_variadic" , & self . c_variadic )
641
+ . field ( "fixed_count" , & self . fixed_count )
642
+ . field ( "conv" , & self . conv )
643
+ . field ( "can_unwind" , & self . can_unwind )
644
+ . finish ( )
645
+ }
646
+ }
647
+
629
648
/// Error produced by attempting to adjust a `FnAbi`, for a "foreign" ABI.
630
649
#[ derive( Copy , Clone , Debug , HashStable_Generic ) ]
631
650
pub enum AdjustForForeignAbiError {
0 commit comments