@@ -23,7 +23,7 @@ pub struct ParametersList {
23
23
}
24
24
25
25
/// `T: Type = type_expression`
26
- #[ derive( Clone , Debug , PartialEq , Eq , Hash ) ]
26
+ #[ derive( Clone , PartialEq , Eq , Hash ) ]
27
27
#[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
28
28
pub enum ParameterTerm {
29
29
/// `<`
@@ -61,6 +61,51 @@ pub enum ParameterTerm {
61
61
} ,
62
62
}
63
63
64
+ impl Debug for ParameterTerm {
65
+ fn fmt ( & self , f : & mut Formatter < ' _ > ) -> core:: fmt:: Result {
66
+ match self {
67
+ Self :: LMark => f. write_str ( "<<<disable-index-parameters>>>" ) ,
68
+ Self :: RMark => f. write_str ( "<<<require-named-parameters>>>" ) ,
69
+ Self :: Single { annotations, key, bound, default } => {
70
+ let w = & mut f. debug_struct ( "Parameter" ) ;
71
+ w. field ( "key" , & key. name ) ;
72
+ if !annotations. is_empty ( ) {
73
+ w. field ( "annotations" , annotations) ;
74
+ }
75
+ if let Some ( bound) = bound {
76
+ w. field ( "bound" , bound) ;
77
+ }
78
+ if let Some ( default) = default {
79
+ w. field ( "default" , default) ;
80
+ }
81
+ w. finish ( )
82
+ }
83
+ Self :: UnpackList { modifiers, key, bound } => {
84
+ let w = & mut f. debug_struct ( "UnpackList" ) ;
85
+ w. field ( "key" , & key. name ) ;
86
+ if !modifiers. is_empty ( ) {
87
+ w. field ( "modifiers" , modifiers) ;
88
+ }
89
+ if let Some ( bound) = bound {
90
+ w. field ( "bound" , bound) ;
91
+ }
92
+ w. finish ( )
93
+ }
94
+ Self :: UnpackDict { modifiers, key, bound } => {
95
+ let w = & mut f. debug_struct ( "UnpackDict" ) ;
96
+ w. field ( "key" , & key. name ) ;
97
+ if !modifiers. is_empty ( ) {
98
+ w. field ( "modifiers" , modifiers) ;
99
+ }
100
+ if let Some ( bound) = bound {
101
+ w. field ( "bound" , bound) ;
102
+ }
103
+ w. finish ( )
104
+ }
105
+ }
106
+ }
107
+ }
108
+
64
109
impl Default for ParameterKind {
65
110
fn default ( ) -> Self {
66
111
Self :: Expression
0 commit comments