1 // This file is @generated by syn-internal-codegen.
2 // It is not intended for manual editing.
3
4 #![allow(unused_variables)]
5 #[cfg(any(feature = "full", feature = "derive"))]
6 use crate::gen::helper::visit::*;
7 #[cfg(any(feature = "full", feature = "derive"))]
8 use crate::punctuated::Punctuated;
9 use crate::*;
10 use proc_macro2::Span;
11 #[cfg(feature = "full")]
12 macro_rules! full {
13 ($e:expr) => {
14 $e
15 };
16 }
17 #[cfg(all(feature = "derive", not(feature = "full")))]
18 macro_rules! full {
19 ($e:expr) => {
20 unreachable!()
21 };
22 }
23 #[cfg(any(feature = "full", feature = "derive"))]
24 macro_rules! skip {
25 ($($tt:tt)*) => {};
26 }
27 /// Syntax tree traversal to walk a shared borrow of a syntax tree.
28 ///
29 /// See the [module documentation] for details.
30 ///
31 /// [module documentation]: self
32 ///
33 /// *This trait is available if Syn is built with the `"visit"` feature.*
34 pub trait Visit<'ast> {
35 #[cfg(any(feature = "derive", feature = "full"))]
visit_abi(&mut self, i: &'ast Abi)36 fn visit_abi(&mut self, i: &'ast Abi) {
37 visit_abi(self, i)
38 }
39 #[cfg(any(feature = "derive", feature = "full"))]
visit_angle_bracketed_generic_arguments(&mut self, i: &'ast AngleBracketedGenericArguments)40 fn visit_angle_bracketed_generic_arguments(&mut self, i: &'ast AngleBracketedGenericArguments) {
41 visit_angle_bracketed_generic_arguments(self, i)
42 }
43 #[cfg(feature = "full")]
visit_arm(&mut self, i: &'ast Arm)44 fn visit_arm(&mut self, i: &'ast Arm) {
45 visit_arm(self, i)
46 }
47 #[cfg(any(feature = "derive", feature = "full"))]
visit_attr_style(&mut self, i: &'ast AttrStyle)48 fn visit_attr_style(&mut self, i: &'ast AttrStyle) {
49 visit_attr_style(self, i)
50 }
51 #[cfg(any(feature = "derive", feature = "full"))]
visit_attribute(&mut self, i: &'ast Attribute)52 fn visit_attribute(&mut self, i: &'ast Attribute) {
53 visit_attribute(self, i)
54 }
55 #[cfg(any(feature = "derive", feature = "full"))]
visit_bare_fn_arg(&mut self, i: &'ast BareFnArg)56 fn visit_bare_fn_arg(&mut self, i: &'ast BareFnArg) {
57 visit_bare_fn_arg(self, i)
58 }
59 #[cfg(any(feature = "derive", feature = "full"))]
visit_bin_op(&mut self, i: &'ast BinOp)60 fn visit_bin_op(&mut self, i: &'ast BinOp) {
61 visit_bin_op(self, i)
62 }
63 #[cfg(any(feature = "derive", feature = "full"))]
visit_binding(&mut self, i: &'ast Binding)64 fn visit_binding(&mut self, i: &'ast Binding) {
65 visit_binding(self, i)
66 }
67 #[cfg(feature = "full")]
visit_block(&mut self, i: &'ast Block)68 fn visit_block(&mut self, i: &'ast Block) {
69 visit_block(self, i)
70 }
71 #[cfg(any(feature = "derive", feature = "full"))]
visit_bound_lifetimes(&mut self, i: &'ast BoundLifetimes)72 fn visit_bound_lifetimes(&mut self, i: &'ast BoundLifetimes) {
73 visit_bound_lifetimes(self, i)
74 }
75 #[cfg(any(feature = "derive", feature = "full"))]
visit_const_param(&mut self, i: &'ast ConstParam)76 fn visit_const_param(&mut self, i: &'ast ConstParam) {
77 visit_const_param(self, i)
78 }
79 #[cfg(any(feature = "derive", feature = "full"))]
visit_constraint(&mut self, i: &'ast Constraint)80 fn visit_constraint(&mut self, i: &'ast Constraint) {
81 visit_constraint(self, i)
82 }
83 #[cfg(feature = "derive")]
visit_data(&mut self, i: &'ast Data)84 fn visit_data(&mut self, i: &'ast Data) {
85 visit_data(self, i)
86 }
87 #[cfg(feature = "derive")]
visit_data_enum(&mut self, i: &'ast DataEnum)88 fn visit_data_enum(&mut self, i: &'ast DataEnum) {
89 visit_data_enum(self, i)
90 }
91 #[cfg(feature = "derive")]
visit_data_struct(&mut self, i: &'ast DataStruct)92 fn visit_data_struct(&mut self, i: &'ast DataStruct) {
93 visit_data_struct(self, i)
94 }
95 #[cfg(feature = "derive")]
visit_data_union(&mut self, i: &'ast DataUnion)96 fn visit_data_union(&mut self, i: &'ast DataUnion) {
97 visit_data_union(self, i)
98 }
99 #[cfg(feature = "derive")]
visit_derive_input(&mut self, i: &'ast DeriveInput)100 fn visit_derive_input(&mut self, i: &'ast DeriveInput) {
101 visit_derive_input(self, i)
102 }
103 #[cfg(any(feature = "derive", feature = "full"))]
visit_expr(&mut self, i: &'ast Expr)104 fn visit_expr(&mut self, i: &'ast Expr) {
105 visit_expr(self, i)
106 }
107 #[cfg(feature = "full")]
visit_expr_array(&mut self, i: &'ast ExprArray)108 fn visit_expr_array(&mut self, i: &'ast ExprArray) {
109 visit_expr_array(self, i)
110 }
111 #[cfg(feature = "full")]
visit_expr_assign(&mut self, i: &'ast ExprAssign)112 fn visit_expr_assign(&mut self, i: &'ast ExprAssign) {
113 visit_expr_assign(self, i)
114 }
115 #[cfg(feature = "full")]
visit_expr_assign_op(&mut self, i: &'ast ExprAssignOp)116 fn visit_expr_assign_op(&mut self, i: &'ast ExprAssignOp) {
117 visit_expr_assign_op(self, i)
118 }
119 #[cfg(feature = "full")]
visit_expr_async(&mut self, i: &'ast ExprAsync)120 fn visit_expr_async(&mut self, i: &'ast ExprAsync) {
121 visit_expr_async(self, i)
122 }
123 #[cfg(feature = "full")]
visit_expr_await(&mut self, i: &'ast ExprAwait)124 fn visit_expr_await(&mut self, i: &'ast ExprAwait) {
125 visit_expr_await(self, i)
126 }
127 #[cfg(any(feature = "derive", feature = "full"))]
visit_expr_binary(&mut self, i: &'ast ExprBinary)128 fn visit_expr_binary(&mut self, i: &'ast ExprBinary) {
129 visit_expr_binary(self, i)
130 }
131 #[cfg(feature = "full")]
visit_expr_block(&mut self, i: &'ast ExprBlock)132 fn visit_expr_block(&mut self, i: &'ast ExprBlock) {
133 visit_expr_block(self, i)
134 }
135 #[cfg(feature = "full")]
visit_expr_box(&mut self, i: &'ast ExprBox)136 fn visit_expr_box(&mut self, i: &'ast ExprBox) {
137 visit_expr_box(self, i)
138 }
139 #[cfg(feature = "full")]
visit_expr_break(&mut self, i: &'ast ExprBreak)140 fn visit_expr_break(&mut self, i: &'ast ExprBreak) {
141 visit_expr_break(self, i)
142 }
143 #[cfg(any(feature = "derive", feature = "full"))]
visit_expr_call(&mut self, i: &'ast ExprCall)144 fn visit_expr_call(&mut self, i: &'ast ExprCall) {
145 visit_expr_call(self, i)
146 }
147 #[cfg(any(feature = "derive", feature = "full"))]
visit_expr_cast(&mut self, i: &'ast ExprCast)148 fn visit_expr_cast(&mut self, i: &'ast ExprCast) {
149 visit_expr_cast(self, i)
150 }
151 #[cfg(feature = "full")]
visit_expr_closure(&mut self, i: &'ast ExprClosure)152 fn visit_expr_closure(&mut self, i: &'ast ExprClosure) {
153 visit_expr_closure(self, i)
154 }
155 #[cfg(feature = "full")]
visit_expr_continue(&mut self, i: &'ast ExprContinue)156 fn visit_expr_continue(&mut self, i: &'ast ExprContinue) {
157 visit_expr_continue(self, i)
158 }
159 #[cfg(any(feature = "derive", feature = "full"))]
visit_expr_field(&mut self, i: &'ast ExprField)160 fn visit_expr_field(&mut self, i: &'ast ExprField) {
161 visit_expr_field(self, i)
162 }
163 #[cfg(feature = "full")]
visit_expr_for_loop(&mut self, i: &'ast ExprForLoop)164 fn visit_expr_for_loop(&mut self, i: &'ast ExprForLoop) {
165 visit_expr_for_loop(self, i)
166 }
167 #[cfg(feature = "full")]
visit_expr_group(&mut self, i: &'ast ExprGroup)168 fn visit_expr_group(&mut self, i: &'ast ExprGroup) {
169 visit_expr_group(self, i)
170 }
171 #[cfg(feature = "full")]
visit_expr_if(&mut self, i: &'ast ExprIf)172 fn visit_expr_if(&mut self, i: &'ast ExprIf) {
173 visit_expr_if(self, i)
174 }
175 #[cfg(any(feature = "derive", feature = "full"))]
visit_expr_index(&mut self, i: &'ast ExprIndex)176 fn visit_expr_index(&mut self, i: &'ast ExprIndex) {
177 visit_expr_index(self, i)
178 }
179 #[cfg(feature = "full")]
visit_expr_let(&mut self, i: &'ast ExprLet)180 fn visit_expr_let(&mut self, i: &'ast ExprLet) {
181 visit_expr_let(self, i)
182 }
183 #[cfg(any(feature = "derive", feature = "full"))]
visit_expr_lit(&mut self, i: &'ast ExprLit)184 fn visit_expr_lit(&mut self, i: &'ast ExprLit) {
185 visit_expr_lit(self, i)
186 }
187 #[cfg(feature = "full")]
visit_expr_loop(&mut self, i: &'ast ExprLoop)188 fn visit_expr_loop(&mut self, i: &'ast ExprLoop) {
189 visit_expr_loop(self, i)
190 }
191 #[cfg(feature = "full")]
visit_expr_macro(&mut self, i: &'ast ExprMacro)192 fn visit_expr_macro(&mut self, i: &'ast ExprMacro) {
193 visit_expr_macro(self, i)
194 }
195 #[cfg(feature = "full")]
visit_expr_match(&mut self, i: &'ast ExprMatch)196 fn visit_expr_match(&mut self, i: &'ast ExprMatch) {
197 visit_expr_match(self, i)
198 }
199 #[cfg(feature = "full")]
visit_expr_method_call(&mut self, i: &'ast ExprMethodCall)200 fn visit_expr_method_call(&mut self, i: &'ast ExprMethodCall) {
201 visit_expr_method_call(self, i)
202 }
203 #[cfg(any(feature = "derive", feature = "full"))]
visit_expr_paren(&mut self, i: &'ast ExprParen)204 fn visit_expr_paren(&mut self, i: &'ast ExprParen) {
205 visit_expr_paren(self, i)
206 }
207 #[cfg(any(feature = "derive", feature = "full"))]
visit_expr_path(&mut self, i: &'ast ExprPath)208 fn visit_expr_path(&mut self, i: &'ast ExprPath) {
209 visit_expr_path(self, i)
210 }
211 #[cfg(feature = "full")]
visit_expr_range(&mut self, i: &'ast ExprRange)212 fn visit_expr_range(&mut self, i: &'ast ExprRange) {
213 visit_expr_range(self, i)
214 }
215 #[cfg(feature = "full")]
visit_expr_reference(&mut self, i: &'ast ExprReference)216 fn visit_expr_reference(&mut self, i: &'ast ExprReference) {
217 visit_expr_reference(self, i)
218 }
219 #[cfg(feature = "full")]
visit_expr_repeat(&mut self, i: &'ast ExprRepeat)220 fn visit_expr_repeat(&mut self, i: &'ast ExprRepeat) {
221 visit_expr_repeat(self, i)
222 }
223 #[cfg(feature = "full")]
visit_expr_return(&mut self, i: &'ast ExprReturn)224 fn visit_expr_return(&mut self, i: &'ast ExprReturn) {
225 visit_expr_return(self, i)
226 }
227 #[cfg(feature = "full")]
visit_expr_struct(&mut self, i: &'ast ExprStruct)228 fn visit_expr_struct(&mut self, i: &'ast ExprStruct) {
229 visit_expr_struct(self, i)
230 }
231 #[cfg(feature = "full")]
visit_expr_try(&mut self, i: &'ast ExprTry)232 fn visit_expr_try(&mut self, i: &'ast ExprTry) {
233 visit_expr_try(self, i)
234 }
235 #[cfg(feature = "full")]
visit_expr_try_block(&mut self, i: &'ast ExprTryBlock)236 fn visit_expr_try_block(&mut self, i: &'ast ExprTryBlock) {
237 visit_expr_try_block(self, i)
238 }
239 #[cfg(feature = "full")]
visit_expr_tuple(&mut self, i: &'ast ExprTuple)240 fn visit_expr_tuple(&mut self, i: &'ast ExprTuple) {
241 visit_expr_tuple(self, i)
242 }
243 #[cfg(feature = "full")]
visit_expr_type(&mut self, i: &'ast ExprType)244 fn visit_expr_type(&mut self, i: &'ast ExprType) {
245 visit_expr_type(self, i)
246 }
247 #[cfg(any(feature = "derive", feature = "full"))]
visit_expr_unary(&mut self, i: &'ast ExprUnary)248 fn visit_expr_unary(&mut self, i: &'ast ExprUnary) {
249 visit_expr_unary(self, i)
250 }
251 #[cfg(feature = "full")]
visit_expr_unsafe(&mut self, i: &'ast ExprUnsafe)252 fn visit_expr_unsafe(&mut self, i: &'ast ExprUnsafe) {
253 visit_expr_unsafe(self, i)
254 }
255 #[cfg(feature = "full")]
visit_expr_while(&mut self, i: &'ast ExprWhile)256 fn visit_expr_while(&mut self, i: &'ast ExprWhile) {
257 visit_expr_while(self, i)
258 }
259 #[cfg(feature = "full")]
visit_expr_yield(&mut self, i: &'ast ExprYield)260 fn visit_expr_yield(&mut self, i: &'ast ExprYield) {
261 visit_expr_yield(self, i)
262 }
263 #[cfg(any(feature = "derive", feature = "full"))]
visit_field(&mut self, i: &'ast Field)264 fn visit_field(&mut self, i: &'ast Field) {
265 visit_field(self, i)
266 }
267 #[cfg(feature = "full")]
visit_field_pat(&mut self, i: &'ast FieldPat)268 fn visit_field_pat(&mut self, i: &'ast FieldPat) {
269 visit_field_pat(self, i)
270 }
271 #[cfg(feature = "full")]
visit_field_value(&mut self, i: &'ast FieldValue)272 fn visit_field_value(&mut self, i: &'ast FieldValue) {
273 visit_field_value(self, i)
274 }
275 #[cfg(any(feature = "derive", feature = "full"))]
visit_fields(&mut self, i: &'ast Fields)276 fn visit_fields(&mut self, i: &'ast Fields) {
277 visit_fields(self, i)
278 }
279 #[cfg(any(feature = "derive", feature = "full"))]
visit_fields_named(&mut self, i: &'ast FieldsNamed)280 fn visit_fields_named(&mut self, i: &'ast FieldsNamed) {
281 visit_fields_named(self, i)
282 }
283 #[cfg(any(feature = "derive", feature = "full"))]
visit_fields_unnamed(&mut self, i: &'ast FieldsUnnamed)284 fn visit_fields_unnamed(&mut self, i: &'ast FieldsUnnamed) {
285 visit_fields_unnamed(self, i)
286 }
287 #[cfg(feature = "full")]
visit_file(&mut self, i: &'ast File)288 fn visit_file(&mut self, i: &'ast File) {
289 visit_file(self, i)
290 }
291 #[cfg(feature = "full")]
visit_fn_arg(&mut self, i: &'ast FnArg)292 fn visit_fn_arg(&mut self, i: &'ast FnArg) {
293 visit_fn_arg(self, i)
294 }
295 #[cfg(feature = "full")]
visit_foreign_item(&mut self, i: &'ast ForeignItem)296 fn visit_foreign_item(&mut self, i: &'ast ForeignItem) {
297 visit_foreign_item(self, i)
298 }
299 #[cfg(feature = "full")]
visit_foreign_item_fn(&mut self, i: &'ast ForeignItemFn)300 fn visit_foreign_item_fn(&mut self, i: &'ast ForeignItemFn) {
301 visit_foreign_item_fn(self, i)
302 }
303 #[cfg(feature = "full")]
visit_foreign_item_macro(&mut self, i: &'ast ForeignItemMacro)304 fn visit_foreign_item_macro(&mut self, i: &'ast ForeignItemMacro) {
305 visit_foreign_item_macro(self, i)
306 }
307 #[cfg(feature = "full")]
visit_foreign_item_static(&mut self, i: &'ast ForeignItemStatic)308 fn visit_foreign_item_static(&mut self, i: &'ast ForeignItemStatic) {
309 visit_foreign_item_static(self, i)
310 }
311 #[cfg(feature = "full")]
visit_foreign_item_type(&mut self, i: &'ast ForeignItemType)312 fn visit_foreign_item_type(&mut self, i: &'ast ForeignItemType) {
313 visit_foreign_item_type(self, i)
314 }
315 #[cfg(any(feature = "derive", feature = "full"))]
visit_generic_argument(&mut self, i: &'ast GenericArgument)316 fn visit_generic_argument(&mut self, i: &'ast GenericArgument) {
317 visit_generic_argument(self, i)
318 }
319 #[cfg(feature = "full")]
visit_generic_method_argument(&mut self, i: &'ast GenericMethodArgument)320 fn visit_generic_method_argument(&mut self, i: &'ast GenericMethodArgument) {
321 visit_generic_method_argument(self, i)
322 }
323 #[cfg(any(feature = "derive", feature = "full"))]
visit_generic_param(&mut self, i: &'ast GenericParam)324 fn visit_generic_param(&mut self, i: &'ast GenericParam) {
325 visit_generic_param(self, i)
326 }
327 #[cfg(any(feature = "derive", feature = "full"))]
visit_generics(&mut self, i: &'ast Generics)328 fn visit_generics(&mut self, i: &'ast Generics) {
329 visit_generics(self, i)
330 }
visit_ident(&mut self, i: &'ast Ident)331 fn visit_ident(&mut self, i: &'ast Ident) {
332 visit_ident(self, i)
333 }
334 #[cfg(feature = "full")]
visit_impl_item(&mut self, i: &'ast ImplItem)335 fn visit_impl_item(&mut self, i: &'ast ImplItem) {
336 visit_impl_item(self, i)
337 }
338 #[cfg(feature = "full")]
visit_impl_item_const(&mut self, i: &'ast ImplItemConst)339 fn visit_impl_item_const(&mut self, i: &'ast ImplItemConst) {
340 visit_impl_item_const(self, i)
341 }
342 #[cfg(feature = "full")]
visit_impl_item_macro(&mut self, i: &'ast ImplItemMacro)343 fn visit_impl_item_macro(&mut self, i: &'ast ImplItemMacro) {
344 visit_impl_item_macro(self, i)
345 }
346 #[cfg(feature = "full")]
visit_impl_item_method(&mut self, i: &'ast ImplItemMethod)347 fn visit_impl_item_method(&mut self, i: &'ast ImplItemMethod) {
348 visit_impl_item_method(self, i)
349 }
350 #[cfg(feature = "full")]
visit_impl_item_type(&mut self, i: &'ast ImplItemType)351 fn visit_impl_item_type(&mut self, i: &'ast ImplItemType) {
352 visit_impl_item_type(self, i)
353 }
354 #[cfg(any(feature = "derive", feature = "full"))]
visit_index(&mut self, i: &'ast Index)355 fn visit_index(&mut self, i: &'ast Index) {
356 visit_index(self, i)
357 }
358 #[cfg(feature = "full")]
visit_item(&mut self, i: &'ast Item)359 fn visit_item(&mut self, i: &'ast Item) {
360 visit_item(self, i)
361 }
362 #[cfg(feature = "full")]
visit_item_const(&mut self, i: &'ast ItemConst)363 fn visit_item_const(&mut self, i: &'ast ItemConst) {
364 visit_item_const(self, i)
365 }
366 #[cfg(feature = "full")]
visit_item_enum(&mut self, i: &'ast ItemEnum)367 fn visit_item_enum(&mut self, i: &'ast ItemEnum) {
368 visit_item_enum(self, i)
369 }
370 #[cfg(feature = "full")]
visit_item_extern_crate(&mut self, i: &'ast ItemExternCrate)371 fn visit_item_extern_crate(&mut self, i: &'ast ItemExternCrate) {
372 visit_item_extern_crate(self, i)
373 }
374 #[cfg(feature = "full")]
visit_item_fn(&mut self, i: &'ast ItemFn)375 fn visit_item_fn(&mut self, i: &'ast ItemFn) {
376 visit_item_fn(self, i)
377 }
378 #[cfg(feature = "full")]
visit_item_foreign_mod(&mut self, i: &'ast ItemForeignMod)379 fn visit_item_foreign_mod(&mut self, i: &'ast ItemForeignMod) {
380 visit_item_foreign_mod(self, i)
381 }
382 #[cfg(feature = "full")]
visit_item_impl(&mut self, i: &'ast ItemImpl)383 fn visit_item_impl(&mut self, i: &'ast ItemImpl) {
384 visit_item_impl(self, i)
385 }
386 #[cfg(feature = "full")]
visit_item_macro(&mut self, i: &'ast ItemMacro)387 fn visit_item_macro(&mut self, i: &'ast ItemMacro) {
388 visit_item_macro(self, i)
389 }
390 #[cfg(feature = "full")]
visit_item_macro2(&mut self, i: &'ast ItemMacro2)391 fn visit_item_macro2(&mut self, i: &'ast ItemMacro2) {
392 visit_item_macro2(self, i)
393 }
394 #[cfg(feature = "full")]
visit_item_mod(&mut self, i: &'ast ItemMod)395 fn visit_item_mod(&mut self, i: &'ast ItemMod) {
396 visit_item_mod(self, i)
397 }
398 #[cfg(feature = "full")]
visit_item_static(&mut self, i: &'ast ItemStatic)399 fn visit_item_static(&mut self, i: &'ast ItemStatic) {
400 visit_item_static(self, i)
401 }
402 #[cfg(feature = "full")]
visit_item_struct(&mut self, i: &'ast ItemStruct)403 fn visit_item_struct(&mut self, i: &'ast ItemStruct) {
404 visit_item_struct(self, i)
405 }
406 #[cfg(feature = "full")]
visit_item_trait(&mut self, i: &'ast ItemTrait)407 fn visit_item_trait(&mut self, i: &'ast ItemTrait) {
408 visit_item_trait(self, i)
409 }
410 #[cfg(feature = "full")]
visit_item_trait_alias(&mut self, i: &'ast ItemTraitAlias)411 fn visit_item_trait_alias(&mut self, i: &'ast ItemTraitAlias) {
412 visit_item_trait_alias(self, i)
413 }
414 #[cfg(feature = "full")]
visit_item_type(&mut self, i: &'ast ItemType)415 fn visit_item_type(&mut self, i: &'ast ItemType) {
416 visit_item_type(self, i)
417 }
418 #[cfg(feature = "full")]
visit_item_union(&mut self, i: &'ast ItemUnion)419 fn visit_item_union(&mut self, i: &'ast ItemUnion) {
420 visit_item_union(self, i)
421 }
422 #[cfg(feature = "full")]
visit_item_use(&mut self, i: &'ast ItemUse)423 fn visit_item_use(&mut self, i: &'ast ItemUse) {
424 visit_item_use(self, i)
425 }
426 #[cfg(feature = "full")]
visit_label(&mut self, i: &'ast Label)427 fn visit_label(&mut self, i: &'ast Label) {
428 visit_label(self, i)
429 }
visit_lifetime(&mut self, i: &'ast Lifetime)430 fn visit_lifetime(&mut self, i: &'ast Lifetime) {
431 visit_lifetime(self, i)
432 }
433 #[cfg(any(feature = "derive", feature = "full"))]
visit_lifetime_def(&mut self, i: &'ast LifetimeDef)434 fn visit_lifetime_def(&mut self, i: &'ast LifetimeDef) {
435 visit_lifetime_def(self, i)
436 }
437 #[cfg(any(feature = "derive", feature = "full"))]
visit_lit(&mut self, i: &'ast Lit)438 fn visit_lit(&mut self, i: &'ast Lit) {
439 visit_lit(self, i)
440 }
441 #[cfg(any(feature = "derive", feature = "full"))]
visit_lit_bool(&mut self, i: &'ast LitBool)442 fn visit_lit_bool(&mut self, i: &'ast LitBool) {
443 visit_lit_bool(self, i)
444 }
445 #[cfg(any(feature = "derive", feature = "full"))]
visit_lit_byte(&mut self, i: &'ast LitByte)446 fn visit_lit_byte(&mut self, i: &'ast LitByte) {
447 visit_lit_byte(self, i)
448 }
449 #[cfg(any(feature = "derive", feature = "full"))]
visit_lit_byte_str(&mut self, i: &'ast LitByteStr)450 fn visit_lit_byte_str(&mut self, i: &'ast LitByteStr) {
451 visit_lit_byte_str(self, i)
452 }
453 #[cfg(any(feature = "derive", feature = "full"))]
visit_lit_char(&mut self, i: &'ast LitChar)454 fn visit_lit_char(&mut self, i: &'ast LitChar) {
455 visit_lit_char(self, i)
456 }
457 #[cfg(any(feature = "derive", feature = "full"))]
visit_lit_float(&mut self, i: &'ast LitFloat)458 fn visit_lit_float(&mut self, i: &'ast LitFloat) {
459 visit_lit_float(self, i)
460 }
461 #[cfg(any(feature = "derive", feature = "full"))]
visit_lit_int(&mut self, i: &'ast LitInt)462 fn visit_lit_int(&mut self, i: &'ast LitInt) {
463 visit_lit_int(self, i)
464 }
465 #[cfg(any(feature = "derive", feature = "full"))]
visit_lit_str(&mut self, i: &'ast LitStr)466 fn visit_lit_str(&mut self, i: &'ast LitStr) {
467 visit_lit_str(self, i)
468 }
469 #[cfg(feature = "full")]
visit_local(&mut self, i: &'ast Local)470 fn visit_local(&mut self, i: &'ast Local) {
471 visit_local(self, i)
472 }
473 #[cfg(any(feature = "derive", feature = "full"))]
visit_macro(&mut self, i: &'ast Macro)474 fn visit_macro(&mut self, i: &'ast Macro) {
475 visit_macro(self, i)
476 }
477 #[cfg(any(feature = "derive", feature = "full"))]
visit_macro_delimiter(&mut self, i: &'ast MacroDelimiter)478 fn visit_macro_delimiter(&mut self, i: &'ast MacroDelimiter) {
479 visit_macro_delimiter(self, i)
480 }
481 #[cfg(any(feature = "derive", feature = "full"))]
visit_member(&mut self, i: &'ast Member)482 fn visit_member(&mut self, i: &'ast Member) {
483 visit_member(self, i)
484 }
485 #[cfg(any(feature = "derive", feature = "full"))]
visit_meta(&mut self, i: &'ast Meta)486 fn visit_meta(&mut self, i: &'ast Meta) {
487 visit_meta(self, i)
488 }
489 #[cfg(any(feature = "derive", feature = "full"))]
visit_meta_list(&mut self, i: &'ast MetaList)490 fn visit_meta_list(&mut self, i: &'ast MetaList) {
491 visit_meta_list(self, i)
492 }
493 #[cfg(any(feature = "derive", feature = "full"))]
visit_meta_name_value(&mut self, i: &'ast MetaNameValue)494 fn visit_meta_name_value(&mut self, i: &'ast MetaNameValue) {
495 visit_meta_name_value(self, i)
496 }
497 #[cfg(feature = "full")]
visit_method_turbofish(&mut self, i: &'ast MethodTurbofish)498 fn visit_method_turbofish(&mut self, i: &'ast MethodTurbofish) {
499 visit_method_turbofish(self, i)
500 }
501 #[cfg(any(feature = "derive", feature = "full"))]
visit_nested_meta(&mut self, i: &'ast NestedMeta)502 fn visit_nested_meta(&mut self, i: &'ast NestedMeta) {
503 visit_nested_meta(self, i)
504 }
505 #[cfg(any(feature = "derive", feature = "full"))]
visit_parenthesized_generic_arguments(&mut self, i: &'ast ParenthesizedGenericArguments)506 fn visit_parenthesized_generic_arguments(&mut self, i: &'ast ParenthesizedGenericArguments) {
507 visit_parenthesized_generic_arguments(self, i)
508 }
509 #[cfg(feature = "full")]
visit_pat(&mut self, i: &'ast Pat)510 fn visit_pat(&mut self, i: &'ast Pat) {
511 visit_pat(self, i)
512 }
513 #[cfg(feature = "full")]
visit_pat_box(&mut self, i: &'ast PatBox)514 fn visit_pat_box(&mut self, i: &'ast PatBox) {
515 visit_pat_box(self, i)
516 }
517 #[cfg(feature = "full")]
visit_pat_ident(&mut self, i: &'ast PatIdent)518 fn visit_pat_ident(&mut self, i: &'ast PatIdent) {
519 visit_pat_ident(self, i)
520 }
521 #[cfg(feature = "full")]
visit_pat_lit(&mut self, i: &'ast PatLit)522 fn visit_pat_lit(&mut self, i: &'ast PatLit) {
523 visit_pat_lit(self, i)
524 }
525 #[cfg(feature = "full")]
visit_pat_macro(&mut self, i: &'ast PatMacro)526 fn visit_pat_macro(&mut self, i: &'ast PatMacro) {
527 visit_pat_macro(self, i)
528 }
529 #[cfg(feature = "full")]
visit_pat_or(&mut self, i: &'ast PatOr)530 fn visit_pat_or(&mut self, i: &'ast PatOr) {
531 visit_pat_or(self, i)
532 }
533 #[cfg(feature = "full")]
visit_pat_path(&mut self, i: &'ast PatPath)534 fn visit_pat_path(&mut self, i: &'ast PatPath) {
535 visit_pat_path(self, i)
536 }
537 #[cfg(feature = "full")]
visit_pat_range(&mut self, i: &'ast PatRange)538 fn visit_pat_range(&mut self, i: &'ast PatRange) {
539 visit_pat_range(self, i)
540 }
541 #[cfg(feature = "full")]
visit_pat_reference(&mut self, i: &'ast PatReference)542 fn visit_pat_reference(&mut self, i: &'ast PatReference) {
543 visit_pat_reference(self, i)
544 }
545 #[cfg(feature = "full")]
visit_pat_rest(&mut self, i: &'ast PatRest)546 fn visit_pat_rest(&mut self, i: &'ast PatRest) {
547 visit_pat_rest(self, i)
548 }
549 #[cfg(feature = "full")]
visit_pat_slice(&mut self, i: &'ast PatSlice)550 fn visit_pat_slice(&mut self, i: &'ast PatSlice) {
551 visit_pat_slice(self, i)
552 }
553 #[cfg(feature = "full")]
visit_pat_struct(&mut self, i: &'ast PatStruct)554 fn visit_pat_struct(&mut self, i: &'ast PatStruct) {
555 visit_pat_struct(self, i)
556 }
557 #[cfg(feature = "full")]
visit_pat_tuple(&mut self, i: &'ast PatTuple)558 fn visit_pat_tuple(&mut self, i: &'ast PatTuple) {
559 visit_pat_tuple(self, i)
560 }
561 #[cfg(feature = "full")]
visit_pat_tuple_struct(&mut self, i: &'ast PatTupleStruct)562 fn visit_pat_tuple_struct(&mut self, i: &'ast PatTupleStruct) {
563 visit_pat_tuple_struct(self, i)
564 }
565 #[cfg(feature = "full")]
visit_pat_type(&mut self, i: &'ast PatType)566 fn visit_pat_type(&mut self, i: &'ast PatType) {
567 visit_pat_type(self, i)
568 }
569 #[cfg(feature = "full")]
visit_pat_wild(&mut self, i: &'ast PatWild)570 fn visit_pat_wild(&mut self, i: &'ast PatWild) {
571 visit_pat_wild(self, i)
572 }
573 #[cfg(any(feature = "derive", feature = "full"))]
visit_path(&mut self, i: &'ast Path)574 fn visit_path(&mut self, i: &'ast Path) {
575 visit_path(self, i)
576 }
577 #[cfg(any(feature = "derive", feature = "full"))]
visit_path_arguments(&mut self, i: &'ast PathArguments)578 fn visit_path_arguments(&mut self, i: &'ast PathArguments) {
579 visit_path_arguments(self, i)
580 }
581 #[cfg(any(feature = "derive", feature = "full"))]
visit_path_segment(&mut self, i: &'ast PathSegment)582 fn visit_path_segment(&mut self, i: &'ast PathSegment) {
583 visit_path_segment(self, i)
584 }
585 #[cfg(any(feature = "derive", feature = "full"))]
visit_predicate_eq(&mut self, i: &'ast PredicateEq)586 fn visit_predicate_eq(&mut self, i: &'ast PredicateEq) {
587 visit_predicate_eq(self, i)
588 }
589 #[cfg(any(feature = "derive", feature = "full"))]
visit_predicate_lifetime(&mut self, i: &'ast PredicateLifetime)590 fn visit_predicate_lifetime(&mut self, i: &'ast PredicateLifetime) {
591 visit_predicate_lifetime(self, i)
592 }
593 #[cfg(any(feature = "derive", feature = "full"))]
visit_predicate_type(&mut self, i: &'ast PredicateType)594 fn visit_predicate_type(&mut self, i: &'ast PredicateType) {
595 visit_predicate_type(self, i)
596 }
597 #[cfg(any(feature = "derive", feature = "full"))]
visit_qself(&mut self, i: &'ast QSelf)598 fn visit_qself(&mut self, i: &'ast QSelf) {
599 visit_qself(self, i)
600 }
601 #[cfg(feature = "full")]
visit_range_limits(&mut self, i: &'ast RangeLimits)602 fn visit_range_limits(&mut self, i: &'ast RangeLimits) {
603 visit_range_limits(self, i)
604 }
605 #[cfg(feature = "full")]
visit_receiver(&mut self, i: &'ast Receiver)606 fn visit_receiver(&mut self, i: &'ast Receiver) {
607 visit_receiver(self, i)
608 }
609 #[cfg(any(feature = "derive", feature = "full"))]
visit_return_type(&mut self, i: &'ast ReturnType)610 fn visit_return_type(&mut self, i: &'ast ReturnType) {
611 visit_return_type(self, i)
612 }
613 #[cfg(feature = "full")]
visit_signature(&mut self, i: &'ast Signature)614 fn visit_signature(&mut self, i: &'ast Signature) {
615 visit_signature(self, i)
616 }
visit_span(&mut self, i: &Span)617 fn visit_span(&mut self, i: &Span) {
618 visit_span(self, i)
619 }
620 #[cfg(feature = "full")]
visit_stmt(&mut self, i: &'ast Stmt)621 fn visit_stmt(&mut self, i: &'ast Stmt) {
622 visit_stmt(self, i)
623 }
624 #[cfg(any(feature = "derive", feature = "full"))]
visit_trait_bound(&mut self, i: &'ast TraitBound)625 fn visit_trait_bound(&mut self, i: &'ast TraitBound) {
626 visit_trait_bound(self, i)
627 }
628 #[cfg(any(feature = "derive", feature = "full"))]
visit_trait_bound_modifier(&mut self, i: &'ast TraitBoundModifier)629 fn visit_trait_bound_modifier(&mut self, i: &'ast TraitBoundModifier) {
630 visit_trait_bound_modifier(self, i)
631 }
632 #[cfg(feature = "full")]
visit_trait_item(&mut self, i: &'ast TraitItem)633 fn visit_trait_item(&mut self, i: &'ast TraitItem) {
634 visit_trait_item(self, i)
635 }
636 #[cfg(feature = "full")]
visit_trait_item_const(&mut self, i: &'ast TraitItemConst)637 fn visit_trait_item_const(&mut self, i: &'ast TraitItemConst) {
638 visit_trait_item_const(self, i)
639 }
640 #[cfg(feature = "full")]
visit_trait_item_macro(&mut self, i: &'ast TraitItemMacro)641 fn visit_trait_item_macro(&mut self, i: &'ast TraitItemMacro) {
642 visit_trait_item_macro(self, i)
643 }
644 #[cfg(feature = "full")]
visit_trait_item_method(&mut self, i: &'ast TraitItemMethod)645 fn visit_trait_item_method(&mut self, i: &'ast TraitItemMethod) {
646 visit_trait_item_method(self, i)
647 }
648 #[cfg(feature = "full")]
visit_trait_item_type(&mut self, i: &'ast TraitItemType)649 fn visit_trait_item_type(&mut self, i: &'ast TraitItemType) {
650 visit_trait_item_type(self, i)
651 }
652 #[cfg(any(feature = "derive", feature = "full"))]
visit_type(&mut self, i: &'ast Type)653 fn visit_type(&mut self, i: &'ast Type) {
654 visit_type(self, i)
655 }
656 #[cfg(any(feature = "derive", feature = "full"))]
visit_type_array(&mut self, i: &'ast TypeArray)657 fn visit_type_array(&mut self, i: &'ast TypeArray) {
658 visit_type_array(self, i)
659 }
660 #[cfg(any(feature = "derive", feature = "full"))]
visit_type_bare_fn(&mut self, i: &'ast TypeBareFn)661 fn visit_type_bare_fn(&mut self, i: &'ast TypeBareFn) {
662 visit_type_bare_fn(self, i)
663 }
664 #[cfg(any(feature = "derive", feature = "full"))]
visit_type_group(&mut self, i: &'ast TypeGroup)665 fn visit_type_group(&mut self, i: &'ast TypeGroup) {
666 visit_type_group(self, i)
667 }
668 #[cfg(any(feature = "derive", feature = "full"))]
visit_type_impl_trait(&mut self, i: &'ast TypeImplTrait)669 fn visit_type_impl_trait(&mut self, i: &'ast TypeImplTrait) {
670 visit_type_impl_trait(self, i)
671 }
672 #[cfg(any(feature = "derive", feature = "full"))]
visit_type_infer(&mut self, i: &'ast TypeInfer)673 fn visit_type_infer(&mut self, i: &'ast TypeInfer) {
674 visit_type_infer(self, i)
675 }
676 #[cfg(any(feature = "derive", feature = "full"))]
visit_type_macro(&mut self, i: &'ast TypeMacro)677 fn visit_type_macro(&mut self, i: &'ast TypeMacro) {
678 visit_type_macro(self, i)
679 }
680 #[cfg(any(feature = "derive", feature = "full"))]
visit_type_never(&mut self, i: &'ast TypeNever)681 fn visit_type_never(&mut self, i: &'ast TypeNever) {
682 visit_type_never(self, i)
683 }
684 #[cfg(any(feature = "derive", feature = "full"))]
visit_type_param(&mut self, i: &'ast TypeParam)685 fn visit_type_param(&mut self, i: &'ast TypeParam) {
686 visit_type_param(self, i)
687 }
688 #[cfg(any(feature = "derive", feature = "full"))]
visit_type_param_bound(&mut self, i: &'ast TypeParamBound)689 fn visit_type_param_bound(&mut self, i: &'ast TypeParamBound) {
690 visit_type_param_bound(self, i)
691 }
692 #[cfg(any(feature = "derive", feature = "full"))]
visit_type_paren(&mut self, i: &'ast TypeParen)693 fn visit_type_paren(&mut self, i: &'ast TypeParen) {
694 visit_type_paren(self, i)
695 }
696 #[cfg(any(feature = "derive", feature = "full"))]
visit_type_path(&mut self, i: &'ast TypePath)697 fn visit_type_path(&mut self, i: &'ast TypePath) {
698 visit_type_path(self, i)
699 }
700 #[cfg(any(feature = "derive", feature = "full"))]
visit_type_ptr(&mut self, i: &'ast TypePtr)701 fn visit_type_ptr(&mut self, i: &'ast TypePtr) {
702 visit_type_ptr(self, i)
703 }
704 #[cfg(any(feature = "derive", feature = "full"))]
visit_type_reference(&mut self, i: &'ast TypeReference)705 fn visit_type_reference(&mut self, i: &'ast TypeReference) {
706 visit_type_reference(self, i)
707 }
708 #[cfg(any(feature = "derive", feature = "full"))]
visit_type_slice(&mut self, i: &'ast TypeSlice)709 fn visit_type_slice(&mut self, i: &'ast TypeSlice) {
710 visit_type_slice(self, i)
711 }
712 #[cfg(any(feature = "derive", feature = "full"))]
visit_type_trait_object(&mut self, i: &'ast TypeTraitObject)713 fn visit_type_trait_object(&mut self, i: &'ast TypeTraitObject) {
714 visit_type_trait_object(self, i)
715 }
716 #[cfg(any(feature = "derive", feature = "full"))]
visit_type_tuple(&mut self, i: &'ast TypeTuple)717 fn visit_type_tuple(&mut self, i: &'ast TypeTuple) {
718 visit_type_tuple(self, i)
719 }
720 #[cfg(any(feature = "derive", feature = "full"))]
visit_un_op(&mut self, i: &'ast UnOp)721 fn visit_un_op(&mut self, i: &'ast UnOp) {
722 visit_un_op(self, i)
723 }
724 #[cfg(feature = "full")]
visit_use_glob(&mut self, i: &'ast UseGlob)725 fn visit_use_glob(&mut self, i: &'ast UseGlob) {
726 visit_use_glob(self, i)
727 }
728 #[cfg(feature = "full")]
visit_use_group(&mut self, i: &'ast UseGroup)729 fn visit_use_group(&mut self, i: &'ast UseGroup) {
730 visit_use_group(self, i)
731 }
732 #[cfg(feature = "full")]
visit_use_name(&mut self, i: &'ast UseName)733 fn visit_use_name(&mut self, i: &'ast UseName) {
734 visit_use_name(self, i)
735 }
736 #[cfg(feature = "full")]
visit_use_path(&mut self, i: &'ast UsePath)737 fn visit_use_path(&mut self, i: &'ast UsePath) {
738 visit_use_path(self, i)
739 }
740 #[cfg(feature = "full")]
visit_use_rename(&mut self, i: &'ast UseRename)741 fn visit_use_rename(&mut self, i: &'ast UseRename) {
742 visit_use_rename(self, i)
743 }
744 #[cfg(feature = "full")]
visit_use_tree(&mut self, i: &'ast UseTree)745 fn visit_use_tree(&mut self, i: &'ast UseTree) {
746 visit_use_tree(self, i)
747 }
748 #[cfg(any(feature = "derive", feature = "full"))]
visit_variadic(&mut self, i: &'ast Variadic)749 fn visit_variadic(&mut self, i: &'ast Variadic) {
750 visit_variadic(self, i)
751 }
752 #[cfg(any(feature = "derive", feature = "full"))]
visit_variant(&mut self, i: &'ast Variant)753 fn visit_variant(&mut self, i: &'ast Variant) {
754 visit_variant(self, i)
755 }
756 #[cfg(any(feature = "derive", feature = "full"))]
visit_vis_crate(&mut self, i: &'ast VisCrate)757 fn visit_vis_crate(&mut self, i: &'ast VisCrate) {
758 visit_vis_crate(self, i)
759 }
760 #[cfg(any(feature = "derive", feature = "full"))]
visit_vis_public(&mut self, i: &'ast VisPublic)761 fn visit_vis_public(&mut self, i: &'ast VisPublic) {
762 visit_vis_public(self, i)
763 }
764 #[cfg(any(feature = "derive", feature = "full"))]
visit_vis_restricted(&mut self, i: &'ast VisRestricted)765 fn visit_vis_restricted(&mut self, i: &'ast VisRestricted) {
766 visit_vis_restricted(self, i)
767 }
768 #[cfg(any(feature = "derive", feature = "full"))]
visit_visibility(&mut self, i: &'ast Visibility)769 fn visit_visibility(&mut self, i: &'ast Visibility) {
770 visit_visibility(self, i)
771 }
772 #[cfg(any(feature = "derive", feature = "full"))]
visit_where_clause(&mut self, i: &'ast WhereClause)773 fn visit_where_clause(&mut self, i: &'ast WhereClause) {
774 visit_where_clause(self, i)
775 }
776 #[cfg(any(feature = "derive", feature = "full"))]
visit_where_predicate(&mut self, i: &'ast WherePredicate)777 fn visit_where_predicate(&mut self, i: &'ast WherePredicate) {
778 visit_where_predicate(self, i)
779 }
780 }
781 #[cfg(any(feature = "derive", feature = "full"))]
visit_abi<'ast, V>(v: &mut V, node: &'ast Abi) where V: Visit<'ast> + ?Sized,782 pub fn visit_abi<'ast, V>(v: &mut V, node: &'ast Abi)
783 where
784 V: Visit<'ast> + ?Sized,
785 {
786 tokens_helper(v, &node.extern_token.span);
787 if let Some(it) = &node.name {
788 v.visit_lit_str(it)
789 };
790 }
791 #[cfg(any(feature = "derive", feature = "full"))]
visit_angle_bracketed_generic_arguments<'ast, V>( v: &mut V, node: &'ast AngleBracketedGenericArguments, ) where V: Visit<'ast> + ?Sized,792 pub fn visit_angle_bracketed_generic_arguments<'ast, V>(
793 v: &mut V,
794 node: &'ast AngleBracketedGenericArguments,
795 ) where
796 V: Visit<'ast> + ?Sized,
797 {
798 if let Some(it) = &node.colon2_token {
799 tokens_helper(v, &it.spans)
800 };
801 tokens_helper(v, &node.lt_token.spans);
802 for el in Punctuated::pairs(&node.args) {
803 let (it, p) = el.into_tuple();
804 v.visit_generic_argument(it);
805 if let Some(p) = p {
806 tokens_helper(v, &p.spans);
807 }
808 }
809 tokens_helper(v, &node.gt_token.spans);
810 }
811 #[cfg(feature = "full")]
visit_arm<'ast, V>(v: &mut V, node: &'ast Arm) where V: Visit<'ast> + ?Sized,812 pub fn visit_arm<'ast, V>(v: &mut V, node: &'ast Arm)
813 where
814 V: Visit<'ast> + ?Sized,
815 {
816 for it in &node.attrs {
817 v.visit_attribute(it)
818 }
819 v.visit_pat(&node.pat);
820 if let Some(it) = &node.guard {
821 tokens_helper(v, &(it).0.span);
822 v.visit_expr(&*(it).1);
823 };
824 tokens_helper(v, &node.fat_arrow_token.spans);
825 v.visit_expr(&*node.body);
826 if let Some(it) = &node.comma {
827 tokens_helper(v, &it.spans)
828 };
829 }
830 #[cfg(any(feature = "derive", feature = "full"))]
visit_attr_style<'ast, V>(v: &mut V, node: &'ast AttrStyle) where V: Visit<'ast> + ?Sized,831 pub fn visit_attr_style<'ast, V>(v: &mut V, node: &'ast AttrStyle)
832 where
833 V: Visit<'ast> + ?Sized,
834 {
835 match node {
836 AttrStyle::Outer => {}
837 AttrStyle::Inner(_binding_0) => {
838 tokens_helper(v, &_binding_0.spans);
839 }
840 }
841 }
842 #[cfg(any(feature = "derive", feature = "full"))]
visit_attribute<'ast, V>(v: &mut V, node: &'ast Attribute) where V: Visit<'ast> + ?Sized,843 pub fn visit_attribute<'ast, V>(v: &mut V, node: &'ast Attribute)
844 where
845 V: Visit<'ast> + ?Sized,
846 {
847 tokens_helper(v, &node.pound_token.spans);
848 v.visit_attr_style(&node.style);
849 tokens_helper(v, &node.bracket_token.span);
850 v.visit_path(&node.path);
851 skip!(node.tokens);
852 }
853 #[cfg(any(feature = "derive", feature = "full"))]
visit_bare_fn_arg<'ast, V>(v: &mut V, node: &'ast BareFnArg) where V: Visit<'ast> + ?Sized,854 pub fn visit_bare_fn_arg<'ast, V>(v: &mut V, node: &'ast BareFnArg)
855 where
856 V: Visit<'ast> + ?Sized,
857 {
858 for it in &node.attrs {
859 v.visit_attribute(it)
860 }
861 if let Some(it) = &node.name {
862 v.visit_ident(&(it).0);
863 tokens_helper(v, &(it).1.spans);
864 };
865 v.visit_type(&node.ty);
866 }
867 #[cfg(any(feature = "derive", feature = "full"))]
visit_bin_op<'ast, V>(v: &mut V, node: &'ast BinOp) where V: Visit<'ast> + ?Sized,868 pub fn visit_bin_op<'ast, V>(v: &mut V, node: &'ast BinOp)
869 where
870 V: Visit<'ast> + ?Sized,
871 {
872 match node {
873 BinOp::Add(_binding_0) => {
874 tokens_helper(v, &_binding_0.spans);
875 }
876 BinOp::Sub(_binding_0) => {
877 tokens_helper(v, &_binding_0.spans);
878 }
879 BinOp::Mul(_binding_0) => {
880 tokens_helper(v, &_binding_0.spans);
881 }
882 BinOp::Div(_binding_0) => {
883 tokens_helper(v, &_binding_0.spans);
884 }
885 BinOp::Rem(_binding_0) => {
886 tokens_helper(v, &_binding_0.spans);
887 }
888 BinOp::And(_binding_0) => {
889 tokens_helper(v, &_binding_0.spans);
890 }
891 BinOp::Or(_binding_0) => {
892 tokens_helper(v, &_binding_0.spans);
893 }
894 BinOp::BitXor(_binding_0) => {
895 tokens_helper(v, &_binding_0.spans);
896 }
897 BinOp::BitAnd(_binding_0) => {
898 tokens_helper(v, &_binding_0.spans);
899 }
900 BinOp::BitOr(_binding_0) => {
901 tokens_helper(v, &_binding_0.spans);
902 }
903 BinOp::Shl(_binding_0) => {
904 tokens_helper(v, &_binding_0.spans);
905 }
906 BinOp::Shr(_binding_0) => {
907 tokens_helper(v, &_binding_0.spans);
908 }
909 BinOp::Eq(_binding_0) => {
910 tokens_helper(v, &_binding_0.spans);
911 }
912 BinOp::Lt(_binding_0) => {
913 tokens_helper(v, &_binding_0.spans);
914 }
915 BinOp::Le(_binding_0) => {
916 tokens_helper(v, &_binding_0.spans);
917 }
918 BinOp::Ne(_binding_0) => {
919 tokens_helper(v, &_binding_0.spans);
920 }
921 BinOp::Ge(_binding_0) => {
922 tokens_helper(v, &_binding_0.spans);
923 }
924 BinOp::Gt(_binding_0) => {
925 tokens_helper(v, &_binding_0.spans);
926 }
927 BinOp::AddEq(_binding_0) => {
928 tokens_helper(v, &_binding_0.spans);
929 }
930 BinOp::SubEq(_binding_0) => {
931 tokens_helper(v, &_binding_0.spans);
932 }
933 BinOp::MulEq(_binding_0) => {
934 tokens_helper(v, &_binding_0.spans);
935 }
936 BinOp::DivEq(_binding_0) => {
937 tokens_helper(v, &_binding_0.spans);
938 }
939 BinOp::RemEq(_binding_0) => {
940 tokens_helper(v, &_binding_0.spans);
941 }
942 BinOp::BitXorEq(_binding_0) => {
943 tokens_helper(v, &_binding_0.spans);
944 }
945 BinOp::BitAndEq(_binding_0) => {
946 tokens_helper(v, &_binding_0.spans);
947 }
948 BinOp::BitOrEq(_binding_0) => {
949 tokens_helper(v, &_binding_0.spans);
950 }
951 BinOp::ShlEq(_binding_0) => {
952 tokens_helper(v, &_binding_0.spans);
953 }
954 BinOp::ShrEq(_binding_0) => {
955 tokens_helper(v, &_binding_0.spans);
956 }
957 }
958 }
959 #[cfg(any(feature = "derive", feature = "full"))]
visit_binding<'ast, V>(v: &mut V, node: &'ast Binding) where V: Visit<'ast> + ?Sized,960 pub fn visit_binding<'ast, V>(v: &mut V, node: &'ast Binding)
961 where
962 V: Visit<'ast> + ?Sized,
963 {
964 v.visit_ident(&node.ident);
965 tokens_helper(v, &node.eq_token.spans);
966 v.visit_type(&node.ty);
967 }
968 #[cfg(feature = "full")]
visit_block<'ast, V>(v: &mut V, node: &'ast Block) where V: Visit<'ast> + ?Sized,969 pub fn visit_block<'ast, V>(v: &mut V, node: &'ast Block)
970 where
971 V: Visit<'ast> + ?Sized,
972 {
973 tokens_helper(v, &node.brace_token.span);
974 for it in &node.stmts {
975 v.visit_stmt(it)
976 }
977 }
978 #[cfg(any(feature = "derive", feature = "full"))]
visit_bound_lifetimes<'ast, V>(v: &mut V, node: &'ast BoundLifetimes) where V: Visit<'ast> + ?Sized,979 pub fn visit_bound_lifetimes<'ast, V>(v: &mut V, node: &'ast BoundLifetimes)
980 where
981 V: Visit<'ast> + ?Sized,
982 {
983 tokens_helper(v, &node.for_token.span);
984 tokens_helper(v, &node.lt_token.spans);
985 for el in Punctuated::pairs(&node.lifetimes) {
986 let (it, p) = el.into_tuple();
987 v.visit_lifetime_def(it);
988 if let Some(p) = p {
989 tokens_helper(v, &p.spans);
990 }
991 }
992 tokens_helper(v, &node.gt_token.spans);
993 }
994 #[cfg(any(feature = "derive", feature = "full"))]
visit_const_param<'ast, V>(v: &mut V, node: &'ast ConstParam) where V: Visit<'ast> + ?Sized,995 pub fn visit_const_param<'ast, V>(v: &mut V, node: &'ast ConstParam)
996 where
997 V: Visit<'ast> + ?Sized,
998 {
999 for it in &node.attrs {
1000 v.visit_attribute(it)
1001 }
1002 tokens_helper(v, &node.const_token.span);
1003 v.visit_ident(&node.ident);
1004 tokens_helper(v, &node.colon_token.spans);
1005 v.visit_type(&node.ty);
1006 if let Some(it) = &node.eq_token {
1007 tokens_helper(v, &it.spans)
1008 };
1009 if let Some(it) = &node.default {
1010 v.visit_expr(it)
1011 };
1012 }
1013 #[cfg(any(feature = "derive", feature = "full"))]
visit_constraint<'ast, V>(v: &mut V, node: &'ast Constraint) where V: Visit<'ast> + ?Sized,1014 pub fn visit_constraint<'ast, V>(v: &mut V, node: &'ast Constraint)
1015 where
1016 V: Visit<'ast> + ?Sized,
1017 {
1018 v.visit_ident(&node.ident);
1019 tokens_helper(v, &node.colon_token.spans);
1020 for el in Punctuated::pairs(&node.bounds) {
1021 let (it, p) = el.into_tuple();
1022 v.visit_type_param_bound(it);
1023 if let Some(p) = p {
1024 tokens_helper(v, &p.spans);
1025 }
1026 }
1027 }
1028 #[cfg(feature = "derive")]
visit_data<'ast, V>(v: &mut V, node: &'ast Data) where V: Visit<'ast> + ?Sized,1029 pub fn visit_data<'ast, V>(v: &mut V, node: &'ast Data)
1030 where
1031 V: Visit<'ast> + ?Sized,
1032 {
1033 match node {
1034 Data::Struct(_binding_0) => {
1035 v.visit_data_struct(_binding_0);
1036 }
1037 Data::Enum(_binding_0) => {
1038 v.visit_data_enum(_binding_0);
1039 }
1040 Data::Union(_binding_0) => {
1041 v.visit_data_union(_binding_0);
1042 }
1043 }
1044 }
1045 #[cfg(feature = "derive")]
visit_data_enum<'ast, V>(v: &mut V, node: &'ast DataEnum) where V: Visit<'ast> + ?Sized,1046 pub fn visit_data_enum<'ast, V>(v: &mut V, node: &'ast DataEnum)
1047 where
1048 V: Visit<'ast> + ?Sized,
1049 {
1050 tokens_helper(v, &node.enum_token.span);
1051 tokens_helper(v, &node.brace_token.span);
1052 for el in Punctuated::pairs(&node.variants) {
1053 let (it, p) = el.into_tuple();
1054 v.visit_variant(it);
1055 if let Some(p) = p {
1056 tokens_helper(v, &p.spans);
1057 }
1058 }
1059 }
1060 #[cfg(feature = "derive")]
visit_data_struct<'ast, V>(v: &mut V, node: &'ast DataStruct) where V: Visit<'ast> + ?Sized,1061 pub fn visit_data_struct<'ast, V>(v: &mut V, node: &'ast DataStruct)
1062 where
1063 V: Visit<'ast> + ?Sized,
1064 {
1065 tokens_helper(v, &node.struct_token.span);
1066 v.visit_fields(&node.fields);
1067 if let Some(it) = &node.semi_token {
1068 tokens_helper(v, &it.spans)
1069 };
1070 }
1071 #[cfg(feature = "derive")]
visit_data_union<'ast, V>(v: &mut V, node: &'ast DataUnion) where V: Visit<'ast> + ?Sized,1072 pub fn visit_data_union<'ast, V>(v: &mut V, node: &'ast DataUnion)
1073 where
1074 V: Visit<'ast> + ?Sized,
1075 {
1076 tokens_helper(v, &node.union_token.span);
1077 v.visit_fields_named(&node.fields);
1078 }
1079 #[cfg(feature = "derive")]
visit_derive_input<'ast, V>(v: &mut V, node: &'ast DeriveInput) where V: Visit<'ast> + ?Sized,1080 pub fn visit_derive_input<'ast, V>(v: &mut V, node: &'ast DeriveInput)
1081 where
1082 V: Visit<'ast> + ?Sized,
1083 {
1084 for it in &node.attrs {
1085 v.visit_attribute(it)
1086 }
1087 v.visit_visibility(&node.vis);
1088 v.visit_ident(&node.ident);
1089 v.visit_generics(&node.generics);
1090 v.visit_data(&node.data);
1091 }
1092 #[cfg(any(feature = "derive", feature = "full"))]
visit_expr<'ast, V>(v: &mut V, node: &'ast Expr) where V: Visit<'ast> + ?Sized,1093 pub fn visit_expr<'ast, V>(v: &mut V, node: &'ast Expr)
1094 where
1095 V: Visit<'ast> + ?Sized,
1096 {
1097 match node {
1098 Expr::Array(_binding_0) => {
1099 full!(v.visit_expr_array(_binding_0));
1100 }
1101 Expr::Assign(_binding_0) => {
1102 full!(v.visit_expr_assign(_binding_0));
1103 }
1104 Expr::AssignOp(_binding_0) => {
1105 full!(v.visit_expr_assign_op(_binding_0));
1106 }
1107 Expr::Async(_binding_0) => {
1108 full!(v.visit_expr_async(_binding_0));
1109 }
1110 Expr::Await(_binding_0) => {
1111 full!(v.visit_expr_await(_binding_0));
1112 }
1113 Expr::Binary(_binding_0) => {
1114 v.visit_expr_binary(_binding_0);
1115 }
1116 Expr::Block(_binding_0) => {
1117 full!(v.visit_expr_block(_binding_0));
1118 }
1119 Expr::Box(_binding_0) => {
1120 full!(v.visit_expr_box(_binding_0));
1121 }
1122 Expr::Break(_binding_0) => {
1123 full!(v.visit_expr_break(_binding_0));
1124 }
1125 Expr::Call(_binding_0) => {
1126 v.visit_expr_call(_binding_0);
1127 }
1128 Expr::Cast(_binding_0) => {
1129 v.visit_expr_cast(_binding_0);
1130 }
1131 Expr::Closure(_binding_0) => {
1132 full!(v.visit_expr_closure(_binding_0));
1133 }
1134 Expr::Continue(_binding_0) => {
1135 full!(v.visit_expr_continue(_binding_0));
1136 }
1137 Expr::Field(_binding_0) => {
1138 v.visit_expr_field(_binding_0);
1139 }
1140 Expr::ForLoop(_binding_0) => {
1141 full!(v.visit_expr_for_loop(_binding_0));
1142 }
1143 Expr::Group(_binding_0) => {
1144 full!(v.visit_expr_group(_binding_0));
1145 }
1146 Expr::If(_binding_0) => {
1147 full!(v.visit_expr_if(_binding_0));
1148 }
1149 Expr::Index(_binding_0) => {
1150 v.visit_expr_index(_binding_0);
1151 }
1152 Expr::Let(_binding_0) => {
1153 full!(v.visit_expr_let(_binding_0));
1154 }
1155 Expr::Lit(_binding_0) => {
1156 v.visit_expr_lit(_binding_0);
1157 }
1158 Expr::Loop(_binding_0) => {
1159 full!(v.visit_expr_loop(_binding_0));
1160 }
1161 Expr::Macro(_binding_0) => {
1162 full!(v.visit_expr_macro(_binding_0));
1163 }
1164 Expr::Match(_binding_0) => {
1165 full!(v.visit_expr_match(_binding_0));
1166 }
1167 Expr::MethodCall(_binding_0) => {
1168 full!(v.visit_expr_method_call(_binding_0));
1169 }
1170 Expr::Paren(_binding_0) => {
1171 v.visit_expr_paren(_binding_0);
1172 }
1173 Expr::Path(_binding_0) => {
1174 v.visit_expr_path(_binding_0);
1175 }
1176 Expr::Range(_binding_0) => {
1177 full!(v.visit_expr_range(_binding_0));
1178 }
1179 Expr::Reference(_binding_0) => {
1180 full!(v.visit_expr_reference(_binding_0));
1181 }
1182 Expr::Repeat(_binding_0) => {
1183 full!(v.visit_expr_repeat(_binding_0));
1184 }
1185 Expr::Return(_binding_0) => {
1186 full!(v.visit_expr_return(_binding_0));
1187 }
1188 Expr::Struct(_binding_0) => {
1189 full!(v.visit_expr_struct(_binding_0));
1190 }
1191 Expr::Try(_binding_0) => {
1192 full!(v.visit_expr_try(_binding_0));
1193 }
1194 Expr::TryBlock(_binding_0) => {
1195 full!(v.visit_expr_try_block(_binding_0));
1196 }
1197 Expr::Tuple(_binding_0) => {
1198 full!(v.visit_expr_tuple(_binding_0));
1199 }
1200 Expr::Type(_binding_0) => {
1201 full!(v.visit_expr_type(_binding_0));
1202 }
1203 Expr::Unary(_binding_0) => {
1204 v.visit_expr_unary(_binding_0);
1205 }
1206 Expr::Unsafe(_binding_0) => {
1207 full!(v.visit_expr_unsafe(_binding_0));
1208 }
1209 Expr::Verbatim(_binding_0) => {
1210 skip!(_binding_0);
1211 }
1212 Expr::While(_binding_0) => {
1213 full!(v.visit_expr_while(_binding_0));
1214 }
1215 Expr::Yield(_binding_0) => {
1216 full!(v.visit_expr_yield(_binding_0));
1217 }
1218 _ => unreachable!(),
1219 }
1220 }
1221 #[cfg(feature = "full")]
visit_expr_array<'ast, V>(v: &mut V, node: &'ast ExprArray) where V: Visit<'ast> + ?Sized,1222 pub fn visit_expr_array<'ast, V>(v: &mut V, node: &'ast ExprArray)
1223 where
1224 V: Visit<'ast> + ?Sized,
1225 {
1226 for it in &node.attrs {
1227 v.visit_attribute(it)
1228 }
1229 tokens_helper(v, &node.bracket_token.span);
1230 for el in Punctuated::pairs(&node.elems) {
1231 let (it, p) = el.into_tuple();
1232 v.visit_expr(it);
1233 if let Some(p) = p {
1234 tokens_helper(v, &p.spans);
1235 }
1236 }
1237 }
1238 #[cfg(feature = "full")]
visit_expr_assign<'ast, V>(v: &mut V, node: &'ast ExprAssign) where V: Visit<'ast> + ?Sized,1239 pub fn visit_expr_assign<'ast, V>(v: &mut V, node: &'ast ExprAssign)
1240 where
1241 V: Visit<'ast> + ?Sized,
1242 {
1243 for it in &node.attrs {
1244 v.visit_attribute(it)
1245 }
1246 v.visit_expr(&*node.left);
1247 tokens_helper(v, &node.eq_token.spans);
1248 v.visit_expr(&*node.right);
1249 }
1250 #[cfg(feature = "full")]
visit_expr_assign_op<'ast, V>(v: &mut V, node: &'ast ExprAssignOp) where V: Visit<'ast> + ?Sized,1251 pub fn visit_expr_assign_op<'ast, V>(v: &mut V, node: &'ast ExprAssignOp)
1252 where
1253 V: Visit<'ast> + ?Sized,
1254 {
1255 for it in &node.attrs {
1256 v.visit_attribute(it)
1257 }
1258 v.visit_expr(&*node.left);
1259 v.visit_bin_op(&node.op);
1260 v.visit_expr(&*node.right);
1261 }
1262 #[cfg(feature = "full")]
visit_expr_async<'ast, V>(v: &mut V, node: &'ast ExprAsync) where V: Visit<'ast> + ?Sized,1263 pub fn visit_expr_async<'ast, V>(v: &mut V, node: &'ast ExprAsync)
1264 where
1265 V: Visit<'ast> + ?Sized,
1266 {
1267 for it in &node.attrs {
1268 v.visit_attribute(it)
1269 }
1270 tokens_helper(v, &node.async_token.span);
1271 if let Some(it) = &node.capture {
1272 tokens_helper(v, &it.span)
1273 };
1274 v.visit_block(&node.block);
1275 }
1276 #[cfg(feature = "full")]
visit_expr_await<'ast, V>(v: &mut V, node: &'ast ExprAwait) where V: Visit<'ast> + ?Sized,1277 pub fn visit_expr_await<'ast, V>(v: &mut V, node: &'ast ExprAwait)
1278 where
1279 V: Visit<'ast> + ?Sized,
1280 {
1281 for it in &node.attrs {
1282 v.visit_attribute(it)
1283 }
1284 v.visit_expr(&*node.base);
1285 tokens_helper(v, &node.dot_token.spans);
1286 tokens_helper(v, &node.await_token.span);
1287 }
1288 #[cfg(any(feature = "derive", feature = "full"))]
visit_expr_binary<'ast, V>(v: &mut V, node: &'ast ExprBinary) where V: Visit<'ast> + ?Sized,1289 pub fn visit_expr_binary<'ast, V>(v: &mut V, node: &'ast ExprBinary)
1290 where
1291 V: Visit<'ast> + ?Sized,
1292 {
1293 for it in &node.attrs {
1294 v.visit_attribute(it)
1295 }
1296 v.visit_expr(&*node.left);
1297 v.visit_bin_op(&node.op);
1298 v.visit_expr(&*node.right);
1299 }
1300 #[cfg(feature = "full")]
visit_expr_block<'ast, V>(v: &mut V, node: &'ast ExprBlock) where V: Visit<'ast> + ?Sized,1301 pub fn visit_expr_block<'ast, V>(v: &mut V, node: &'ast ExprBlock)
1302 where
1303 V: Visit<'ast> + ?Sized,
1304 {
1305 for it in &node.attrs {
1306 v.visit_attribute(it)
1307 }
1308 if let Some(it) = &node.label {
1309 v.visit_label(it)
1310 };
1311 v.visit_block(&node.block);
1312 }
1313 #[cfg(feature = "full")]
visit_expr_box<'ast, V>(v: &mut V, node: &'ast ExprBox) where V: Visit<'ast> + ?Sized,1314 pub fn visit_expr_box<'ast, V>(v: &mut V, node: &'ast ExprBox)
1315 where
1316 V: Visit<'ast> + ?Sized,
1317 {
1318 for it in &node.attrs {
1319 v.visit_attribute(it)
1320 }
1321 tokens_helper(v, &node.box_token.span);
1322 v.visit_expr(&*node.expr);
1323 }
1324 #[cfg(feature = "full")]
visit_expr_break<'ast, V>(v: &mut V, node: &'ast ExprBreak) where V: Visit<'ast> + ?Sized,1325 pub fn visit_expr_break<'ast, V>(v: &mut V, node: &'ast ExprBreak)
1326 where
1327 V: Visit<'ast> + ?Sized,
1328 {
1329 for it in &node.attrs {
1330 v.visit_attribute(it)
1331 }
1332 tokens_helper(v, &node.break_token.span);
1333 if let Some(it) = &node.label {
1334 v.visit_lifetime(it)
1335 };
1336 if let Some(it) = &node.expr {
1337 v.visit_expr(&**it)
1338 };
1339 }
1340 #[cfg(any(feature = "derive", feature = "full"))]
visit_expr_call<'ast, V>(v: &mut V, node: &'ast ExprCall) where V: Visit<'ast> + ?Sized,1341 pub fn visit_expr_call<'ast, V>(v: &mut V, node: &'ast ExprCall)
1342 where
1343 V: Visit<'ast> + ?Sized,
1344 {
1345 for it in &node.attrs {
1346 v.visit_attribute(it)
1347 }
1348 v.visit_expr(&*node.func);
1349 tokens_helper(v, &node.paren_token.span);
1350 for el in Punctuated::pairs(&node.args) {
1351 let (it, p) = el.into_tuple();
1352 v.visit_expr(it);
1353 if let Some(p) = p {
1354 tokens_helper(v, &p.spans);
1355 }
1356 }
1357 }
1358 #[cfg(any(feature = "derive", feature = "full"))]
visit_expr_cast<'ast, V>(v: &mut V, node: &'ast ExprCast) where V: Visit<'ast> + ?Sized,1359 pub fn visit_expr_cast<'ast, V>(v: &mut V, node: &'ast ExprCast)
1360 where
1361 V: Visit<'ast> + ?Sized,
1362 {
1363 for it in &node.attrs {
1364 v.visit_attribute(it)
1365 }
1366 v.visit_expr(&*node.expr);
1367 tokens_helper(v, &node.as_token.span);
1368 v.visit_type(&*node.ty);
1369 }
1370 #[cfg(feature = "full")]
visit_expr_closure<'ast, V>(v: &mut V, node: &'ast ExprClosure) where V: Visit<'ast> + ?Sized,1371 pub fn visit_expr_closure<'ast, V>(v: &mut V, node: &'ast ExprClosure)
1372 where
1373 V: Visit<'ast> + ?Sized,
1374 {
1375 for it in &node.attrs {
1376 v.visit_attribute(it)
1377 }
1378 if let Some(it) = &node.asyncness {
1379 tokens_helper(v, &it.span)
1380 };
1381 if let Some(it) = &node.movability {
1382 tokens_helper(v, &it.span)
1383 };
1384 if let Some(it) = &node.capture {
1385 tokens_helper(v, &it.span)
1386 };
1387 tokens_helper(v, &node.or1_token.spans);
1388 for el in Punctuated::pairs(&node.inputs) {
1389 let (it, p) = el.into_tuple();
1390 v.visit_pat(it);
1391 if let Some(p) = p {
1392 tokens_helper(v, &p.spans);
1393 }
1394 }
1395 tokens_helper(v, &node.or2_token.spans);
1396 v.visit_return_type(&node.output);
1397 v.visit_expr(&*node.body);
1398 }
1399 #[cfg(feature = "full")]
visit_expr_continue<'ast, V>(v: &mut V, node: &'ast ExprContinue) where V: Visit<'ast> + ?Sized,1400 pub fn visit_expr_continue<'ast, V>(v: &mut V, node: &'ast ExprContinue)
1401 where
1402 V: Visit<'ast> + ?Sized,
1403 {
1404 for it in &node.attrs {
1405 v.visit_attribute(it)
1406 }
1407 tokens_helper(v, &node.continue_token.span);
1408 if let Some(it) = &node.label {
1409 v.visit_lifetime(it)
1410 };
1411 }
1412 #[cfg(any(feature = "derive", feature = "full"))]
visit_expr_field<'ast, V>(v: &mut V, node: &'ast ExprField) where V: Visit<'ast> + ?Sized,1413 pub fn visit_expr_field<'ast, V>(v: &mut V, node: &'ast ExprField)
1414 where
1415 V: Visit<'ast> + ?Sized,
1416 {
1417 for it in &node.attrs {
1418 v.visit_attribute(it)
1419 }
1420 v.visit_expr(&*node.base);
1421 tokens_helper(v, &node.dot_token.spans);
1422 v.visit_member(&node.member);
1423 }
1424 #[cfg(feature = "full")]
visit_expr_for_loop<'ast, V>(v: &mut V, node: &'ast ExprForLoop) where V: Visit<'ast> + ?Sized,1425 pub fn visit_expr_for_loop<'ast, V>(v: &mut V, node: &'ast ExprForLoop)
1426 where
1427 V: Visit<'ast> + ?Sized,
1428 {
1429 for it in &node.attrs {
1430 v.visit_attribute(it)
1431 }
1432 if let Some(it) = &node.label {
1433 v.visit_label(it)
1434 };
1435 tokens_helper(v, &node.for_token.span);
1436 v.visit_pat(&node.pat);
1437 tokens_helper(v, &node.in_token.span);
1438 v.visit_expr(&*node.expr);
1439 v.visit_block(&node.body);
1440 }
1441 #[cfg(feature = "full")]
visit_expr_group<'ast, V>(v: &mut V, node: &'ast ExprGroup) where V: Visit<'ast> + ?Sized,1442 pub fn visit_expr_group<'ast, V>(v: &mut V, node: &'ast ExprGroup)
1443 where
1444 V: Visit<'ast> + ?Sized,
1445 {
1446 for it in &node.attrs {
1447 v.visit_attribute(it)
1448 }
1449 tokens_helper(v, &node.group_token.span);
1450 v.visit_expr(&*node.expr);
1451 }
1452 #[cfg(feature = "full")]
visit_expr_if<'ast, V>(v: &mut V, node: &'ast ExprIf) where V: Visit<'ast> + ?Sized,1453 pub fn visit_expr_if<'ast, V>(v: &mut V, node: &'ast ExprIf)
1454 where
1455 V: Visit<'ast> + ?Sized,
1456 {
1457 for it in &node.attrs {
1458 v.visit_attribute(it)
1459 }
1460 tokens_helper(v, &node.if_token.span);
1461 v.visit_expr(&*node.cond);
1462 v.visit_block(&node.then_branch);
1463 if let Some(it) = &node.else_branch {
1464 tokens_helper(v, &(it).0.span);
1465 v.visit_expr(&*(it).1);
1466 };
1467 }
1468 #[cfg(any(feature = "derive", feature = "full"))]
visit_expr_index<'ast, V>(v: &mut V, node: &'ast ExprIndex) where V: Visit<'ast> + ?Sized,1469 pub fn visit_expr_index<'ast, V>(v: &mut V, node: &'ast ExprIndex)
1470 where
1471 V: Visit<'ast> + ?Sized,
1472 {
1473 for it in &node.attrs {
1474 v.visit_attribute(it)
1475 }
1476 v.visit_expr(&*node.expr);
1477 tokens_helper(v, &node.bracket_token.span);
1478 v.visit_expr(&*node.index);
1479 }
1480 #[cfg(feature = "full")]
visit_expr_let<'ast, V>(v: &mut V, node: &'ast ExprLet) where V: Visit<'ast> + ?Sized,1481 pub fn visit_expr_let<'ast, V>(v: &mut V, node: &'ast ExprLet)
1482 where
1483 V: Visit<'ast> + ?Sized,
1484 {
1485 for it in &node.attrs {
1486 v.visit_attribute(it)
1487 }
1488 tokens_helper(v, &node.let_token.span);
1489 v.visit_pat(&node.pat);
1490 tokens_helper(v, &node.eq_token.spans);
1491 v.visit_expr(&*node.expr);
1492 }
1493 #[cfg(any(feature = "derive", feature = "full"))]
visit_expr_lit<'ast, V>(v: &mut V, node: &'ast ExprLit) where V: Visit<'ast> + ?Sized,1494 pub fn visit_expr_lit<'ast, V>(v: &mut V, node: &'ast ExprLit)
1495 where
1496 V: Visit<'ast> + ?Sized,
1497 {
1498 for it in &node.attrs {
1499 v.visit_attribute(it)
1500 }
1501 v.visit_lit(&node.lit);
1502 }
1503 #[cfg(feature = "full")]
visit_expr_loop<'ast, V>(v: &mut V, node: &'ast ExprLoop) where V: Visit<'ast> + ?Sized,1504 pub fn visit_expr_loop<'ast, V>(v: &mut V, node: &'ast ExprLoop)
1505 where
1506 V: Visit<'ast> + ?Sized,
1507 {
1508 for it in &node.attrs {
1509 v.visit_attribute(it)
1510 }
1511 if let Some(it) = &node.label {
1512 v.visit_label(it)
1513 };
1514 tokens_helper(v, &node.loop_token.span);
1515 v.visit_block(&node.body);
1516 }
1517 #[cfg(feature = "full")]
visit_expr_macro<'ast, V>(v: &mut V, node: &'ast ExprMacro) where V: Visit<'ast> + ?Sized,1518 pub fn visit_expr_macro<'ast, V>(v: &mut V, node: &'ast ExprMacro)
1519 where
1520 V: Visit<'ast> + ?Sized,
1521 {
1522 for it in &node.attrs {
1523 v.visit_attribute(it)
1524 }
1525 v.visit_macro(&node.mac);
1526 }
1527 #[cfg(feature = "full")]
visit_expr_match<'ast, V>(v: &mut V, node: &'ast ExprMatch) where V: Visit<'ast> + ?Sized,1528 pub fn visit_expr_match<'ast, V>(v: &mut V, node: &'ast ExprMatch)
1529 where
1530 V: Visit<'ast> + ?Sized,
1531 {
1532 for it in &node.attrs {
1533 v.visit_attribute(it)
1534 }
1535 tokens_helper(v, &node.match_token.span);
1536 v.visit_expr(&*node.expr);
1537 tokens_helper(v, &node.brace_token.span);
1538 for it in &node.arms {
1539 v.visit_arm(it)
1540 }
1541 }
1542 #[cfg(feature = "full")]
visit_expr_method_call<'ast, V>(v: &mut V, node: &'ast ExprMethodCall) where V: Visit<'ast> + ?Sized,1543 pub fn visit_expr_method_call<'ast, V>(v: &mut V, node: &'ast ExprMethodCall)
1544 where
1545 V: Visit<'ast> + ?Sized,
1546 {
1547 for it in &node.attrs {
1548 v.visit_attribute(it)
1549 }
1550 v.visit_expr(&*node.receiver);
1551 tokens_helper(v, &node.dot_token.spans);
1552 v.visit_ident(&node.method);
1553 if let Some(it) = &node.turbofish {
1554 v.visit_method_turbofish(it)
1555 };
1556 tokens_helper(v, &node.paren_token.span);
1557 for el in Punctuated::pairs(&node.args) {
1558 let (it, p) = el.into_tuple();
1559 v.visit_expr(it);
1560 if let Some(p) = p {
1561 tokens_helper(v, &p.spans);
1562 }
1563 }
1564 }
1565 #[cfg(any(feature = "derive", feature = "full"))]
visit_expr_paren<'ast, V>(v: &mut V, node: &'ast ExprParen) where V: Visit<'ast> + ?Sized,1566 pub fn visit_expr_paren<'ast, V>(v: &mut V, node: &'ast ExprParen)
1567 where
1568 V: Visit<'ast> + ?Sized,
1569 {
1570 for it in &node.attrs {
1571 v.visit_attribute(it)
1572 }
1573 tokens_helper(v, &node.paren_token.span);
1574 v.visit_expr(&*node.expr);
1575 }
1576 #[cfg(any(feature = "derive", feature = "full"))]
visit_expr_path<'ast, V>(v: &mut V, node: &'ast ExprPath) where V: Visit<'ast> + ?Sized,1577 pub fn visit_expr_path<'ast, V>(v: &mut V, node: &'ast ExprPath)
1578 where
1579 V: Visit<'ast> + ?Sized,
1580 {
1581 for it in &node.attrs {
1582 v.visit_attribute(it)
1583 }
1584 if let Some(it) = &node.qself {
1585 v.visit_qself(it)
1586 };
1587 v.visit_path(&node.path);
1588 }
1589 #[cfg(feature = "full")]
visit_expr_range<'ast, V>(v: &mut V, node: &'ast ExprRange) where V: Visit<'ast> + ?Sized,1590 pub fn visit_expr_range<'ast, V>(v: &mut V, node: &'ast ExprRange)
1591 where
1592 V: Visit<'ast> + ?Sized,
1593 {
1594 for it in &node.attrs {
1595 v.visit_attribute(it)
1596 }
1597 if let Some(it) = &node.from {
1598 v.visit_expr(&**it)
1599 };
1600 v.visit_range_limits(&node.limits);
1601 if let Some(it) = &node.to {
1602 v.visit_expr(&**it)
1603 };
1604 }
1605 #[cfg(feature = "full")]
visit_expr_reference<'ast, V>(v: &mut V, node: &'ast ExprReference) where V: Visit<'ast> + ?Sized,1606 pub fn visit_expr_reference<'ast, V>(v: &mut V, node: &'ast ExprReference)
1607 where
1608 V: Visit<'ast> + ?Sized,
1609 {
1610 for it in &node.attrs {
1611 v.visit_attribute(it)
1612 }
1613 tokens_helper(v, &node.and_token.spans);
1614 if let Some(it) = &node.mutability {
1615 tokens_helper(v, &it.span)
1616 };
1617 v.visit_expr(&*node.expr);
1618 }
1619 #[cfg(feature = "full")]
visit_expr_repeat<'ast, V>(v: &mut V, node: &'ast ExprRepeat) where V: Visit<'ast> + ?Sized,1620 pub fn visit_expr_repeat<'ast, V>(v: &mut V, node: &'ast ExprRepeat)
1621 where
1622 V: Visit<'ast> + ?Sized,
1623 {
1624 for it in &node.attrs {
1625 v.visit_attribute(it)
1626 }
1627 tokens_helper(v, &node.bracket_token.span);
1628 v.visit_expr(&*node.expr);
1629 tokens_helper(v, &node.semi_token.spans);
1630 v.visit_expr(&*node.len);
1631 }
1632 #[cfg(feature = "full")]
visit_expr_return<'ast, V>(v: &mut V, node: &'ast ExprReturn) where V: Visit<'ast> + ?Sized,1633 pub fn visit_expr_return<'ast, V>(v: &mut V, node: &'ast ExprReturn)
1634 where
1635 V: Visit<'ast> + ?Sized,
1636 {
1637 for it in &node.attrs {
1638 v.visit_attribute(it)
1639 }
1640 tokens_helper(v, &node.return_token.span);
1641 if let Some(it) = &node.expr {
1642 v.visit_expr(&**it)
1643 };
1644 }
1645 #[cfg(feature = "full")]
visit_expr_struct<'ast, V>(v: &mut V, node: &'ast ExprStruct) where V: Visit<'ast> + ?Sized,1646 pub fn visit_expr_struct<'ast, V>(v: &mut V, node: &'ast ExprStruct)
1647 where
1648 V: Visit<'ast> + ?Sized,
1649 {
1650 for it in &node.attrs {
1651 v.visit_attribute(it)
1652 }
1653 v.visit_path(&node.path);
1654 tokens_helper(v, &node.brace_token.span);
1655 for el in Punctuated::pairs(&node.fields) {
1656 let (it, p) = el.into_tuple();
1657 v.visit_field_value(it);
1658 if let Some(p) = p {
1659 tokens_helper(v, &p.spans);
1660 }
1661 }
1662 if let Some(it) = &node.dot2_token {
1663 tokens_helper(v, &it.spans)
1664 };
1665 if let Some(it) = &node.rest {
1666 v.visit_expr(&**it)
1667 };
1668 }
1669 #[cfg(feature = "full")]
visit_expr_try<'ast, V>(v: &mut V, node: &'ast ExprTry) where V: Visit<'ast> + ?Sized,1670 pub fn visit_expr_try<'ast, V>(v: &mut V, node: &'ast ExprTry)
1671 where
1672 V: Visit<'ast> + ?Sized,
1673 {
1674 for it in &node.attrs {
1675 v.visit_attribute(it)
1676 }
1677 v.visit_expr(&*node.expr);
1678 tokens_helper(v, &node.question_token.spans);
1679 }
1680 #[cfg(feature = "full")]
visit_expr_try_block<'ast, V>(v: &mut V, node: &'ast ExprTryBlock) where V: Visit<'ast> + ?Sized,1681 pub fn visit_expr_try_block<'ast, V>(v: &mut V, node: &'ast ExprTryBlock)
1682 where
1683 V: Visit<'ast> + ?Sized,
1684 {
1685 for it in &node.attrs {
1686 v.visit_attribute(it)
1687 }
1688 tokens_helper(v, &node.try_token.span);
1689 v.visit_block(&node.block);
1690 }
1691 #[cfg(feature = "full")]
visit_expr_tuple<'ast, V>(v: &mut V, node: &'ast ExprTuple) where V: Visit<'ast> + ?Sized,1692 pub fn visit_expr_tuple<'ast, V>(v: &mut V, node: &'ast ExprTuple)
1693 where
1694 V: Visit<'ast> + ?Sized,
1695 {
1696 for it in &node.attrs {
1697 v.visit_attribute(it)
1698 }
1699 tokens_helper(v, &node.paren_token.span);
1700 for el in Punctuated::pairs(&node.elems) {
1701 let (it, p) = el.into_tuple();
1702 v.visit_expr(it);
1703 if let Some(p) = p {
1704 tokens_helper(v, &p.spans);
1705 }
1706 }
1707 }
1708 #[cfg(feature = "full")]
visit_expr_type<'ast, V>(v: &mut V, node: &'ast ExprType) where V: Visit<'ast> + ?Sized,1709 pub fn visit_expr_type<'ast, V>(v: &mut V, node: &'ast ExprType)
1710 where
1711 V: Visit<'ast> + ?Sized,
1712 {
1713 for it in &node.attrs {
1714 v.visit_attribute(it)
1715 }
1716 v.visit_expr(&*node.expr);
1717 tokens_helper(v, &node.colon_token.spans);
1718 v.visit_type(&*node.ty);
1719 }
1720 #[cfg(any(feature = "derive", feature = "full"))]
visit_expr_unary<'ast, V>(v: &mut V, node: &'ast ExprUnary) where V: Visit<'ast> + ?Sized,1721 pub fn visit_expr_unary<'ast, V>(v: &mut V, node: &'ast ExprUnary)
1722 where
1723 V: Visit<'ast> + ?Sized,
1724 {
1725 for it in &node.attrs {
1726 v.visit_attribute(it)
1727 }
1728 v.visit_un_op(&node.op);
1729 v.visit_expr(&*node.expr);
1730 }
1731 #[cfg(feature = "full")]
visit_expr_unsafe<'ast, V>(v: &mut V, node: &'ast ExprUnsafe) where V: Visit<'ast> + ?Sized,1732 pub fn visit_expr_unsafe<'ast, V>(v: &mut V, node: &'ast ExprUnsafe)
1733 where
1734 V: Visit<'ast> + ?Sized,
1735 {
1736 for it in &node.attrs {
1737 v.visit_attribute(it)
1738 }
1739 tokens_helper(v, &node.unsafe_token.span);
1740 v.visit_block(&node.block);
1741 }
1742 #[cfg(feature = "full")]
visit_expr_while<'ast, V>(v: &mut V, node: &'ast ExprWhile) where V: Visit<'ast> + ?Sized,1743 pub fn visit_expr_while<'ast, V>(v: &mut V, node: &'ast ExprWhile)
1744 where
1745 V: Visit<'ast> + ?Sized,
1746 {
1747 for it in &node.attrs {
1748 v.visit_attribute(it)
1749 }
1750 if let Some(it) = &node.label {
1751 v.visit_label(it)
1752 };
1753 tokens_helper(v, &node.while_token.span);
1754 v.visit_expr(&*node.cond);
1755 v.visit_block(&node.body);
1756 }
1757 #[cfg(feature = "full")]
visit_expr_yield<'ast, V>(v: &mut V, node: &'ast ExprYield) where V: Visit<'ast> + ?Sized,1758 pub fn visit_expr_yield<'ast, V>(v: &mut V, node: &'ast ExprYield)
1759 where
1760 V: Visit<'ast> + ?Sized,
1761 {
1762 for it in &node.attrs {
1763 v.visit_attribute(it)
1764 }
1765 tokens_helper(v, &node.yield_token.span);
1766 if let Some(it) = &node.expr {
1767 v.visit_expr(&**it)
1768 };
1769 }
1770 #[cfg(any(feature = "derive", feature = "full"))]
visit_field<'ast, V>(v: &mut V, node: &'ast Field) where V: Visit<'ast> + ?Sized,1771 pub fn visit_field<'ast, V>(v: &mut V, node: &'ast Field)
1772 where
1773 V: Visit<'ast> + ?Sized,
1774 {
1775 for it in &node.attrs {
1776 v.visit_attribute(it)
1777 }
1778 v.visit_visibility(&node.vis);
1779 if let Some(it) = &node.ident {
1780 v.visit_ident(it)
1781 };
1782 if let Some(it) = &node.colon_token {
1783 tokens_helper(v, &it.spans)
1784 };
1785 v.visit_type(&node.ty);
1786 }
1787 #[cfg(feature = "full")]
visit_field_pat<'ast, V>(v: &mut V, node: &'ast FieldPat) where V: Visit<'ast> + ?Sized,1788 pub fn visit_field_pat<'ast, V>(v: &mut V, node: &'ast FieldPat)
1789 where
1790 V: Visit<'ast> + ?Sized,
1791 {
1792 for it in &node.attrs {
1793 v.visit_attribute(it)
1794 }
1795 v.visit_member(&node.member);
1796 if let Some(it) = &node.colon_token {
1797 tokens_helper(v, &it.spans)
1798 };
1799 v.visit_pat(&*node.pat);
1800 }
1801 #[cfg(feature = "full")]
visit_field_value<'ast, V>(v: &mut V, node: &'ast FieldValue) where V: Visit<'ast> + ?Sized,1802 pub fn visit_field_value<'ast, V>(v: &mut V, node: &'ast FieldValue)
1803 where
1804 V: Visit<'ast> + ?Sized,
1805 {
1806 for it in &node.attrs {
1807 v.visit_attribute(it)
1808 }
1809 v.visit_member(&node.member);
1810 if let Some(it) = &node.colon_token {
1811 tokens_helper(v, &it.spans)
1812 };
1813 v.visit_expr(&node.expr);
1814 }
1815 #[cfg(any(feature = "derive", feature = "full"))]
visit_fields<'ast, V>(v: &mut V, node: &'ast Fields) where V: Visit<'ast> + ?Sized,1816 pub fn visit_fields<'ast, V>(v: &mut V, node: &'ast Fields)
1817 where
1818 V: Visit<'ast> + ?Sized,
1819 {
1820 match node {
1821 Fields::Named(_binding_0) => {
1822 v.visit_fields_named(_binding_0);
1823 }
1824 Fields::Unnamed(_binding_0) => {
1825 v.visit_fields_unnamed(_binding_0);
1826 }
1827 Fields::Unit => {}
1828 }
1829 }
1830 #[cfg(any(feature = "derive", feature = "full"))]
visit_fields_named<'ast, V>(v: &mut V, node: &'ast FieldsNamed) where V: Visit<'ast> + ?Sized,1831 pub fn visit_fields_named<'ast, V>(v: &mut V, node: &'ast FieldsNamed)
1832 where
1833 V: Visit<'ast> + ?Sized,
1834 {
1835 tokens_helper(v, &node.brace_token.span);
1836 for el in Punctuated::pairs(&node.named) {
1837 let (it, p) = el.into_tuple();
1838 v.visit_field(it);
1839 if let Some(p) = p {
1840 tokens_helper(v, &p.spans);
1841 }
1842 }
1843 }
1844 #[cfg(any(feature = "derive", feature = "full"))]
visit_fields_unnamed<'ast, V>(v: &mut V, node: &'ast FieldsUnnamed) where V: Visit<'ast> + ?Sized,1845 pub fn visit_fields_unnamed<'ast, V>(v: &mut V, node: &'ast FieldsUnnamed)
1846 where
1847 V: Visit<'ast> + ?Sized,
1848 {
1849 tokens_helper(v, &node.paren_token.span);
1850 for el in Punctuated::pairs(&node.unnamed) {
1851 let (it, p) = el.into_tuple();
1852 v.visit_field(it);
1853 if let Some(p) = p {
1854 tokens_helper(v, &p.spans);
1855 }
1856 }
1857 }
1858 #[cfg(feature = "full")]
visit_file<'ast, V>(v: &mut V, node: &'ast File) where V: Visit<'ast> + ?Sized,1859 pub fn visit_file<'ast, V>(v: &mut V, node: &'ast File)
1860 where
1861 V: Visit<'ast> + ?Sized,
1862 {
1863 skip!(node.shebang);
1864 for it in &node.attrs {
1865 v.visit_attribute(it)
1866 }
1867 for it in &node.items {
1868 v.visit_item(it)
1869 }
1870 }
1871 #[cfg(feature = "full")]
visit_fn_arg<'ast, V>(v: &mut V, node: &'ast FnArg) where V: Visit<'ast> + ?Sized,1872 pub fn visit_fn_arg<'ast, V>(v: &mut V, node: &'ast FnArg)
1873 where
1874 V: Visit<'ast> + ?Sized,
1875 {
1876 match node {
1877 FnArg::Receiver(_binding_0) => {
1878 v.visit_receiver(_binding_0);
1879 }
1880 FnArg::Typed(_binding_0) => {
1881 v.visit_pat_type(_binding_0);
1882 }
1883 }
1884 }
1885 #[cfg(feature = "full")]
visit_foreign_item<'ast, V>(v: &mut V, node: &'ast ForeignItem) where V: Visit<'ast> + ?Sized,1886 pub fn visit_foreign_item<'ast, V>(v: &mut V, node: &'ast ForeignItem)
1887 where
1888 V: Visit<'ast> + ?Sized,
1889 {
1890 match node {
1891 ForeignItem::Fn(_binding_0) => {
1892 v.visit_foreign_item_fn(_binding_0);
1893 }
1894 ForeignItem::Static(_binding_0) => {
1895 v.visit_foreign_item_static(_binding_0);
1896 }
1897 ForeignItem::Type(_binding_0) => {
1898 v.visit_foreign_item_type(_binding_0);
1899 }
1900 ForeignItem::Macro(_binding_0) => {
1901 v.visit_foreign_item_macro(_binding_0);
1902 }
1903 ForeignItem::Verbatim(_binding_0) => {
1904 skip!(_binding_0);
1905 }
1906 _ => unreachable!(),
1907 }
1908 }
1909 #[cfg(feature = "full")]
visit_foreign_item_fn<'ast, V>(v: &mut V, node: &'ast ForeignItemFn) where V: Visit<'ast> + ?Sized,1910 pub fn visit_foreign_item_fn<'ast, V>(v: &mut V, node: &'ast ForeignItemFn)
1911 where
1912 V: Visit<'ast> + ?Sized,
1913 {
1914 for it in &node.attrs {
1915 v.visit_attribute(it)
1916 }
1917 v.visit_visibility(&node.vis);
1918 v.visit_signature(&node.sig);
1919 tokens_helper(v, &node.semi_token.spans);
1920 }
1921 #[cfg(feature = "full")]
visit_foreign_item_macro<'ast, V>(v: &mut V, node: &'ast ForeignItemMacro) where V: Visit<'ast> + ?Sized,1922 pub fn visit_foreign_item_macro<'ast, V>(v: &mut V, node: &'ast ForeignItemMacro)
1923 where
1924 V: Visit<'ast> + ?Sized,
1925 {
1926 for it in &node.attrs {
1927 v.visit_attribute(it)
1928 }
1929 v.visit_macro(&node.mac);
1930 if let Some(it) = &node.semi_token {
1931 tokens_helper(v, &it.spans)
1932 };
1933 }
1934 #[cfg(feature = "full")]
visit_foreign_item_static<'ast, V>(v: &mut V, node: &'ast ForeignItemStatic) where V: Visit<'ast> + ?Sized,1935 pub fn visit_foreign_item_static<'ast, V>(v: &mut V, node: &'ast ForeignItemStatic)
1936 where
1937 V: Visit<'ast> + ?Sized,
1938 {
1939 for it in &node.attrs {
1940 v.visit_attribute(it)
1941 }
1942 v.visit_visibility(&node.vis);
1943 tokens_helper(v, &node.static_token.span);
1944 if let Some(it) = &node.mutability {
1945 tokens_helper(v, &it.span)
1946 };
1947 v.visit_ident(&node.ident);
1948 tokens_helper(v, &node.colon_token.spans);
1949 v.visit_type(&*node.ty);
1950 tokens_helper(v, &node.semi_token.spans);
1951 }
1952 #[cfg(feature = "full")]
visit_foreign_item_type<'ast, V>(v: &mut V, node: &'ast ForeignItemType) where V: Visit<'ast> + ?Sized,1953 pub fn visit_foreign_item_type<'ast, V>(v: &mut V, node: &'ast ForeignItemType)
1954 where
1955 V: Visit<'ast> + ?Sized,
1956 {
1957 for it in &node.attrs {
1958 v.visit_attribute(it)
1959 }
1960 v.visit_visibility(&node.vis);
1961 tokens_helper(v, &node.type_token.span);
1962 v.visit_ident(&node.ident);
1963 tokens_helper(v, &node.semi_token.spans);
1964 }
1965 #[cfg(any(feature = "derive", feature = "full"))]
visit_generic_argument<'ast, V>(v: &mut V, node: &'ast GenericArgument) where V: Visit<'ast> + ?Sized,1966 pub fn visit_generic_argument<'ast, V>(v: &mut V, node: &'ast GenericArgument)
1967 where
1968 V: Visit<'ast> + ?Sized,
1969 {
1970 match node {
1971 GenericArgument::Lifetime(_binding_0) => {
1972 v.visit_lifetime(_binding_0);
1973 }
1974 GenericArgument::Type(_binding_0) => {
1975 v.visit_type(_binding_0);
1976 }
1977 GenericArgument::Binding(_binding_0) => {
1978 v.visit_binding(_binding_0);
1979 }
1980 GenericArgument::Constraint(_binding_0) => {
1981 v.visit_constraint(_binding_0);
1982 }
1983 GenericArgument::Const(_binding_0) => {
1984 v.visit_expr(_binding_0);
1985 }
1986 }
1987 }
1988 #[cfg(feature = "full")]
visit_generic_method_argument<'ast, V>(v: &mut V, node: &'ast GenericMethodArgument) where V: Visit<'ast> + ?Sized,1989 pub fn visit_generic_method_argument<'ast, V>(v: &mut V, node: &'ast GenericMethodArgument)
1990 where
1991 V: Visit<'ast> + ?Sized,
1992 {
1993 match node {
1994 GenericMethodArgument::Type(_binding_0) => {
1995 v.visit_type(_binding_0);
1996 }
1997 GenericMethodArgument::Const(_binding_0) => {
1998 v.visit_expr(_binding_0);
1999 }
2000 }
2001 }
2002 #[cfg(any(feature = "derive", feature = "full"))]
visit_generic_param<'ast, V>(v: &mut V, node: &'ast GenericParam) where V: Visit<'ast> + ?Sized,2003 pub fn visit_generic_param<'ast, V>(v: &mut V, node: &'ast GenericParam)
2004 where
2005 V: Visit<'ast> + ?Sized,
2006 {
2007 match node {
2008 GenericParam::Type(_binding_0) => {
2009 v.visit_type_param(_binding_0);
2010 }
2011 GenericParam::Lifetime(_binding_0) => {
2012 v.visit_lifetime_def(_binding_0);
2013 }
2014 GenericParam::Const(_binding_0) => {
2015 v.visit_const_param(_binding_0);
2016 }
2017 }
2018 }
2019 #[cfg(any(feature = "derive", feature = "full"))]
visit_generics<'ast, V>(v: &mut V, node: &'ast Generics) where V: Visit<'ast> + ?Sized,2020 pub fn visit_generics<'ast, V>(v: &mut V, node: &'ast Generics)
2021 where
2022 V: Visit<'ast> + ?Sized,
2023 {
2024 if let Some(it) = &node.lt_token {
2025 tokens_helper(v, &it.spans)
2026 };
2027 for el in Punctuated::pairs(&node.params) {
2028 let (it, p) = el.into_tuple();
2029 v.visit_generic_param(it);
2030 if let Some(p) = p {
2031 tokens_helper(v, &p.spans);
2032 }
2033 }
2034 if let Some(it) = &node.gt_token {
2035 tokens_helper(v, &it.spans)
2036 };
2037 if let Some(it) = &node.where_clause {
2038 v.visit_where_clause(it)
2039 };
2040 }
visit_ident<'ast, V>(v: &mut V, node: &'ast Ident) where V: Visit<'ast> + ?Sized,2041 pub fn visit_ident<'ast, V>(v: &mut V, node: &'ast Ident)
2042 where
2043 V: Visit<'ast> + ?Sized,
2044 {
2045 v.visit_span(&node.span());
2046 }
2047 #[cfg(feature = "full")]
visit_impl_item<'ast, V>(v: &mut V, node: &'ast ImplItem) where V: Visit<'ast> + ?Sized,2048 pub fn visit_impl_item<'ast, V>(v: &mut V, node: &'ast ImplItem)
2049 where
2050 V: Visit<'ast> + ?Sized,
2051 {
2052 match node {
2053 ImplItem::Const(_binding_0) => {
2054 v.visit_impl_item_const(_binding_0);
2055 }
2056 ImplItem::Method(_binding_0) => {
2057 v.visit_impl_item_method(_binding_0);
2058 }
2059 ImplItem::Type(_binding_0) => {
2060 v.visit_impl_item_type(_binding_0);
2061 }
2062 ImplItem::Macro(_binding_0) => {
2063 v.visit_impl_item_macro(_binding_0);
2064 }
2065 ImplItem::Verbatim(_binding_0) => {
2066 skip!(_binding_0);
2067 }
2068 _ => unreachable!(),
2069 }
2070 }
2071 #[cfg(feature = "full")]
visit_impl_item_const<'ast, V>(v: &mut V, node: &'ast ImplItemConst) where V: Visit<'ast> + ?Sized,2072 pub fn visit_impl_item_const<'ast, V>(v: &mut V, node: &'ast ImplItemConst)
2073 where
2074 V: Visit<'ast> + ?Sized,
2075 {
2076 for it in &node.attrs {
2077 v.visit_attribute(it)
2078 }
2079 v.visit_visibility(&node.vis);
2080 if let Some(it) = &node.defaultness {
2081 tokens_helper(v, &it.span)
2082 };
2083 tokens_helper(v, &node.const_token.span);
2084 v.visit_ident(&node.ident);
2085 tokens_helper(v, &node.colon_token.spans);
2086 v.visit_type(&node.ty);
2087 tokens_helper(v, &node.eq_token.spans);
2088 v.visit_expr(&node.expr);
2089 tokens_helper(v, &node.semi_token.spans);
2090 }
2091 #[cfg(feature = "full")]
visit_impl_item_macro<'ast, V>(v: &mut V, node: &'ast ImplItemMacro) where V: Visit<'ast> + ?Sized,2092 pub fn visit_impl_item_macro<'ast, V>(v: &mut V, node: &'ast ImplItemMacro)
2093 where
2094 V: Visit<'ast> + ?Sized,
2095 {
2096 for it in &node.attrs {
2097 v.visit_attribute(it)
2098 }
2099 v.visit_macro(&node.mac);
2100 if let Some(it) = &node.semi_token {
2101 tokens_helper(v, &it.spans)
2102 };
2103 }
2104 #[cfg(feature = "full")]
visit_impl_item_method<'ast, V>(v: &mut V, node: &'ast ImplItemMethod) where V: Visit<'ast> + ?Sized,2105 pub fn visit_impl_item_method<'ast, V>(v: &mut V, node: &'ast ImplItemMethod)
2106 where
2107 V: Visit<'ast> + ?Sized,
2108 {
2109 for it in &node.attrs {
2110 v.visit_attribute(it)
2111 }
2112 v.visit_visibility(&node.vis);
2113 if let Some(it) = &node.defaultness {
2114 tokens_helper(v, &it.span)
2115 };
2116 v.visit_signature(&node.sig);
2117 v.visit_block(&node.block);
2118 }
2119 #[cfg(feature = "full")]
visit_impl_item_type<'ast, V>(v: &mut V, node: &'ast ImplItemType) where V: Visit<'ast> + ?Sized,2120 pub fn visit_impl_item_type<'ast, V>(v: &mut V, node: &'ast ImplItemType)
2121 where
2122 V: Visit<'ast> + ?Sized,
2123 {
2124 for it in &node.attrs {
2125 v.visit_attribute(it)
2126 }
2127 v.visit_visibility(&node.vis);
2128 if let Some(it) = &node.defaultness {
2129 tokens_helper(v, &it.span)
2130 };
2131 tokens_helper(v, &node.type_token.span);
2132 v.visit_ident(&node.ident);
2133 v.visit_generics(&node.generics);
2134 tokens_helper(v, &node.eq_token.spans);
2135 v.visit_type(&node.ty);
2136 tokens_helper(v, &node.semi_token.spans);
2137 }
2138 #[cfg(any(feature = "derive", feature = "full"))]
visit_index<'ast, V>(v: &mut V, node: &'ast Index) where V: Visit<'ast> + ?Sized,2139 pub fn visit_index<'ast, V>(v: &mut V, node: &'ast Index)
2140 where
2141 V: Visit<'ast> + ?Sized,
2142 {
2143 skip!(node.index);
2144 v.visit_span(&node.span);
2145 }
2146 #[cfg(feature = "full")]
visit_item<'ast, V>(v: &mut V, node: &'ast Item) where V: Visit<'ast> + ?Sized,2147 pub fn visit_item<'ast, V>(v: &mut V, node: &'ast Item)
2148 where
2149 V: Visit<'ast> + ?Sized,
2150 {
2151 match node {
2152 Item::Const(_binding_0) => {
2153 v.visit_item_const(_binding_0);
2154 }
2155 Item::Enum(_binding_0) => {
2156 v.visit_item_enum(_binding_0);
2157 }
2158 Item::ExternCrate(_binding_0) => {
2159 v.visit_item_extern_crate(_binding_0);
2160 }
2161 Item::Fn(_binding_0) => {
2162 v.visit_item_fn(_binding_0);
2163 }
2164 Item::ForeignMod(_binding_0) => {
2165 v.visit_item_foreign_mod(_binding_0);
2166 }
2167 Item::Impl(_binding_0) => {
2168 v.visit_item_impl(_binding_0);
2169 }
2170 Item::Macro(_binding_0) => {
2171 v.visit_item_macro(_binding_0);
2172 }
2173 Item::Macro2(_binding_0) => {
2174 v.visit_item_macro2(_binding_0);
2175 }
2176 Item::Mod(_binding_0) => {
2177 v.visit_item_mod(_binding_0);
2178 }
2179 Item::Static(_binding_0) => {
2180 v.visit_item_static(_binding_0);
2181 }
2182 Item::Struct(_binding_0) => {
2183 v.visit_item_struct(_binding_0);
2184 }
2185 Item::Trait(_binding_0) => {
2186 v.visit_item_trait(_binding_0);
2187 }
2188 Item::TraitAlias(_binding_0) => {
2189 v.visit_item_trait_alias(_binding_0);
2190 }
2191 Item::Type(_binding_0) => {
2192 v.visit_item_type(_binding_0);
2193 }
2194 Item::Union(_binding_0) => {
2195 v.visit_item_union(_binding_0);
2196 }
2197 Item::Use(_binding_0) => {
2198 v.visit_item_use(_binding_0);
2199 }
2200 Item::Verbatim(_binding_0) => {
2201 skip!(_binding_0);
2202 }
2203 _ => unreachable!(),
2204 }
2205 }
2206 #[cfg(feature = "full")]
visit_item_const<'ast, V>(v: &mut V, node: &'ast ItemConst) where V: Visit<'ast> + ?Sized,2207 pub fn visit_item_const<'ast, V>(v: &mut V, node: &'ast ItemConst)
2208 where
2209 V: Visit<'ast> + ?Sized,
2210 {
2211 for it in &node.attrs {
2212 v.visit_attribute(it)
2213 }
2214 v.visit_visibility(&node.vis);
2215 tokens_helper(v, &node.const_token.span);
2216 v.visit_ident(&node.ident);
2217 tokens_helper(v, &node.colon_token.spans);
2218 v.visit_type(&*node.ty);
2219 tokens_helper(v, &node.eq_token.spans);
2220 v.visit_expr(&*node.expr);
2221 tokens_helper(v, &node.semi_token.spans);
2222 }
2223 #[cfg(feature = "full")]
visit_item_enum<'ast, V>(v: &mut V, node: &'ast ItemEnum) where V: Visit<'ast> + ?Sized,2224 pub fn visit_item_enum<'ast, V>(v: &mut V, node: &'ast ItemEnum)
2225 where
2226 V: Visit<'ast> + ?Sized,
2227 {
2228 for it in &node.attrs {
2229 v.visit_attribute(it)
2230 }
2231 v.visit_visibility(&node.vis);
2232 tokens_helper(v, &node.enum_token.span);
2233 v.visit_ident(&node.ident);
2234 v.visit_generics(&node.generics);
2235 tokens_helper(v, &node.brace_token.span);
2236 for el in Punctuated::pairs(&node.variants) {
2237 let (it, p) = el.into_tuple();
2238 v.visit_variant(it);
2239 if let Some(p) = p {
2240 tokens_helper(v, &p.spans);
2241 }
2242 }
2243 }
2244 #[cfg(feature = "full")]
visit_item_extern_crate<'ast, V>(v: &mut V, node: &'ast ItemExternCrate) where V: Visit<'ast> + ?Sized,2245 pub fn visit_item_extern_crate<'ast, V>(v: &mut V, node: &'ast ItemExternCrate)
2246 where
2247 V: Visit<'ast> + ?Sized,
2248 {
2249 for it in &node.attrs {
2250 v.visit_attribute(it)
2251 }
2252 v.visit_visibility(&node.vis);
2253 tokens_helper(v, &node.extern_token.span);
2254 tokens_helper(v, &node.crate_token.span);
2255 v.visit_ident(&node.ident);
2256 if let Some(it) = &node.rename {
2257 tokens_helper(v, &(it).0.span);
2258 v.visit_ident(&(it).1);
2259 };
2260 tokens_helper(v, &node.semi_token.spans);
2261 }
2262 #[cfg(feature = "full")]
visit_item_fn<'ast, V>(v: &mut V, node: &'ast ItemFn) where V: Visit<'ast> + ?Sized,2263 pub fn visit_item_fn<'ast, V>(v: &mut V, node: &'ast ItemFn)
2264 where
2265 V: Visit<'ast> + ?Sized,
2266 {
2267 for it in &node.attrs {
2268 v.visit_attribute(it)
2269 }
2270 v.visit_visibility(&node.vis);
2271 v.visit_signature(&node.sig);
2272 v.visit_block(&*node.block);
2273 }
2274 #[cfg(feature = "full")]
visit_item_foreign_mod<'ast, V>(v: &mut V, node: &'ast ItemForeignMod) where V: Visit<'ast> + ?Sized,2275 pub fn visit_item_foreign_mod<'ast, V>(v: &mut V, node: &'ast ItemForeignMod)
2276 where
2277 V: Visit<'ast> + ?Sized,
2278 {
2279 for it in &node.attrs {
2280 v.visit_attribute(it)
2281 }
2282 v.visit_abi(&node.abi);
2283 tokens_helper(v, &node.brace_token.span);
2284 for it in &node.items {
2285 v.visit_foreign_item(it)
2286 }
2287 }
2288 #[cfg(feature = "full")]
visit_item_impl<'ast, V>(v: &mut V, node: &'ast ItemImpl) where V: Visit<'ast> + ?Sized,2289 pub fn visit_item_impl<'ast, V>(v: &mut V, node: &'ast ItemImpl)
2290 where
2291 V: Visit<'ast> + ?Sized,
2292 {
2293 for it in &node.attrs {
2294 v.visit_attribute(it)
2295 }
2296 if let Some(it) = &node.defaultness {
2297 tokens_helper(v, &it.span)
2298 };
2299 if let Some(it) = &node.unsafety {
2300 tokens_helper(v, &it.span)
2301 };
2302 tokens_helper(v, &node.impl_token.span);
2303 v.visit_generics(&node.generics);
2304 if let Some(it) = &node.trait_ {
2305 if let Some(it) = &(it).0 {
2306 tokens_helper(v, &it.spans)
2307 };
2308 v.visit_path(&(it).1);
2309 tokens_helper(v, &(it).2.span);
2310 };
2311 v.visit_type(&*node.self_ty);
2312 tokens_helper(v, &node.brace_token.span);
2313 for it in &node.items {
2314 v.visit_impl_item(it)
2315 }
2316 }
2317 #[cfg(feature = "full")]
visit_item_macro<'ast, V>(v: &mut V, node: &'ast ItemMacro) where V: Visit<'ast> + ?Sized,2318 pub fn visit_item_macro<'ast, V>(v: &mut V, node: &'ast ItemMacro)
2319 where
2320 V: Visit<'ast> + ?Sized,
2321 {
2322 for it in &node.attrs {
2323 v.visit_attribute(it)
2324 }
2325 if let Some(it) = &node.ident {
2326 v.visit_ident(it)
2327 };
2328 v.visit_macro(&node.mac);
2329 if let Some(it) = &node.semi_token {
2330 tokens_helper(v, &it.spans)
2331 };
2332 }
2333 #[cfg(feature = "full")]
visit_item_macro2<'ast, V>(v: &mut V, node: &'ast ItemMacro2) where V: Visit<'ast> + ?Sized,2334 pub fn visit_item_macro2<'ast, V>(v: &mut V, node: &'ast ItemMacro2)
2335 where
2336 V: Visit<'ast> + ?Sized,
2337 {
2338 for it in &node.attrs {
2339 v.visit_attribute(it)
2340 }
2341 v.visit_visibility(&node.vis);
2342 tokens_helper(v, &node.macro_token.span);
2343 v.visit_ident(&node.ident);
2344 skip!(node.rules);
2345 }
2346 #[cfg(feature = "full")]
visit_item_mod<'ast, V>(v: &mut V, node: &'ast ItemMod) where V: Visit<'ast> + ?Sized,2347 pub fn visit_item_mod<'ast, V>(v: &mut V, node: &'ast ItemMod)
2348 where
2349 V: Visit<'ast> + ?Sized,
2350 {
2351 for it in &node.attrs {
2352 v.visit_attribute(it)
2353 }
2354 v.visit_visibility(&node.vis);
2355 tokens_helper(v, &node.mod_token.span);
2356 v.visit_ident(&node.ident);
2357 if let Some(it) = &node.content {
2358 tokens_helper(v, &(it).0.span);
2359 for it in &(it).1 {
2360 v.visit_item(it)
2361 }
2362 };
2363 if let Some(it) = &node.semi {
2364 tokens_helper(v, &it.spans)
2365 };
2366 }
2367 #[cfg(feature = "full")]
visit_item_static<'ast, V>(v: &mut V, node: &'ast ItemStatic) where V: Visit<'ast> + ?Sized,2368 pub fn visit_item_static<'ast, V>(v: &mut V, node: &'ast ItemStatic)
2369 where
2370 V: Visit<'ast> + ?Sized,
2371 {
2372 for it in &node.attrs {
2373 v.visit_attribute(it)
2374 }
2375 v.visit_visibility(&node.vis);
2376 tokens_helper(v, &node.static_token.span);
2377 if let Some(it) = &node.mutability {
2378 tokens_helper(v, &it.span)
2379 };
2380 v.visit_ident(&node.ident);
2381 tokens_helper(v, &node.colon_token.spans);
2382 v.visit_type(&*node.ty);
2383 tokens_helper(v, &node.eq_token.spans);
2384 v.visit_expr(&*node.expr);
2385 tokens_helper(v, &node.semi_token.spans);
2386 }
2387 #[cfg(feature = "full")]
visit_item_struct<'ast, V>(v: &mut V, node: &'ast ItemStruct) where V: Visit<'ast> + ?Sized,2388 pub fn visit_item_struct<'ast, V>(v: &mut V, node: &'ast ItemStruct)
2389 where
2390 V: Visit<'ast> + ?Sized,
2391 {
2392 for it in &node.attrs {
2393 v.visit_attribute(it)
2394 }
2395 v.visit_visibility(&node.vis);
2396 tokens_helper(v, &node.struct_token.span);
2397 v.visit_ident(&node.ident);
2398 v.visit_generics(&node.generics);
2399 v.visit_fields(&node.fields);
2400 if let Some(it) = &node.semi_token {
2401 tokens_helper(v, &it.spans)
2402 };
2403 }
2404 #[cfg(feature = "full")]
visit_item_trait<'ast, V>(v: &mut V, node: &'ast ItemTrait) where V: Visit<'ast> + ?Sized,2405 pub fn visit_item_trait<'ast, V>(v: &mut V, node: &'ast ItemTrait)
2406 where
2407 V: Visit<'ast> + ?Sized,
2408 {
2409 for it in &node.attrs {
2410 v.visit_attribute(it)
2411 }
2412 v.visit_visibility(&node.vis);
2413 if let Some(it) = &node.unsafety {
2414 tokens_helper(v, &it.span)
2415 };
2416 if let Some(it) = &node.auto_token {
2417 tokens_helper(v, &it.span)
2418 };
2419 tokens_helper(v, &node.trait_token.span);
2420 v.visit_ident(&node.ident);
2421 v.visit_generics(&node.generics);
2422 if let Some(it) = &node.colon_token {
2423 tokens_helper(v, &it.spans)
2424 };
2425 for el in Punctuated::pairs(&node.supertraits) {
2426 let (it, p) = el.into_tuple();
2427 v.visit_type_param_bound(it);
2428 if let Some(p) = p {
2429 tokens_helper(v, &p.spans);
2430 }
2431 }
2432 tokens_helper(v, &node.brace_token.span);
2433 for it in &node.items {
2434 v.visit_trait_item(it)
2435 }
2436 }
2437 #[cfg(feature = "full")]
visit_item_trait_alias<'ast, V>(v: &mut V, node: &'ast ItemTraitAlias) where V: Visit<'ast> + ?Sized,2438 pub fn visit_item_trait_alias<'ast, V>(v: &mut V, node: &'ast ItemTraitAlias)
2439 where
2440 V: Visit<'ast> + ?Sized,
2441 {
2442 for it in &node.attrs {
2443 v.visit_attribute(it)
2444 }
2445 v.visit_visibility(&node.vis);
2446 tokens_helper(v, &node.trait_token.span);
2447 v.visit_ident(&node.ident);
2448 v.visit_generics(&node.generics);
2449 tokens_helper(v, &node.eq_token.spans);
2450 for el in Punctuated::pairs(&node.bounds) {
2451 let (it, p) = el.into_tuple();
2452 v.visit_type_param_bound(it);
2453 if let Some(p) = p {
2454 tokens_helper(v, &p.spans);
2455 }
2456 }
2457 tokens_helper(v, &node.semi_token.spans);
2458 }
2459 #[cfg(feature = "full")]
visit_item_type<'ast, V>(v: &mut V, node: &'ast ItemType) where V: Visit<'ast> + ?Sized,2460 pub fn visit_item_type<'ast, V>(v: &mut V, node: &'ast ItemType)
2461 where
2462 V: Visit<'ast> + ?Sized,
2463 {
2464 for it in &node.attrs {
2465 v.visit_attribute(it)
2466 }
2467 v.visit_visibility(&node.vis);
2468 tokens_helper(v, &node.type_token.span);
2469 v.visit_ident(&node.ident);
2470 v.visit_generics(&node.generics);
2471 tokens_helper(v, &node.eq_token.spans);
2472 v.visit_type(&*node.ty);
2473 tokens_helper(v, &node.semi_token.spans);
2474 }
2475 #[cfg(feature = "full")]
visit_item_union<'ast, V>(v: &mut V, node: &'ast ItemUnion) where V: Visit<'ast> + ?Sized,2476 pub fn visit_item_union<'ast, V>(v: &mut V, node: &'ast ItemUnion)
2477 where
2478 V: Visit<'ast> + ?Sized,
2479 {
2480 for it in &node.attrs {
2481 v.visit_attribute(it)
2482 }
2483 v.visit_visibility(&node.vis);
2484 tokens_helper(v, &node.union_token.span);
2485 v.visit_ident(&node.ident);
2486 v.visit_generics(&node.generics);
2487 v.visit_fields_named(&node.fields);
2488 }
2489 #[cfg(feature = "full")]
visit_item_use<'ast, V>(v: &mut V, node: &'ast ItemUse) where V: Visit<'ast> + ?Sized,2490 pub fn visit_item_use<'ast, V>(v: &mut V, node: &'ast ItemUse)
2491 where
2492 V: Visit<'ast> + ?Sized,
2493 {
2494 for it in &node.attrs {
2495 v.visit_attribute(it)
2496 }
2497 v.visit_visibility(&node.vis);
2498 tokens_helper(v, &node.use_token.span);
2499 if let Some(it) = &node.leading_colon {
2500 tokens_helper(v, &it.spans)
2501 };
2502 v.visit_use_tree(&node.tree);
2503 tokens_helper(v, &node.semi_token.spans);
2504 }
2505 #[cfg(feature = "full")]
visit_label<'ast, V>(v: &mut V, node: &'ast Label) where V: Visit<'ast> + ?Sized,2506 pub fn visit_label<'ast, V>(v: &mut V, node: &'ast Label)
2507 where
2508 V: Visit<'ast> + ?Sized,
2509 {
2510 v.visit_lifetime(&node.name);
2511 tokens_helper(v, &node.colon_token.spans);
2512 }
visit_lifetime<'ast, V>(v: &mut V, node: &'ast Lifetime) where V: Visit<'ast> + ?Sized,2513 pub fn visit_lifetime<'ast, V>(v: &mut V, node: &'ast Lifetime)
2514 where
2515 V: Visit<'ast> + ?Sized,
2516 {
2517 v.visit_span(&node.apostrophe);
2518 v.visit_ident(&node.ident);
2519 }
2520 #[cfg(any(feature = "derive", feature = "full"))]
visit_lifetime_def<'ast, V>(v: &mut V, node: &'ast LifetimeDef) where V: Visit<'ast> + ?Sized,2521 pub fn visit_lifetime_def<'ast, V>(v: &mut V, node: &'ast LifetimeDef)
2522 where
2523 V: Visit<'ast> + ?Sized,
2524 {
2525 for it in &node.attrs {
2526 v.visit_attribute(it)
2527 }
2528 v.visit_lifetime(&node.lifetime);
2529 if let Some(it) = &node.colon_token {
2530 tokens_helper(v, &it.spans)
2531 };
2532 for el in Punctuated::pairs(&node.bounds) {
2533 let (it, p) = el.into_tuple();
2534 v.visit_lifetime(it);
2535 if let Some(p) = p {
2536 tokens_helper(v, &p.spans);
2537 }
2538 }
2539 }
2540 #[cfg(any(feature = "derive", feature = "full"))]
visit_lit<'ast, V>(v: &mut V, node: &'ast Lit) where V: Visit<'ast> + ?Sized,2541 pub fn visit_lit<'ast, V>(v: &mut V, node: &'ast Lit)
2542 where
2543 V: Visit<'ast> + ?Sized,
2544 {
2545 match node {
2546 Lit::Str(_binding_0) => {
2547 v.visit_lit_str(_binding_0);
2548 }
2549 Lit::ByteStr(_binding_0) => {
2550 v.visit_lit_byte_str(_binding_0);
2551 }
2552 Lit::Byte(_binding_0) => {
2553 v.visit_lit_byte(_binding_0);
2554 }
2555 Lit::Char(_binding_0) => {
2556 v.visit_lit_char(_binding_0);
2557 }
2558 Lit::Int(_binding_0) => {
2559 v.visit_lit_int(_binding_0);
2560 }
2561 Lit::Float(_binding_0) => {
2562 v.visit_lit_float(_binding_0);
2563 }
2564 Lit::Bool(_binding_0) => {
2565 v.visit_lit_bool(_binding_0);
2566 }
2567 Lit::Verbatim(_binding_0) => {
2568 skip!(_binding_0);
2569 }
2570 }
2571 }
2572 #[cfg(any(feature = "derive", feature = "full"))]
visit_lit_bool<'ast, V>(v: &mut V, node: &'ast LitBool) where V: Visit<'ast> + ?Sized,2573 pub fn visit_lit_bool<'ast, V>(v: &mut V, node: &'ast LitBool)
2574 where
2575 V: Visit<'ast> + ?Sized,
2576 {
2577 skip!(node.value);
2578 v.visit_span(&node.span);
2579 }
2580 #[cfg(any(feature = "derive", feature = "full"))]
visit_lit_byte<'ast, V>(v: &mut V, node: &'ast LitByte) where V: Visit<'ast> + ?Sized,2581 pub fn visit_lit_byte<'ast, V>(v: &mut V, node: &'ast LitByte)
2582 where
2583 V: Visit<'ast> + ?Sized,
2584 {
2585 }
2586 #[cfg(any(feature = "derive", feature = "full"))]
visit_lit_byte_str<'ast, V>(v: &mut V, node: &'ast LitByteStr) where V: Visit<'ast> + ?Sized,2587 pub fn visit_lit_byte_str<'ast, V>(v: &mut V, node: &'ast LitByteStr)
2588 where
2589 V: Visit<'ast> + ?Sized,
2590 {
2591 }
2592 #[cfg(any(feature = "derive", feature = "full"))]
visit_lit_char<'ast, V>(v: &mut V, node: &'ast LitChar) where V: Visit<'ast> + ?Sized,2593 pub fn visit_lit_char<'ast, V>(v: &mut V, node: &'ast LitChar)
2594 where
2595 V: Visit<'ast> + ?Sized,
2596 {
2597 }
2598 #[cfg(any(feature = "derive", feature = "full"))]
visit_lit_float<'ast, V>(v: &mut V, node: &'ast LitFloat) where V: Visit<'ast> + ?Sized,2599 pub fn visit_lit_float<'ast, V>(v: &mut V, node: &'ast LitFloat)
2600 where
2601 V: Visit<'ast> + ?Sized,
2602 {
2603 }
2604 #[cfg(any(feature = "derive", feature = "full"))]
visit_lit_int<'ast, V>(v: &mut V, node: &'ast LitInt) where V: Visit<'ast> + ?Sized,2605 pub fn visit_lit_int<'ast, V>(v: &mut V, node: &'ast LitInt)
2606 where
2607 V: Visit<'ast> + ?Sized,
2608 {
2609 }
2610 #[cfg(any(feature = "derive", feature = "full"))]
visit_lit_str<'ast, V>(v: &mut V, node: &'ast LitStr) where V: Visit<'ast> + ?Sized,2611 pub fn visit_lit_str<'ast, V>(v: &mut V, node: &'ast LitStr)
2612 where
2613 V: Visit<'ast> + ?Sized,
2614 {
2615 }
2616 #[cfg(feature = "full")]
visit_local<'ast, V>(v: &mut V, node: &'ast Local) where V: Visit<'ast> + ?Sized,2617 pub fn visit_local<'ast, V>(v: &mut V, node: &'ast Local)
2618 where
2619 V: Visit<'ast> + ?Sized,
2620 {
2621 for it in &node.attrs {
2622 v.visit_attribute(it)
2623 }
2624 tokens_helper(v, &node.let_token.span);
2625 v.visit_pat(&node.pat);
2626 if let Some(it) = &node.init {
2627 tokens_helper(v, &(it).0.spans);
2628 v.visit_expr(&*(it).1);
2629 };
2630 tokens_helper(v, &node.semi_token.spans);
2631 }
2632 #[cfg(any(feature = "derive", feature = "full"))]
visit_macro<'ast, V>(v: &mut V, node: &'ast Macro) where V: Visit<'ast> + ?Sized,2633 pub fn visit_macro<'ast, V>(v: &mut V, node: &'ast Macro)
2634 where
2635 V: Visit<'ast> + ?Sized,
2636 {
2637 v.visit_path(&node.path);
2638 tokens_helper(v, &node.bang_token.spans);
2639 v.visit_macro_delimiter(&node.delimiter);
2640 skip!(node.tokens);
2641 }
2642 #[cfg(any(feature = "derive", feature = "full"))]
visit_macro_delimiter<'ast, V>(v: &mut V, node: &'ast MacroDelimiter) where V: Visit<'ast> + ?Sized,2643 pub fn visit_macro_delimiter<'ast, V>(v: &mut V, node: &'ast MacroDelimiter)
2644 where
2645 V: Visit<'ast> + ?Sized,
2646 {
2647 match node {
2648 MacroDelimiter::Paren(_binding_0) => {
2649 tokens_helper(v, &_binding_0.span);
2650 }
2651 MacroDelimiter::Brace(_binding_0) => {
2652 tokens_helper(v, &_binding_0.span);
2653 }
2654 MacroDelimiter::Bracket(_binding_0) => {
2655 tokens_helper(v, &_binding_0.span);
2656 }
2657 }
2658 }
2659 #[cfg(any(feature = "derive", feature = "full"))]
visit_member<'ast, V>(v: &mut V, node: &'ast Member) where V: Visit<'ast> + ?Sized,2660 pub fn visit_member<'ast, V>(v: &mut V, node: &'ast Member)
2661 where
2662 V: Visit<'ast> + ?Sized,
2663 {
2664 match node {
2665 Member::Named(_binding_0) => {
2666 v.visit_ident(_binding_0);
2667 }
2668 Member::Unnamed(_binding_0) => {
2669 v.visit_index(_binding_0);
2670 }
2671 }
2672 }
2673 #[cfg(any(feature = "derive", feature = "full"))]
visit_meta<'ast, V>(v: &mut V, node: &'ast Meta) where V: Visit<'ast> + ?Sized,2674 pub fn visit_meta<'ast, V>(v: &mut V, node: &'ast Meta)
2675 where
2676 V: Visit<'ast> + ?Sized,
2677 {
2678 match node {
2679 Meta::Path(_binding_0) => {
2680 v.visit_path(_binding_0);
2681 }
2682 Meta::List(_binding_0) => {
2683 v.visit_meta_list(_binding_0);
2684 }
2685 Meta::NameValue(_binding_0) => {
2686 v.visit_meta_name_value(_binding_0);
2687 }
2688 }
2689 }
2690 #[cfg(any(feature = "derive", feature = "full"))]
visit_meta_list<'ast, V>(v: &mut V, node: &'ast MetaList) where V: Visit<'ast> + ?Sized,2691 pub fn visit_meta_list<'ast, V>(v: &mut V, node: &'ast MetaList)
2692 where
2693 V: Visit<'ast> + ?Sized,
2694 {
2695 v.visit_path(&node.path);
2696 tokens_helper(v, &node.paren_token.span);
2697 for el in Punctuated::pairs(&node.nested) {
2698 let (it, p) = el.into_tuple();
2699 v.visit_nested_meta(it);
2700 if let Some(p) = p {
2701 tokens_helper(v, &p.spans);
2702 }
2703 }
2704 }
2705 #[cfg(any(feature = "derive", feature = "full"))]
visit_meta_name_value<'ast, V>(v: &mut V, node: &'ast MetaNameValue) where V: Visit<'ast> + ?Sized,2706 pub fn visit_meta_name_value<'ast, V>(v: &mut V, node: &'ast MetaNameValue)
2707 where
2708 V: Visit<'ast> + ?Sized,
2709 {
2710 v.visit_path(&node.path);
2711 tokens_helper(v, &node.eq_token.spans);
2712 v.visit_lit(&node.lit);
2713 }
2714 #[cfg(feature = "full")]
visit_method_turbofish<'ast, V>(v: &mut V, node: &'ast MethodTurbofish) where V: Visit<'ast> + ?Sized,2715 pub fn visit_method_turbofish<'ast, V>(v: &mut V, node: &'ast MethodTurbofish)
2716 where
2717 V: Visit<'ast> + ?Sized,
2718 {
2719 tokens_helper(v, &node.colon2_token.spans);
2720 tokens_helper(v, &node.lt_token.spans);
2721 for el in Punctuated::pairs(&node.args) {
2722 let (it, p) = el.into_tuple();
2723 v.visit_generic_method_argument(it);
2724 if let Some(p) = p {
2725 tokens_helper(v, &p.spans);
2726 }
2727 }
2728 tokens_helper(v, &node.gt_token.spans);
2729 }
2730 #[cfg(any(feature = "derive", feature = "full"))]
visit_nested_meta<'ast, V>(v: &mut V, node: &'ast NestedMeta) where V: Visit<'ast> + ?Sized,2731 pub fn visit_nested_meta<'ast, V>(v: &mut V, node: &'ast NestedMeta)
2732 where
2733 V: Visit<'ast> + ?Sized,
2734 {
2735 match node {
2736 NestedMeta::Meta(_binding_0) => {
2737 v.visit_meta(_binding_0);
2738 }
2739 NestedMeta::Lit(_binding_0) => {
2740 v.visit_lit(_binding_0);
2741 }
2742 }
2743 }
2744 #[cfg(any(feature = "derive", feature = "full"))]
visit_parenthesized_generic_arguments<'ast, V>( v: &mut V, node: &'ast ParenthesizedGenericArguments, ) where V: Visit<'ast> + ?Sized,2745 pub fn visit_parenthesized_generic_arguments<'ast, V>(
2746 v: &mut V,
2747 node: &'ast ParenthesizedGenericArguments,
2748 ) where
2749 V: Visit<'ast> + ?Sized,
2750 {
2751 tokens_helper(v, &node.paren_token.span);
2752 for el in Punctuated::pairs(&node.inputs) {
2753 let (it, p) = el.into_tuple();
2754 v.visit_type(it);
2755 if let Some(p) = p {
2756 tokens_helper(v, &p.spans);
2757 }
2758 }
2759 v.visit_return_type(&node.output);
2760 }
2761 #[cfg(feature = "full")]
visit_pat<'ast, V>(v: &mut V, node: &'ast Pat) where V: Visit<'ast> + ?Sized,2762 pub fn visit_pat<'ast, V>(v: &mut V, node: &'ast Pat)
2763 where
2764 V: Visit<'ast> + ?Sized,
2765 {
2766 match node {
2767 Pat::Box(_binding_0) => {
2768 v.visit_pat_box(_binding_0);
2769 }
2770 Pat::Ident(_binding_0) => {
2771 v.visit_pat_ident(_binding_0);
2772 }
2773 Pat::Lit(_binding_0) => {
2774 v.visit_pat_lit(_binding_0);
2775 }
2776 Pat::Macro(_binding_0) => {
2777 v.visit_pat_macro(_binding_0);
2778 }
2779 Pat::Or(_binding_0) => {
2780 v.visit_pat_or(_binding_0);
2781 }
2782 Pat::Path(_binding_0) => {
2783 v.visit_pat_path(_binding_0);
2784 }
2785 Pat::Range(_binding_0) => {
2786 v.visit_pat_range(_binding_0);
2787 }
2788 Pat::Reference(_binding_0) => {
2789 v.visit_pat_reference(_binding_0);
2790 }
2791 Pat::Rest(_binding_0) => {
2792 v.visit_pat_rest(_binding_0);
2793 }
2794 Pat::Slice(_binding_0) => {
2795 v.visit_pat_slice(_binding_0);
2796 }
2797 Pat::Struct(_binding_0) => {
2798 v.visit_pat_struct(_binding_0);
2799 }
2800 Pat::Tuple(_binding_0) => {
2801 v.visit_pat_tuple(_binding_0);
2802 }
2803 Pat::TupleStruct(_binding_0) => {
2804 v.visit_pat_tuple_struct(_binding_0);
2805 }
2806 Pat::Type(_binding_0) => {
2807 v.visit_pat_type(_binding_0);
2808 }
2809 Pat::Verbatim(_binding_0) => {
2810 skip!(_binding_0);
2811 }
2812 Pat::Wild(_binding_0) => {
2813 v.visit_pat_wild(_binding_0);
2814 }
2815 _ => unreachable!(),
2816 }
2817 }
2818 #[cfg(feature = "full")]
visit_pat_box<'ast, V>(v: &mut V, node: &'ast PatBox) where V: Visit<'ast> + ?Sized,2819 pub fn visit_pat_box<'ast, V>(v: &mut V, node: &'ast PatBox)
2820 where
2821 V: Visit<'ast> + ?Sized,
2822 {
2823 for it in &node.attrs {
2824 v.visit_attribute(it)
2825 }
2826 tokens_helper(v, &node.box_token.span);
2827 v.visit_pat(&*node.pat);
2828 }
2829 #[cfg(feature = "full")]
visit_pat_ident<'ast, V>(v: &mut V, node: &'ast PatIdent) where V: Visit<'ast> + ?Sized,2830 pub fn visit_pat_ident<'ast, V>(v: &mut V, node: &'ast PatIdent)
2831 where
2832 V: Visit<'ast> + ?Sized,
2833 {
2834 for it in &node.attrs {
2835 v.visit_attribute(it)
2836 }
2837 if let Some(it) = &node.by_ref {
2838 tokens_helper(v, &it.span)
2839 };
2840 if let Some(it) = &node.mutability {
2841 tokens_helper(v, &it.span)
2842 };
2843 v.visit_ident(&node.ident);
2844 if let Some(it) = &node.subpat {
2845 tokens_helper(v, &(it).0.spans);
2846 v.visit_pat(&*(it).1);
2847 };
2848 }
2849 #[cfg(feature = "full")]
visit_pat_lit<'ast, V>(v: &mut V, node: &'ast PatLit) where V: Visit<'ast> + ?Sized,2850 pub fn visit_pat_lit<'ast, V>(v: &mut V, node: &'ast PatLit)
2851 where
2852 V: Visit<'ast> + ?Sized,
2853 {
2854 for it in &node.attrs {
2855 v.visit_attribute(it)
2856 }
2857 v.visit_expr(&*node.expr);
2858 }
2859 #[cfg(feature = "full")]
visit_pat_macro<'ast, V>(v: &mut V, node: &'ast PatMacro) where V: Visit<'ast> + ?Sized,2860 pub fn visit_pat_macro<'ast, V>(v: &mut V, node: &'ast PatMacro)
2861 where
2862 V: Visit<'ast> + ?Sized,
2863 {
2864 for it in &node.attrs {
2865 v.visit_attribute(it)
2866 }
2867 v.visit_macro(&node.mac);
2868 }
2869 #[cfg(feature = "full")]
visit_pat_or<'ast, V>(v: &mut V, node: &'ast PatOr) where V: Visit<'ast> + ?Sized,2870 pub fn visit_pat_or<'ast, V>(v: &mut V, node: &'ast PatOr)
2871 where
2872 V: Visit<'ast> + ?Sized,
2873 {
2874 for it in &node.attrs {
2875 v.visit_attribute(it)
2876 }
2877 if let Some(it) = &node.leading_vert {
2878 tokens_helper(v, &it.spans)
2879 };
2880 for el in Punctuated::pairs(&node.cases) {
2881 let (it, p) = el.into_tuple();
2882 v.visit_pat(it);
2883 if let Some(p) = p {
2884 tokens_helper(v, &p.spans);
2885 }
2886 }
2887 }
2888 #[cfg(feature = "full")]
visit_pat_path<'ast, V>(v: &mut V, node: &'ast PatPath) where V: Visit<'ast> + ?Sized,2889 pub fn visit_pat_path<'ast, V>(v: &mut V, node: &'ast PatPath)
2890 where
2891 V: Visit<'ast> + ?Sized,
2892 {
2893 for it in &node.attrs {
2894 v.visit_attribute(it)
2895 }
2896 if let Some(it) = &node.qself {
2897 v.visit_qself(it)
2898 };
2899 v.visit_path(&node.path);
2900 }
2901 #[cfg(feature = "full")]
visit_pat_range<'ast, V>(v: &mut V, node: &'ast PatRange) where V: Visit<'ast> + ?Sized,2902 pub fn visit_pat_range<'ast, V>(v: &mut V, node: &'ast PatRange)
2903 where
2904 V: Visit<'ast> + ?Sized,
2905 {
2906 for it in &node.attrs {
2907 v.visit_attribute(it)
2908 }
2909 v.visit_expr(&*node.lo);
2910 v.visit_range_limits(&node.limits);
2911 v.visit_expr(&*node.hi);
2912 }
2913 #[cfg(feature = "full")]
visit_pat_reference<'ast, V>(v: &mut V, node: &'ast PatReference) where V: Visit<'ast> + ?Sized,2914 pub fn visit_pat_reference<'ast, V>(v: &mut V, node: &'ast PatReference)
2915 where
2916 V: Visit<'ast> + ?Sized,
2917 {
2918 for it in &node.attrs {
2919 v.visit_attribute(it)
2920 }
2921 tokens_helper(v, &node.and_token.spans);
2922 if let Some(it) = &node.mutability {
2923 tokens_helper(v, &it.span)
2924 };
2925 v.visit_pat(&*node.pat);
2926 }
2927 #[cfg(feature = "full")]
visit_pat_rest<'ast, V>(v: &mut V, node: &'ast PatRest) where V: Visit<'ast> + ?Sized,2928 pub fn visit_pat_rest<'ast, V>(v: &mut V, node: &'ast PatRest)
2929 where
2930 V: Visit<'ast> + ?Sized,
2931 {
2932 for it in &node.attrs {
2933 v.visit_attribute(it)
2934 }
2935 tokens_helper(v, &node.dot2_token.spans);
2936 }
2937 #[cfg(feature = "full")]
visit_pat_slice<'ast, V>(v: &mut V, node: &'ast PatSlice) where V: Visit<'ast> + ?Sized,2938 pub fn visit_pat_slice<'ast, V>(v: &mut V, node: &'ast PatSlice)
2939 where
2940 V: Visit<'ast> + ?Sized,
2941 {
2942 for it in &node.attrs {
2943 v.visit_attribute(it)
2944 }
2945 tokens_helper(v, &node.bracket_token.span);
2946 for el in Punctuated::pairs(&node.elems) {
2947 let (it, p) = el.into_tuple();
2948 v.visit_pat(it);
2949 if let Some(p) = p {
2950 tokens_helper(v, &p.spans);
2951 }
2952 }
2953 }
2954 #[cfg(feature = "full")]
visit_pat_struct<'ast, V>(v: &mut V, node: &'ast PatStruct) where V: Visit<'ast> + ?Sized,2955 pub fn visit_pat_struct<'ast, V>(v: &mut V, node: &'ast PatStruct)
2956 where
2957 V: Visit<'ast> + ?Sized,
2958 {
2959 for it in &node.attrs {
2960 v.visit_attribute(it)
2961 }
2962 v.visit_path(&node.path);
2963 tokens_helper(v, &node.brace_token.span);
2964 for el in Punctuated::pairs(&node.fields) {
2965 let (it, p) = el.into_tuple();
2966 v.visit_field_pat(it);
2967 if let Some(p) = p {
2968 tokens_helper(v, &p.spans);
2969 }
2970 }
2971 if let Some(it) = &node.dot2_token {
2972 tokens_helper(v, &it.spans)
2973 };
2974 }
2975 #[cfg(feature = "full")]
visit_pat_tuple<'ast, V>(v: &mut V, node: &'ast PatTuple) where V: Visit<'ast> + ?Sized,2976 pub fn visit_pat_tuple<'ast, V>(v: &mut V, node: &'ast PatTuple)
2977 where
2978 V: Visit<'ast> + ?Sized,
2979 {
2980 for it in &node.attrs {
2981 v.visit_attribute(it)
2982 }
2983 tokens_helper(v, &node.paren_token.span);
2984 for el in Punctuated::pairs(&node.elems) {
2985 let (it, p) = el.into_tuple();
2986 v.visit_pat(it);
2987 if let Some(p) = p {
2988 tokens_helper(v, &p.spans);
2989 }
2990 }
2991 }
2992 #[cfg(feature = "full")]
visit_pat_tuple_struct<'ast, V>(v: &mut V, node: &'ast PatTupleStruct) where V: Visit<'ast> + ?Sized,2993 pub fn visit_pat_tuple_struct<'ast, V>(v: &mut V, node: &'ast PatTupleStruct)
2994 where
2995 V: Visit<'ast> + ?Sized,
2996 {
2997 for it in &node.attrs {
2998 v.visit_attribute(it)
2999 }
3000 v.visit_path(&node.path);
3001 v.visit_pat_tuple(&node.pat);
3002 }
3003 #[cfg(feature = "full")]
visit_pat_type<'ast, V>(v: &mut V, node: &'ast PatType) where V: Visit<'ast> + ?Sized,3004 pub fn visit_pat_type<'ast, V>(v: &mut V, node: &'ast PatType)
3005 where
3006 V: Visit<'ast> + ?Sized,
3007 {
3008 for it in &node.attrs {
3009 v.visit_attribute(it)
3010 }
3011 v.visit_pat(&*node.pat);
3012 tokens_helper(v, &node.colon_token.spans);
3013 v.visit_type(&*node.ty);
3014 }
3015 #[cfg(feature = "full")]
visit_pat_wild<'ast, V>(v: &mut V, node: &'ast PatWild) where V: Visit<'ast> + ?Sized,3016 pub fn visit_pat_wild<'ast, V>(v: &mut V, node: &'ast PatWild)
3017 where
3018 V: Visit<'ast> + ?Sized,
3019 {
3020 for it in &node.attrs {
3021 v.visit_attribute(it)
3022 }
3023 tokens_helper(v, &node.underscore_token.spans);
3024 }
3025 #[cfg(any(feature = "derive", feature = "full"))]
visit_path<'ast, V>(v: &mut V, node: &'ast Path) where V: Visit<'ast> + ?Sized,3026 pub fn visit_path<'ast, V>(v: &mut V, node: &'ast Path)
3027 where
3028 V: Visit<'ast> + ?Sized,
3029 {
3030 if let Some(it) = &node.leading_colon {
3031 tokens_helper(v, &it.spans)
3032 };
3033 for el in Punctuated::pairs(&node.segments) {
3034 let (it, p) = el.into_tuple();
3035 v.visit_path_segment(it);
3036 if let Some(p) = p {
3037 tokens_helper(v, &p.spans);
3038 }
3039 }
3040 }
3041 #[cfg(any(feature = "derive", feature = "full"))]
visit_path_arguments<'ast, V>(v: &mut V, node: &'ast PathArguments) where V: Visit<'ast> + ?Sized,3042 pub fn visit_path_arguments<'ast, V>(v: &mut V, node: &'ast PathArguments)
3043 where
3044 V: Visit<'ast> + ?Sized,
3045 {
3046 match node {
3047 PathArguments::None => {}
3048 PathArguments::AngleBracketed(_binding_0) => {
3049 v.visit_angle_bracketed_generic_arguments(_binding_0);
3050 }
3051 PathArguments::Parenthesized(_binding_0) => {
3052 v.visit_parenthesized_generic_arguments(_binding_0);
3053 }
3054 }
3055 }
3056 #[cfg(any(feature = "derive", feature = "full"))]
visit_path_segment<'ast, V>(v: &mut V, node: &'ast PathSegment) where V: Visit<'ast> + ?Sized,3057 pub fn visit_path_segment<'ast, V>(v: &mut V, node: &'ast PathSegment)
3058 where
3059 V: Visit<'ast> + ?Sized,
3060 {
3061 v.visit_ident(&node.ident);
3062 v.visit_path_arguments(&node.arguments);
3063 }
3064 #[cfg(any(feature = "derive", feature = "full"))]
visit_predicate_eq<'ast, V>(v: &mut V, node: &'ast PredicateEq) where V: Visit<'ast> + ?Sized,3065 pub fn visit_predicate_eq<'ast, V>(v: &mut V, node: &'ast PredicateEq)
3066 where
3067 V: Visit<'ast> + ?Sized,
3068 {
3069 v.visit_type(&node.lhs_ty);
3070 tokens_helper(v, &node.eq_token.spans);
3071 v.visit_type(&node.rhs_ty);
3072 }
3073 #[cfg(any(feature = "derive", feature = "full"))]
visit_predicate_lifetime<'ast, V>(v: &mut V, node: &'ast PredicateLifetime) where V: Visit<'ast> + ?Sized,3074 pub fn visit_predicate_lifetime<'ast, V>(v: &mut V, node: &'ast PredicateLifetime)
3075 where
3076 V: Visit<'ast> + ?Sized,
3077 {
3078 v.visit_lifetime(&node.lifetime);
3079 tokens_helper(v, &node.colon_token.spans);
3080 for el in Punctuated::pairs(&node.bounds) {
3081 let (it, p) = el.into_tuple();
3082 v.visit_lifetime(it);
3083 if let Some(p) = p {
3084 tokens_helper(v, &p.spans);
3085 }
3086 }
3087 }
3088 #[cfg(any(feature = "derive", feature = "full"))]
visit_predicate_type<'ast, V>(v: &mut V, node: &'ast PredicateType) where V: Visit<'ast> + ?Sized,3089 pub fn visit_predicate_type<'ast, V>(v: &mut V, node: &'ast PredicateType)
3090 where
3091 V: Visit<'ast> + ?Sized,
3092 {
3093 if let Some(it) = &node.lifetimes {
3094 v.visit_bound_lifetimes(it)
3095 };
3096 v.visit_type(&node.bounded_ty);
3097 tokens_helper(v, &node.colon_token.spans);
3098 for el in Punctuated::pairs(&node.bounds) {
3099 let (it, p) = el.into_tuple();
3100 v.visit_type_param_bound(it);
3101 if let Some(p) = p {
3102 tokens_helper(v, &p.spans);
3103 }
3104 }
3105 }
3106 #[cfg(any(feature = "derive", feature = "full"))]
visit_qself<'ast, V>(v: &mut V, node: &'ast QSelf) where V: Visit<'ast> + ?Sized,3107 pub fn visit_qself<'ast, V>(v: &mut V, node: &'ast QSelf)
3108 where
3109 V: Visit<'ast> + ?Sized,
3110 {
3111 tokens_helper(v, &node.lt_token.spans);
3112 v.visit_type(&*node.ty);
3113 skip!(node.position);
3114 if let Some(it) = &node.as_token {
3115 tokens_helper(v, &it.span)
3116 };
3117 tokens_helper(v, &node.gt_token.spans);
3118 }
3119 #[cfg(feature = "full")]
visit_range_limits<'ast, V>(v: &mut V, node: &'ast RangeLimits) where V: Visit<'ast> + ?Sized,3120 pub fn visit_range_limits<'ast, V>(v: &mut V, node: &'ast RangeLimits)
3121 where
3122 V: Visit<'ast> + ?Sized,
3123 {
3124 match node {
3125 RangeLimits::HalfOpen(_binding_0) => {
3126 tokens_helper(v, &_binding_0.spans);
3127 }
3128 RangeLimits::Closed(_binding_0) => {
3129 tokens_helper(v, &_binding_0.spans);
3130 }
3131 }
3132 }
3133 #[cfg(feature = "full")]
visit_receiver<'ast, V>(v: &mut V, node: &'ast Receiver) where V: Visit<'ast> + ?Sized,3134 pub fn visit_receiver<'ast, V>(v: &mut V, node: &'ast Receiver)
3135 where
3136 V: Visit<'ast> + ?Sized,
3137 {
3138 for it in &node.attrs {
3139 v.visit_attribute(it)
3140 }
3141 if let Some(it) = &node.reference {
3142 tokens_helper(v, &(it).0.spans);
3143 if let Some(it) = &(it).1 {
3144 v.visit_lifetime(it)
3145 };
3146 };
3147 if let Some(it) = &node.mutability {
3148 tokens_helper(v, &it.span)
3149 };
3150 tokens_helper(v, &node.self_token.span);
3151 }
3152 #[cfg(any(feature = "derive", feature = "full"))]
visit_return_type<'ast, V>(v: &mut V, node: &'ast ReturnType) where V: Visit<'ast> + ?Sized,3153 pub fn visit_return_type<'ast, V>(v: &mut V, node: &'ast ReturnType)
3154 where
3155 V: Visit<'ast> + ?Sized,
3156 {
3157 match node {
3158 ReturnType::Default => {}
3159 ReturnType::Type(_binding_0, _binding_1) => {
3160 tokens_helper(v, &_binding_0.spans);
3161 v.visit_type(&**_binding_1);
3162 }
3163 }
3164 }
3165 #[cfg(feature = "full")]
visit_signature<'ast, V>(v: &mut V, node: &'ast Signature) where V: Visit<'ast> + ?Sized,3166 pub fn visit_signature<'ast, V>(v: &mut V, node: &'ast Signature)
3167 where
3168 V: Visit<'ast> + ?Sized,
3169 {
3170 if let Some(it) = &node.constness {
3171 tokens_helper(v, &it.span)
3172 };
3173 if let Some(it) = &node.asyncness {
3174 tokens_helper(v, &it.span)
3175 };
3176 if let Some(it) = &node.unsafety {
3177 tokens_helper(v, &it.span)
3178 };
3179 if let Some(it) = &node.abi {
3180 v.visit_abi(it)
3181 };
3182 tokens_helper(v, &node.fn_token.span);
3183 v.visit_ident(&node.ident);
3184 v.visit_generics(&node.generics);
3185 tokens_helper(v, &node.paren_token.span);
3186 for el in Punctuated::pairs(&node.inputs) {
3187 let (it, p) = el.into_tuple();
3188 v.visit_fn_arg(it);
3189 if let Some(p) = p {
3190 tokens_helper(v, &p.spans);
3191 }
3192 }
3193 if let Some(it) = &node.variadic {
3194 v.visit_variadic(it)
3195 };
3196 v.visit_return_type(&node.output);
3197 }
visit_span<'ast, V>(v: &mut V, node: &Span) where V: Visit<'ast> + ?Sized,3198 pub fn visit_span<'ast, V>(v: &mut V, node: &Span)
3199 where
3200 V: Visit<'ast> + ?Sized,
3201 {
3202 }
3203 #[cfg(feature = "full")]
visit_stmt<'ast, V>(v: &mut V, node: &'ast Stmt) where V: Visit<'ast> + ?Sized,3204 pub fn visit_stmt<'ast, V>(v: &mut V, node: &'ast Stmt)
3205 where
3206 V: Visit<'ast> + ?Sized,
3207 {
3208 match node {
3209 Stmt::Local(_binding_0) => {
3210 v.visit_local(_binding_0);
3211 }
3212 Stmt::Item(_binding_0) => {
3213 v.visit_item(_binding_0);
3214 }
3215 Stmt::Expr(_binding_0) => {
3216 v.visit_expr(_binding_0);
3217 }
3218 Stmt::Semi(_binding_0, _binding_1) => {
3219 v.visit_expr(_binding_0);
3220 tokens_helper(v, &_binding_1.spans);
3221 }
3222 }
3223 }
3224 #[cfg(any(feature = "derive", feature = "full"))]
visit_trait_bound<'ast, V>(v: &mut V, node: &'ast TraitBound) where V: Visit<'ast> + ?Sized,3225 pub fn visit_trait_bound<'ast, V>(v: &mut V, node: &'ast TraitBound)
3226 where
3227 V: Visit<'ast> + ?Sized,
3228 {
3229 if let Some(it) = &node.paren_token {
3230 tokens_helper(v, &it.span)
3231 };
3232 v.visit_trait_bound_modifier(&node.modifier);
3233 if let Some(it) = &node.lifetimes {
3234 v.visit_bound_lifetimes(it)
3235 };
3236 v.visit_path(&node.path);
3237 }
3238 #[cfg(any(feature = "derive", feature = "full"))]
visit_trait_bound_modifier<'ast, V>(v: &mut V, node: &'ast TraitBoundModifier) where V: Visit<'ast> + ?Sized,3239 pub fn visit_trait_bound_modifier<'ast, V>(v: &mut V, node: &'ast TraitBoundModifier)
3240 where
3241 V: Visit<'ast> + ?Sized,
3242 {
3243 match node {
3244 TraitBoundModifier::None => {}
3245 TraitBoundModifier::Maybe(_binding_0) => {
3246 tokens_helper(v, &_binding_0.spans);
3247 }
3248 }
3249 }
3250 #[cfg(feature = "full")]
visit_trait_item<'ast, V>(v: &mut V, node: &'ast TraitItem) where V: Visit<'ast> + ?Sized,3251 pub fn visit_trait_item<'ast, V>(v: &mut V, node: &'ast TraitItem)
3252 where
3253 V: Visit<'ast> + ?Sized,
3254 {
3255 match node {
3256 TraitItem::Const(_binding_0) => {
3257 v.visit_trait_item_const(_binding_0);
3258 }
3259 TraitItem::Method(_binding_0) => {
3260 v.visit_trait_item_method(_binding_0);
3261 }
3262 TraitItem::Type(_binding_0) => {
3263 v.visit_trait_item_type(_binding_0);
3264 }
3265 TraitItem::Macro(_binding_0) => {
3266 v.visit_trait_item_macro(_binding_0);
3267 }
3268 TraitItem::Verbatim(_binding_0) => {
3269 skip!(_binding_0);
3270 }
3271 _ => unreachable!(),
3272 }
3273 }
3274 #[cfg(feature = "full")]
visit_trait_item_const<'ast, V>(v: &mut V, node: &'ast TraitItemConst) where V: Visit<'ast> + ?Sized,3275 pub fn visit_trait_item_const<'ast, V>(v: &mut V, node: &'ast TraitItemConst)
3276 where
3277 V: Visit<'ast> + ?Sized,
3278 {
3279 for it in &node.attrs {
3280 v.visit_attribute(it)
3281 }
3282 tokens_helper(v, &node.const_token.span);
3283 v.visit_ident(&node.ident);
3284 tokens_helper(v, &node.colon_token.spans);
3285 v.visit_type(&node.ty);
3286 if let Some(it) = &node.default {
3287 tokens_helper(v, &(it).0.spans);
3288 v.visit_expr(&(it).1);
3289 };
3290 tokens_helper(v, &node.semi_token.spans);
3291 }
3292 #[cfg(feature = "full")]
visit_trait_item_macro<'ast, V>(v: &mut V, node: &'ast TraitItemMacro) where V: Visit<'ast> + ?Sized,3293 pub fn visit_trait_item_macro<'ast, V>(v: &mut V, node: &'ast TraitItemMacro)
3294 where
3295 V: Visit<'ast> + ?Sized,
3296 {
3297 for it in &node.attrs {
3298 v.visit_attribute(it)
3299 }
3300 v.visit_macro(&node.mac);
3301 if let Some(it) = &node.semi_token {
3302 tokens_helper(v, &it.spans)
3303 };
3304 }
3305 #[cfg(feature = "full")]
visit_trait_item_method<'ast, V>(v: &mut V, node: &'ast TraitItemMethod) where V: Visit<'ast> + ?Sized,3306 pub fn visit_trait_item_method<'ast, V>(v: &mut V, node: &'ast TraitItemMethod)
3307 where
3308 V: Visit<'ast> + ?Sized,
3309 {
3310 for it in &node.attrs {
3311 v.visit_attribute(it)
3312 }
3313 v.visit_signature(&node.sig);
3314 if let Some(it) = &node.default {
3315 v.visit_block(it)
3316 };
3317 if let Some(it) = &node.semi_token {
3318 tokens_helper(v, &it.spans)
3319 };
3320 }
3321 #[cfg(feature = "full")]
visit_trait_item_type<'ast, V>(v: &mut V, node: &'ast TraitItemType) where V: Visit<'ast> + ?Sized,3322 pub fn visit_trait_item_type<'ast, V>(v: &mut V, node: &'ast TraitItemType)
3323 where
3324 V: Visit<'ast> + ?Sized,
3325 {
3326 for it in &node.attrs {
3327 v.visit_attribute(it)
3328 }
3329 tokens_helper(v, &node.type_token.span);
3330 v.visit_ident(&node.ident);
3331 v.visit_generics(&node.generics);
3332 if let Some(it) = &node.colon_token {
3333 tokens_helper(v, &it.spans)
3334 };
3335 for el in Punctuated::pairs(&node.bounds) {
3336 let (it, p) = el.into_tuple();
3337 v.visit_type_param_bound(it);
3338 if let Some(p) = p {
3339 tokens_helper(v, &p.spans);
3340 }
3341 }
3342 if let Some(it) = &node.default {
3343 tokens_helper(v, &(it).0.spans);
3344 v.visit_type(&(it).1);
3345 };
3346 tokens_helper(v, &node.semi_token.spans);
3347 }
3348 #[cfg(any(feature = "derive", feature = "full"))]
visit_type<'ast, V>(v: &mut V, node: &'ast Type) where V: Visit<'ast> + ?Sized,3349 pub fn visit_type<'ast, V>(v: &mut V, node: &'ast Type)
3350 where
3351 V: Visit<'ast> + ?Sized,
3352 {
3353 match node {
3354 Type::Array(_binding_0) => {
3355 v.visit_type_array(_binding_0);
3356 }
3357 Type::BareFn(_binding_0) => {
3358 v.visit_type_bare_fn(_binding_0);
3359 }
3360 Type::Group(_binding_0) => {
3361 v.visit_type_group(_binding_0);
3362 }
3363 Type::ImplTrait(_binding_0) => {
3364 v.visit_type_impl_trait(_binding_0);
3365 }
3366 Type::Infer(_binding_0) => {
3367 v.visit_type_infer(_binding_0);
3368 }
3369 Type::Macro(_binding_0) => {
3370 v.visit_type_macro(_binding_0);
3371 }
3372 Type::Never(_binding_0) => {
3373 v.visit_type_never(_binding_0);
3374 }
3375 Type::Paren(_binding_0) => {
3376 v.visit_type_paren(_binding_0);
3377 }
3378 Type::Path(_binding_0) => {
3379 v.visit_type_path(_binding_0);
3380 }
3381 Type::Ptr(_binding_0) => {
3382 v.visit_type_ptr(_binding_0);
3383 }
3384 Type::Reference(_binding_0) => {
3385 v.visit_type_reference(_binding_0);
3386 }
3387 Type::Slice(_binding_0) => {
3388 v.visit_type_slice(_binding_0);
3389 }
3390 Type::TraitObject(_binding_0) => {
3391 v.visit_type_trait_object(_binding_0);
3392 }
3393 Type::Tuple(_binding_0) => {
3394 v.visit_type_tuple(_binding_0);
3395 }
3396 Type::Verbatim(_binding_0) => {
3397 skip!(_binding_0);
3398 }
3399 _ => unreachable!(),
3400 }
3401 }
3402 #[cfg(any(feature = "derive", feature = "full"))]
visit_type_array<'ast, V>(v: &mut V, node: &'ast TypeArray) where V: Visit<'ast> + ?Sized,3403 pub fn visit_type_array<'ast, V>(v: &mut V, node: &'ast TypeArray)
3404 where
3405 V: Visit<'ast> + ?Sized,
3406 {
3407 tokens_helper(v, &node.bracket_token.span);
3408 v.visit_type(&*node.elem);
3409 tokens_helper(v, &node.semi_token.spans);
3410 v.visit_expr(&node.len);
3411 }
3412 #[cfg(any(feature = "derive", feature = "full"))]
visit_type_bare_fn<'ast, V>(v: &mut V, node: &'ast TypeBareFn) where V: Visit<'ast> + ?Sized,3413 pub fn visit_type_bare_fn<'ast, V>(v: &mut V, node: &'ast TypeBareFn)
3414 where
3415 V: Visit<'ast> + ?Sized,
3416 {
3417 if let Some(it) = &node.lifetimes {
3418 v.visit_bound_lifetimes(it)
3419 };
3420 if let Some(it) = &node.unsafety {
3421 tokens_helper(v, &it.span)
3422 };
3423 if let Some(it) = &node.abi {
3424 v.visit_abi(it)
3425 };
3426 tokens_helper(v, &node.fn_token.span);
3427 tokens_helper(v, &node.paren_token.span);
3428 for el in Punctuated::pairs(&node.inputs) {
3429 let (it, p) = el.into_tuple();
3430 v.visit_bare_fn_arg(it);
3431 if let Some(p) = p {
3432 tokens_helper(v, &p.spans);
3433 }
3434 }
3435 if let Some(it) = &node.variadic {
3436 v.visit_variadic(it)
3437 };
3438 v.visit_return_type(&node.output);
3439 }
3440 #[cfg(any(feature = "derive", feature = "full"))]
visit_type_group<'ast, V>(v: &mut V, node: &'ast TypeGroup) where V: Visit<'ast> + ?Sized,3441 pub fn visit_type_group<'ast, V>(v: &mut V, node: &'ast TypeGroup)
3442 where
3443 V: Visit<'ast> + ?Sized,
3444 {
3445 tokens_helper(v, &node.group_token.span);
3446 v.visit_type(&*node.elem);
3447 }
3448 #[cfg(any(feature = "derive", feature = "full"))]
visit_type_impl_trait<'ast, V>(v: &mut V, node: &'ast TypeImplTrait) where V: Visit<'ast> + ?Sized,3449 pub fn visit_type_impl_trait<'ast, V>(v: &mut V, node: &'ast TypeImplTrait)
3450 where
3451 V: Visit<'ast> + ?Sized,
3452 {
3453 tokens_helper(v, &node.impl_token.span);
3454 for el in Punctuated::pairs(&node.bounds) {
3455 let (it, p) = el.into_tuple();
3456 v.visit_type_param_bound(it);
3457 if let Some(p) = p {
3458 tokens_helper(v, &p.spans);
3459 }
3460 }
3461 }
3462 #[cfg(any(feature = "derive", feature = "full"))]
visit_type_infer<'ast, V>(v: &mut V, node: &'ast TypeInfer) where V: Visit<'ast> + ?Sized,3463 pub fn visit_type_infer<'ast, V>(v: &mut V, node: &'ast TypeInfer)
3464 where
3465 V: Visit<'ast> + ?Sized,
3466 {
3467 tokens_helper(v, &node.underscore_token.spans);
3468 }
3469 #[cfg(any(feature = "derive", feature = "full"))]
visit_type_macro<'ast, V>(v: &mut V, node: &'ast TypeMacro) where V: Visit<'ast> + ?Sized,3470 pub fn visit_type_macro<'ast, V>(v: &mut V, node: &'ast TypeMacro)
3471 where
3472 V: Visit<'ast> + ?Sized,
3473 {
3474 v.visit_macro(&node.mac);
3475 }
3476 #[cfg(any(feature = "derive", feature = "full"))]
visit_type_never<'ast, V>(v: &mut V, node: &'ast TypeNever) where V: Visit<'ast> + ?Sized,3477 pub fn visit_type_never<'ast, V>(v: &mut V, node: &'ast TypeNever)
3478 where
3479 V: Visit<'ast> + ?Sized,
3480 {
3481 tokens_helper(v, &node.bang_token.spans);
3482 }
3483 #[cfg(any(feature = "derive", feature = "full"))]
visit_type_param<'ast, V>(v: &mut V, node: &'ast TypeParam) where V: Visit<'ast> + ?Sized,3484 pub fn visit_type_param<'ast, V>(v: &mut V, node: &'ast TypeParam)
3485 where
3486 V: Visit<'ast> + ?Sized,
3487 {
3488 for it in &node.attrs {
3489 v.visit_attribute(it)
3490 }
3491 v.visit_ident(&node.ident);
3492 if let Some(it) = &node.colon_token {
3493 tokens_helper(v, &it.spans)
3494 };
3495 for el in Punctuated::pairs(&node.bounds) {
3496 let (it, p) = el.into_tuple();
3497 v.visit_type_param_bound(it);
3498 if let Some(p) = p {
3499 tokens_helper(v, &p.spans);
3500 }
3501 }
3502 if let Some(it) = &node.eq_token {
3503 tokens_helper(v, &it.spans)
3504 };
3505 if let Some(it) = &node.default {
3506 v.visit_type(it)
3507 };
3508 }
3509 #[cfg(any(feature = "derive", feature = "full"))]
visit_type_param_bound<'ast, V>(v: &mut V, node: &'ast TypeParamBound) where V: Visit<'ast> + ?Sized,3510 pub fn visit_type_param_bound<'ast, V>(v: &mut V, node: &'ast TypeParamBound)
3511 where
3512 V: Visit<'ast> + ?Sized,
3513 {
3514 match node {
3515 TypeParamBound::Trait(_binding_0) => {
3516 v.visit_trait_bound(_binding_0);
3517 }
3518 TypeParamBound::Lifetime(_binding_0) => {
3519 v.visit_lifetime(_binding_0);
3520 }
3521 }
3522 }
3523 #[cfg(any(feature = "derive", feature = "full"))]
visit_type_paren<'ast, V>(v: &mut V, node: &'ast TypeParen) where V: Visit<'ast> + ?Sized,3524 pub fn visit_type_paren<'ast, V>(v: &mut V, node: &'ast TypeParen)
3525 where
3526 V: Visit<'ast> + ?Sized,
3527 {
3528 tokens_helper(v, &node.paren_token.span);
3529 v.visit_type(&*node.elem);
3530 }
3531 #[cfg(any(feature = "derive", feature = "full"))]
visit_type_path<'ast, V>(v: &mut V, node: &'ast TypePath) where V: Visit<'ast> + ?Sized,3532 pub fn visit_type_path<'ast, V>(v: &mut V, node: &'ast TypePath)
3533 where
3534 V: Visit<'ast> + ?Sized,
3535 {
3536 if let Some(it) = &node.qself {
3537 v.visit_qself(it)
3538 };
3539 v.visit_path(&node.path);
3540 }
3541 #[cfg(any(feature = "derive", feature = "full"))]
visit_type_ptr<'ast, V>(v: &mut V, node: &'ast TypePtr) where V: Visit<'ast> + ?Sized,3542 pub fn visit_type_ptr<'ast, V>(v: &mut V, node: &'ast TypePtr)
3543 where
3544 V: Visit<'ast> + ?Sized,
3545 {
3546 tokens_helper(v, &node.star_token.spans);
3547 if let Some(it) = &node.const_token {
3548 tokens_helper(v, &it.span)
3549 };
3550 if let Some(it) = &node.mutability {
3551 tokens_helper(v, &it.span)
3552 };
3553 v.visit_type(&*node.elem);
3554 }
3555 #[cfg(any(feature = "derive", feature = "full"))]
visit_type_reference<'ast, V>(v: &mut V, node: &'ast TypeReference) where V: Visit<'ast> + ?Sized,3556 pub fn visit_type_reference<'ast, V>(v: &mut V, node: &'ast TypeReference)
3557 where
3558 V: Visit<'ast> + ?Sized,
3559 {
3560 tokens_helper(v, &node.and_token.spans);
3561 if let Some(it) = &node.lifetime {
3562 v.visit_lifetime(it)
3563 };
3564 if let Some(it) = &node.mutability {
3565 tokens_helper(v, &it.span)
3566 };
3567 v.visit_type(&*node.elem);
3568 }
3569 #[cfg(any(feature = "derive", feature = "full"))]
visit_type_slice<'ast, V>(v: &mut V, node: &'ast TypeSlice) where V: Visit<'ast> + ?Sized,3570 pub fn visit_type_slice<'ast, V>(v: &mut V, node: &'ast TypeSlice)
3571 where
3572 V: Visit<'ast> + ?Sized,
3573 {
3574 tokens_helper(v, &node.bracket_token.span);
3575 v.visit_type(&*node.elem);
3576 }
3577 #[cfg(any(feature = "derive", feature = "full"))]
visit_type_trait_object<'ast, V>(v: &mut V, node: &'ast TypeTraitObject) where V: Visit<'ast> + ?Sized,3578 pub fn visit_type_trait_object<'ast, V>(v: &mut V, node: &'ast TypeTraitObject)
3579 where
3580 V: Visit<'ast> + ?Sized,
3581 {
3582 if let Some(it) = &node.dyn_token {
3583 tokens_helper(v, &it.span)
3584 };
3585 for el in Punctuated::pairs(&node.bounds) {
3586 let (it, p) = el.into_tuple();
3587 v.visit_type_param_bound(it);
3588 if let Some(p) = p {
3589 tokens_helper(v, &p.spans);
3590 }
3591 }
3592 }
3593 #[cfg(any(feature = "derive", feature = "full"))]
visit_type_tuple<'ast, V>(v: &mut V, node: &'ast TypeTuple) where V: Visit<'ast> + ?Sized,3594 pub fn visit_type_tuple<'ast, V>(v: &mut V, node: &'ast TypeTuple)
3595 where
3596 V: Visit<'ast> + ?Sized,
3597 {
3598 tokens_helper(v, &node.paren_token.span);
3599 for el in Punctuated::pairs(&node.elems) {
3600 let (it, p) = el.into_tuple();
3601 v.visit_type(it);
3602 if let Some(p) = p {
3603 tokens_helper(v, &p.spans);
3604 }
3605 }
3606 }
3607 #[cfg(any(feature = "derive", feature = "full"))]
visit_un_op<'ast, V>(v: &mut V, node: &'ast UnOp) where V: Visit<'ast> + ?Sized,3608 pub fn visit_un_op<'ast, V>(v: &mut V, node: &'ast UnOp)
3609 where
3610 V: Visit<'ast> + ?Sized,
3611 {
3612 match node {
3613 UnOp::Deref(_binding_0) => {
3614 tokens_helper(v, &_binding_0.spans);
3615 }
3616 UnOp::Not(_binding_0) => {
3617 tokens_helper(v, &_binding_0.spans);
3618 }
3619 UnOp::Neg(_binding_0) => {
3620 tokens_helper(v, &_binding_0.spans);
3621 }
3622 }
3623 }
3624 #[cfg(feature = "full")]
visit_use_glob<'ast, V>(v: &mut V, node: &'ast UseGlob) where V: Visit<'ast> + ?Sized,3625 pub fn visit_use_glob<'ast, V>(v: &mut V, node: &'ast UseGlob)
3626 where
3627 V: Visit<'ast> + ?Sized,
3628 {
3629 tokens_helper(v, &node.star_token.spans);
3630 }
3631 #[cfg(feature = "full")]
visit_use_group<'ast, V>(v: &mut V, node: &'ast UseGroup) where V: Visit<'ast> + ?Sized,3632 pub fn visit_use_group<'ast, V>(v: &mut V, node: &'ast UseGroup)
3633 where
3634 V: Visit<'ast> + ?Sized,
3635 {
3636 tokens_helper(v, &node.brace_token.span);
3637 for el in Punctuated::pairs(&node.items) {
3638 let (it, p) = el.into_tuple();
3639 v.visit_use_tree(it);
3640 if let Some(p) = p {
3641 tokens_helper(v, &p.spans);
3642 }
3643 }
3644 }
3645 #[cfg(feature = "full")]
visit_use_name<'ast, V>(v: &mut V, node: &'ast UseName) where V: Visit<'ast> + ?Sized,3646 pub fn visit_use_name<'ast, V>(v: &mut V, node: &'ast UseName)
3647 where
3648 V: Visit<'ast> + ?Sized,
3649 {
3650 v.visit_ident(&node.ident);
3651 }
3652 #[cfg(feature = "full")]
visit_use_path<'ast, V>(v: &mut V, node: &'ast UsePath) where V: Visit<'ast> + ?Sized,3653 pub fn visit_use_path<'ast, V>(v: &mut V, node: &'ast UsePath)
3654 where
3655 V: Visit<'ast> + ?Sized,
3656 {
3657 v.visit_ident(&node.ident);
3658 tokens_helper(v, &node.colon2_token.spans);
3659 v.visit_use_tree(&*node.tree);
3660 }
3661 #[cfg(feature = "full")]
visit_use_rename<'ast, V>(v: &mut V, node: &'ast UseRename) where V: Visit<'ast> + ?Sized,3662 pub fn visit_use_rename<'ast, V>(v: &mut V, node: &'ast UseRename)
3663 where
3664 V: Visit<'ast> + ?Sized,
3665 {
3666 v.visit_ident(&node.ident);
3667 tokens_helper(v, &node.as_token.span);
3668 v.visit_ident(&node.rename);
3669 }
3670 #[cfg(feature = "full")]
visit_use_tree<'ast, V>(v: &mut V, node: &'ast UseTree) where V: Visit<'ast> + ?Sized,3671 pub fn visit_use_tree<'ast, V>(v: &mut V, node: &'ast UseTree)
3672 where
3673 V: Visit<'ast> + ?Sized,
3674 {
3675 match node {
3676 UseTree::Path(_binding_0) => {
3677 v.visit_use_path(_binding_0);
3678 }
3679 UseTree::Name(_binding_0) => {
3680 v.visit_use_name(_binding_0);
3681 }
3682 UseTree::Rename(_binding_0) => {
3683 v.visit_use_rename(_binding_0);
3684 }
3685 UseTree::Glob(_binding_0) => {
3686 v.visit_use_glob(_binding_0);
3687 }
3688 UseTree::Group(_binding_0) => {
3689 v.visit_use_group(_binding_0);
3690 }
3691 }
3692 }
3693 #[cfg(any(feature = "derive", feature = "full"))]
visit_variadic<'ast, V>(v: &mut V, node: &'ast Variadic) where V: Visit<'ast> + ?Sized,3694 pub fn visit_variadic<'ast, V>(v: &mut V, node: &'ast Variadic)
3695 where
3696 V: Visit<'ast> + ?Sized,
3697 {
3698 for it in &node.attrs {
3699 v.visit_attribute(it)
3700 }
3701 tokens_helper(v, &node.dots.spans);
3702 }
3703 #[cfg(any(feature = "derive", feature = "full"))]
visit_variant<'ast, V>(v: &mut V, node: &'ast Variant) where V: Visit<'ast> + ?Sized,3704 pub fn visit_variant<'ast, V>(v: &mut V, node: &'ast Variant)
3705 where
3706 V: Visit<'ast> + ?Sized,
3707 {
3708 for it in &node.attrs {
3709 v.visit_attribute(it)
3710 }
3711 v.visit_ident(&node.ident);
3712 v.visit_fields(&node.fields);
3713 if let Some(it) = &node.discriminant {
3714 tokens_helper(v, &(it).0.spans);
3715 v.visit_expr(&(it).1);
3716 };
3717 }
3718 #[cfg(any(feature = "derive", feature = "full"))]
visit_vis_crate<'ast, V>(v: &mut V, node: &'ast VisCrate) where V: Visit<'ast> + ?Sized,3719 pub fn visit_vis_crate<'ast, V>(v: &mut V, node: &'ast VisCrate)
3720 where
3721 V: Visit<'ast> + ?Sized,
3722 {
3723 tokens_helper(v, &node.crate_token.span);
3724 }
3725 #[cfg(any(feature = "derive", feature = "full"))]
visit_vis_public<'ast, V>(v: &mut V, node: &'ast VisPublic) where V: Visit<'ast> + ?Sized,3726 pub fn visit_vis_public<'ast, V>(v: &mut V, node: &'ast VisPublic)
3727 where
3728 V: Visit<'ast> + ?Sized,
3729 {
3730 tokens_helper(v, &node.pub_token.span);
3731 }
3732 #[cfg(any(feature = "derive", feature = "full"))]
visit_vis_restricted<'ast, V>(v: &mut V, node: &'ast VisRestricted) where V: Visit<'ast> + ?Sized,3733 pub fn visit_vis_restricted<'ast, V>(v: &mut V, node: &'ast VisRestricted)
3734 where
3735 V: Visit<'ast> + ?Sized,
3736 {
3737 tokens_helper(v, &node.pub_token.span);
3738 tokens_helper(v, &node.paren_token.span);
3739 if let Some(it) = &node.in_token {
3740 tokens_helper(v, &it.span)
3741 };
3742 v.visit_path(&*node.path);
3743 }
3744 #[cfg(any(feature = "derive", feature = "full"))]
visit_visibility<'ast, V>(v: &mut V, node: &'ast Visibility) where V: Visit<'ast> + ?Sized,3745 pub fn visit_visibility<'ast, V>(v: &mut V, node: &'ast Visibility)
3746 where
3747 V: Visit<'ast> + ?Sized,
3748 {
3749 match node {
3750 Visibility::Public(_binding_0) => {
3751 v.visit_vis_public(_binding_0);
3752 }
3753 Visibility::Crate(_binding_0) => {
3754 v.visit_vis_crate(_binding_0);
3755 }
3756 Visibility::Restricted(_binding_0) => {
3757 v.visit_vis_restricted(_binding_0);
3758 }
3759 Visibility::Inherited => {}
3760 }
3761 }
3762 #[cfg(any(feature = "derive", feature = "full"))]
visit_where_clause<'ast, V>(v: &mut V, node: &'ast WhereClause) where V: Visit<'ast> + ?Sized,3763 pub fn visit_where_clause<'ast, V>(v: &mut V, node: &'ast WhereClause)
3764 where
3765 V: Visit<'ast> + ?Sized,
3766 {
3767 tokens_helper(v, &node.where_token.span);
3768 for el in Punctuated::pairs(&node.predicates) {
3769 let (it, p) = el.into_tuple();
3770 v.visit_where_predicate(it);
3771 if let Some(p) = p {
3772 tokens_helper(v, &p.spans);
3773 }
3774 }
3775 }
3776 #[cfg(any(feature = "derive", feature = "full"))]
visit_where_predicate<'ast, V>(v: &mut V, node: &'ast WherePredicate) where V: Visit<'ast> + ?Sized,3777 pub fn visit_where_predicate<'ast, V>(v: &mut V, node: &'ast WherePredicate)
3778 where
3779 V: Visit<'ast> + ?Sized,
3780 {
3781 match node {
3782 WherePredicate::Type(_binding_0) => {
3783 v.visit_predicate_type(_binding_0);
3784 }
3785 WherePredicate::Lifetime(_binding_0) => {
3786 v.visit_predicate_lifetime(_binding_0);
3787 }
3788 WherePredicate::Eq(_binding_0) => {
3789 v.visit_predicate_eq(_binding_0);
3790 }
3791 }
3792 }
3793