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