@@ -443,6 +443,8 @@ impl DotAttributes for TypeKind {
443
443
where
444
444
W : io:: Write ,
445
445
{
446
+ writeln ! ( out, "<tr><td>type kind</td><td>{}</td></tr>" , self . kind_name( ) ) ?;
447
+
446
448
if let TypeKind :: Comp ( ref comp) = * self {
447
449
comp. dot_attributes ( ctx, out) ?;
448
450
}
@@ -451,6 +453,35 @@ impl DotAttributes for TypeKind {
451
453
}
452
454
}
453
455
456
+ impl TypeKind {
457
+ fn kind_name ( & self ) -> & ' static str {
458
+ match * self {
459
+ TypeKind :: Void => "Void" ,
460
+ TypeKind :: NullPtr => "NullPtr" ,
461
+ TypeKind :: Comp ( ..) => "Comp" ,
462
+ TypeKind :: Opaque => "Opaque" ,
463
+ TypeKind :: Int ( ..) => "Int" ,
464
+ TypeKind :: Float ( ..) => "Float" ,
465
+ TypeKind :: Complex ( ..) => "Complex" ,
466
+ TypeKind :: Alias ( ..) => "Alias" ,
467
+ TypeKind :: TemplateAlias ( ..) => "TemplateAlias" ,
468
+ TypeKind :: Array ( ..) => "Array" ,
469
+ TypeKind :: Function ( ..) => "Function" ,
470
+ TypeKind :: Enum ( ..) => "Enum" ,
471
+ TypeKind :: Pointer ( ..) => "Pointer" ,
472
+ TypeKind :: BlockPointer => "BlockPointer" ,
473
+ TypeKind :: Reference ( ..) => "Reference" ,
474
+ TypeKind :: TemplateInstantiation ( ..) => "TemplateInstantiation" ,
475
+ TypeKind :: UnresolvedTypeRef ( ..) => "UnresolvedTypeRef" ,
476
+ TypeKind :: ResolvedTypeRef ( ..) => "ResolvedTypeRef" ,
477
+ TypeKind :: TypeParam => "TypeParam" ,
478
+ TypeKind :: ObjCInterface ( ..) => "ObjCInterface" ,
479
+ TypeKind :: ObjCId => "ObjCId" ,
480
+ TypeKind :: ObjCSel => "ObjCSel" ,
481
+ }
482
+ }
483
+ }
484
+
454
485
#[ test]
455
486
fn is_invalid_type_param_valid ( ) {
456
487
let ty = Type :: new ( Some ( "foo" . into ( ) ) , None , TypeKind :: TypeParam , false ) ;
0 commit comments