@@ -32,7 +32,10 @@ pub struct Validator<'a> {
32
32
33
33
enum PathKind {
34
34
Trait ,
35
- StructEnumUnion ,
35
+ /// Structs, Enums, Unions and Typedefs.
36
+ ///
37
+ /// This doesn't include trait's because traits are not types.
38
+ Type ,
36
39
}
37
40
38
41
impl < ' a > Validator < ' a > {
@@ -224,7 +227,7 @@ impl<'a> Validator<'a> {
224
227
225
228
fn check_type ( & mut self , x : & ' a Type ) {
226
229
match x {
227
- Type :: ResolvedPath ( path) => self . check_path ( path, PathKind :: StructEnumUnion ) ,
230
+ Type :: ResolvedPath ( path) => self . check_path ( path, PathKind :: Type ) ,
228
231
Type :: DynTrait ( dyn_trait) => self . check_dyn_trait ( dyn_trait) ,
229
232
Type :: Generic ( _) => { }
230
233
Type :: Primitive ( _) => { }
@@ -264,7 +267,7 @@ impl<'a> Validator<'a> {
264
267
fn check_path ( & mut self , x : & ' a Path , kind : PathKind ) {
265
268
match kind {
266
269
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 ) ,
268
271
}
269
272
if let Some ( args) = & x. args {
270
273
self . check_generic_args ( & * * args) ;
@@ -392,8 +395,8 @@ impl<'a> Validator<'a> {
392
395
self . add_id_checked ( id, Kind :: is_trait, "Trait" ) ;
393
396
}
394
397
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) " ) ;
397
400
}
398
401
399
402
/// Add an Id that appeared in a trait
0 commit comments