blob: 7d154222c94780bd456b87a409cf8dce592871cb [file] [log] [blame]
Nika Layzell27726662017-10-24 23:16:35 -04001// THIS FILE IS AUTOMATICALLY GENERATED; DO NOT EDIT
2
David Tolnayf0d63bf2017-12-26 12:29:47 -05003#![cfg_attr(feature = "cargo-clippy", allow(match_same_arms))]
David Tolnay0a0d78c2018-01-05 15:24:01 -08004#[cfg(any(feature = "full", feature = "derive"))]
David Tolnaycc0f0372017-12-28 19:11:04 -05005use gen::helper::visit::*;
David Tolnay8c81f622018-07-31 23:34:35 -07006use proc_macro2::Span;
7#[cfg(any(feature = "full", feature = "derive"))]
8use punctuated::Punctuated;
9use *;
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040010#[cfg(feature = "full")]
11macro_rules! full {
David Tolnay280202f2018-08-02 00:29:54 -070012 ($e:expr) => {
David Tolnay8c81f622018-07-31 23:34:35 -070013 $e
14 };
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040015}
David Tolnay0a0d78c2018-01-05 15:24:01 -080016#[cfg(all(feature = "derive", not(feature = "full")))]
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040017macro_rules! full {
David Tolnay280202f2018-08-02 00:29:54 -070018 ($e:expr) => {
David Tolnay8c81f622018-07-31 23:34:35 -070019 unreachable!()
20 };
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040021}
David Tolnay6af48992018-08-01 11:16:28 -070022#[cfg(any(feature = "full", feature = "derive"))]
23macro_rules! skip {
David Tolnay280202f2018-08-02 00:29:54 -070024 ($($tt:tt)*) => {};
David Tolnay6af48992018-08-01 11:16:28 -070025}
26#[doc = r" Syntax tree traversal to walk a shared borrow of a syntax tree."]
27#[doc = r""]
28#[doc = r" See the [module documentation] for details."]
29#[doc = r""]
30#[doc = r" [module documentation]: index.html"]
31#[doc = r""]
32#[doc = r#" *This trait is available if Syn is built with the `"visit"` feature.*"#]
David Tolnay4b4c4b62018-01-06 13:48:05 -080033pub trait Visit<'ast> {
David Tolnay8c81f622018-07-31 23:34:35 -070034 #[cfg(any(feature = "full", feature = "derive"))]
35 fn visit_abi(&mut self, i: &'ast Abi) {
36 visit_abi(self, i)
37 }
38 #[cfg(any(feature = "full", feature = "derive"))]
39 fn visit_angle_bracketed_generic_arguments(&mut self, i: &'ast AngleBracketedGenericArguments) {
40 visit_angle_bracketed_generic_arguments(self, i)
41 }
42 #[cfg(feature = "full")]
43 fn visit_arg_captured(&mut self, i: &'ast ArgCaptured) {
44 visit_arg_captured(self, i)
45 }
46 #[cfg(feature = "full")]
47 fn visit_arg_self(&mut self, i: &'ast ArgSelf) {
48 visit_arg_self(self, i)
49 }
50 #[cfg(feature = "full")]
51 fn visit_arg_self_ref(&mut self, i: &'ast ArgSelfRef) {
52 visit_arg_self_ref(self, i)
53 }
54 #[cfg(any(feature = "full", feature = "derive"))]
55 #[cfg(feature = "full")]
56 fn visit_arm(&mut self, i: &'ast Arm) {
57 visit_arm(self, i)
58 }
59 #[cfg(any(feature = "full", feature = "derive"))]
60 fn visit_attr_style(&mut self, i: &'ast AttrStyle) {
61 visit_attr_style(self, i)
62 }
63 #[cfg(any(feature = "full", feature = "derive"))]
64 fn visit_attribute(&mut self, i: &'ast Attribute) {
65 visit_attribute(self, i)
66 }
67 #[cfg(any(feature = "full", feature = "derive"))]
68 fn visit_bare_fn_arg(&mut self, i: &'ast BareFnArg) {
69 visit_bare_fn_arg(self, i)
70 }
71 #[cfg(any(feature = "full", feature = "derive"))]
72 fn visit_bare_fn_arg_name(&mut self, i: &'ast BareFnArgName) {
73 visit_bare_fn_arg_name(self, i)
74 }
75 #[cfg(any(feature = "full", feature = "derive"))]
76 fn visit_bin_op(&mut self, i: &'ast BinOp) {
77 visit_bin_op(self, i)
78 }
79 #[cfg(any(feature = "full", feature = "derive"))]
80 fn visit_binding(&mut self, i: &'ast Binding) {
81 visit_binding(self, i)
82 }
83 #[cfg(any(feature = "full", feature = "derive"))]
84 #[cfg(feature = "full")]
85 fn visit_block(&mut self, i: &'ast Block) {
86 visit_block(self, i)
87 }
88 #[cfg(any(feature = "full", feature = "derive"))]
89 fn visit_bound_lifetimes(&mut self, i: &'ast BoundLifetimes) {
90 visit_bound_lifetimes(self, i)
91 }
92 #[cfg(any(feature = "full", feature = "derive"))]
93 fn visit_const_param(&mut self, i: &'ast ConstParam) {
94 visit_const_param(self, i)
95 }
96 #[cfg(feature = "derive")]
97 fn visit_data(&mut self, i: &'ast Data) {
98 visit_data(self, i)
99 }
100 #[cfg(feature = "derive")]
101 fn visit_data_enum(&mut self, i: &'ast DataEnum) {
102 visit_data_enum(self, i)
103 }
104 #[cfg(feature = "derive")]
105 fn visit_data_struct(&mut self, i: &'ast DataStruct) {
106 visit_data_struct(self, i)
107 }
108 #[cfg(feature = "derive")]
109 fn visit_data_union(&mut self, i: &'ast DataUnion) {
110 visit_data_union(self, i)
111 }
112 #[cfg(feature = "derive")]
113 fn visit_derive_input(&mut self, i: &'ast DeriveInput) {
114 visit_derive_input(self, i)
115 }
116 #[cfg(any(feature = "full", feature = "derive"))]
117 fn visit_expr(&mut self, i: &'ast Expr) {
118 visit_expr(self, i)
119 }
120 #[cfg(feature = "full")]
121 #[cfg(any(feature = "full", feature = "derive"))]
122 fn visit_expr_array(&mut self, i: &'ast ExprArray) {
123 visit_expr_array(self, i)
124 }
125 #[cfg(feature = "full")]
126 #[cfg(any(feature = "full", feature = "derive"))]
127 fn visit_expr_assign(&mut self, i: &'ast ExprAssign) {
128 visit_expr_assign(self, i)
129 }
130 #[cfg(feature = "full")]
131 #[cfg(any(feature = "full", feature = "derive"))]
132 fn visit_expr_assign_op(&mut self, i: &'ast ExprAssignOp) {
133 visit_expr_assign_op(self, i)
134 }
David Tolnay02a9c6f2018-08-24 18:58:45 -0400135 #[cfg(feature = "full")]
136 #[cfg(any(feature = "full", feature = "derive"))]
137 fn visit_expr_async(&mut self, i: &'ast ExprAsync) {
138 visit_expr_async(self, i)
139 }
David Tolnay8c81f622018-07-31 23:34:35 -0700140 #[cfg(any(feature = "full", feature = "derive"))]
141 fn visit_expr_binary(&mut self, i: &'ast ExprBinary) {
142 visit_expr_binary(self, i)
143 }
144 #[cfg(feature = "full")]
145 #[cfg(any(feature = "full", feature = "derive"))]
146 fn visit_expr_block(&mut self, i: &'ast ExprBlock) {
147 visit_expr_block(self, i)
148 }
149 #[cfg(feature = "full")]
150 #[cfg(any(feature = "full", feature = "derive"))]
151 fn visit_expr_box(&mut self, i: &'ast ExprBox) {
152 visit_expr_box(self, i)
153 }
154 #[cfg(feature = "full")]
155 #[cfg(any(feature = "full", feature = "derive"))]
156 fn visit_expr_break(&mut self, i: &'ast ExprBreak) {
157 visit_expr_break(self, i)
158 }
159 #[cfg(any(feature = "full", feature = "derive"))]
160 fn visit_expr_call(&mut self, i: &'ast ExprCall) {
161 visit_expr_call(self, i)
162 }
163 #[cfg(any(feature = "full", feature = "derive"))]
164 fn visit_expr_cast(&mut self, i: &'ast ExprCast) {
165 visit_expr_cast(self, i)
166 }
167 #[cfg(feature = "full")]
168 #[cfg(any(feature = "full", feature = "derive"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700169 fn visit_expr_closure(&mut self, i: &'ast ExprClosure) {
170 visit_expr_closure(self, i)
171 }
172 #[cfg(feature = "full")]
173 #[cfg(any(feature = "full", feature = "derive"))]
174 fn visit_expr_continue(&mut self, i: &'ast ExprContinue) {
175 visit_expr_continue(self, i)
176 }
177 #[cfg(any(feature = "full", feature = "derive"))]
178 fn visit_expr_field(&mut self, i: &'ast ExprField) {
179 visit_expr_field(self, i)
180 }
181 #[cfg(feature = "full")]
182 #[cfg(any(feature = "full", feature = "derive"))]
183 fn visit_expr_for_loop(&mut self, i: &'ast ExprForLoop) {
184 visit_expr_for_loop(self, i)
185 }
186 #[cfg(feature = "full")]
187 #[cfg(any(feature = "full", feature = "derive"))]
188 fn visit_expr_group(&mut self, i: &'ast ExprGroup) {
189 visit_expr_group(self, i)
190 }
191 #[cfg(feature = "full")]
192 #[cfg(any(feature = "full", feature = "derive"))]
193 fn visit_expr_if(&mut self, i: &'ast ExprIf) {
194 visit_expr_if(self, i)
195 }
196 #[cfg(feature = "full")]
197 #[cfg(any(feature = "full", feature = "derive"))]
198 fn visit_expr_if_let(&mut self, i: &'ast ExprIfLet) {
199 visit_expr_if_let(self, i)
200 }
201 #[cfg(feature = "full")]
202 #[cfg(any(feature = "full", feature = "derive"))]
203 fn visit_expr_in_place(&mut self, i: &'ast ExprInPlace) {
204 visit_expr_in_place(self, i)
205 }
206 #[cfg(any(feature = "full", feature = "derive"))]
207 fn visit_expr_index(&mut self, i: &'ast ExprIndex) {
208 visit_expr_index(self, i)
209 }
210 #[cfg(any(feature = "full", feature = "derive"))]
211 fn visit_expr_lit(&mut self, i: &'ast ExprLit) {
212 visit_expr_lit(self, i)
213 }
214 #[cfg(feature = "full")]
215 #[cfg(any(feature = "full", feature = "derive"))]
216 fn visit_expr_loop(&mut self, i: &'ast ExprLoop) {
217 visit_expr_loop(self, i)
218 }
219 #[cfg(feature = "full")]
220 #[cfg(any(feature = "full", feature = "derive"))]
221 fn visit_expr_macro(&mut self, i: &'ast ExprMacro) {
222 visit_expr_macro(self, i)
223 }
224 #[cfg(feature = "full")]
225 #[cfg(any(feature = "full", feature = "derive"))]
226 fn visit_expr_match(&mut self, i: &'ast ExprMatch) {
227 visit_expr_match(self, i)
228 }
229 #[cfg(feature = "full")]
230 #[cfg(any(feature = "full", feature = "derive"))]
231 fn visit_expr_method_call(&mut self, i: &'ast ExprMethodCall) {
232 visit_expr_method_call(self, i)
233 }
234 #[cfg(any(feature = "full", feature = "derive"))]
235 fn visit_expr_paren(&mut self, i: &'ast ExprParen) {
236 visit_expr_paren(self, i)
237 }
238 #[cfg(any(feature = "full", feature = "derive"))]
239 fn visit_expr_path(&mut self, i: &'ast ExprPath) {
240 visit_expr_path(self, i)
241 }
242 #[cfg(feature = "full")]
243 #[cfg(any(feature = "full", feature = "derive"))]
244 fn visit_expr_range(&mut self, i: &'ast ExprRange) {
245 visit_expr_range(self, i)
246 }
247 #[cfg(feature = "full")]
248 #[cfg(any(feature = "full", feature = "derive"))]
249 fn visit_expr_reference(&mut self, i: &'ast ExprReference) {
250 visit_expr_reference(self, i)
251 }
252 #[cfg(feature = "full")]
253 #[cfg(any(feature = "full", feature = "derive"))]
254 fn visit_expr_repeat(&mut self, i: &'ast ExprRepeat) {
255 visit_expr_repeat(self, i)
256 }
257 #[cfg(feature = "full")]
258 #[cfg(any(feature = "full", feature = "derive"))]
259 fn visit_expr_return(&mut self, i: &'ast ExprReturn) {
260 visit_expr_return(self, i)
261 }
262 #[cfg(feature = "full")]
263 #[cfg(any(feature = "full", feature = "derive"))]
264 fn visit_expr_struct(&mut self, i: &'ast ExprStruct) {
265 visit_expr_struct(self, i)
266 }
267 #[cfg(feature = "full")]
268 #[cfg(any(feature = "full", feature = "derive"))]
269 fn visit_expr_try(&mut self, i: &'ast ExprTry) {
270 visit_expr_try(self, i)
271 }
272 #[cfg(feature = "full")]
273 #[cfg(any(feature = "full", feature = "derive"))]
David Tolnayfb2dd4b2018-08-24 16:45:34 -0400274 fn visit_expr_try_block(&mut self, i: &'ast ExprTryBlock) {
275 visit_expr_try_block(self, i)
276 }
277 #[cfg(feature = "full")]
278 #[cfg(any(feature = "full", feature = "derive"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700279 fn visit_expr_tuple(&mut self, i: &'ast ExprTuple) {
280 visit_expr_tuple(self, i)
281 }
282 #[cfg(feature = "full")]
283 #[cfg(any(feature = "full", feature = "derive"))]
284 fn visit_expr_type(&mut self, i: &'ast ExprType) {
285 visit_expr_type(self, i)
286 }
287 #[cfg(any(feature = "full", feature = "derive"))]
288 fn visit_expr_unary(&mut self, i: &'ast ExprUnary) {
289 visit_expr_unary(self, i)
290 }
291 #[cfg(feature = "full")]
292 #[cfg(any(feature = "full", feature = "derive"))]
293 fn visit_expr_unsafe(&mut self, i: &'ast ExprUnsafe) {
294 visit_expr_unsafe(self, i)
295 }
296 #[cfg(any(feature = "full", feature = "derive"))]
297 fn visit_expr_verbatim(&mut self, i: &'ast ExprVerbatim) {
298 visit_expr_verbatim(self, i)
299 }
300 #[cfg(feature = "full")]
301 #[cfg(any(feature = "full", feature = "derive"))]
302 fn visit_expr_while(&mut self, i: &'ast ExprWhile) {
303 visit_expr_while(self, i)
304 }
305 #[cfg(feature = "full")]
306 #[cfg(any(feature = "full", feature = "derive"))]
307 fn visit_expr_while_let(&mut self, i: &'ast ExprWhileLet) {
308 visit_expr_while_let(self, i)
309 }
310 #[cfg(feature = "full")]
311 #[cfg(any(feature = "full", feature = "derive"))]
312 fn visit_expr_yield(&mut self, i: &'ast ExprYield) {
313 visit_expr_yield(self, i)
314 }
315 #[cfg(any(feature = "full", feature = "derive"))]
316 fn visit_field(&mut self, i: &'ast Field) {
317 visit_field(self, i)
318 }
319 #[cfg(any(feature = "full", feature = "derive"))]
320 #[cfg(feature = "full")]
321 fn visit_field_pat(&mut self, i: &'ast FieldPat) {
322 visit_field_pat(self, i)
323 }
324 #[cfg(any(feature = "full", feature = "derive"))]
325 #[cfg(feature = "full")]
326 fn visit_field_value(&mut self, i: &'ast FieldValue) {
327 visit_field_value(self, i)
328 }
329 #[cfg(any(feature = "full", feature = "derive"))]
330 fn visit_fields(&mut self, i: &'ast Fields) {
331 visit_fields(self, i)
332 }
333 #[cfg(any(feature = "full", feature = "derive"))]
334 fn visit_fields_named(&mut self, i: &'ast FieldsNamed) {
335 visit_fields_named(self, i)
336 }
337 #[cfg(any(feature = "full", feature = "derive"))]
338 fn visit_fields_unnamed(&mut self, i: &'ast FieldsUnnamed) {
339 visit_fields_unnamed(self, i)
340 }
341 #[cfg(feature = "full")]
342 fn visit_file(&mut self, i: &'ast File) {
343 visit_file(self, i)
344 }
345 #[cfg(feature = "full")]
346 fn visit_fn_arg(&mut self, i: &'ast FnArg) {
347 visit_fn_arg(self, i)
348 }
349 #[cfg(feature = "full")]
350 fn visit_fn_decl(&mut self, i: &'ast FnDecl) {
351 visit_fn_decl(self, i)
352 }
353 #[cfg(feature = "full")]
354 fn visit_foreign_item(&mut self, i: &'ast ForeignItem) {
355 visit_foreign_item(self, i)
356 }
357 #[cfg(feature = "full")]
358 fn visit_foreign_item_fn(&mut self, i: &'ast ForeignItemFn) {
359 visit_foreign_item_fn(self, i)
360 }
361 #[cfg(feature = "full")]
David Tolnay435c1782018-08-24 16:15:44 -0400362 fn visit_foreign_item_macro(&mut self, i: &'ast ForeignItemMacro) {
363 visit_foreign_item_macro(self, i)
364 }
365 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700366 fn visit_foreign_item_static(&mut self, i: &'ast ForeignItemStatic) {
367 visit_foreign_item_static(self, i)
368 }
369 #[cfg(feature = "full")]
370 fn visit_foreign_item_type(&mut self, i: &'ast ForeignItemType) {
371 visit_foreign_item_type(self, i)
372 }
373 #[cfg(feature = "full")]
374 fn visit_foreign_item_verbatim(&mut self, i: &'ast ForeignItemVerbatim) {
375 visit_foreign_item_verbatim(self, i)
376 }
377 #[cfg(any(feature = "full", feature = "derive"))]
378 fn visit_generic_argument(&mut self, i: &'ast GenericArgument) {
379 visit_generic_argument(self, i)
380 }
381 #[cfg(any(feature = "full", feature = "derive"))]
382 #[cfg(feature = "full")]
383 fn visit_generic_method_argument(&mut self, i: &'ast GenericMethodArgument) {
384 visit_generic_method_argument(self, i)
385 }
386 #[cfg(any(feature = "full", feature = "derive"))]
387 fn visit_generic_param(&mut self, i: &'ast GenericParam) {
388 visit_generic_param(self, i)
389 }
390 #[cfg(any(feature = "full", feature = "derive"))]
391 fn visit_generics(&mut self, i: &'ast Generics) {
392 visit_generics(self, i)
393 }
David Tolnay8c81f622018-07-31 23:34:35 -0700394 fn visit_ident(&mut self, i: &'ast Ident) {
395 visit_ident(self, i)
396 }
397 #[cfg(feature = "full")]
398 fn visit_impl_item(&mut self, i: &'ast ImplItem) {
399 visit_impl_item(self, i)
400 }
401 #[cfg(feature = "full")]
402 fn visit_impl_item_const(&mut self, i: &'ast ImplItemConst) {
403 visit_impl_item_const(self, i)
404 }
405 #[cfg(feature = "full")]
David Tolnaybb82ef02018-08-24 20:15:45 -0400406 fn visit_impl_item_existential(&mut self, i: &'ast ImplItemExistential) {
407 visit_impl_item_existential(self, i)
408 }
409 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700410 fn visit_impl_item_macro(&mut self, i: &'ast ImplItemMacro) {
411 visit_impl_item_macro(self, i)
412 }
413 #[cfg(feature = "full")]
414 fn visit_impl_item_method(&mut self, i: &'ast ImplItemMethod) {
415 visit_impl_item_method(self, i)
416 }
417 #[cfg(feature = "full")]
418 fn visit_impl_item_type(&mut self, i: &'ast ImplItemType) {
419 visit_impl_item_type(self, i)
420 }
421 #[cfg(feature = "full")]
422 fn visit_impl_item_verbatim(&mut self, i: &'ast ImplItemVerbatim) {
423 visit_impl_item_verbatim(self, i)
424 }
425 #[cfg(any(feature = "full", feature = "derive"))]
426 fn visit_index(&mut self, i: &'ast Index) {
427 visit_index(self, i)
428 }
429 #[cfg(feature = "full")]
430 fn visit_item(&mut self, i: &'ast Item) {
431 visit_item(self, i)
432 }
433 #[cfg(feature = "full")]
434 fn visit_item_const(&mut self, i: &'ast ItemConst) {
435 visit_item_const(self, i)
436 }
437 #[cfg(feature = "full")]
438 fn visit_item_enum(&mut self, i: &'ast ItemEnum) {
439 visit_item_enum(self, i)
440 }
441 #[cfg(feature = "full")]
David Tolnaybb82ef02018-08-24 20:15:45 -0400442 fn visit_item_existential(&mut self, i: &'ast ItemExistential) {
443 visit_item_existential(self, i)
444 }
445 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700446 fn visit_item_extern_crate(&mut self, i: &'ast ItemExternCrate) {
447 visit_item_extern_crate(self, i)
448 }
449 #[cfg(feature = "full")]
450 fn visit_item_fn(&mut self, i: &'ast ItemFn) {
451 visit_item_fn(self, i)
452 }
453 #[cfg(feature = "full")]
454 fn visit_item_foreign_mod(&mut self, i: &'ast ItemForeignMod) {
455 visit_item_foreign_mod(self, i)
456 }
457 #[cfg(feature = "full")]
458 fn visit_item_impl(&mut self, i: &'ast ItemImpl) {
459 visit_item_impl(self, i)
460 }
461 #[cfg(feature = "full")]
462 fn visit_item_macro(&mut self, i: &'ast ItemMacro) {
463 visit_item_macro(self, i)
464 }
465 #[cfg(feature = "full")]
466 fn visit_item_macro2(&mut self, i: &'ast ItemMacro2) {
467 visit_item_macro2(self, i)
468 }
469 #[cfg(feature = "full")]
470 fn visit_item_mod(&mut self, i: &'ast ItemMod) {
471 visit_item_mod(self, i)
472 }
473 #[cfg(feature = "full")]
474 fn visit_item_static(&mut self, i: &'ast ItemStatic) {
475 visit_item_static(self, i)
476 }
477 #[cfg(feature = "full")]
478 fn visit_item_struct(&mut self, i: &'ast ItemStruct) {
479 visit_item_struct(self, i)
480 }
481 #[cfg(feature = "full")]
482 fn visit_item_trait(&mut self, i: &'ast ItemTrait) {
483 visit_item_trait(self, i)
484 }
485 #[cfg(feature = "full")]
486 fn visit_item_type(&mut self, i: &'ast ItemType) {
487 visit_item_type(self, i)
488 }
489 #[cfg(feature = "full")]
490 fn visit_item_union(&mut self, i: &'ast ItemUnion) {
491 visit_item_union(self, i)
492 }
493 #[cfg(feature = "full")]
494 fn visit_item_use(&mut self, i: &'ast ItemUse) {
495 visit_item_use(self, i)
496 }
497 #[cfg(feature = "full")]
498 fn visit_item_verbatim(&mut self, i: &'ast ItemVerbatim) {
499 visit_item_verbatim(self, i)
500 }
501 #[cfg(any(feature = "full", feature = "derive"))]
502 #[cfg(feature = "full")]
503 fn visit_label(&mut self, i: &'ast Label) {
504 visit_label(self, i)
505 }
506 #[cfg(any(feature = "full", feature = "derive"))]
507 fn visit_lifetime(&mut self, i: &'ast Lifetime) {
508 visit_lifetime(self, i)
509 }
510 #[cfg(any(feature = "full", feature = "derive"))]
511 fn visit_lifetime_def(&mut self, i: &'ast LifetimeDef) {
512 visit_lifetime_def(self, i)
513 }
514 #[cfg(any(feature = "full", feature = "derive"))]
515 fn visit_lit(&mut self, i: &'ast Lit) {
516 visit_lit(self, i)
517 }
518 #[cfg(any(feature = "full", feature = "derive"))]
519 fn visit_lit_bool(&mut self, i: &'ast LitBool) {
520 visit_lit_bool(self, i)
521 }
522 #[cfg(any(feature = "full", feature = "derive"))]
523 fn visit_lit_byte(&mut self, i: &'ast LitByte) {
524 visit_lit_byte(self, i)
525 }
526 #[cfg(any(feature = "full", feature = "derive"))]
527 fn visit_lit_byte_str(&mut self, i: &'ast LitByteStr) {
528 visit_lit_byte_str(self, i)
529 }
530 #[cfg(any(feature = "full", feature = "derive"))]
531 fn visit_lit_char(&mut self, i: &'ast LitChar) {
532 visit_lit_char(self, i)
533 }
534 #[cfg(any(feature = "full", feature = "derive"))]
535 fn visit_lit_float(&mut self, i: &'ast LitFloat) {
536 visit_lit_float(self, i)
537 }
538 #[cfg(any(feature = "full", feature = "derive"))]
539 fn visit_lit_int(&mut self, i: &'ast LitInt) {
540 visit_lit_int(self, i)
541 }
542 #[cfg(any(feature = "full", feature = "derive"))]
543 fn visit_lit_str(&mut self, i: &'ast LitStr) {
544 visit_lit_str(self, i)
545 }
546 #[cfg(any(feature = "full", feature = "derive"))]
547 fn visit_lit_verbatim(&mut self, i: &'ast LitVerbatim) {
548 visit_lit_verbatim(self, i)
549 }
550 #[cfg(any(feature = "full", feature = "derive"))]
551 #[cfg(feature = "full")]
552 fn visit_local(&mut self, i: &'ast Local) {
553 visit_local(self, i)
554 }
555 #[cfg(any(feature = "full", feature = "derive"))]
556 fn visit_macro(&mut self, i: &'ast Macro) {
557 visit_macro(self, i)
558 }
559 #[cfg(any(feature = "full", feature = "derive"))]
560 fn visit_macro_delimiter(&mut self, i: &'ast MacroDelimiter) {
561 visit_macro_delimiter(self, i)
562 }
563 #[cfg(any(feature = "full", feature = "derive"))]
564 fn visit_member(&mut self, i: &'ast Member) {
565 visit_member(self, i)
566 }
567 #[cfg(any(feature = "full", feature = "derive"))]
568 fn visit_meta(&mut self, i: &'ast Meta) {
569 visit_meta(self, i)
570 }
571 #[cfg(any(feature = "full", feature = "derive"))]
572 fn visit_meta_list(&mut self, i: &'ast MetaList) {
573 visit_meta_list(self, i)
574 }
575 #[cfg(any(feature = "full", feature = "derive"))]
576 fn visit_meta_name_value(&mut self, i: &'ast MetaNameValue) {
577 visit_meta_name_value(self, i)
578 }
579 #[cfg(feature = "full")]
580 fn visit_method_sig(&mut self, i: &'ast MethodSig) {
581 visit_method_sig(self, i)
582 }
583 #[cfg(any(feature = "full", feature = "derive"))]
584 #[cfg(feature = "full")]
585 fn visit_method_turbofish(&mut self, i: &'ast MethodTurbofish) {
586 visit_method_turbofish(self, i)
587 }
588 #[cfg(any(feature = "full", feature = "derive"))]
589 fn visit_nested_meta(&mut self, i: &'ast NestedMeta) {
590 visit_nested_meta(self, i)
591 }
592 #[cfg(any(feature = "full", feature = "derive"))]
593 fn visit_parenthesized_generic_arguments(&mut self, i: &'ast ParenthesizedGenericArguments) {
594 visit_parenthesized_generic_arguments(self, i)
595 }
596 #[cfg(any(feature = "full", feature = "derive"))]
597 #[cfg(feature = "full")]
598 fn visit_pat(&mut self, i: &'ast Pat) {
599 visit_pat(self, i)
600 }
601 #[cfg(any(feature = "full", feature = "derive"))]
602 #[cfg(feature = "full")]
603 fn visit_pat_box(&mut self, i: &'ast PatBox) {
604 visit_pat_box(self, i)
605 }
606 #[cfg(any(feature = "full", feature = "derive"))]
607 #[cfg(feature = "full")]
608 fn visit_pat_ident(&mut self, i: &'ast PatIdent) {
609 visit_pat_ident(self, i)
610 }
611 #[cfg(any(feature = "full", feature = "derive"))]
612 #[cfg(feature = "full")]
613 fn visit_pat_lit(&mut self, i: &'ast PatLit) {
614 visit_pat_lit(self, i)
615 }
616 #[cfg(any(feature = "full", feature = "derive"))]
617 #[cfg(feature = "full")]
618 fn visit_pat_macro(&mut self, i: &'ast PatMacro) {
619 visit_pat_macro(self, i)
620 }
621 #[cfg(any(feature = "full", feature = "derive"))]
622 #[cfg(feature = "full")]
623 fn visit_pat_path(&mut self, i: &'ast PatPath) {
624 visit_pat_path(self, i)
625 }
626 #[cfg(any(feature = "full", feature = "derive"))]
627 #[cfg(feature = "full")]
628 fn visit_pat_range(&mut self, i: &'ast PatRange) {
629 visit_pat_range(self, i)
630 }
631 #[cfg(any(feature = "full", feature = "derive"))]
632 #[cfg(feature = "full")]
633 fn visit_pat_ref(&mut self, i: &'ast PatRef) {
634 visit_pat_ref(self, i)
635 }
636 #[cfg(any(feature = "full", feature = "derive"))]
637 #[cfg(feature = "full")]
638 fn visit_pat_slice(&mut self, i: &'ast PatSlice) {
639 visit_pat_slice(self, i)
640 }
641 #[cfg(any(feature = "full", feature = "derive"))]
642 #[cfg(feature = "full")]
643 fn visit_pat_struct(&mut self, i: &'ast PatStruct) {
644 visit_pat_struct(self, i)
645 }
646 #[cfg(any(feature = "full", feature = "derive"))]
647 #[cfg(feature = "full")]
648 fn visit_pat_tuple(&mut self, i: &'ast PatTuple) {
649 visit_pat_tuple(self, i)
650 }
651 #[cfg(any(feature = "full", feature = "derive"))]
652 #[cfg(feature = "full")]
653 fn visit_pat_tuple_struct(&mut self, i: &'ast PatTupleStruct) {
654 visit_pat_tuple_struct(self, i)
655 }
656 #[cfg(any(feature = "full", feature = "derive"))]
657 #[cfg(feature = "full")]
658 fn visit_pat_verbatim(&mut self, i: &'ast PatVerbatim) {
659 visit_pat_verbatim(self, i)
660 }
661 #[cfg(any(feature = "full", feature = "derive"))]
662 #[cfg(feature = "full")]
663 fn visit_pat_wild(&mut self, i: &'ast PatWild) {
664 visit_pat_wild(self, i)
665 }
666 #[cfg(any(feature = "full", feature = "derive"))]
667 fn visit_path(&mut self, i: &'ast Path) {
668 visit_path(self, i)
669 }
670 #[cfg(any(feature = "full", feature = "derive"))]
671 fn visit_path_arguments(&mut self, i: &'ast PathArguments) {
672 visit_path_arguments(self, i)
673 }
674 #[cfg(any(feature = "full", feature = "derive"))]
675 fn visit_path_segment(&mut self, i: &'ast PathSegment) {
676 visit_path_segment(self, i)
677 }
678 #[cfg(any(feature = "full", feature = "derive"))]
679 fn visit_predicate_eq(&mut self, i: &'ast PredicateEq) {
680 visit_predicate_eq(self, i)
681 }
682 #[cfg(any(feature = "full", feature = "derive"))]
683 fn visit_predicate_lifetime(&mut self, i: &'ast PredicateLifetime) {
684 visit_predicate_lifetime(self, i)
685 }
686 #[cfg(any(feature = "full", feature = "derive"))]
687 fn visit_predicate_type(&mut self, i: &'ast PredicateType) {
688 visit_predicate_type(self, i)
689 }
690 #[cfg(any(feature = "full", feature = "derive"))]
691 fn visit_qself(&mut self, i: &'ast QSelf) {
692 visit_qself(self, i)
693 }
694 #[cfg(any(feature = "full", feature = "derive"))]
695 #[cfg(feature = "full")]
696 fn visit_range_limits(&mut self, i: &'ast RangeLimits) {
697 visit_range_limits(self, i)
698 }
699 #[cfg(any(feature = "full", feature = "derive"))]
700 fn visit_return_type(&mut self, i: &'ast ReturnType) {
701 visit_return_type(self, i)
702 }
David Tolnay8c81f622018-07-31 23:34:35 -0700703 fn visit_span(&mut self, i: &'ast Span) {
704 visit_span(self, i)
705 }
706 #[cfg(any(feature = "full", feature = "derive"))]
707 #[cfg(feature = "full")]
708 fn visit_stmt(&mut self, i: &'ast Stmt) {
709 visit_stmt(self, i)
710 }
711 #[cfg(any(feature = "full", feature = "derive"))]
712 fn visit_trait_bound(&mut self, i: &'ast TraitBound) {
713 visit_trait_bound(self, i)
714 }
715 #[cfg(any(feature = "full", feature = "derive"))]
716 fn visit_trait_bound_modifier(&mut self, i: &'ast TraitBoundModifier) {
717 visit_trait_bound_modifier(self, i)
718 }
719 #[cfg(feature = "full")]
720 fn visit_trait_item(&mut self, i: &'ast TraitItem) {
721 visit_trait_item(self, i)
722 }
723 #[cfg(feature = "full")]
724 fn visit_trait_item_const(&mut self, i: &'ast TraitItemConst) {
725 visit_trait_item_const(self, i)
726 }
727 #[cfg(feature = "full")]
David Tolnaybb82ef02018-08-24 20:15:45 -0400728 fn visit_trait_item_existential(&mut self, i: &'ast TraitItemExistential) {
729 visit_trait_item_existential(self, i)
730 }
731 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700732 fn visit_trait_item_macro(&mut self, i: &'ast TraitItemMacro) {
733 visit_trait_item_macro(self, i)
734 }
735 #[cfg(feature = "full")]
736 fn visit_trait_item_method(&mut self, i: &'ast TraitItemMethod) {
737 visit_trait_item_method(self, i)
738 }
739 #[cfg(feature = "full")]
740 fn visit_trait_item_type(&mut self, i: &'ast TraitItemType) {
741 visit_trait_item_type(self, i)
742 }
743 #[cfg(feature = "full")]
744 fn visit_trait_item_verbatim(&mut self, i: &'ast TraitItemVerbatim) {
745 visit_trait_item_verbatim(self, i)
746 }
747 #[cfg(any(feature = "full", feature = "derive"))]
748 fn visit_type(&mut self, i: &'ast Type) {
749 visit_type(self, i)
750 }
751 #[cfg(any(feature = "full", feature = "derive"))]
752 fn visit_type_array(&mut self, i: &'ast TypeArray) {
753 visit_type_array(self, i)
754 }
755 #[cfg(any(feature = "full", feature = "derive"))]
756 fn visit_type_bare_fn(&mut self, i: &'ast TypeBareFn) {
757 visit_type_bare_fn(self, i)
758 }
759 #[cfg(any(feature = "full", feature = "derive"))]
760 fn visit_type_group(&mut self, i: &'ast TypeGroup) {
761 visit_type_group(self, i)
762 }
763 #[cfg(any(feature = "full", feature = "derive"))]
764 fn visit_type_impl_trait(&mut self, i: &'ast TypeImplTrait) {
765 visit_type_impl_trait(self, i)
766 }
767 #[cfg(any(feature = "full", feature = "derive"))]
768 fn visit_type_infer(&mut self, i: &'ast TypeInfer) {
769 visit_type_infer(self, i)
770 }
771 #[cfg(any(feature = "full", feature = "derive"))]
772 fn visit_type_macro(&mut self, i: &'ast TypeMacro) {
773 visit_type_macro(self, i)
774 }
775 #[cfg(any(feature = "full", feature = "derive"))]
776 fn visit_type_never(&mut self, i: &'ast TypeNever) {
777 visit_type_never(self, i)
778 }
779 #[cfg(any(feature = "full", feature = "derive"))]
780 fn visit_type_param(&mut self, i: &'ast TypeParam) {
781 visit_type_param(self, i)
782 }
783 #[cfg(any(feature = "full", feature = "derive"))]
784 fn visit_type_param_bound(&mut self, i: &'ast TypeParamBound) {
785 visit_type_param_bound(self, i)
786 }
787 #[cfg(any(feature = "full", feature = "derive"))]
788 fn visit_type_paren(&mut self, i: &'ast TypeParen) {
789 visit_type_paren(self, i)
790 }
791 #[cfg(any(feature = "full", feature = "derive"))]
792 fn visit_type_path(&mut self, i: &'ast TypePath) {
793 visit_type_path(self, i)
794 }
795 #[cfg(any(feature = "full", feature = "derive"))]
796 fn visit_type_ptr(&mut self, i: &'ast TypePtr) {
797 visit_type_ptr(self, i)
798 }
799 #[cfg(any(feature = "full", feature = "derive"))]
800 fn visit_type_reference(&mut self, i: &'ast TypeReference) {
801 visit_type_reference(self, i)
802 }
803 #[cfg(any(feature = "full", feature = "derive"))]
804 fn visit_type_slice(&mut self, i: &'ast TypeSlice) {
805 visit_type_slice(self, i)
806 }
807 #[cfg(any(feature = "full", feature = "derive"))]
808 fn visit_type_trait_object(&mut self, i: &'ast TypeTraitObject) {
809 visit_type_trait_object(self, i)
810 }
811 #[cfg(any(feature = "full", feature = "derive"))]
812 fn visit_type_tuple(&mut self, i: &'ast TypeTuple) {
813 visit_type_tuple(self, i)
814 }
815 #[cfg(any(feature = "full", feature = "derive"))]
816 fn visit_type_verbatim(&mut self, i: &'ast TypeVerbatim) {
817 visit_type_verbatim(self, i)
818 }
819 #[cfg(any(feature = "full", feature = "derive"))]
820 fn visit_un_op(&mut self, i: &'ast UnOp) {
821 visit_un_op(self, i)
822 }
823 #[cfg(feature = "full")]
824 fn visit_use_glob(&mut self, i: &'ast UseGlob) {
825 visit_use_glob(self, i)
826 }
827 #[cfg(feature = "full")]
828 fn visit_use_group(&mut self, i: &'ast UseGroup) {
829 visit_use_group(self, i)
830 }
831 #[cfg(feature = "full")]
832 fn visit_use_name(&mut self, i: &'ast UseName) {
833 visit_use_name(self, i)
834 }
835 #[cfg(feature = "full")]
836 fn visit_use_path(&mut self, i: &'ast UsePath) {
837 visit_use_path(self, i)
838 }
839 #[cfg(feature = "full")]
840 fn visit_use_rename(&mut self, i: &'ast UseRename) {
841 visit_use_rename(self, i)
842 }
843 #[cfg(feature = "full")]
844 fn visit_use_tree(&mut self, i: &'ast UseTree) {
845 visit_use_tree(self, i)
846 }
847 #[cfg(any(feature = "full", feature = "derive"))]
848 fn visit_variant(&mut self, i: &'ast Variant) {
849 visit_variant(self, i)
850 }
851 #[cfg(any(feature = "full", feature = "derive"))]
852 fn visit_vis_crate(&mut self, i: &'ast VisCrate) {
853 visit_vis_crate(self, i)
854 }
855 #[cfg(any(feature = "full", feature = "derive"))]
856 fn visit_vis_public(&mut self, i: &'ast VisPublic) {
857 visit_vis_public(self, i)
858 }
859 #[cfg(any(feature = "full", feature = "derive"))]
860 fn visit_vis_restricted(&mut self, i: &'ast VisRestricted) {
861 visit_vis_restricted(self, i)
862 }
863 #[cfg(any(feature = "full", feature = "derive"))]
864 fn visit_visibility(&mut self, i: &'ast Visibility) {
865 visit_visibility(self, i)
866 }
867 #[cfg(any(feature = "full", feature = "derive"))]
868 fn visit_where_clause(&mut self, i: &'ast WhereClause) {
869 visit_where_clause(self, i)
870 }
871 #[cfg(any(feature = "full", feature = "derive"))]
872 fn visit_where_predicate(&mut self, i: &'ast WherePredicate) {
873 visit_where_predicate(self, i)
874 }
Nika Layzell27726662017-10-24 23:16:35 -0400875}
David Tolnay8c81f622018-07-31 23:34:35 -0700876#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800877pub fn visit_abi<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Abi) {
David Tolnay7ac699c2018-08-24 14:00:58 -0400878 tokens_helper(_visitor, &_i.extern_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -0700879 if let Some(ref it) = _i.name {
880 _visitor.visit_lit_str(it)
881 };
Nika Layzell27726662017-10-24 23:16:35 -0400882}
David Tolnay8c81f622018-07-31 23:34:35 -0700883#[cfg(any(feature = "full", feature = "derive"))]
884pub fn visit_angle_bracketed_generic_arguments<'ast, V: Visit<'ast> + ?Sized>(
885 _visitor: &mut V,
886 _i: &'ast AngleBracketedGenericArguments,
887) {
888 if let Some(ref it) = _i.colon2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -0400889 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -0700890 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400891 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700892 for el in Punctuated::pairs(&_i.args) {
893 let it = el.value();
894 _visitor.visit_generic_argument(it)
895 }
David Tolnay7ac699c2018-08-24 14:00:58 -0400896 tokens_helper(_visitor, &_i.gt_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400897}
David Tolnay8c81f622018-07-31 23:34:35 -0700898#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800899pub fn visit_arg_captured<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ArgCaptured) {
David Tolnay8c81f622018-07-31 23:34:35 -0700900 _visitor.visit_pat(&_i.pat);
David Tolnay7ac699c2018-08-24 14:00:58 -0400901 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700902 _visitor.visit_type(&_i.ty);
Nika Layzell27726662017-10-24 23:16:35 -0400903}
David Tolnay8c81f622018-07-31 23:34:35 -0700904#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800905pub fn visit_arg_self<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ArgSelf) {
David Tolnay8c81f622018-07-31 23:34:35 -0700906 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -0400907 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -0700908 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400909 tokens_helper(_visitor, &_i.self_token.span);
Nika Layzell27726662017-10-24 23:16:35 -0400910}
David Tolnay8c81f622018-07-31 23:34:35 -0700911#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800912pub fn visit_arg_self_ref<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ArgSelfRef) {
David Tolnay7ac699c2018-08-24 14:00:58 -0400913 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700914 if let Some(ref it) = _i.lifetime {
915 _visitor.visit_lifetime(it)
916 };
917 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -0400918 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -0700919 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400920 tokens_helper(_visitor, &_i.self_token.span);
Nika Layzell27726662017-10-24 23:16:35 -0400921}
David Tolnay8c81f622018-07-31 23:34:35 -0700922#[cfg(any(feature = "full", feature = "derive"))]
923#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800924pub fn visit_arm<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Arm) {
David Tolnay8c81f622018-07-31 23:34:35 -0700925 for it in &_i.attrs {
926 _visitor.visit_attribute(it)
927 }
928 if let Some(ref it) = _i.leading_vert {
David Tolnay7ac699c2018-08-24 14:00:58 -0400929 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -0700930 };
931 for el in Punctuated::pairs(&_i.pats) {
932 let it = el.value();
933 _visitor.visit_pat(it)
934 }
935 if let Some(ref it) = _i.guard {
David Tolnay7ac699c2018-08-24 14:00:58 -0400936 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -0700937 _visitor.visit_expr(&*(it).1);
938 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400939 tokens_helper(_visitor, &_i.fat_arrow_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700940 _visitor.visit_expr(&*_i.body);
941 if let Some(ref it) = _i.comma {
David Tolnay7ac699c2018-08-24 14:00:58 -0400942 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -0700943 };
Nika Layzell27726662017-10-24 23:16:35 -0400944}
David Tolnay8c81f622018-07-31 23:34:35 -0700945#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800946pub fn visit_attr_style<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast AttrStyle) {
Nika Layzell27726662017-10-24 23:16:35 -0400947 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -0700948 AttrStyle::Outer => {}
949 AttrStyle::Inner(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400950 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400951 }
952 }
953}
David Tolnay8c81f622018-07-31 23:34:35 -0700954#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800955pub fn visit_attribute<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Attribute) {
David Tolnay7ac699c2018-08-24 14:00:58 -0400956 tokens_helper(_visitor, &_i.pound_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700957 _visitor.visit_attr_style(&_i.style);
David Tolnay7ac699c2018-08-24 14:00:58 -0400958 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -0700959 _visitor.visit_path(&_i.path);
David Tolnay6af48992018-08-01 11:16:28 -0700960 skip!(_i.tts);
Nika Layzell27726662017-10-24 23:16:35 -0400961}
David Tolnay8c81f622018-07-31 23:34:35 -0700962#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800963pub fn visit_bare_fn_arg<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast BareFnArg) {
David Tolnay8c81f622018-07-31 23:34:35 -0700964 if let Some(ref it) = _i.name {
965 _visitor.visit_bare_fn_arg_name(&(it).0);
David Tolnay7ac699c2018-08-24 14:00:58 -0400966 tokens_helper(_visitor, &(it).1.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700967 };
968 _visitor.visit_type(&_i.ty);
Nika Layzell27726662017-10-24 23:16:35 -0400969}
David Tolnay8c81f622018-07-31 23:34:35 -0700970#[cfg(any(feature = "full", feature = "derive"))]
971pub fn visit_bare_fn_arg_name<'ast, V: Visit<'ast> + ?Sized>(
972 _visitor: &mut V,
973 _i: &'ast BareFnArgName,
974) {
Nika Layzell27726662017-10-24 23:16:35 -0400975 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -0700976 BareFnArgName::Named(ref _binding_0) => {
Alex Crichtond261d092018-05-18 13:47:35 -0700977 _visitor.visit_ident(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -0400978 }
David Tolnay8c81f622018-07-31 23:34:35 -0700979 BareFnArgName::Wild(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400980 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400981 }
982 }
983}
David Tolnay8c81f622018-07-31 23:34:35 -0700984#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800985pub fn visit_bin_op<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast BinOp) {
Nika Layzell27726662017-10-24 23:16:35 -0400986 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -0700987 BinOp::Add(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400988 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400989 }
David Tolnay8c81f622018-07-31 23:34:35 -0700990 BinOp::Sub(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400991 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400992 }
David Tolnay8c81f622018-07-31 23:34:35 -0700993 BinOp::Mul(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400994 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400995 }
David Tolnay8c81f622018-07-31 23:34:35 -0700996 BinOp::Div(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400997 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400998 }
David Tolnay8c81f622018-07-31 23:34:35 -0700999 BinOp::Rem(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001000 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001001 }
David Tolnay8c81f622018-07-31 23:34:35 -07001002 BinOp::And(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001003 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001004 }
David Tolnay8c81f622018-07-31 23:34:35 -07001005 BinOp::Or(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001006 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001007 }
David Tolnay8c81f622018-07-31 23:34:35 -07001008 BinOp::BitXor(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001009 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001010 }
David Tolnay8c81f622018-07-31 23:34:35 -07001011 BinOp::BitAnd(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001012 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001013 }
David Tolnay8c81f622018-07-31 23:34:35 -07001014 BinOp::BitOr(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001015 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001016 }
David Tolnay8c81f622018-07-31 23:34:35 -07001017 BinOp::Shl(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001018 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001019 }
David Tolnay8c81f622018-07-31 23:34:35 -07001020 BinOp::Shr(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001021 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001022 }
David Tolnay8c81f622018-07-31 23:34:35 -07001023 BinOp::Eq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001024 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001025 }
David Tolnay8c81f622018-07-31 23:34:35 -07001026 BinOp::Lt(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001027 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001028 }
David Tolnay8c81f622018-07-31 23:34:35 -07001029 BinOp::Le(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001030 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001031 }
David Tolnay8c81f622018-07-31 23:34:35 -07001032 BinOp::Ne(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001033 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001034 }
David Tolnay8c81f622018-07-31 23:34:35 -07001035 BinOp::Ge(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001036 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001037 }
David Tolnay8c81f622018-07-31 23:34:35 -07001038 BinOp::Gt(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001039 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001040 }
David Tolnay8c81f622018-07-31 23:34:35 -07001041 BinOp::AddEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001042 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001043 }
David Tolnay8c81f622018-07-31 23:34:35 -07001044 BinOp::SubEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001045 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001046 }
David Tolnay8c81f622018-07-31 23:34:35 -07001047 BinOp::MulEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001048 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001049 }
David Tolnay8c81f622018-07-31 23:34:35 -07001050 BinOp::DivEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001051 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001052 }
David Tolnay8c81f622018-07-31 23:34:35 -07001053 BinOp::RemEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001054 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001055 }
David Tolnay8c81f622018-07-31 23:34:35 -07001056 BinOp::BitXorEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001057 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001058 }
David Tolnay8c81f622018-07-31 23:34:35 -07001059 BinOp::BitAndEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001060 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001061 }
David Tolnay8c81f622018-07-31 23:34:35 -07001062 BinOp::BitOrEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001063 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001064 }
David Tolnay8c81f622018-07-31 23:34:35 -07001065 BinOp::ShlEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001066 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001067 }
David Tolnay8c81f622018-07-31 23:34:35 -07001068 BinOp::ShrEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001069 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001070 }
1071 }
1072}
David Tolnay8c81f622018-07-31 23:34:35 -07001073#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001074pub fn visit_binding<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Binding) {
David Tolnay8c81f622018-07-31 23:34:35 -07001075 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001076 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001077 _visitor.visit_type(&_i.ty);
David Tolnay506e43a2017-12-29 11:34:36 -05001078}
David Tolnay8c81f622018-07-31 23:34:35 -07001079#[cfg(any(feature = "full", feature = "derive"))]
1080#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001081pub fn visit_block<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Block) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001082 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001083 for it in &_i.stmts {
1084 _visitor.visit_stmt(it)
1085 }
Nika Layzell27726662017-10-24 23:16:35 -04001086}
David Tolnay8c81f622018-07-31 23:34:35 -07001087#[cfg(any(feature = "full", feature = "derive"))]
1088pub fn visit_bound_lifetimes<'ast, V: Visit<'ast> + ?Sized>(
1089 _visitor: &mut V,
1090 _i: &'ast BoundLifetimes,
1091) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001092 tokens_helper(_visitor, &_i.for_token.span);
1093 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001094 for el in Punctuated::pairs(&_i.lifetimes) {
1095 let it = el.value();
1096 _visitor.visit_lifetime_def(it)
1097 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001098 tokens_helper(_visitor, &_i.gt_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001099}
David Tolnay8c81f622018-07-31 23:34:35 -07001100#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001101pub fn visit_const_param<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ConstParam) {
David Tolnay8c81f622018-07-31 23:34:35 -07001102 for it in &_i.attrs {
1103 _visitor.visit_attribute(it)
1104 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001105 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001106 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001107 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001108 _visitor.visit_type(&_i.ty);
1109 if let Some(ref it) = _i.eq_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001110 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001111 };
1112 if let Some(ref it) = _i.default {
1113 _visitor.visit_expr(it)
1114 };
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001115}
David Tolnay8c81f622018-07-31 23:34:35 -07001116#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001117pub fn visit_data<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Data) {
David Tolnaye3d41b72017-12-31 15:24:00 -05001118 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001119 Data::Struct(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05001120 _visitor.visit_data_struct(_binding_0);
1121 }
David Tolnay8c81f622018-07-31 23:34:35 -07001122 Data::Enum(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05001123 _visitor.visit_data_enum(_binding_0);
1124 }
David Tolnay8c81f622018-07-31 23:34:35 -07001125 Data::Union(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05001126 _visitor.visit_data_union(_binding_0);
1127 }
1128 }
1129}
David Tolnay8c81f622018-07-31 23:34:35 -07001130#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001131pub fn visit_data_enum<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataEnum) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001132 tokens_helper(_visitor, &_i.enum_token.span);
1133 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001134 for el in Punctuated::pairs(&_i.variants) {
1135 let it = el.value();
1136 _visitor.visit_variant(it)
1137 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001138}
David Tolnay8c81f622018-07-31 23:34:35 -07001139#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001140pub fn visit_data_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataStruct) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001141 tokens_helper(_visitor, &_i.struct_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001142 _visitor.visit_fields(&_i.fields);
1143 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001144 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001145 };
David Tolnaye3d41b72017-12-31 15:24:00 -05001146}
David Tolnay8c81f622018-07-31 23:34:35 -07001147#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001148pub fn visit_data_union<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataUnion) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001149 tokens_helper(_visitor, &_i.union_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001150 _visitor.visit_fields_named(&_i.fields);
David Tolnaye3d41b72017-12-31 15:24:00 -05001151}
David Tolnay8c81f622018-07-31 23:34:35 -07001152#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001153pub fn visit_derive_input<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DeriveInput) {
David Tolnay8c81f622018-07-31 23:34:35 -07001154 for it in &_i.attrs {
1155 _visitor.visit_attribute(it)
1156 }
1157 _visitor.visit_visibility(&_i.vis);
1158 _visitor.visit_ident(&_i.ident);
1159 _visitor.visit_generics(&_i.generics);
1160 _visitor.visit_data(&_i.data);
Nika Layzell27726662017-10-24 23:16:35 -04001161}
David Tolnay8c81f622018-07-31 23:34:35 -07001162#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001163pub fn visit_expr<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Expr) {
Nika Layzell27726662017-10-24 23:16:35 -04001164 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001165 Expr::Box(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001166 full!(_visitor.visit_expr_box(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001167 }
David Tolnay8c81f622018-07-31 23:34:35 -07001168 Expr::InPlace(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001169 full!(_visitor.visit_expr_in_place(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001170 }
David Tolnay8c81f622018-07-31 23:34:35 -07001171 Expr::Array(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001172 full!(_visitor.visit_expr_array(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001173 }
David Tolnay8c81f622018-07-31 23:34:35 -07001174 Expr::Call(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001175 _visitor.visit_expr_call(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001176 }
David Tolnay8c81f622018-07-31 23:34:35 -07001177 Expr::MethodCall(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001178 full!(_visitor.visit_expr_method_call(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001179 }
David Tolnay8c81f622018-07-31 23:34:35 -07001180 Expr::Tuple(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001181 full!(_visitor.visit_expr_tuple(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001182 }
David Tolnay8c81f622018-07-31 23:34:35 -07001183 Expr::Binary(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001184 _visitor.visit_expr_binary(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001185 }
David Tolnay8c81f622018-07-31 23:34:35 -07001186 Expr::Unary(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001187 _visitor.visit_expr_unary(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001188 }
David Tolnay8c81f622018-07-31 23:34:35 -07001189 Expr::Lit(ref _binding_0) => {
David Tolnay8c91b882017-12-28 23:04:32 -05001190 _visitor.visit_expr_lit(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001191 }
David Tolnay8c81f622018-07-31 23:34:35 -07001192 Expr::Cast(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001193 _visitor.visit_expr_cast(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001194 }
David Tolnay8c81f622018-07-31 23:34:35 -07001195 Expr::Type(ref _binding_0) => {
David Tolnay0cf94f22017-12-28 23:46:26 -05001196 full!(_visitor.visit_expr_type(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001197 }
David Tolnay8c81f622018-07-31 23:34:35 -07001198 Expr::If(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001199 full!(_visitor.visit_expr_if(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001200 }
David Tolnay8c81f622018-07-31 23:34:35 -07001201 Expr::IfLet(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001202 full!(_visitor.visit_expr_if_let(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001203 }
David Tolnay8c81f622018-07-31 23:34:35 -07001204 Expr::While(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001205 full!(_visitor.visit_expr_while(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001206 }
David Tolnay8c81f622018-07-31 23:34:35 -07001207 Expr::WhileLet(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001208 full!(_visitor.visit_expr_while_let(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001209 }
David Tolnay8c81f622018-07-31 23:34:35 -07001210 Expr::ForLoop(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001211 full!(_visitor.visit_expr_for_loop(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001212 }
David Tolnay8c81f622018-07-31 23:34:35 -07001213 Expr::Loop(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001214 full!(_visitor.visit_expr_loop(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001215 }
David Tolnay8c81f622018-07-31 23:34:35 -07001216 Expr::Match(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001217 full!(_visitor.visit_expr_match(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001218 }
David Tolnay8c81f622018-07-31 23:34:35 -07001219 Expr::Closure(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001220 full!(_visitor.visit_expr_closure(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001221 }
David Tolnay8c81f622018-07-31 23:34:35 -07001222 Expr::Unsafe(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001223 full!(_visitor.visit_expr_unsafe(_binding_0));
Nika Layzell640832a2017-12-04 13:37:09 -05001224 }
David Tolnay8c81f622018-07-31 23:34:35 -07001225 Expr::Block(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001226 full!(_visitor.visit_expr_block(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001227 }
David Tolnay8c81f622018-07-31 23:34:35 -07001228 Expr::Assign(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001229 full!(_visitor.visit_expr_assign(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001230 }
David Tolnay8c81f622018-07-31 23:34:35 -07001231 Expr::AssignOp(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001232 full!(_visitor.visit_expr_assign_op(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001233 }
David Tolnay8c81f622018-07-31 23:34:35 -07001234 Expr::Field(ref _binding_0) => {
David Tolnayd093fa92018-06-30 10:23:25 -07001235 _visitor.visit_expr_field(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001236 }
David Tolnay8c81f622018-07-31 23:34:35 -07001237 Expr::Index(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001238 _visitor.visit_expr_index(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001239 }
David Tolnay8c81f622018-07-31 23:34:35 -07001240 Expr::Range(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001241 full!(_visitor.visit_expr_range(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001242 }
David Tolnay8c81f622018-07-31 23:34:35 -07001243 Expr::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001244 _visitor.visit_expr_path(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001245 }
David Tolnay8c81f622018-07-31 23:34:35 -07001246 Expr::Reference(ref _binding_0) => {
David Tolnay00674ba2018-03-31 18:14:11 +02001247 full!(_visitor.visit_expr_reference(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001248 }
David Tolnay8c81f622018-07-31 23:34:35 -07001249 Expr::Break(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001250 full!(_visitor.visit_expr_break(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001251 }
David Tolnay8c81f622018-07-31 23:34:35 -07001252 Expr::Continue(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001253 full!(_visitor.visit_expr_continue(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001254 }
David Tolnay8c81f622018-07-31 23:34:35 -07001255 Expr::Return(ref _binding_0) => {
David Tolnayc246cd32017-12-28 23:14:32 -05001256 full!(_visitor.visit_expr_return(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001257 }
David Tolnay8c81f622018-07-31 23:34:35 -07001258 Expr::Macro(ref _binding_0) => {
David Tolnay8c91b882017-12-28 23:04:32 -05001259 full!(_visitor.visit_expr_macro(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001260 }
David Tolnay8c81f622018-07-31 23:34:35 -07001261 Expr::Struct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001262 full!(_visitor.visit_expr_struct(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001263 }
David Tolnay8c81f622018-07-31 23:34:35 -07001264 Expr::Repeat(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001265 full!(_visitor.visit_expr_repeat(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001266 }
David Tolnay8c81f622018-07-31 23:34:35 -07001267 Expr::Paren(ref _binding_0) => {
David Tolnay81ab4f62018-01-27 19:02:51 -08001268 _visitor.visit_expr_paren(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001269 }
David Tolnay8c81f622018-07-31 23:34:35 -07001270 Expr::Group(ref _binding_0) => {
David Tolnaye98775f2017-12-28 23:17:00 -05001271 full!(_visitor.visit_expr_group(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001272 }
David Tolnay8c81f622018-07-31 23:34:35 -07001273 Expr::Try(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001274 full!(_visitor.visit_expr_try(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001275 }
David Tolnay02a9c6f2018-08-24 18:58:45 -04001276 Expr::Async(ref _binding_0) => {
1277 full!(_visitor.visit_expr_async(_binding_0));
1278 }
David Tolnayfb2dd4b2018-08-24 16:45:34 -04001279 Expr::TryBlock(ref _binding_0) => {
1280 full!(_visitor.visit_expr_try_block(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001281 }
David Tolnay8c81f622018-07-31 23:34:35 -07001282 Expr::Yield(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001283 full!(_visitor.visit_expr_yield(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001284 }
David Tolnay8c81f622018-07-31 23:34:35 -07001285 Expr::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05001286 _visitor.visit_expr_verbatim(_binding_0);
1287 }
Nika Layzell27726662017-10-24 23:16:35 -04001288 }
1289}
David Tolnay8c81f622018-07-31 23:34:35 -07001290#[cfg(feature = "full")]
1291#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001292pub fn visit_expr_array<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprArray) {
David Tolnay8c81f622018-07-31 23:34:35 -07001293 for it in &_i.attrs {
1294 _visitor.visit_attribute(it)
1295 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001296 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001297 for el in Punctuated::pairs(&_i.elems) {
1298 let it = el.value();
1299 _visitor.visit_expr(it)
David Tolnaye3d41b72017-12-31 15:24:00 -05001300 }
1301}
David Tolnay8c81f622018-07-31 23:34:35 -07001302#[cfg(feature = "full")]
1303#[cfg(any(feature = "full", feature = "derive"))]
1304pub fn visit_expr_assign<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprAssign) {
1305 for it in &_i.attrs {
1306 _visitor.visit_attribute(it)
1307 }
1308 _visitor.visit_expr(&*_i.left);
David Tolnay7ac699c2018-08-24 14:00:58 -04001309 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001310 _visitor.visit_expr(&*_i.right);
1311}
1312#[cfg(feature = "full")]
1313#[cfg(any(feature = "full", feature = "derive"))]
1314pub fn visit_expr_assign_op<'ast, V: Visit<'ast> + ?Sized>(
1315 _visitor: &mut V,
1316 _i: &'ast ExprAssignOp,
1317) {
1318 for it in &_i.attrs {
1319 _visitor.visit_attribute(it)
1320 }
1321 _visitor.visit_expr(&*_i.left);
1322 _visitor.visit_bin_op(&_i.op);
1323 _visitor.visit_expr(&*_i.right);
1324}
David Tolnay02a9c6f2018-08-24 18:58:45 -04001325#[cfg(feature = "full")]
1326#[cfg(any(feature = "full", feature = "derive"))]
1327pub fn visit_expr_async<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprAsync) {
1328 for it in &_i.attrs {
1329 _visitor.visit_attribute(it)
1330 }
1331 tokens_helper(_visitor, &_i.async_token.span);
1332 if let Some(ref it) = _i.capture {
1333 tokens_helper(_visitor, &it.span)
1334 };
1335 _visitor.visit_block(&_i.block);
1336}
David Tolnay8c81f622018-07-31 23:34:35 -07001337#[cfg(any(feature = "full", feature = "derive"))]
1338pub fn visit_expr_binary<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBinary) {
1339 for it in &_i.attrs {
1340 _visitor.visit_attribute(it)
1341 }
1342 _visitor.visit_expr(&*_i.left);
1343 _visitor.visit_bin_op(&_i.op);
1344 _visitor.visit_expr(&*_i.right);
1345}
1346#[cfg(feature = "full")]
1347#[cfg(any(feature = "full", feature = "derive"))]
1348pub fn visit_expr_block<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBlock) {
1349 for it in &_i.attrs {
1350 _visitor.visit_attribute(it)
1351 }
David Tolnay1d8e9962018-08-24 19:04:20 -04001352 if let Some(ref it) = _i.label {
1353 _visitor.visit_label(it)
1354 };
David Tolnay8c81f622018-07-31 23:34:35 -07001355 _visitor.visit_block(&_i.block);
1356}
1357#[cfg(feature = "full")]
1358#[cfg(any(feature = "full", feature = "derive"))]
1359pub fn visit_expr_box<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBox) {
1360 for it in &_i.attrs {
1361 _visitor.visit_attribute(it)
1362 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001363 tokens_helper(_visitor, &_i.box_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001364 _visitor.visit_expr(&*_i.expr);
1365}
1366#[cfg(feature = "full")]
1367#[cfg(any(feature = "full", feature = "derive"))]
1368pub fn visit_expr_break<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBreak) {
1369 for it in &_i.attrs {
1370 _visitor.visit_attribute(it)
1371 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001372 tokens_helper(_visitor, &_i.break_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001373 if let Some(ref it) = _i.label {
1374 _visitor.visit_lifetime(it)
1375 };
1376 if let Some(ref it) = _i.expr {
1377 _visitor.visit_expr(&**it)
1378 };
1379}
1380#[cfg(any(feature = "full", feature = "derive"))]
1381pub fn visit_expr_call<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprCall) {
1382 for it in &_i.attrs {
1383 _visitor.visit_attribute(it)
1384 }
1385 _visitor.visit_expr(&*_i.func);
David Tolnay7ac699c2018-08-24 14:00:58 -04001386 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001387 for el in Punctuated::pairs(&_i.args) {
1388 let it = el.value();
1389 _visitor.visit_expr(it)
1390 }
1391}
1392#[cfg(any(feature = "full", feature = "derive"))]
1393pub fn visit_expr_cast<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprCast) {
1394 for it in &_i.attrs {
1395 _visitor.visit_attribute(it)
1396 }
1397 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001398 tokens_helper(_visitor, &_i.as_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001399 _visitor.visit_type(&*_i.ty);
1400}
1401#[cfg(feature = "full")]
1402#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001403pub fn visit_expr_closure<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprClosure) {
1404 for it in &_i.attrs {
1405 _visitor.visit_attribute(it)
1406 }
Yusuke Sasaki4e5d9662018-07-21 02:49:47 +09001407 if let Some(ref it) = _i.asyncness {
1408 tokens_helper(_visitor, &it.span)
1409 };
David Tolnay8c81f622018-07-31 23:34:35 -07001410 if let Some(ref it) = _i.movability {
David Tolnay7ac699c2018-08-24 14:00:58 -04001411 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001412 };
1413 if let Some(ref it) = _i.capture {
David Tolnay7ac699c2018-08-24 14:00:58 -04001414 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001415 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001416 tokens_helper(_visitor, &_i.or1_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001417 for el in Punctuated::pairs(&_i.inputs) {
1418 let it = el.value();
1419 _visitor.visit_fn_arg(it)
1420 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001421 tokens_helper(_visitor, &_i.or2_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001422 _visitor.visit_return_type(&_i.output);
1423 _visitor.visit_expr(&*_i.body);
1424}
1425#[cfg(feature = "full")]
1426#[cfg(any(feature = "full", feature = "derive"))]
1427pub fn visit_expr_continue<'ast, V: Visit<'ast> + ?Sized>(
1428 _visitor: &mut V,
1429 _i: &'ast ExprContinue,
1430) {
1431 for it in &_i.attrs {
1432 _visitor.visit_attribute(it)
1433 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001434 tokens_helper(_visitor, &_i.continue_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001435 if let Some(ref it) = _i.label {
1436 _visitor.visit_lifetime(it)
1437 };
1438}
1439#[cfg(any(feature = "full", feature = "derive"))]
1440pub fn visit_expr_field<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprField) {
1441 for it in &_i.attrs {
1442 _visitor.visit_attribute(it)
1443 }
1444 _visitor.visit_expr(&*_i.base);
David Tolnay7ac699c2018-08-24 14:00:58 -04001445 tokens_helper(_visitor, &_i.dot_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001446 _visitor.visit_member(&_i.member);
1447}
1448#[cfg(feature = "full")]
1449#[cfg(any(feature = "full", feature = "derive"))]
1450pub fn visit_expr_for_loop<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprForLoop) {
1451 for it in &_i.attrs {
1452 _visitor.visit_attribute(it)
1453 }
1454 if let Some(ref it) = _i.label {
1455 _visitor.visit_label(it)
1456 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001457 tokens_helper(_visitor, &_i.for_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001458 _visitor.visit_pat(&*_i.pat);
David Tolnay7ac699c2018-08-24 14:00:58 -04001459 tokens_helper(_visitor, &_i.in_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001460 _visitor.visit_expr(&*_i.expr);
1461 _visitor.visit_block(&_i.body);
1462}
1463#[cfg(feature = "full")]
1464#[cfg(any(feature = "full", feature = "derive"))]
1465pub fn visit_expr_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprGroup) {
1466 for it in &_i.attrs {
1467 _visitor.visit_attribute(it)
1468 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001469 tokens_helper(_visitor, &_i.group_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001470 _visitor.visit_expr(&*_i.expr);
1471}
1472#[cfg(feature = "full")]
1473#[cfg(any(feature = "full", feature = "derive"))]
1474pub fn visit_expr_if<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprIf) {
1475 for it in &_i.attrs {
1476 _visitor.visit_attribute(it)
1477 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001478 tokens_helper(_visitor, &_i.if_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001479 _visitor.visit_expr(&*_i.cond);
1480 _visitor.visit_block(&_i.then_branch);
1481 if let Some(ref it) = _i.else_branch {
David Tolnay7ac699c2018-08-24 14:00:58 -04001482 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001483 _visitor.visit_expr(&*(it).1);
1484 };
1485}
1486#[cfg(feature = "full")]
1487#[cfg(any(feature = "full", feature = "derive"))]
1488pub fn visit_expr_if_let<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprIfLet) {
1489 for it in &_i.attrs {
1490 _visitor.visit_attribute(it)
1491 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001492 tokens_helper(_visitor, &_i.if_token.span);
1493 tokens_helper(_visitor, &_i.let_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001494 for el in Punctuated::pairs(&_i.pats) {
1495 let it = el.value();
1496 _visitor.visit_pat(it)
1497 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001498 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001499 _visitor.visit_expr(&*_i.expr);
1500 _visitor.visit_block(&_i.then_branch);
1501 if let Some(ref it) = _i.else_branch {
David Tolnay7ac699c2018-08-24 14:00:58 -04001502 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001503 _visitor.visit_expr(&*(it).1);
1504 };
1505}
1506#[cfg(feature = "full")]
1507#[cfg(any(feature = "full", feature = "derive"))]
1508pub fn visit_expr_in_place<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprInPlace) {
1509 for it in &_i.attrs {
1510 _visitor.visit_attribute(it)
1511 }
1512 _visitor.visit_expr(&*_i.place);
David Tolnay7ac699c2018-08-24 14:00:58 -04001513 tokens_helper(_visitor, &_i.arrow_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001514 _visitor.visit_expr(&*_i.value);
1515}
1516#[cfg(any(feature = "full", feature = "derive"))]
1517pub fn visit_expr_index<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprIndex) {
1518 for it in &_i.attrs {
1519 _visitor.visit_attribute(it)
1520 }
1521 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001522 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001523 _visitor.visit_expr(&*_i.index);
1524}
1525#[cfg(any(feature = "full", feature = "derive"))]
1526pub fn visit_expr_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprLit) {
1527 for it in &_i.attrs {
1528 _visitor.visit_attribute(it)
1529 }
1530 _visitor.visit_lit(&_i.lit);
1531}
1532#[cfg(feature = "full")]
1533#[cfg(any(feature = "full", feature = "derive"))]
1534pub fn visit_expr_loop<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprLoop) {
1535 for it in &_i.attrs {
1536 _visitor.visit_attribute(it)
1537 }
1538 if let Some(ref it) = _i.label {
1539 _visitor.visit_label(it)
1540 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001541 tokens_helper(_visitor, &_i.loop_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001542 _visitor.visit_block(&_i.body);
1543}
1544#[cfg(feature = "full")]
1545#[cfg(any(feature = "full", feature = "derive"))]
1546pub fn visit_expr_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprMacro) {
1547 for it in &_i.attrs {
1548 _visitor.visit_attribute(it)
1549 }
1550 _visitor.visit_macro(&_i.mac);
1551}
1552#[cfg(feature = "full")]
1553#[cfg(any(feature = "full", feature = "derive"))]
1554pub fn visit_expr_match<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprMatch) {
1555 for it in &_i.attrs {
1556 _visitor.visit_attribute(it)
1557 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001558 tokens_helper(_visitor, &_i.match_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001559 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001560 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001561 for it in &_i.arms {
1562 _visitor.visit_arm(it)
1563 }
1564}
1565#[cfg(feature = "full")]
1566#[cfg(any(feature = "full", feature = "derive"))]
1567pub fn visit_expr_method_call<'ast, V: Visit<'ast> + ?Sized>(
1568 _visitor: &mut V,
1569 _i: &'ast ExprMethodCall,
1570) {
1571 for it in &_i.attrs {
1572 _visitor.visit_attribute(it)
1573 }
1574 _visitor.visit_expr(&*_i.receiver);
David Tolnay7ac699c2018-08-24 14:00:58 -04001575 tokens_helper(_visitor, &_i.dot_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001576 _visitor.visit_ident(&_i.method);
1577 if let Some(ref it) = _i.turbofish {
1578 _visitor.visit_method_turbofish(it)
1579 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001580 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001581 for el in Punctuated::pairs(&_i.args) {
1582 let it = el.value();
1583 _visitor.visit_expr(it)
1584 }
1585}
1586#[cfg(any(feature = "full", feature = "derive"))]
1587pub fn visit_expr_paren<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprParen) {
1588 for it in &_i.attrs {
1589 _visitor.visit_attribute(it)
1590 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001591 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001592 _visitor.visit_expr(&*_i.expr);
1593}
1594#[cfg(any(feature = "full", feature = "derive"))]
1595pub fn visit_expr_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprPath) {
1596 for it in &_i.attrs {
1597 _visitor.visit_attribute(it)
1598 }
1599 if let Some(ref it) = _i.qself {
1600 _visitor.visit_qself(it)
1601 };
1602 _visitor.visit_path(&_i.path);
1603}
1604#[cfg(feature = "full")]
1605#[cfg(any(feature = "full", feature = "derive"))]
1606pub fn visit_expr_range<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprRange) {
1607 for it in &_i.attrs {
1608 _visitor.visit_attribute(it)
1609 }
1610 if let Some(ref it) = _i.from {
1611 _visitor.visit_expr(&**it)
1612 };
1613 _visitor.visit_range_limits(&_i.limits);
1614 if let Some(ref it) = _i.to {
1615 _visitor.visit_expr(&**it)
1616 };
1617}
1618#[cfg(feature = "full")]
1619#[cfg(any(feature = "full", feature = "derive"))]
1620pub fn visit_expr_reference<'ast, V: Visit<'ast> + ?Sized>(
1621 _visitor: &mut V,
1622 _i: &'ast ExprReference,
1623) {
1624 for it in &_i.attrs {
1625 _visitor.visit_attribute(it)
1626 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001627 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001628 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04001629 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001630 };
1631 _visitor.visit_expr(&*_i.expr);
1632}
1633#[cfg(feature = "full")]
1634#[cfg(any(feature = "full", feature = "derive"))]
1635pub fn visit_expr_repeat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprRepeat) {
1636 for it in &_i.attrs {
1637 _visitor.visit_attribute(it)
1638 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001639 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001640 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001641 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001642 _visitor.visit_expr(&*_i.len);
1643}
1644#[cfg(feature = "full")]
1645#[cfg(any(feature = "full", feature = "derive"))]
1646pub fn visit_expr_return<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprReturn) {
1647 for it in &_i.attrs {
1648 _visitor.visit_attribute(it)
1649 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001650 tokens_helper(_visitor, &_i.return_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001651 if let Some(ref it) = _i.expr {
1652 _visitor.visit_expr(&**it)
1653 };
1654}
1655#[cfg(feature = "full")]
1656#[cfg(any(feature = "full", feature = "derive"))]
1657pub fn visit_expr_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprStruct) {
1658 for it in &_i.attrs {
1659 _visitor.visit_attribute(it)
1660 }
1661 _visitor.visit_path(&_i.path);
David Tolnay7ac699c2018-08-24 14:00:58 -04001662 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001663 for el in Punctuated::pairs(&_i.fields) {
1664 let it = el.value();
1665 _visitor.visit_field_value(it)
1666 }
1667 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001668 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001669 };
1670 if let Some(ref it) = _i.rest {
1671 _visitor.visit_expr(&**it)
1672 };
1673}
1674#[cfg(feature = "full")]
1675#[cfg(any(feature = "full", feature = "derive"))]
1676pub fn visit_expr_try<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprTry) {
1677 for it in &_i.attrs {
1678 _visitor.visit_attribute(it)
1679 }
1680 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001681 tokens_helper(_visitor, &_i.question_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001682}
1683#[cfg(feature = "full")]
1684#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayfb2dd4b2018-08-24 16:45:34 -04001685pub fn visit_expr_try_block<'ast, V: Visit<'ast> + ?Sized>(
1686 _visitor: &mut V,
1687 _i: &'ast ExprTryBlock,
1688) {
1689 for it in &_i.attrs {
1690 _visitor.visit_attribute(it)
1691 }
1692 tokens_helper(_visitor, &_i.try_token.span);
1693 _visitor.visit_block(&_i.block);
1694}
1695#[cfg(feature = "full")]
1696#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001697pub fn visit_expr_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprTuple) {
1698 for it in &_i.attrs {
1699 _visitor.visit_attribute(it)
1700 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001701 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001702 for el in Punctuated::pairs(&_i.elems) {
1703 let it = el.value();
1704 _visitor.visit_expr(it)
1705 }
1706}
1707#[cfg(feature = "full")]
1708#[cfg(any(feature = "full", feature = "derive"))]
1709pub fn visit_expr_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprType) {
1710 for it in &_i.attrs {
1711 _visitor.visit_attribute(it)
1712 }
1713 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001714 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001715 _visitor.visit_type(&*_i.ty);
1716}
1717#[cfg(any(feature = "full", feature = "derive"))]
1718pub fn visit_expr_unary<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprUnary) {
1719 for it in &_i.attrs {
1720 _visitor.visit_attribute(it)
1721 }
1722 _visitor.visit_un_op(&_i.op);
1723 _visitor.visit_expr(&*_i.expr);
1724}
1725#[cfg(feature = "full")]
1726#[cfg(any(feature = "full", feature = "derive"))]
1727pub fn visit_expr_unsafe<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprUnsafe) {
1728 for it in &_i.attrs {
1729 _visitor.visit_attribute(it)
1730 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001731 tokens_helper(_visitor, &_i.unsafe_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001732 _visitor.visit_block(&_i.block);
1733}
1734#[cfg(any(feature = "full", feature = "derive"))]
1735pub fn visit_expr_verbatim<'ast, V: Visit<'ast> + ?Sized>(
1736 _visitor: &mut V,
1737 _i: &'ast ExprVerbatim,
1738) {
David Tolnay6af48992018-08-01 11:16:28 -07001739 skip!(_i.tts);
David Tolnay8c81f622018-07-31 23:34:35 -07001740}
1741#[cfg(feature = "full")]
1742#[cfg(any(feature = "full", feature = "derive"))]
1743pub fn visit_expr_while<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprWhile) {
1744 for it in &_i.attrs {
1745 _visitor.visit_attribute(it)
1746 }
1747 if let Some(ref it) = _i.label {
1748 _visitor.visit_label(it)
1749 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001750 tokens_helper(_visitor, &_i.while_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001751 _visitor.visit_expr(&*_i.cond);
1752 _visitor.visit_block(&_i.body);
1753}
1754#[cfg(feature = "full")]
1755#[cfg(any(feature = "full", feature = "derive"))]
1756pub fn visit_expr_while_let<'ast, V: Visit<'ast> + ?Sized>(
1757 _visitor: &mut V,
1758 _i: &'ast ExprWhileLet,
1759) {
1760 for it in &_i.attrs {
1761 _visitor.visit_attribute(it)
1762 }
1763 if let Some(ref it) = _i.label {
1764 _visitor.visit_label(it)
1765 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001766 tokens_helper(_visitor, &_i.while_token.span);
1767 tokens_helper(_visitor, &_i.let_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001768 for el in Punctuated::pairs(&_i.pats) {
1769 let it = el.value();
1770 _visitor.visit_pat(it)
1771 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001772 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001773 _visitor.visit_expr(&*_i.expr);
1774 _visitor.visit_block(&_i.body);
1775}
1776#[cfg(feature = "full")]
1777#[cfg(any(feature = "full", feature = "derive"))]
1778pub fn visit_expr_yield<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprYield) {
1779 for it in &_i.attrs {
1780 _visitor.visit_attribute(it)
1781 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001782 tokens_helper(_visitor, &_i.yield_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001783 if let Some(ref it) = _i.expr {
1784 _visitor.visit_expr(&**it)
1785 };
1786}
1787#[cfg(any(feature = "full", feature = "derive"))]
1788pub fn visit_field<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Field) {
1789 for it in &_i.attrs {
1790 _visitor.visit_attribute(it)
1791 }
1792 _visitor.visit_visibility(&_i.vis);
1793 if let Some(ref it) = _i.ident {
1794 _visitor.visit_ident(it)
1795 };
1796 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001797 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001798 };
1799 _visitor.visit_type(&_i.ty);
1800}
1801#[cfg(any(feature = "full", feature = "derive"))]
1802#[cfg(feature = "full")]
1803pub fn visit_field_pat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldPat) {
1804 for it in &_i.attrs {
1805 _visitor.visit_attribute(it)
1806 }
1807 _visitor.visit_member(&_i.member);
1808 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001809 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001810 };
1811 _visitor.visit_pat(&*_i.pat);
1812}
1813#[cfg(any(feature = "full", feature = "derive"))]
1814#[cfg(feature = "full")]
1815pub fn visit_field_value<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldValue) {
1816 for it in &_i.attrs {
1817 _visitor.visit_attribute(it)
1818 }
1819 _visitor.visit_member(&_i.member);
1820 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001821 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001822 };
1823 _visitor.visit_expr(&_i.expr);
1824}
1825#[cfg(any(feature = "full", feature = "derive"))]
1826pub fn visit_fields<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Fields) {
1827 match *_i {
1828 Fields::Named(ref _binding_0) => {
1829 _visitor.visit_fields_named(_binding_0);
1830 }
1831 Fields::Unnamed(ref _binding_0) => {
1832 _visitor.visit_fields_unnamed(_binding_0);
1833 }
1834 Fields::Unit => {}
1835 }
1836}
1837#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001838pub fn visit_fields_named<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldsNamed) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001839 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001840 for el in Punctuated::pairs(&_i.named) {
1841 let it = el.value();
1842 _visitor.visit_field(it)
1843 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001844}
David Tolnay8c81f622018-07-31 23:34:35 -07001845#[cfg(any(feature = "full", feature = "derive"))]
1846pub fn visit_fields_unnamed<'ast, V: Visit<'ast> + ?Sized>(
1847 _visitor: &mut V,
1848 _i: &'ast FieldsUnnamed,
1849) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001850 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001851 for el in Punctuated::pairs(&_i.unnamed) {
1852 let it = el.value();
1853 _visitor.visit_field(it)
1854 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001855}
David Tolnay8c81f622018-07-31 23:34:35 -07001856#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001857pub fn visit_file<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast File) {
David Tolnay6af48992018-08-01 11:16:28 -07001858 skip!(_i.shebang);
David Tolnay8c81f622018-07-31 23:34:35 -07001859 for it in &_i.attrs {
1860 _visitor.visit_attribute(it)
1861 }
1862 for it in &_i.items {
1863 _visitor.visit_item(it)
1864 }
Nika Layzell27726662017-10-24 23:16:35 -04001865}
David Tolnay8c81f622018-07-31 23:34:35 -07001866#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001867pub fn visit_fn_arg<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FnArg) {
Nika Layzell27726662017-10-24 23:16:35 -04001868 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001869 FnArg::SelfRef(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001870 _visitor.visit_arg_self_ref(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001871 }
David Tolnay8c81f622018-07-31 23:34:35 -07001872 FnArg::SelfValue(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001873 _visitor.visit_arg_self(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001874 }
David Tolnay8c81f622018-07-31 23:34:35 -07001875 FnArg::Captured(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001876 _visitor.visit_arg_captured(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001877 }
David Tolnay8c81f622018-07-31 23:34:35 -07001878 FnArg::Inferred(ref _binding_0) => {
David Tolnay80ed55f2017-12-27 22:54:40 -05001879 _visitor.visit_pat(_binding_0);
1880 }
David Tolnay8c81f622018-07-31 23:34:35 -07001881 FnArg::Ignored(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001882 _visitor.visit_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001883 }
1884 }
1885}
David Tolnay8c81f622018-07-31 23:34:35 -07001886#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001887pub fn visit_fn_decl<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FnDecl) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001888 tokens_helper(_visitor, &_i.fn_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001889 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04001890 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001891 for el in Punctuated::pairs(&_i.inputs) {
1892 let it = el.value();
1893 _visitor.visit_fn_arg(it)
1894 }
1895 if let Some(ref it) = _i.variadic {
David Tolnay7ac699c2018-08-24 14:00:58 -04001896 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001897 };
1898 _visitor.visit_return_type(&_i.output);
Nika Layzell27726662017-10-24 23:16:35 -04001899}
David Tolnay8c81f622018-07-31 23:34:35 -07001900#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001901pub fn visit_foreign_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ForeignItem) {
Nika Layzell27726662017-10-24 23:16:35 -04001902 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001903 ForeignItem::Fn(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001904 _visitor.visit_foreign_item_fn(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001905 }
David Tolnay8c81f622018-07-31 23:34:35 -07001906 ForeignItem::Static(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001907 _visitor.visit_foreign_item_static(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001908 }
David Tolnay8c81f622018-07-31 23:34:35 -07001909 ForeignItem::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001910 _visitor.visit_foreign_item_type(_binding_0);
David Tolnay199bcbb2017-11-12 10:33:52 -08001911 }
David Tolnay435c1782018-08-24 16:15:44 -04001912 ForeignItem::Macro(ref _binding_0) => {
1913 _visitor.visit_foreign_item_macro(_binding_0);
1914 }
David Tolnay8c81f622018-07-31 23:34:35 -07001915 ForeignItem::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05001916 _visitor.visit_foreign_item_verbatim(_binding_0);
1917 }
Nika Layzell27726662017-10-24 23:16:35 -04001918 }
1919}
David Tolnay8c81f622018-07-31 23:34:35 -07001920#[cfg(feature = "full")]
1921pub fn visit_foreign_item_fn<'ast, V: Visit<'ast> + ?Sized>(
1922 _visitor: &mut V,
1923 _i: &'ast ForeignItemFn,
1924) {
1925 for it in &_i.attrs {
1926 _visitor.visit_attribute(it)
1927 }
1928 _visitor.visit_visibility(&_i.vis);
1929 _visitor.visit_ident(&_i.ident);
1930 _visitor.visit_fn_decl(&*_i.decl);
David Tolnay7ac699c2018-08-24 14:00:58 -04001931 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay8894f602017-11-11 12:11:04 -08001932}
David Tolnay8c81f622018-07-31 23:34:35 -07001933#[cfg(feature = "full")]
David Tolnay435c1782018-08-24 16:15:44 -04001934pub fn visit_foreign_item_macro<'ast, V: Visit<'ast> + ?Sized>(
1935 _visitor: &mut V,
1936 _i: &'ast ForeignItemMacro,
1937) {
1938 for it in &_i.attrs {
1939 _visitor.visit_attribute(it)
1940 }
1941 _visitor.visit_macro(&_i.mac);
1942 if let Some(ref it) = _i.semi_token {
1943 tokens_helper(_visitor, &it.spans)
1944 };
1945}
1946#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001947pub fn visit_foreign_item_static<'ast, V: Visit<'ast> + ?Sized>(
1948 _visitor: &mut V,
1949 _i: &'ast ForeignItemStatic,
1950) {
1951 for it in &_i.attrs {
1952 _visitor.visit_attribute(it)
1953 }
1954 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04001955 tokens_helper(_visitor, &_i.static_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001956 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04001957 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001958 };
1959 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001960 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001961 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04001962 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001963}
David Tolnay8c81f622018-07-31 23:34:35 -07001964#[cfg(feature = "full")]
1965pub fn visit_foreign_item_type<'ast, V: Visit<'ast> + ?Sized>(
1966 _visitor: &mut V,
1967 _i: &'ast ForeignItemType,
1968) {
1969 for it in &_i.attrs {
1970 _visitor.visit_attribute(it)
1971 }
1972 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04001973 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001974 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001975 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay199bcbb2017-11-12 10:33:52 -08001976}
David Tolnay8c81f622018-07-31 23:34:35 -07001977#[cfg(feature = "full")]
1978pub fn visit_foreign_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
1979 _visitor: &mut V,
1980 _i: &'ast ForeignItemVerbatim,
1981) {
David Tolnay6af48992018-08-01 11:16:28 -07001982 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05001983}
David Tolnay8c81f622018-07-31 23:34:35 -07001984#[cfg(any(feature = "full", feature = "derive"))]
1985pub fn visit_generic_argument<'ast, V: Visit<'ast> + ?Sized>(
1986 _visitor: &mut V,
1987 _i: &'ast GenericArgument,
1988) {
Nika Layzell357885a2017-12-04 15:47:07 -05001989 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001990 GenericArgument::Lifetime(ref _binding_0) => {
David Tolnay4ba63a02017-12-28 15:53:05 -05001991 _visitor.visit_lifetime(_binding_0);
Nika Layzell357885a2017-12-04 15:47:07 -05001992 }
David Tolnay8c81f622018-07-31 23:34:35 -07001993 GenericArgument::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001994 _visitor.visit_type(_binding_0);
Nika Layzell357885a2017-12-04 15:47:07 -05001995 }
David Tolnay8c81f622018-07-31 23:34:35 -07001996 GenericArgument::Binding(ref _binding_0) => {
David Tolnay506e43a2017-12-29 11:34:36 -05001997 _visitor.visit_binding(_binding_0);
Nika Layzell357885a2017-12-04 15:47:07 -05001998 }
David Tolnay8c81f622018-07-31 23:34:35 -07001999 GenericArgument::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002000 _visitor.visit_expr(_binding_0);
Nika Layzellc680e612017-12-04 19:07:20 -05002001 }
Nika Layzell357885a2017-12-04 15:47:07 -05002002 }
2003}
David Tolnay8c81f622018-07-31 23:34:35 -07002004#[cfg(any(feature = "full", feature = "derive"))]
2005#[cfg(feature = "full")]
2006pub fn visit_generic_method_argument<'ast, V: Visit<'ast> + ?Sized>(
2007 _visitor: &mut V,
2008 _i: &'ast GenericMethodArgument,
2009) {
David Tolnayd60cfec2017-12-29 00:21:38 -05002010 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002011 GenericMethodArgument::Type(ref _binding_0) => {
David Tolnayd60cfec2017-12-29 00:21:38 -05002012 _visitor.visit_type(_binding_0);
2013 }
David Tolnay8c81f622018-07-31 23:34:35 -07002014 GenericMethodArgument::Const(ref _binding_0) => {
David Tolnayd60cfec2017-12-29 00:21:38 -05002015 _visitor.visit_expr(_binding_0);
2016 }
2017 }
2018}
David Tolnay8c81f622018-07-31 23:34:35 -07002019#[cfg(any(feature = "full", feature = "derive"))]
2020pub fn visit_generic_param<'ast, V: Visit<'ast> + ?Sized>(
2021 _visitor: &mut V,
2022 _i: &'ast GenericParam,
2023) {
David Tolnayc2f1aba2017-11-12 20:29:22 -08002024 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002025 GenericParam::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002026 _visitor.visit_type_param(_binding_0);
David Tolnayc2f1aba2017-11-12 20:29:22 -08002027 }
David Tolnay8c81f622018-07-31 23:34:35 -07002028 GenericParam::Lifetime(ref _binding_0) => {
David Tolnay517f3692018-01-01 20:17:23 -08002029 _visitor.visit_lifetime_def(_binding_0);
2030 }
David Tolnay8c81f622018-07-31 23:34:35 -07002031 GenericParam::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002032 _visitor.visit_const_param(_binding_0);
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05002033 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08002034 }
2035}
David Tolnay8c81f622018-07-31 23:34:35 -07002036#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002037pub fn visit_generics<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Generics) {
David Tolnay8c81f622018-07-31 23:34:35 -07002038 if let Some(ref it) = _i.lt_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002039 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002040 };
2041 for el in Punctuated::pairs(&_i.params) {
2042 let it = el.value();
2043 _visitor.visit_generic_param(it)
2044 }
2045 if let Some(ref it) = _i.gt_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002046 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002047 };
2048 if let Some(ref it) = _i.where_clause {
2049 _visitor.visit_where_clause(it)
2050 };
Nika Layzell27726662017-10-24 23:16:35 -04002051}
David Tolnay8c81f622018-07-31 23:34:35 -07002052pub fn visit_ident<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Ident) {}
2053#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002054pub fn visit_impl_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ImplItem) {
Nika Layzell27726662017-10-24 23:16:35 -04002055 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002056 ImplItem::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002057 _visitor.visit_impl_item_const(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002058 }
David Tolnay8c81f622018-07-31 23:34:35 -07002059 ImplItem::Method(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002060 _visitor.visit_impl_item_method(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002061 }
David Tolnay8c81f622018-07-31 23:34:35 -07002062 ImplItem::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002063 _visitor.visit_impl_item_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002064 }
David Tolnaybb82ef02018-08-24 20:15:45 -04002065 ImplItem::Existential(ref _binding_0) => {
2066 _visitor.visit_impl_item_existential(_binding_0);
2067 }
David Tolnay8c81f622018-07-31 23:34:35 -07002068 ImplItem::Macro(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002069 _visitor.visit_impl_item_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002070 }
David Tolnay8c81f622018-07-31 23:34:35 -07002071 ImplItem::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002072 _visitor.visit_impl_item_verbatim(_binding_0);
2073 }
Nika Layzell27726662017-10-24 23:16:35 -04002074 }
2075}
David Tolnay8c81f622018-07-31 23:34:35 -07002076#[cfg(feature = "full")]
2077pub fn visit_impl_item_const<'ast, V: Visit<'ast> + ?Sized>(
2078 _visitor: &mut V,
2079 _i: &'ast ImplItemConst,
2080) {
2081 for it in &_i.attrs {
2082 _visitor.visit_attribute(it)
2083 }
2084 _visitor.visit_visibility(&_i.vis);
2085 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002086 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002087 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002088 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002089 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002090 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002091 _visitor.visit_type(&_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002092 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002093 _visitor.visit_expr(&_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04002094 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay857628c2017-11-11 12:25:31 -08002095}
David Tolnay8c81f622018-07-31 23:34:35 -07002096#[cfg(feature = "full")]
David Tolnaybb82ef02018-08-24 20:15:45 -04002097pub fn visit_impl_item_existential<'ast, V: Visit<'ast> + ?Sized>(
2098 _visitor: &mut V,
2099 _i: &'ast ImplItemExistential,
2100) {
2101 for it in &_i.attrs {
2102 _visitor.visit_attribute(it)
2103 }
2104 tokens_helper(_visitor, &_i.existential_token.span);
2105 tokens_helper(_visitor, &_i.type_token.span);
2106 _visitor.visit_ident(&_i.ident);
2107 _visitor.visit_generics(&_i.generics);
2108 if let Some(ref it) = _i.colon_token {
2109 tokens_helper(_visitor, &it.spans)
2110 };
2111 for el in Punctuated::pairs(&_i.bounds) {
2112 let it = el.value();
2113 _visitor.visit_type_param_bound(it)
2114 }
2115 tokens_helper(_visitor, &_i.semi_token.spans);
2116}
2117#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07002118pub fn visit_impl_item_macro<'ast, V: Visit<'ast> + ?Sized>(
2119 _visitor: &mut V,
2120 _i: &'ast ImplItemMacro,
2121) {
2122 for it in &_i.attrs {
2123 _visitor.visit_attribute(it)
2124 }
2125 _visitor.visit_macro(&_i.mac);
2126 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002127 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002128 };
David Tolnay857628c2017-11-11 12:25:31 -08002129}
David Tolnay8c81f622018-07-31 23:34:35 -07002130#[cfg(feature = "full")]
2131pub fn visit_impl_item_method<'ast, V: Visit<'ast> + ?Sized>(
2132 _visitor: &mut V,
2133 _i: &'ast ImplItemMethod,
2134) {
2135 for it in &_i.attrs {
2136 _visitor.visit_attribute(it)
2137 }
2138 _visitor.visit_visibility(&_i.vis);
2139 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002140 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002141 };
2142 _visitor.visit_method_sig(&_i.sig);
2143 _visitor.visit_block(&_i.block);
Nika Layzell27726662017-10-24 23:16:35 -04002144}
David Tolnay8c81f622018-07-31 23:34:35 -07002145#[cfg(feature = "full")]
2146pub fn visit_impl_item_type<'ast, V: Visit<'ast> + ?Sized>(
2147 _visitor: &mut V,
2148 _i: &'ast ImplItemType,
2149) {
2150 for it in &_i.attrs {
2151 _visitor.visit_attribute(it)
2152 }
2153 _visitor.visit_visibility(&_i.vis);
2154 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002155 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002156 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002157 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002158 _visitor.visit_ident(&_i.ident);
2159 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04002160 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002161 _visitor.visit_type(&_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002162 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002163}
David Tolnay8c81f622018-07-31 23:34:35 -07002164#[cfg(feature = "full")]
2165pub fn visit_impl_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
2166 _visitor: &mut V,
2167 _i: &'ast ImplItemVerbatim,
2168) {
David Tolnay6af48992018-08-01 11:16:28 -07002169 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05002170}
David Tolnay8c81f622018-07-31 23:34:35 -07002171#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002172pub fn visit_index<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Index) {
David Tolnay6af48992018-08-01 11:16:28 -07002173 skip!(_i.index);
David Tolnay8c81f622018-07-31 23:34:35 -07002174 _visitor.visit_span(&_i.span);
David Tolnay85b69a42017-12-27 20:43:10 -05002175}
David Tolnay8c81f622018-07-31 23:34:35 -07002176#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002177pub fn visit_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Item) {
Nika Layzell27726662017-10-24 23:16:35 -04002178 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002179 Item::ExternCrate(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002180 _visitor.visit_item_extern_crate(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002181 }
David Tolnay8c81f622018-07-31 23:34:35 -07002182 Item::Use(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002183 _visitor.visit_item_use(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002184 }
David Tolnay8c81f622018-07-31 23:34:35 -07002185 Item::Static(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002186 _visitor.visit_item_static(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002187 }
David Tolnay8c81f622018-07-31 23:34:35 -07002188 Item::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002189 _visitor.visit_item_const(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002190 }
David Tolnay8c81f622018-07-31 23:34:35 -07002191 Item::Fn(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002192 _visitor.visit_item_fn(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002193 }
David Tolnay8c81f622018-07-31 23:34:35 -07002194 Item::Mod(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002195 _visitor.visit_item_mod(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002196 }
David Tolnay8c81f622018-07-31 23:34:35 -07002197 Item::ForeignMod(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002198 _visitor.visit_item_foreign_mod(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002199 }
David Tolnay8c81f622018-07-31 23:34:35 -07002200 Item::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002201 _visitor.visit_item_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002202 }
David Tolnaybb82ef02018-08-24 20:15:45 -04002203 Item::Existential(ref _binding_0) => {
2204 _visitor.visit_item_existential(_binding_0);
2205 }
David Tolnay8c81f622018-07-31 23:34:35 -07002206 Item::Struct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002207 _visitor.visit_item_struct(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002208 }
David Tolnay8c81f622018-07-31 23:34:35 -07002209 Item::Enum(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05002210 _visitor.visit_item_enum(_binding_0);
2211 }
David Tolnay8c81f622018-07-31 23:34:35 -07002212 Item::Union(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002213 _visitor.visit_item_union(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002214 }
David Tolnay8c81f622018-07-31 23:34:35 -07002215 Item::Trait(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002216 _visitor.visit_item_trait(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002217 }
David Tolnay8c81f622018-07-31 23:34:35 -07002218 Item::Impl(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002219 _visitor.visit_item_impl(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002220 }
David Tolnay8c81f622018-07-31 23:34:35 -07002221 Item::Macro(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002222 _visitor.visit_item_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002223 }
David Tolnay8c81f622018-07-31 23:34:35 -07002224 Item::Macro2(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002225 _visitor.visit_item_macro2(_binding_0);
David Tolnay500d8322017-12-18 00:32:51 -08002226 }
David Tolnay8c81f622018-07-31 23:34:35 -07002227 Item::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002228 _visitor.visit_item_verbatim(_binding_0);
2229 }
Nika Layzell27726662017-10-24 23:16:35 -04002230 }
2231}
David Tolnay8c81f622018-07-31 23:34:35 -07002232#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002233pub fn visit_item_const<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemConst) {
David Tolnay8c81f622018-07-31 23:34:35 -07002234 for it in &_i.attrs {
2235 _visitor.visit_attribute(it)
2236 }
2237 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002238 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002239 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002240 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002241 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002242 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002243 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04002244 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnayc6b55bc2017-11-09 22:48:38 -08002245}
David Tolnay8c81f622018-07-31 23:34:35 -07002246#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002247pub fn visit_item_enum<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemEnum) {
David Tolnay8c81f622018-07-31 23:34:35 -07002248 for it in &_i.attrs {
2249 _visitor.visit_attribute(it)
2250 }
2251 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002252 tokens_helper(_visitor, &_i.enum_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002253 _visitor.visit_ident(&_i.ident);
2254 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04002255 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002256 for el in Punctuated::pairs(&_i.variants) {
2257 let it = el.value();
2258 _visitor.visit_variant(it)
2259 }
David Tolnayc6b55bc2017-11-09 22:48:38 -08002260}
David Tolnay8c81f622018-07-31 23:34:35 -07002261#[cfg(feature = "full")]
David Tolnaybb82ef02018-08-24 20:15:45 -04002262pub fn visit_item_existential<'ast, V: Visit<'ast> + ?Sized>(
2263 _visitor: &mut V,
2264 _i: &'ast ItemExistential,
2265) {
2266 for it in &_i.attrs {
2267 _visitor.visit_attribute(it)
2268 }
2269 _visitor.visit_visibility(&_i.vis);
2270 tokens_helper(_visitor, &_i.existential_token.span);
2271 tokens_helper(_visitor, &_i.type_token.span);
2272 _visitor.visit_ident(&_i.ident);
2273 _visitor.visit_generics(&_i.generics);
2274 if let Some(ref it) = _i.colon_token {
2275 tokens_helper(_visitor, &it.spans)
2276 };
2277 for el in Punctuated::pairs(&_i.bounds) {
2278 let it = el.value();
2279 _visitor.visit_type_param_bound(it)
2280 }
2281 tokens_helper(_visitor, &_i.semi_token.spans);
2282}
2283#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07002284pub fn visit_item_extern_crate<'ast, V: Visit<'ast> + ?Sized>(
2285 _visitor: &mut V,
2286 _i: &'ast ItemExternCrate,
2287) {
2288 for it in &_i.attrs {
2289 _visitor.visit_attribute(it)
2290 }
2291 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002292 tokens_helper(_visitor, &_i.extern_token.span);
2293 tokens_helper(_visitor, &_i.crate_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002294 _visitor.visit_ident(&_i.ident);
2295 if let Some(ref it) = _i.rename {
David Tolnay7ac699c2018-08-24 14:00:58 -04002296 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002297 _visitor.visit_ident(&(it).1);
2298 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002299 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnayc6b55bc2017-11-09 22:48:38 -08002300}
David Tolnay8c81f622018-07-31 23:34:35 -07002301#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002302pub fn visit_item_fn<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemFn) {
David Tolnay8c81f622018-07-31 23:34:35 -07002303 for it in &_i.attrs {
2304 _visitor.visit_attribute(it)
2305 }
2306 _visitor.visit_visibility(&_i.vis);
2307 if let Some(ref it) = _i.constness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002308 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002309 };
2310 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002311 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002312 };
Yusuke Sasakif00a3ef2018-07-20 22:08:42 +09002313 if let Some(ref it) = _i.asyncness {
2314 tokens_helper(_visitor, &it.span)
2315 };
David Tolnay8c81f622018-07-31 23:34:35 -07002316 if let Some(ref it) = _i.abi {
2317 _visitor.visit_abi(it)
2318 };
2319 _visitor.visit_ident(&_i.ident);
2320 _visitor.visit_fn_decl(&*_i.decl);
2321 _visitor.visit_block(&*_i.block);
David Tolnayc6b55bc2017-11-09 22:48:38 -08002322}
David Tolnay8c81f622018-07-31 23:34:35 -07002323#[cfg(feature = "full")]
2324pub fn visit_item_foreign_mod<'ast, V: Visit<'ast> + ?Sized>(
2325 _visitor: &mut V,
2326 _i: &'ast ItemForeignMod,
2327) {
2328 for it in &_i.attrs {
2329 _visitor.visit_attribute(it)
2330 }
2331 _visitor.visit_abi(&_i.abi);
David Tolnay7ac699c2018-08-24 14:00:58 -04002332 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002333 for it in &_i.items {
2334 _visitor.visit_foreign_item(it)
2335 }
David Tolnayc6b55bc2017-11-09 22:48:38 -08002336}
David Tolnay8c81f622018-07-31 23:34:35 -07002337#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002338pub fn visit_item_impl<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemImpl) {
David Tolnay8c81f622018-07-31 23:34:35 -07002339 for it in &_i.attrs {
2340 _visitor.visit_attribute(it)
2341 }
2342 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002343 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002344 };
2345 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002346 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002347 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002348 tokens_helper(_visitor, &_i.impl_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002349 _visitor.visit_generics(&_i.generics);
2350 if let Some(ref it) = _i.trait_ {
2351 if let Some(ref it) = (it).0 {
David Tolnay7ac699c2018-08-24 14:00:58 -04002352 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002353 };
2354 _visitor.visit_path(&(it).1);
David Tolnay7ac699c2018-08-24 14:00:58 -04002355 tokens_helper(_visitor, &(it).2.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002356 };
2357 _visitor.visit_type(&*_i.self_ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002358 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002359 for it in &_i.items {
2360 _visitor.visit_impl_item(it)
2361 }
David Tolnayc6b55bc2017-11-09 22:48:38 -08002362}
David Tolnay8c81f622018-07-31 23:34:35 -07002363#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002364pub fn visit_item_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemMacro) {
David Tolnay8c81f622018-07-31 23:34:35 -07002365 for it in &_i.attrs {
2366 _visitor.visit_attribute(it)
2367 }
2368 if let Some(ref it) = _i.ident {
2369 _visitor.visit_ident(it)
2370 };
2371 _visitor.visit_macro(&_i.mac);
2372 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002373 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002374 };
David Tolnayc6b55bc2017-11-09 22:48:38 -08002375}
David Tolnay8c81f622018-07-31 23:34:35 -07002376#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002377pub fn visit_item_macro2<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemMacro2) {
David Tolnay8c81f622018-07-31 23:34:35 -07002378 for it in &_i.attrs {
2379 _visitor.visit_attribute(it)
2380 }
2381 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002382 tokens_helper(_visitor, &_i.macro_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002383 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002384 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay6af48992018-08-01 11:16:28 -07002385 skip!(_i.args);
David Tolnay7ac699c2018-08-24 14:00:58 -04002386 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay6af48992018-08-01 11:16:28 -07002387 skip!(_i.body);
David Tolnay500d8322017-12-18 00:32:51 -08002388}
David Tolnay8c81f622018-07-31 23:34:35 -07002389#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002390pub fn visit_item_mod<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemMod) {
David Tolnay8c81f622018-07-31 23:34:35 -07002391 for it in &_i.attrs {
2392 _visitor.visit_attribute(it)
2393 }
2394 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002395 tokens_helper(_visitor, &_i.mod_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002396 _visitor.visit_ident(&_i.ident);
2397 if let Some(ref it) = _i.content {
David Tolnay7ac699c2018-08-24 14:00:58 -04002398 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002399 for it in &(it).1 {
2400 _visitor.visit_item(it)
2401 }
2402 };
2403 if let Some(ref it) = _i.semi {
David Tolnay7ac699c2018-08-24 14:00:58 -04002404 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002405 };
Nika Layzell27726662017-10-24 23:16:35 -04002406}
David Tolnay8c81f622018-07-31 23:34:35 -07002407#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002408pub fn visit_item_static<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemStatic) {
David Tolnay8c81f622018-07-31 23:34:35 -07002409 for it in &_i.attrs {
2410 _visitor.visit_attribute(it)
2411 }
2412 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002413 tokens_helper(_visitor, &_i.static_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002414 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04002415 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002416 };
2417 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002418 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002419 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002420 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002421 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04002422 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002423}
David Tolnay8c81f622018-07-31 23:34:35 -07002424#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002425pub fn visit_item_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemStruct) {
David Tolnay8c81f622018-07-31 23:34:35 -07002426 for it in &_i.attrs {
2427 _visitor.visit_attribute(it)
2428 }
2429 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002430 tokens_helper(_visitor, &_i.struct_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002431 _visitor.visit_ident(&_i.ident);
2432 _visitor.visit_generics(&_i.generics);
2433 _visitor.visit_fields(&_i.fields);
2434 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002435 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002436 };
Nika Layzell27726662017-10-24 23:16:35 -04002437}
David Tolnay8c81f622018-07-31 23:34:35 -07002438#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002439pub fn visit_item_trait<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemTrait) {
David Tolnay8c81f622018-07-31 23:34:35 -07002440 for it in &_i.attrs {
2441 _visitor.visit_attribute(it)
2442 }
2443 _visitor.visit_visibility(&_i.vis);
2444 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002445 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002446 };
2447 if let Some(ref it) = _i.auto_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002448 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002449 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002450 tokens_helper(_visitor, &_i.trait_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002451 _visitor.visit_ident(&_i.ident);
2452 _visitor.visit_generics(&_i.generics);
2453 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002454 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002455 };
2456 for el in Punctuated::pairs(&_i.supertraits) {
2457 let it = el.value();
2458 _visitor.visit_type_param_bound(it)
2459 }
David Tolnay7ac699c2018-08-24 14:00:58 -04002460 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002461 for it in &_i.items {
2462 _visitor.visit_trait_item(it)
2463 }
Nika Layzell27726662017-10-24 23:16:35 -04002464}
David Tolnay8c81f622018-07-31 23:34:35 -07002465#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002466pub fn visit_item_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemType) {
David Tolnay8c81f622018-07-31 23:34:35 -07002467 for it in &_i.attrs {
2468 _visitor.visit_attribute(it)
2469 }
2470 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002471 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002472 _visitor.visit_ident(&_i.ident);
2473 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04002474 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002475 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002476 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002477}
David Tolnay8c81f622018-07-31 23:34:35 -07002478#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002479pub fn visit_item_union<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemUnion) {
David Tolnay8c81f622018-07-31 23:34:35 -07002480 for it in &_i.attrs {
2481 _visitor.visit_attribute(it)
2482 }
2483 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002484 tokens_helper(_visitor, &_i.union_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002485 _visitor.visit_ident(&_i.ident);
2486 _visitor.visit_generics(&_i.generics);
2487 _visitor.visit_fields_named(&_i.fields);
Nika Layzell27726662017-10-24 23:16:35 -04002488}
David Tolnay8c81f622018-07-31 23:34:35 -07002489#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002490pub fn visit_item_use<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemUse) {
David Tolnay8c81f622018-07-31 23:34:35 -07002491 for it in &_i.attrs {
2492 _visitor.visit_attribute(it)
2493 }
2494 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002495 tokens_helper(_visitor, &_i.use_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002496 if let Some(ref it) = _i.leading_colon {
David Tolnay7ac699c2018-08-24 14:00:58 -04002497 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002498 };
2499 _visitor.visit_use_tree(&_i.tree);
David Tolnay7ac699c2018-08-24 14:00:58 -04002500 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002501}
David Tolnay8c81f622018-07-31 23:34:35 -07002502#[cfg(feature = "full")]
2503pub fn visit_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
2504 _visitor: &mut V,
2505 _i: &'ast ItemVerbatim,
2506) {
David Tolnay6af48992018-08-01 11:16:28 -07002507 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05002508}
David Tolnay8c81f622018-07-31 23:34:35 -07002509#[cfg(any(feature = "full", feature = "derive"))]
2510#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002511pub fn visit_label<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Label) {
David Tolnay8c81f622018-07-31 23:34:35 -07002512 _visitor.visit_lifetime(&_i.name);
David Tolnay7ac699c2018-08-24 14:00:58 -04002513 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnaybcd498f2017-12-29 12:02:33 -05002514}
David Tolnay8c81f622018-07-31 23:34:35 -07002515#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002516pub fn visit_lifetime<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Lifetime) {
David Tolnay6af48992018-08-01 11:16:28 -07002517 skip!(_i.apostrophe);
David Tolnay8c81f622018-07-31 23:34:35 -07002518 _visitor.visit_ident(&_i.ident);
David Tolnay4ba63a02017-12-28 15:53:05 -05002519}
David Tolnay8c81f622018-07-31 23:34:35 -07002520#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002521pub fn visit_lifetime_def<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LifetimeDef) {
David Tolnay8c81f622018-07-31 23:34:35 -07002522 for it in &_i.attrs {
2523 _visitor.visit_attribute(it)
2524 }
2525 _visitor.visit_lifetime(&_i.lifetime);
2526 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002527 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002528 };
2529 for el in Punctuated::pairs(&_i.bounds) {
2530 let it = el.value();
2531 _visitor.visit_lifetime(it)
2532 }
David Tolnay4ba63a02017-12-28 15:53:05 -05002533}
David Tolnay8c81f622018-07-31 23:34:35 -07002534#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002535pub fn visit_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Lit) {
David Tolnay360efd22018-01-04 23:35:26 -08002536 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002537 Lit::Str(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002538 _visitor.visit_lit_str(_binding_0);
2539 }
David Tolnay8c81f622018-07-31 23:34:35 -07002540 Lit::ByteStr(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002541 _visitor.visit_lit_byte_str(_binding_0);
2542 }
David Tolnay8c81f622018-07-31 23:34:35 -07002543 Lit::Byte(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002544 _visitor.visit_lit_byte(_binding_0);
2545 }
David Tolnay8c81f622018-07-31 23:34:35 -07002546 Lit::Char(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002547 _visitor.visit_lit_char(_binding_0);
2548 }
David Tolnay8c81f622018-07-31 23:34:35 -07002549 Lit::Int(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002550 _visitor.visit_lit_int(_binding_0);
2551 }
David Tolnay8c81f622018-07-31 23:34:35 -07002552 Lit::Float(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002553 _visitor.visit_lit_float(_binding_0);
2554 }
David Tolnay8c81f622018-07-31 23:34:35 -07002555 Lit::Bool(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002556 _visitor.visit_lit_bool(_binding_0);
2557 }
David Tolnay8c81f622018-07-31 23:34:35 -07002558 Lit::Verbatim(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002559 _visitor.visit_lit_verbatim(_binding_0);
2560 }
2561 }
2562}
David Tolnay8c81f622018-07-31 23:34:35 -07002563#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002564pub fn visit_lit_bool<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitBool) {
David Tolnay6af48992018-08-01 11:16:28 -07002565 skip!(_i.value);
David Tolnay8c81f622018-07-31 23:34:35 -07002566 _visitor.visit_span(&_i.span);
Nika Layzell27726662017-10-24 23:16:35 -04002567}
David Tolnay8c81f622018-07-31 23:34:35 -07002568#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002569pub fn visit_lit_byte<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitByte) {
David Tolnay6af48992018-08-01 11:16:28 -07002570 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002571}
David Tolnay8c81f622018-07-31 23:34:35 -07002572#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002573pub fn visit_lit_byte_str<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitByteStr) {
David Tolnay6af48992018-08-01 11:16:28 -07002574 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002575}
David Tolnay8c81f622018-07-31 23:34:35 -07002576#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002577pub fn visit_lit_char<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitChar) {
David Tolnay6af48992018-08-01 11:16:28 -07002578 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002579}
David Tolnay8c81f622018-07-31 23:34:35 -07002580#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002581pub fn visit_lit_float<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitFloat) {
David Tolnay6af48992018-08-01 11:16:28 -07002582 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002583}
David Tolnay8c81f622018-07-31 23:34:35 -07002584#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002585pub fn visit_lit_int<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitInt) {
David Tolnay6af48992018-08-01 11:16:28 -07002586 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002587}
David Tolnay8c81f622018-07-31 23:34:35 -07002588#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002589pub fn visit_lit_str<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitStr) {
David Tolnay6af48992018-08-01 11:16:28 -07002590 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002591}
David Tolnay8c81f622018-07-31 23:34:35 -07002592#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002593pub fn visit_lit_verbatim<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitVerbatim) {
David Tolnay6af48992018-08-01 11:16:28 -07002594 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002595}
David Tolnay8c81f622018-07-31 23:34:35 -07002596#[cfg(any(feature = "full", feature = "derive"))]
2597#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002598pub fn visit_local<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Local) {
David Tolnay8c81f622018-07-31 23:34:35 -07002599 for it in &_i.attrs {
2600 _visitor.visit_attribute(it)
2601 }
David Tolnay7ac699c2018-08-24 14:00:58 -04002602 tokens_helper(_visitor, &_i.let_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002603 for el in Punctuated::pairs(&_i.pats) {
2604 let it = el.value();
2605 _visitor.visit_pat(it)
2606 }
2607 if let Some(ref it) = _i.ty {
David Tolnay7ac699c2018-08-24 14:00:58 -04002608 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002609 _visitor.visit_type(&*(it).1);
2610 };
2611 if let Some(ref it) = _i.init {
David Tolnay7ac699c2018-08-24 14:00:58 -04002612 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002613 _visitor.visit_expr(&*(it).1);
2614 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002615 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002616}
David Tolnay8c81f622018-07-31 23:34:35 -07002617#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002618pub fn visit_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Macro) {
David Tolnay8c81f622018-07-31 23:34:35 -07002619 _visitor.visit_path(&_i.path);
David Tolnay7ac699c2018-08-24 14:00:58 -04002620 tokens_helper(_visitor, &_i.bang_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002621 _visitor.visit_macro_delimiter(&_i.delimiter);
David Tolnay6af48992018-08-01 11:16:28 -07002622 skip!(_i.tts);
David Tolnayab919512017-12-30 23:31:51 -05002623}
David Tolnay8c81f622018-07-31 23:34:35 -07002624#[cfg(any(feature = "full", feature = "derive"))]
2625pub fn visit_macro_delimiter<'ast, V: Visit<'ast> + ?Sized>(
2626 _visitor: &mut V,
2627 _i: &'ast MacroDelimiter,
2628) {
David Tolnayab919512017-12-30 23:31:51 -05002629 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002630 MacroDelimiter::Paren(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002631 tokens_helper(_visitor, &_binding_0.span);
David Tolnayab919512017-12-30 23:31:51 -05002632 }
David Tolnay8c81f622018-07-31 23:34:35 -07002633 MacroDelimiter::Brace(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002634 tokens_helper(_visitor, &_binding_0.span);
David Tolnayab919512017-12-30 23:31:51 -05002635 }
David Tolnay8c81f622018-07-31 23:34:35 -07002636 MacroDelimiter::Bracket(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002637 tokens_helper(_visitor, &_binding_0.span);
David Tolnayab919512017-12-30 23:31:51 -05002638 }
2639 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002640}
David Tolnay8c81f622018-07-31 23:34:35 -07002641#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002642pub fn visit_member<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Member) {
David Tolnay85b69a42017-12-27 20:43:10 -05002643 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002644 Member::Named(ref _binding_0) => {
Alex Crichtond261d092018-05-18 13:47:35 -07002645 _visitor.visit_ident(_binding_0);
David Tolnay85b69a42017-12-27 20:43:10 -05002646 }
David Tolnay8c81f622018-07-31 23:34:35 -07002647 Member::Unnamed(ref _binding_0) => {
David Tolnay85b69a42017-12-27 20:43:10 -05002648 _visitor.visit_index(_binding_0);
2649 }
2650 }
2651}
David Tolnay8c81f622018-07-31 23:34:35 -07002652#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayaaadd782018-01-06 22:58:13 -08002653pub fn visit_meta<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Meta) {
Nika Layzell27726662017-10-24 23:16:35 -04002654 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002655 Meta::Word(ref _binding_0) => {
Alex Crichtond261d092018-05-18 13:47:35 -07002656 _visitor.visit_ident(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002657 }
David Tolnay8c81f622018-07-31 23:34:35 -07002658 Meta::List(ref _binding_0) => {
David Tolnayaaadd782018-01-06 22:58:13 -08002659 _visitor.visit_meta_list(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002660 }
David Tolnay8c81f622018-07-31 23:34:35 -07002661 Meta::NameValue(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002662 _visitor.visit_meta_name_value(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002663 }
2664 }
2665}
David Tolnay8c81f622018-07-31 23:34:35 -07002666#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayaaadd782018-01-06 22:58:13 -08002667pub fn visit_meta_list<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast MetaList) {
David Tolnay8c81f622018-07-31 23:34:35 -07002668 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002669 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002670 for el in Punctuated::pairs(&_i.nested) {
2671 let it = el.value();
2672 _visitor.visit_nested_meta(it)
2673 }
Nika Layzell27726662017-10-24 23:16:35 -04002674}
David Tolnay8c81f622018-07-31 23:34:35 -07002675#[cfg(any(feature = "full", feature = "derive"))]
2676pub fn visit_meta_name_value<'ast, V: Visit<'ast> + ?Sized>(
2677 _visitor: &mut V,
2678 _i: &'ast MetaNameValue,
2679) {
2680 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002681 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002682 _visitor.visit_lit(&_i.lit);
Nika Layzell27726662017-10-24 23:16:35 -04002683}
David Tolnay8c81f622018-07-31 23:34:35 -07002684#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002685pub fn visit_method_sig<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast MethodSig) {
David Tolnay8c81f622018-07-31 23:34:35 -07002686 if let Some(ref it) = _i.constness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002687 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002688 };
2689 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002690 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002691 };
Yusuke Sasakif00a3ef2018-07-20 22:08:42 +09002692 if let Some(ref it) = _i.asyncness {
2693 tokens_helper(_visitor, &it.span)
2694 };
David Tolnay8c81f622018-07-31 23:34:35 -07002695 if let Some(ref it) = _i.abi {
2696 _visitor.visit_abi(it)
2697 };
2698 _visitor.visit_ident(&_i.ident);
2699 _visitor.visit_fn_decl(&_i.decl);
Nika Layzell27726662017-10-24 23:16:35 -04002700}
David Tolnay8c81f622018-07-31 23:34:35 -07002701#[cfg(any(feature = "full", feature = "derive"))]
2702#[cfg(feature = "full")]
2703pub fn visit_method_turbofish<'ast, V: Visit<'ast> + ?Sized>(
2704 _visitor: &mut V,
2705 _i: &'ast MethodTurbofish,
2706) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002707 tokens_helper(_visitor, &_i.colon2_token.spans);
2708 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002709 for el in Punctuated::pairs(&_i.args) {
2710 let it = el.value();
2711 _visitor.visit_generic_method_argument(it)
2712 }
David Tolnay7ac699c2018-08-24 14:00:58 -04002713 tokens_helper(_visitor, &_i.gt_token.spans);
David Tolnayd60cfec2017-12-29 00:21:38 -05002714}
David Tolnay8c81f622018-07-31 23:34:35 -07002715#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayaaadd782018-01-06 22:58:13 -08002716pub fn visit_nested_meta<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast NestedMeta) {
Nika Layzell27726662017-10-24 23:16:35 -04002717 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002718 NestedMeta::Meta(ref _binding_0) => {
David Tolnayaaadd782018-01-06 22:58:13 -08002719 _visitor.visit_meta(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002720 }
David Tolnay8c81f622018-07-31 23:34:35 -07002721 NestedMeta::Literal(ref _binding_0) => {
David Tolnay4ba63a02017-12-28 15:53:05 -05002722 _visitor.visit_lit(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002723 }
2724 }
2725}
David Tolnay8c81f622018-07-31 23:34:35 -07002726#[cfg(any(feature = "full", feature = "derive"))]
2727pub fn visit_parenthesized_generic_arguments<'ast, V: Visit<'ast> + ?Sized>(
2728 _visitor: &mut V,
2729 _i: &'ast ParenthesizedGenericArguments,
2730) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002731 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002732 for el in Punctuated::pairs(&_i.inputs) {
2733 let it = el.value();
2734 _visitor.visit_type(it)
2735 }
2736 _visitor.visit_return_type(&_i.output);
Nika Layzell27726662017-10-24 23:16:35 -04002737}
David Tolnay8c81f622018-07-31 23:34:35 -07002738#[cfg(any(feature = "full", feature = "derive"))]
2739#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002740pub fn visit_pat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Pat) {
Nika Layzell27726662017-10-24 23:16:35 -04002741 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002742 Pat::Wild(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002743 _visitor.visit_pat_wild(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002744 }
David Tolnay8c81f622018-07-31 23:34:35 -07002745 Pat::Ident(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002746 _visitor.visit_pat_ident(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002747 }
David Tolnay8c81f622018-07-31 23:34:35 -07002748 Pat::Struct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002749 _visitor.visit_pat_struct(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002750 }
David Tolnay8c81f622018-07-31 23:34:35 -07002751 Pat::TupleStruct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002752 _visitor.visit_pat_tuple_struct(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002753 }
David Tolnay8c81f622018-07-31 23:34:35 -07002754 Pat::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002755 _visitor.visit_pat_path(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002756 }
David Tolnay8c81f622018-07-31 23:34:35 -07002757 Pat::Tuple(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002758 _visitor.visit_pat_tuple(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002759 }
David Tolnay8c81f622018-07-31 23:34:35 -07002760 Pat::Box(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002761 _visitor.visit_pat_box(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002762 }
David Tolnay8c81f622018-07-31 23:34:35 -07002763 Pat::Ref(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002764 _visitor.visit_pat_ref(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002765 }
David Tolnay8c81f622018-07-31 23:34:35 -07002766 Pat::Lit(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002767 _visitor.visit_pat_lit(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002768 }
David Tolnay8c81f622018-07-31 23:34:35 -07002769 Pat::Range(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002770 _visitor.visit_pat_range(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002771 }
David Tolnay8c81f622018-07-31 23:34:35 -07002772 Pat::Slice(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002773 _visitor.visit_pat_slice(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002774 }
David Tolnay8c81f622018-07-31 23:34:35 -07002775 Pat::Macro(ref _binding_0) => {
David Tolnay323279a2017-12-29 11:26:32 -05002776 _visitor.visit_pat_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002777 }
David Tolnay8c81f622018-07-31 23:34:35 -07002778 Pat::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002779 _visitor.visit_pat_verbatim(_binding_0);
2780 }
Nika Layzell27726662017-10-24 23:16:35 -04002781 }
2782}
David Tolnay8c81f622018-07-31 23:34:35 -07002783#[cfg(any(feature = "full", feature = "derive"))]
2784#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002785pub fn visit_pat_box<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatBox) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002786 tokens_helper(_visitor, &_i.box_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002787 _visitor.visit_pat(&*_i.pat);
Nika Layzell27726662017-10-24 23:16:35 -04002788}
David Tolnay8c81f622018-07-31 23:34:35 -07002789#[cfg(any(feature = "full", feature = "derive"))]
2790#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002791pub fn visit_pat_ident<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatIdent) {
David Tolnay8c81f622018-07-31 23:34:35 -07002792 if let Some(ref it) = _i.by_ref {
David Tolnay7ac699c2018-08-24 14:00:58 -04002793 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002794 };
2795 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04002796 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002797 };
2798 _visitor.visit_ident(&_i.ident);
2799 if let Some(ref it) = _i.subpat {
David Tolnay7ac699c2018-08-24 14:00:58 -04002800 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002801 _visitor.visit_pat(&*(it).1);
2802 };
Nika Layzell27726662017-10-24 23:16:35 -04002803}
David Tolnay8c81f622018-07-31 23:34:35 -07002804#[cfg(any(feature = "full", feature = "derive"))]
2805#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002806pub fn visit_pat_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatLit) {
David Tolnay8c81f622018-07-31 23:34:35 -07002807 _visitor.visit_expr(&*_i.expr);
Nika Layzell27726662017-10-24 23:16:35 -04002808}
David Tolnay8c81f622018-07-31 23:34:35 -07002809#[cfg(any(feature = "full", feature = "derive"))]
2810#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002811pub fn visit_pat_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatMacro) {
David Tolnay8c81f622018-07-31 23:34:35 -07002812 _visitor.visit_macro(&_i.mac);
David Tolnay323279a2017-12-29 11:26:32 -05002813}
David Tolnay8c81f622018-07-31 23:34:35 -07002814#[cfg(any(feature = "full", feature = "derive"))]
2815#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002816pub fn visit_pat_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatPath) {
David Tolnay8c81f622018-07-31 23:34:35 -07002817 if let Some(ref it) = _i.qself {
2818 _visitor.visit_qself(it)
2819 };
2820 _visitor.visit_path(&_i.path);
Nika Layzell27726662017-10-24 23:16:35 -04002821}
David Tolnay8c81f622018-07-31 23:34:35 -07002822#[cfg(any(feature = "full", feature = "derive"))]
2823#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002824pub fn visit_pat_range<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatRange) {
David Tolnay8c81f622018-07-31 23:34:35 -07002825 _visitor.visit_expr(&*_i.lo);
2826 _visitor.visit_range_limits(&_i.limits);
2827 _visitor.visit_expr(&*_i.hi);
Nika Layzell27726662017-10-24 23:16:35 -04002828}
David Tolnay8c81f622018-07-31 23:34:35 -07002829#[cfg(any(feature = "full", feature = "derive"))]
2830#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002831pub fn visit_pat_ref<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatRef) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002832 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002833 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04002834 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002835 };
2836 _visitor.visit_pat(&*_i.pat);
Nika Layzell27726662017-10-24 23:16:35 -04002837}
David Tolnay8c81f622018-07-31 23:34:35 -07002838#[cfg(any(feature = "full", feature = "derive"))]
2839#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002840pub fn visit_pat_slice<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatSlice) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002841 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002842 for el in Punctuated::pairs(&_i.front) {
2843 let it = el.value();
2844 _visitor.visit_pat(it)
2845 }
2846 if let Some(ref it) = _i.middle {
2847 _visitor.visit_pat(&**it)
2848 };
2849 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002850 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002851 };
2852 if let Some(ref it) = _i.comma_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002853 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002854 };
2855 for el in Punctuated::pairs(&_i.back) {
2856 let it = el.value();
2857 _visitor.visit_pat(it)
2858 }
Nika Layzell27726662017-10-24 23:16:35 -04002859}
David Tolnay8c81f622018-07-31 23:34:35 -07002860#[cfg(any(feature = "full", feature = "derive"))]
2861#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002862pub fn visit_pat_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatStruct) {
David Tolnay8c81f622018-07-31 23:34:35 -07002863 _visitor.visit_path(&_i.path);
David Tolnay7ac699c2018-08-24 14:00:58 -04002864 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002865 for el in Punctuated::pairs(&_i.fields) {
2866 let it = el.value();
2867 _visitor.visit_field_pat(it)
2868 }
2869 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002870 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002871 };
Nika Layzell27726662017-10-24 23:16:35 -04002872}
David Tolnay8c81f622018-07-31 23:34:35 -07002873#[cfg(any(feature = "full", feature = "derive"))]
2874#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002875pub fn visit_pat_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatTuple) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002876 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002877 for el in Punctuated::pairs(&_i.front) {
2878 let it = el.value();
2879 _visitor.visit_pat(it)
2880 }
2881 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002882 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002883 };
2884 if let Some(ref it) = _i.comma_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002885 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002886 };
2887 for el in Punctuated::pairs(&_i.back) {
2888 let it = el.value();
2889 _visitor.visit_pat(it)
2890 }
Nika Layzell27726662017-10-24 23:16:35 -04002891}
David Tolnay8c81f622018-07-31 23:34:35 -07002892#[cfg(any(feature = "full", feature = "derive"))]
2893#[cfg(feature = "full")]
2894pub fn visit_pat_tuple_struct<'ast, V: Visit<'ast> + ?Sized>(
2895 _visitor: &mut V,
2896 _i: &'ast PatTupleStruct,
2897) {
2898 _visitor.visit_path(&_i.path);
2899 _visitor.visit_pat_tuple(&_i.pat);
Nika Layzell27726662017-10-24 23:16:35 -04002900}
David Tolnay8c81f622018-07-31 23:34:35 -07002901#[cfg(any(feature = "full", feature = "derive"))]
2902#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002903pub fn visit_pat_verbatim<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatVerbatim) {
David Tolnay6af48992018-08-01 11:16:28 -07002904 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05002905}
David Tolnay8c81f622018-07-31 23:34:35 -07002906#[cfg(any(feature = "full", feature = "derive"))]
2907#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002908pub fn visit_pat_wild<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatWild) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002909 tokens_helper(_visitor, &_i.underscore_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002910}
David Tolnay8c81f622018-07-31 23:34:35 -07002911#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002912pub fn visit_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Path) {
David Tolnay8c81f622018-07-31 23:34:35 -07002913 if let Some(ref it) = _i.leading_colon {
David Tolnay7ac699c2018-08-24 14:00:58 -04002914 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002915 };
2916 for el in Punctuated::pairs(&_i.segments) {
2917 let it = el.value();
2918 _visitor.visit_path_segment(it)
2919 }
Nika Layzell27726662017-10-24 23:16:35 -04002920}
David Tolnay8c81f622018-07-31 23:34:35 -07002921#[cfg(any(feature = "full", feature = "derive"))]
2922pub fn visit_path_arguments<'ast, V: Visit<'ast> + ?Sized>(
2923 _visitor: &mut V,
2924 _i: &'ast PathArguments,
2925) {
Nika Layzellc08227a2017-12-04 16:30:17 -05002926 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002927 PathArguments::None => {}
2928 PathArguments::AngleBracketed(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002929 _visitor.visit_angle_bracketed_generic_arguments(_binding_0);
Nika Layzellc08227a2017-12-04 16:30:17 -05002930 }
David Tolnay8c81f622018-07-31 23:34:35 -07002931 PathArguments::Parenthesized(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002932 _visitor.visit_parenthesized_generic_arguments(_binding_0);
Nika Layzellc08227a2017-12-04 16:30:17 -05002933 }
2934 }
2935}
David Tolnay8c81f622018-07-31 23:34:35 -07002936#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002937pub fn visit_path_segment<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PathSegment) {
David Tolnay8c81f622018-07-31 23:34:35 -07002938 _visitor.visit_ident(&_i.ident);
2939 _visitor.visit_path_arguments(&_i.arguments);
Nika Layzell27726662017-10-24 23:16:35 -04002940}
David Tolnay8c81f622018-07-31 23:34:35 -07002941#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002942pub fn visit_predicate_eq<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PredicateEq) {
David Tolnay8c81f622018-07-31 23:34:35 -07002943 _visitor.visit_type(&_i.lhs_ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002944 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002945 _visitor.visit_type(&_i.rhs_ty);
David Tolnayd4add852018-01-01 20:13:24 -08002946}
David Tolnay8c81f622018-07-31 23:34:35 -07002947#[cfg(any(feature = "full", feature = "derive"))]
2948pub fn visit_predicate_lifetime<'ast, V: Visit<'ast> + ?Sized>(
2949 _visitor: &mut V,
2950 _i: &'ast PredicateLifetime,
2951) {
2952 _visitor.visit_lifetime(&_i.lifetime);
2953 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002954 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002955 };
2956 for el in Punctuated::pairs(&_i.bounds) {
2957 let it = el.value();
2958 _visitor.visit_lifetime(it)
2959 }
David Tolnayd4add852018-01-01 20:13:24 -08002960}
David Tolnay8c81f622018-07-31 23:34:35 -07002961#[cfg(any(feature = "full", feature = "derive"))]
2962pub fn visit_predicate_type<'ast, V: Visit<'ast> + ?Sized>(
2963 _visitor: &mut V,
2964 _i: &'ast PredicateType,
2965) {
2966 if let Some(ref it) = _i.lifetimes {
2967 _visitor.visit_bound_lifetimes(it)
2968 };
2969 _visitor.visit_type(&_i.bounded_ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002970 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002971 for el in Punctuated::pairs(&_i.bounds) {
2972 let it = el.value();
2973 _visitor.visit_type_param_bound(it)
2974 }
David Tolnayd4add852018-01-01 20:13:24 -08002975}
David Tolnay8c81f622018-07-31 23:34:35 -07002976#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002977pub fn visit_qself<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast QSelf) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002978 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002979 _visitor.visit_type(&*_i.ty);
David Tolnay6af48992018-08-01 11:16:28 -07002980 skip!(_i.position);
David Tolnay8c81f622018-07-31 23:34:35 -07002981 if let Some(ref it) = _i.as_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002982 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002983 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002984 tokens_helper(_visitor, &_i.gt_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002985}
David Tolnay8c81f622018-07-31 23:34:35 -07002986#[cfg(any(feature = "full", feature = "derive"))]
2987#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002988pub fn visit_range_limits<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast RangeLimits) {
Nika Layzell27726662017-10-24 23:16:35 -04002989 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002990 RangeLimits::HalfOpen(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002991 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002992 }
David Tolnay8c81f622018-07-31 23:34:35 -07002993 RangeLimits::Closed(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002994 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002995 }
2996 }
2997}
David Tolnay8c81f622018-07-31 23:34:35 -07002998#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002999pub fn visit_return_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ReturnType) {
David Tolnayf93b90d2017-11-11 19:21:26 -08003000 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003001 ReturnType::Default => {}
3002 ReturnType::Type(ref _binding_0, ref _binding_1) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003003 tokens_helper(_visitor, &_binding_0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003004 _visitor.visit_type(&**_binding_1);
David Tolnayf93b90d2017-11-11 19:21:26 -08003005 }
3006 }
3007}
David Tolnay8c81f622018-07-31 23:34:35 -07003008pub fn visit_span<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Span) {}
3009#[cfg(any(feature = "full", feature = "derive"))]
3010#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003011pub fn visit_stmt<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Stmt) {
Nika Layzell27726662017-10-24 23:16:35 -04003012 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003013 Stmt::Local(ref _binding_0) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08003014 _visitor.visit_local(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003015 }
David Tolnay8c81f622018-07-31 23:34:35 -07003016 Stmt::Item(ref _binding_0) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08003017 _visitor.visit_item(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003018 }
David Tolnay8c81f622018-07-31 23:34:35 -07003019 Stmt::Expr(ref _binding_0) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08003020 _visitor.visit_expr(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003021 }
David Tolnay8c81f622018-07-31 23:34:35 -07003022 Stmt::Semi(ref _binding_0, ref _binding_1) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08003023 _visitor.visit_expr(_binding_0);
David Tolnay7ac699c2018-08-24 14:00:58 -04003024 tokens_helper(_visitor, &_binding_1.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003025 }
Nika Layzell27726662017-10-24 23:16:35 -04003026 }
3027}
David Tolnay8c81f622018-07-31 23:34:35 -07003028#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003029pub fn visit_trait_bound<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TraitBound) {
David Tolnay8c81f622018-07-31 23:34:35 -07003030 if let Some(ref it) = _i.paren_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003031 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003032 };
3033 _visitor.visit_trait_bound_modifier(&_i.modifier);
3034 if let Some(ref it) = _i.lifetimes {
3035 _visitor.visit_bound_lifetimes(it)
3036 };
3037 _visitor.visit_path(&_i.path);
David Tolnay40fb8ce2018-01-02 10:53:46 -08003038}
David Tolnay8c81f622018-07-31 23:34:35 -07003039#[cfg(any(feature = "full", feature = "derive"))]
3040pub fn visit_trait_bound_modifier<'ast, V: Visit<'ast> + ?Sized>(
3041 _visitor: &mut V,
3042 _i: &'ast TraitBoundModifier,
3043) {
Nika Layzell27726662017-10-24 23:16:35 -04003044 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003045 TraitBoundModifier::None => {}
3046 TraitBoundModifier::Maybe(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003047 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003048 }
3049 }
3050}
David Tolnay8c81f622018-07-31 23:34:35 -07003051#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003052pub fn visit_trait_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TraitItem) {
Nika Layzell27726662017-10-24 23:16:35 -04003053 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003054 TraitItem::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003055 _visitor.visit_trait_item_const(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003056 }
David Tolnay8c81f622018-07-31 23:34:35 -07003057 TraitItem::Method(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003058 _visitor.visit_trait_item_method(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003059 }
David Tolnay8c81f622018-07-31 23:34:35 -07003060 TraitItem::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003061 _visitor.visit_trait_item_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003062 }
David Tolnaybb82ef02018-08-24 20:15:45 -04003063 TraitItem::Existential(ref _binding_0) => {
3064 _visitor.visit_trait_item_existential(_binding_0);
3065 }
David Tolnay8c81f622018-07-31 23:34:35 -07003066 TraitItem::Macro(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003067 _visitor.visit_trait_item_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003068 }
David Tolnay8c81f622018-07-31 23:34:35 -07003069 TraitItem::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05003070 _visitor.visit_trait_item_verbatim(_binding_0);
3071 }
Nika Layzell27726662017-10-24 23:16:35 -04003072 }
3073}
David Tolnay8c81f622018-07-31 23:34:35 -07003074#[cfg(feature = "full")]
3075pub fn visit_trait_item_const<'ast, V: Visit<'ast> + ?Sized>(
3076 _visitor: &mut V,
3077 _i: &'ast TraitItemConst,
3078) {
3079 for it in &_i.attrs {
3080 _visitor.visit_attribute(it)
3081 }
David Tolnay7ac699c2018-08-24 14:00:58 -04003082 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003083 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04003084 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003085 _visitor.visit_type(&_i.ty);
3086 if let Some(ref it) = _i.default {
David Tolnay7ac699c2018-08-24 14:00:58 -04003087 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003088 _visitor.visit_expr(&(it).1);
3089 };
David Tolnay7ac699c2018-08-24 14:00:58 -04003090 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnayda705bd2017-11-10 21:58:05 -08003091}
David Tolnay8c81f622018-07-31 23:34:35 -07003092#[cfg(feature = "full")]
David Tolnaybb82ef02018-08-24 20:15:45 -04003093pub fn visit_trait_item_existential<'ast, V: Visit<'ast> + ?Sized>(
3094 _visitor: &mut V,
3095 _i: &'ast TraitItemExistential,
3096) {
3097 for it in &_i.attrs {
3098 _visitor.visit_attribute(it)
3099 }
3100 tokens_helper(_visitor, &_i.existential_token.span);
3101 tokens_helper(_visitor, &_i.type_token.span);
3102 _visitor.visit_ident(&_i.ident);
3103 _visitor.visit_generics(&_i.generics);
3104 if let Some(ref it) = _i.colon_token {
3105 tokens_helper(_visitor, &it.spans)
3106 };
3107 for el in Punctuated::pairs(&_i.bounds) {
3108 let it = el.value();
3109 _visitor.visit_type_param_bound(it)
3110 }
3111 tokens_helper(_visitor, &_i.semi_token.spans);
3112}
3113#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07003114pub fn visit_trait_item_macro<'ast, V: Visit<'ast> + ?Sized>(
3115 _visitor: &mut V,
3116 _i: &'ast TraitItemMacro,
3117) {
3118 for it in &_i.attrs {
3119 _visitor.visit_attribute(it)
3120 }
3121 _visitor.visit_macro(&_i.mac);
3122 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003123 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003124 };
David Tolnayda705bd2017-11-10 21:58:05 -08003125}
David Tolnay8c81f622018-07-31 23:34:35 -07003126#[cfg(feature = "full")]
3127pub fn visit_trait_item_method<'ast, V: Visit<'ast> + ?Sized>(
3128 _visitor: &mut V,
3129 _i: &'ast TraitItemMethod,
3130) {
3131 for it in &_i.attrs {
3132 _visitor.visit_attribute(it)
3133 }
3134 _visitor.visit_method_sig(&_i.sig);
3135 if let Some(ref it) = _i.default {
3136 _visitor.visit_block(it)
3137 };
3138 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003139 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003140 };
Nika Layzell27726662017-10-24 23:16:35 -04003141}
David Tolnay8c81f622018-07-31 23:34:35 -07003142#[cfg(feature = "full")]
3143pub fn visit_trait_item_type<'ast, V: Visit<'ast> + ?Sized>(
3144 _visitor: &mut V,
3145 _i: &'ast TraitItemType,
3146) {
3147 for it in &_i.attrs {
3148 _visitor.visit_attribute(it)
3149 }
David Tolnay7ac699c2018-08-24 14:00:58 -04003150 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003151 _visitor.visit_ident(&_i.ident);
3152 _visitor.visit_generics(&_i.generics);
3153 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003154 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003155 };
3156 for el in Punctuated::pairs(&_i.bounds) {
3157 let it = el.value();
3158 _visitor.visit_type_param_bound(it)
3159 }
3160 if let Some(ref it) = _i.default {
David Tolnay7ac699c2018-08-24 14:00:58 -04003161 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003162 _visitor.visit_type(&(it).1);
3163 };
David Tolnay7ac699c2018-08-24 14:00:58 -04003164 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003165}
David Tolnay8c81f622018-07-31 23:34:35 -07003166#[cfg(feature = "full")]
3167pub fn visit_trait_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
3168 _visitor: &mut V,
3169 _i: &'ast TraitItemVerbatim,
3170) {
David Tolnay6af48992018-08-01 11:16:28 -07003171 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05003172}
David Tolnay8c81f622018-07-31 23:34:35 -07003173#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003174pub fn visit_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Type) {
Nika Layzell27726662017-10-24 23:16:35 -04003175 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003176 Type::Slice(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003177 _visitor.visit_type_slice(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003178 }
David Tolnay8c81f622018-07-31 23:34:35 -07003179 Type::Array(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003180 _visitor.visit_type_array(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003181 }
David Tolnay8c81f622018-07-31 23:34:35 -07003182 Type::Ptr(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003183 _visitor.visit_type_ptr(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003184 }
David Tolnay8c81f622018-07-31 23:34:35 -07003185 Type::Reference(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003186 _visitor.visit_type_reference(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003187 }
David Tolnay8c81f622018-07-31 23:34:35 -07003188 Type::BareFn(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003189 _visitor.visit_type_bare_fn(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003190 }
David Tolnay8c81f622018-07-31 23:34:35 -07003191 Type::Never(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003192 _visitor.visit_type_never(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003193 }
David Tolnay8c81f622018-07-31 23:34:35 -07003194 Type::Tuple(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003195 _visitor.visit_type_tuple(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003196 }
David Tolnay8c81f622018-07-31 23:34:35 -07003197 Type::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003198 _visitor.visit_type_path(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003199 }
David Tolnay8c81f622018-07-31 23:34:35 -07003200 Type::TraitObject(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003201 _visitor.visit_type_trait_object(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003202 }
David Tolnay8c81f622018-07-31 23:34:35 -07003203 Type::ImplTrait(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003204 _visitor.visit_type_impl_trait(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003205 }
David Tolnay8c81f622018-07-31 23:34:35 -07003206 Type::Paren(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003207 _visitor.visit_type_paren(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003208 }
David Tolnay8c81f622018-07-31 23:34:35 -07003209 Type::Group(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003210 _visitor.visit_type_group(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003211 }
David Tolnay8c81f622018-07-31 23:34:35 -07003212 Type::Infer(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003213 _visitor.visit_type_infer(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003214 }
David Tolnay8c81f622018-07-31 23:34:35 -07003215 Type::Macro(ref _binding_0) => {
David Tolnay323279a2017-12-29 11:26:32 -05003216 _visitor.visit_type_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003217 }
David Tolnay8c81f622018-07-31 23:34:35 -07003218 Type::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05003219 _visitor.visit_type_verbatim(_binding_0);
3220 }
Nika Layzell27726662017-10-24 23:16:35 -04003221 }
3222}
David Tolnay8c81f622018-07-31 23:34:35 -07003223#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003224pub fn visit_type_array<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeArray) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003225 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003226 _visitor.visit_type(&*_i.elem);
David Tolnay7ac699c2018-08-24 14:00:58 -04003227 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003228 _visitor.visit_expr(&_i.len);
Nika Layzell27726662017-10-24 23:16:35 -04003229}
David Tolnay8c81f622018-07-31 23:34:35 -07003230#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003231pub fn visit_type_bare_fn<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeBareFn) {
David Tolnay8c81f622018-07-31 23:34:35 -07003232 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04003233 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003234 };
3235 if let Some(ref it) = _i.abi {
3236 _visitor.visit_abi(it)
3237 };
David Tolnay7ac699c2018-08-24 14:00:58 -04003238 tokens_helper(_visitor, &_i.fn_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003239 if let Some(ref it) = _i.lifetimes {
3240 _visitor.visit_bound_lifetimes(it)
3241 };
David Tolnay7ac699c2018-08-24 14:00:58 -04003242 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003243 for el in Punctuated::pairs(&_i.inputs) {
3244 let it = el.value();
3245 _visitor.visit_bare_fn_arg(it)
3246 }
3247 if let Some(ref it) = _i.variadic {
David Tolnay7ac699c2018-08-24 14:00:58 -04003248 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003249 };
3250 _visitor.visit_return_type(&_i.output);
Nika Layzell27726662017-10-24 23:16:35 -04003251}
David Tolnay8c81f622018-07-31 23:34:35 -07003252#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003253pub fn visit_type_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeGroup) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003254 tokens_helper(_visitor, &_i.group_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003255 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003256}
David Tolnay8c81f622018-07-31 23:34:35 -07003257#[cfg(any(feature = "full", feature = "derive"))]
3258pub fn visit_type_impl_trait<'ast, V: Visit<'ast> + ?Sized>(
3259 _visitor: &mut V,
3260 _i: &'ast TypeImplTrait,
3261) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003262 tokens_helper(_visitor, &_i.impl_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003263 for el in Punctuated::pairs(&_i.bounds) {
3264 let it = el.value();
3265 _visitor.visit_type_param_bound(it)
3266 }
Nika Layzell27726662017-10-24 23:16:35 -04003267}
David Tolnay8c81f622018-07-31 23:34:35 -07003268#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003269pub fn visit_type_infer<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeInfer) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003270 tokens_helper(_visitor, &_i.underscore_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003271}
David Tolnay8c81f622018-07-31 23:34:35 -07003272#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003273pub fn visit_type_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeMacro) {
David Tolnay8c81f622018-07-31 23:34:35 -07003274 _visitor.visit_macro(&_i.mac);
David Tolnay323279a2017-12-29 11:26:32 -05003275}
David Tolnay8c81f622018-07-31 23:34:35 -07003276#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003277pub fn visit_type_never<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeNever) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003278 tokens_helper(_visitor, &_i.bang_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003279}
David Tolnay8c81f622018-07-31 23:34:35 -07003280#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003281pub fn visit_type_param<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeParam) {
David Tolnay8c81f622018-07-31 23:34:35 -07003282 for it in &_i.attrs {
3283 _visitor.visit_attribute(it)
3284 }
3285 _visitor.visit_ident(&_i.ident);
3286 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003287 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003288 };
3289 for el in Punctuated::pairs(&_i.bounds) {
3290 let it = el.value();
3291 _visitor.visit_type_param_bound(it)
3292 }
3293 if let Some(ref it) = _i.eq_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003294 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003295 };
3296 if let Some(ref it) = _i.default {
3297 _visitor.visit_type(it)
3298 };
Nika Layzell27726662017-10-24 23:16:35 -04003299}
David Tolnay8c81f622018-07-31 23:34:35 -07003300#[cfg(any(feature = "full", feature = "derive"))]
3301pub fn visit_type_param_bound<'ast, V: Visit<'ast> + ?Sized>(
3302 _visitor: &mut V,
3303 _i: &'ast TypeParamBound,
3304) {
Nika Layzell27726662017-10-24 23:16:35 -04003305 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003306 TypeParamBound::Trait(ref _binding_0) => {
David Tolnay40fb8ce2018-01-02 10:53:46 -08003307 _visitor.visit_trait_bound(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003308 }
David Tolnay8c81f622018-07-31 23:34:35 -07003309 TypeParamBound::Lifetime(ref _binding_0) => {
David Tolnay4ba63a02017-12-28 15:53:05 -05003310 _visitor.visit_lifetime(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003311 }
3312 }
3313}
David Tolnay8c81f622018-07-31 23:34:35 -07003314#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003315pub fn visit_type_paren<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeParen) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003316 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003317 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003318}
David Tolnay8c81f622018-07-31 23:34:35 -07003319#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003320pub fn visit_type_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypePath) {
David Tolnay8c81f622018-07-31 23:34:35 -07003321 if let Some(ref it) = _i.qself {
3322 _visitor.visit_qself(it)
3323 };
3324 _visitor.visit_path(&_i.path);
Nika Layzell27726662017-10-24 23:16:35 -04003325}
David Tolnay8c81f622018-07-31 23:34:35 -07003326#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003327pub fn visit_type_ptr<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypePtr) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003328 tokens_helper(_visitor, &_i.star_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003329 if let Some(ref it) = _i.const_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003330 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003331 };
3332 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04003333 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003334 };
3335 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003336}
David Tolnay8c81f622018-07-31 23:34:35 -07003337#[cfg(any(feature = "full", feature = "derive"))]
3338pub fn visit_type_reference<'ast, V: Visit<'ast> + ?Sized>(
3339 _visitor: &mut V,
3340 _i: &'ast TypeReference,
3341) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003342 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003343 if let Some(ref it) = _i.lifetime {
3344 _visitor.visit_lifetime(it)
3345 };
3346 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04003347 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003348 };
3349 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003350}
David Tolnay8c81f622018-07-31 23:34:35 -07003351#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003352pub fn visit_type_slice<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeSlice) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003353 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003354 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003355}
David Tolnay8c81f622018-07-31 23:34:35 -07003356#[cfg(any(feature = "full", feature = "derive"))]
3357pub fn visit_type_trait_object<'ast, V: Visit<'ast> + ?Sized>(
3358 _visitor: &mut V,
3359 _i: &'ast TypeTraitObject,
3360) {
3361 if let Some(ref it) = _i.dyn_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003362 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003363 };
3364 for el in Punctuated::pairs(&_i.bounds) {
3365 let it = el.value();
3366 _visitor.visit_type_param_bound(it)
3367 }
Nika Layzell27726662017-10-24 23:16:35 -04003368}
David Tolnay8c81f622018-07-31 23:34:35 -07003369#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003370pub fn visit_type_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeTuple) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003371 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003372 for el in Punctuated::pairs(&_i.elems) {
3373 let it = el.value();
3374 _visitor.visit_type(it)
3375 }
Nika Layzell27726662017-10-24 23:16:35 -04003376}
David Tolnay8c81f622018-07-31 23:34:35 -07003377#[cfg(any(feature = "full", feature = "derive"))]
3378pub fn visit_type_verbatim<'ast, V: Visit<'ast> + ?Sized>(
3379 _visitor: &mut V,
3380 _i: &'ast TypeVerbatim,
3381) {
David Tolnay6af48992018-08-01 11:16:28 -07003382 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05003383}
David Tolnay8c81f622018-07-31 23:34:35 -07003384#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003385pub fn visit_un_op<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UnOp) {
Nika Layzell27726662017-10-24 23:16:35 -04003386 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003387 UnOp::Deref(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003388 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003389 }
David Tolnay8c81f622018-07-31 23:34:35 -07003390 UnOp::Not(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003391 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003392 }
David Tolnay8c81f622018-07-31 23:34:35 -07003393 UnOp::Neg(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003394 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003395 }
3396 }
3397}
David Tolnay8c81f622018-07-31 23:34:35 -07003398#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003399pub fn visit_use_glob<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseGlob) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003400 tokens_helper(_visitor, &_i.star_token.spans);
David Tolnay5f332a92017-12-26 00:42:45 -05003401}
David Tolnay8c81f622018-07-31 23:34:35 -07003402#[cfg(feature = "full")]
David Tolnayd97a7d22018-03-31 19:17:01 +02003403pub fn visit_use_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseGroup) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003404 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003405 for el in Punctuated::pairs(&_i.items) {
3406 let it = el.value();
3407 _visitor.visit_use_tree(it)
3408 }
David Tolnay5f332a92017-12-26 00:42:45 -05003409}
David Tolnay8c81f622018-07-31 23:34:35 -07003410#[cfg(feature = "full")]
David Tolnayd97a7d22018-03-31 19:17:01 +02003411pub fn visit_use_name<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseName) {
David Tolnay8c81f622018-07-31 23:34:35 -07003412 _visitor.visit_ident(&_i.ident);
David Tolnayd97a7d22018-03-31 19:17:01 +02003413}
David Tolnay8c81f622018-07-31 23:34:35 -07003414#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003415pub fn visit_use_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UsePath) {
David Tolnay8c81f622018-07-31 23:34:35 -07003416 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04003417 tokens_helper(_visitor, &_i.colon2_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003418 _visitor.visit_use_tree(&*_i.tree);
David Tolnayd97a7d22018-03-31 19:17:01 +02003419}
David Tolnay8c81f622018-07-31 23:34:35 -07003420#[cfg(feature = "full")]
David Tolnayd97a7d22018-03-31 19:17:01 +02003421pub fn visit_use_rename<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseRename) {
David Tolnay8c81f622018-07-31 23:34:35 -07003422 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04003423 tokens_helper(_visitor, &_i.as_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003424 _visitor.visit_ident(&_i.rename);
David Tolnay5f332a92017-12-26 00:42:45 -05003425}
David Tolnay8c81f622018-07-31 23:34:35 -07003426#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003427pub fn visit_use_tree<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseTree) {
David Tolnay5f332a92017-12-26 00:42:45 -05003428 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003429 UseTree::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003430 _visitor.visit_use_path(_binding_0);
David Tolnay5f332a92017-12-26 00:42:45 -05003431 }
David Tolnay8c81f622018-07-31 23:34:35 -07003432 UseTree::Name(ref _binding_0) => {
David Tolnayd97a7d22018-03-31 19:17:01 +02003433 _visitor.visit_use_name(_binding_0);
3434 }
David Tolnay8c81f622018-07-31 23:34:35 -07003435 UseTree::Rename(ref _binding_0) => {
David Tolnayd97a7d22018-03-31 19:17:01 +02003436 _visitor.visit_use_rename(_binding_0);
3437 }
David Tolnay8c81f622018-07-31 23:34:35 -07003438 UseTree::Glob(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003439 _visitor.visit_use_glob(_binding_0);
David Tolnay5f332a92017-12-26 00:42:45 -05003440 }
David Tolnay8c81f622018-07-31 23:34:35 -07003441 UseTree::Group(ref _binding_0) => {
David Tolnayd97a7d22018-03-31 19:17:01 +02003442 _visitor.visit_use_group(_binding_0);
David Tolnay5f332a92017-12-26 00:42:45 -05003443 }
3444 }
3445}
David Tolnay8c81f622018-07-31 23:34:35 -07003446#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003447pub fn visit_variant<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Variant) {
David Tolnay8c81f622018-07-31 23:34:35 -07003448 for it in &_i.attrs {
3449 _visitor.visit_attribute(it)
3450 }
3451 _visitor.visit_ident(&_i.ident);
3452 _visitor.visit_fields(&_i.fields);
3453 if let Some(ref it) = _i.discriminant {
David Tolnay7ac699c2018-08-24 14:00:58 -04003454 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003455 _visitor.visit_expr(&(it).1);
3456 };
Nika Layzell27726662017-10-24 23:16:35 -04003457}
David Tolnay8c81f622018-07-31 23:34:35 -07003458#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003459pub fn visit_vis_crate<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast VisCrate) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003460 tokens_helper(_visitor, &_i.crate_token.span);
Nika Layzell27726662017-10-24 23:16:35 -04003461}
David Tolnay8c81f622018-07-31 23:34:35 -07003462#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003463pub fn visit_vis_public<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast VisPublic) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003464 tokens_helper(_visitor, &_i.pub_token.span);
Nika Layzell27726662017-10-24 23:16:35 -04003465}
David Tolnay8c81f622018-07-31 23:34:35 -07003466#[cfg(any(feature = "full", feature = "derive"))]
3467pub fn visit_vis_restricted<'ast, V: Visit<'ast> + ?Sized>(
3468 _visitor: &mut V,
3469 _i: &'ast VisRestricted,
3470) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003471 tokens_helper(_visitor, &_i.pub_token.span);
3472 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003473 if let Some(ref it) = _i.in_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003474 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003475 };
3476 _visitor.visit_path(&*_i.path);
Nika Layzell27726662017-10-24 23:16:35 -04003477}
David Tolnay8c81f622018-07-31 23:34:35 -07003478#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003479pub fn visit_visibility<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Visibility) {
Nika Layzell27726662017-10-24 23:16:35 -04003480 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003481 Visibility::Public(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003482 _visitor.visit_vis_public(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003483 }
David Tolnay8c81f622018-07-31 23:34:35 -07003484 Visibility::Crate(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003485 _visitor.visit_vis_crate(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003486 }
David Tolnay8c81f622018-07-31 23:34:35 -07003487 Visibility::Restricted(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003488 _visitor.visit_vis_restricted(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003489 }
David Tolnay8c81f622018-07-31 23:34:35 -07003490 Visibility::Inherited => {}
Nika Layzell27726662017-10-24 23:16:35 -04003491 }
3492}
David Tolnay8c81f622018-07-31 23:34:35 -07003493#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003494pub fn visit_where_clause<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast WhereClause) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003495 tokens_helper(_visitor, &_i.where_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003496 for el in Punctuated::pairs(&_i.predicates) {
3497 let it = el.value();
3498 _visitor.visit_where_predicate(it)
3499 }
Nika Layzell27726662017-10-24 23:16:35 -04003500}
David Tolnay8c81f622018-07-31 23:34:35 -07003501#[cfg(any(feature = "full", feature = "derive"))]
3502pub fn visit_where_predicate<'ast, V: Visit<'ast> + ?Sized>(
3503 _visitor: &mut V,
3504 _i: &'ast WherePredicate,
3505) {
Nika Layzell27726662017-10-24 23:16:35 -04003506 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003507 WherePredicate::Type(ref _binding_0) => {
David Tolnayd4add852018-01-01 20:13:24 -08003508 _visitor.visit_predicate_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003509 }
David Tolnay8c81f622018-07-31 23:34:35 -07003510 WherePredicate::Lifetime(ref _binding_0) => {
David Tolnayd4add852018-01-01 20:13:24 -08003511 _visitor.visit_predicate_lifetime(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003512 }
David Tolnay8c81f622018-07-31 23:34:35 -07003513 WherePredicate::Eq(ref _binding_0) => {
David Tolnayd4add852018-01-01 20:13:24 -08003514 _visitor.visit_predicate_eq(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003515 }
3516 }
3517}