@@ -32,7 +32,10 @@ pub struct Validator<'a> {
3232
3333enum PathKind {
3434 Trait ,
35- StructEnumUnion ,
35+ /// Structs, Enums, Unions and Typedefs.
36+ ///
37+ /// This doesn't include trait's because traits are not types.
38+ Type ,
3639}
3740
3841impl < ' a > Validator < ' a > {
@@ -224,7 +227,7 @@ impl<'a> Validator<'a> {
224227
225228 fn check_type ( & mut self , x : & ' a Type ) {
226229 match x {
227- Type :: ResolvedPath ( path) => self . check_path ( path, PathKind :: StructEnumUnion ) ,
230+ Type :: ResolvedPath ( path) => self . check_path ( path, PathKind :: Type ) ,
228231 Type :: DynTrait ( dyn_trait) => self . check_dyn_trait ( dyn_trait) ,
229232 Type :: Generic ( _) => { }
230233 Type :: Primitive ( _) => { }
@@ -264,7 +267,7 @@ impl<'a> Validator<'a> {
264267 fn check_path ( & mut self , x : & ' a Path , kind : PathKind ) {
265268 match kind {
266269 PathKind :: Trait => self . add_trait_id ( & x. id ) ,
267- PathKind :: StructEnumUnion => self . add_struct_enum_union_id ( & x. id ) ,
270+ PathKind :: Type => self . add_type_id ( & x. id ) ,
268271 }
269272 if let Some ( args) = & x. args {
270273 self . check_generic_args ( & * * args) ;
@@ -392,8 +395,8 @@ impl<'a> Validator<'a> {
392395 self . add_id_checked ( id, Kind :: is_trait, "Trait" ) ;
393396 }
394397
395- fn add_struct_enum_union_id ( & mut self , id : & ' a Id ) {
396- self . add_id_checked ( id, Kind :: is_struct_enum_union , "Struct or Enum or Union " ) ;
398+ fn add_type_id ( & mut self , id : & ' a Id ) {
399+ self . add_id_checked ( id, Kind :: is_type , "Type ( Struct, Enum, Union or Typedef) " ) ;
397400 }
398401
399402 /// Add an Id that appeared in a trait
0 commit comments