fn visit_type(&mut self, ty: &'ast syn::Type) {
            match ty {
                syn::Type::Array(ty) => self.visit_type(&ty.elem),
                syn::Type::BareFn(ty) => {
                    for arg in &ty.inputs {
                        self.visit_type(&arg.ty);
                    }
                    self.visit_return_type(&ty.output);
                }
                syn::Type::Group(ty) => self.visit_type(&ty.elem),
                syn::Type::ImplTrait(ty) => {
                    for bound in &ty.bounds {
                        self.visit_type_param_bound(bound);
                    }
                }
                syn::Type::Macro(ty) => self.visit_macro(&ty.mac),
                syn::Type::Paren(ty) => self.visit_type(&ty.elem),
                syn::Type::Path(ty) => {
                    if let Some(qself) = &ty.qself {
                        self.visit_type(&qself.ty);
                    }
                    self.visit_path(&ty.path);
                }
                syn::Type::Ptr(ty) => self.visit_type(&ty.elem),
                syn::Type::Reference(ty) => self.visit_type(&ty.elem),
                syn::Type::Slice(ty) => self.visit_type(&ty.elem),
                syn::Type::TraitObject(ty) => {
                    for bound in &ty.bounds {
                        self.visit_type_param_bound(bound);
                    }
                }
                syn::Type::Tuple(ty) => {
                    for elem in &ty.elems {
                        self.visit_type(elem);
                    }
                }

                syn::Type::Infer(_) | syn::Type::Never(_) | syn::Type::Verbatim(_) => {}

                #[cfg(test)]
                syn::Type::__TestExhaustive(_) => unimplemented!(),
                #[cfg(not(test))]
                _ => {}
            }
        }
// Everything below is simply traversing the syntax tree.
Everything below is simply traversing the syntax tree.
Everything below is simply traversing the syntax tree .
fn visit_type(&mut self, ty: &'ast syn::Type) {
            match ty {
                syn::Type::Array(ty) => self.visit_type(&ty.elem),
                syn::Type::BareFn(ty) => {
                    for arg in &ty.inputs {
                        self.visit_type(&arg.ty);
                    }
                    self.visit_return_type(&ty.output);
                }
                syn::Type::Group(ty) => self.visit_type(&ty.elem),
                syn::Type::ImplTrait(ty) => {
                    for bound in &ty.bounds {
                        self.visit_type_param_bound(bound);
                    }
                }
                syn::Type::Macro(ty) => self.visit_macro(&ty.mac),
                syn::Type::Paren(ty) => self.visit_type(&ty.elem),
                syn::Type::Path(ty) => {
                    if let Some(qself) = &ty.qself {
                        self.visit_type(&qself.ty);
                    }
                    self.visit_path(&ty.path);
                }
                syn::Type::Ptr(ty) => self.visit_type(&ty.elem),
                syn::Type::Reference(ty) => self.visit_type(&ty.elem),
                syn::Type::Slice(ty) => self.visit_type(&ty.elem),
                syn::Type::TraitObject(ty) => {
                    for bound in &ty.bounds {
                        self.visit_type_param_bound(bound);
                    }
                }
                syn::Type::Tuple(ty) => {
                    for elem in &ty.elems {
                        self.visit_type(elem);
                    }
                }
                syn::Type::Infer(_) | syn::Type::Never(_) | syn::Type::Verbatim(_) => {}
                #[cfg(test)]
                syn::Type::__TestExhaustive(_) => unimplemented!(),
                #[cfg(not(test))]
                _ => {}
            }
        }
fn visit_type ( & mut self , ty : & ' ast syn :: Type ) { match ty { syn :: Type :: Array ( ty ) => self . visit_type ( & ty . elem ) , syn :: Type :: BareFn ( ty ) => { for arg in & ty . inputs { self . visit_type ( & arg . ty ) ; } self . visit_return_type ( & ty . output ) ; } syn :: Type :: Group ( ty ) => self . visit_type ( & ty . elem ) , syn :: Type :: ImplTrait ( ty ) => { for bound in & ty . bounds { self . visit_type_param_bound ( bound ) ; } } syn :: Type :: Macro ( ty ) => self . visit_macro ( & ty . mac ) , syn :: Type :: Paren ( ty ) => self . visit_type ( & ty . elem ) , syn :: Type :: Path ( ty ) => { if let Some ( qself ) = & ty . qself { self . visit_type ( & qself . ty ) ; } self . visit_path ( & ty . path ) ; } syn :: Type :: Ptr ( ty ) => self . visit_type ( & ty . elem ) , syn :: Type :: Reference ( ty ) => self . visit_type ( & ty . elem ) , syn :: Type :: Slice ( ty ) => self . visit_type ( & ty . elem ) , syn :: Type :: TraitObject ( ty ) => { for bound in & ty . bounds { self . visit_type_param_bound ( bound ) ; } } syn :: Type :: Tuple ( ty ) => { for elem in & ty . elems { self . visit_type ( elem ) ; } } syn :: Type :: Infer ( _ ) | syn :: Type :: Never ( _ ) | syn :: Type :: Verbatim ( _ ) => { } # [ cfg ( test ) ] syn :: Type :: __TestExhaustive ( _ ) => unimplemented ! ( ) , # [ cfg ( not ( test ) ) ] _ => { } } }
Everything below is simply traversing the syntax tree.
Everything below is simply traversing the syntax tree .
&mut self
ty
&'ast syn::Type
&mut self
ty
&'ast syn::Type