blob: c1aa751015eb9713913a3680117d7506fd7b69db [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 Tolnay6af48992018-08-01 11:16:28 -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 Tolnay6af48992018-08-01 11:16:28 -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 {
24 ( $ ( $ tt : tt ) * ) => {};
25}
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 }
135 #[cfg(any(feature = "full", feature = "derive"))]
136 fn visit_expr_binary(&mut self, i: &'ast ExprBinary) {
137 visit_expr_binary(self, i)
138 }
139 #[cfg(feature = "full")]
140 #[cfg(any(feature = "full", feature = "derive"))]
141 fn visit_expr_block(&mut self, i: &'ast ExprBlock) {
142 visit_expr_block(self, i)
143 }
144 #[cfg(feature = "full")]
145 #[cfg(any(feature = "full", feature = "derive"))]
146 fn visit_expr_box(&mut self, i: &'ast ExprBox) {
147 visit_expr_box(self, i)
148 }
149 #[cfg(feature = "full")]
150 #[cfg(any(feature = "full", feature = "derive"))]
151 fn visit_expr_break(&mut self, i: &'ast ExprBreak) {
152 visit_expr_break(self, i)
153 }
154 #[cfg(any(feature = "full", feature = "derive"))]
155 fn visit_expr_call(&mut self, i: &'ast ExprCall) {
156 visit_expr_call(self, i)
157 }
158 #[cfg(any(feature = "full", feature = "derive"))]
159 fn visit_expr_cast(&mut self, i: &'ast ExprCast) {
160 visit_expr_cast(self, i)
161 }
162 #[cfg(feature = "full")]
163 #[cfg(any(feature = "full", feature = "derive"))]
164 fn visit_expr_catch(&mut self, i: &'ast ExprCatch) {
165 visit_expr_catch(self, i)
166 }
167 #[cfg(feature = "full")]
168 #[cfg(any(feature = "full", feature = "derive"))]
169 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"))]
274 fn visit_expr_tuple(&mut self, i: &'ast ExprTuple) {
275 visit_expr_tuple(self, i)
276 }
277 #[cfg(feature = "full")]
278 #[cfg(any(feature = "full", feature = "derive"))]
279 fn visit_expr_type(&mut self, i: &'ast ExprType) {
280 visit_expr_type(self, i)
281 }
282 #[cfg(any(feature = "full", feature = "derive"))]
283 fn visit_expr_unary(&mut self, i: &'ast ExprUnary) {
284 visit_expr_unary(self, i)
285 }
286 #[cfg(feature = "full")]
287 #[cfg(any(feature = "full", feature = "derive"))]
288 fn visit_expr_unsafe(&mut self, i: &'ast ExprUnsafe) {
289 visit_expr_unsafe(self, i)
290 }
291 #[cfg(any(feature = "full", feature = "derive"))]
292 fn visit_expr_verbatim(&mut self, i: &'ast ExprVerbatim) {
293 visit_expr_verbatim(self, i)
294 }
295 #[cfg(feature = "full")]
296 #[cfg(any(feature = "full", feature = "derive"))]
297 fn visit_expr_while(&mut self, i: &'ast ExprWhile) {
298 visit_expr_while(self, i)
299 }
300 #[cfg(feature = "full")]
301 #[cfg(any(feature = "full", feature = "derive"))]
302 fn visit_expr_while_let(&mut self, i: &'ast ExprWhileLet) {
303 visit_expr_while_let(self, i)
304 }
305 #[cfg(feature = "full")]
306 #[cfg(any(feature = "full", feature = "derive"))]
307 fn visit_expr_yield(&mut self, i: &'ast ExprYield) {
308 visit_expr_yield(self, i)
309 }
310 #[cfg(any(feature = "full", feature = "derive"))]
311 fn visit_field(&mut self, i: &'ast Field) {
312 visit_field(self, i)
313 }
314 #[cfg(any(feature = "full", feature = "derive"))]
315 #[cfg(feature = "full")]
316 fn visit_field_pat(&mut self, i: &'ast FieldPat) {
317 visit_field_pat(self, i)
318 }
319 #[cfg(any(feature = "full", feature = "derive"))]
320 #[cfg(feature = "full")]
321 fn visit_field_value(&mut self, i: &'ast FieldValue) {
322 visit_field_value(self, i)
323 }
324 #[cfg(any(feature = "full", feature = "derive"))]
325 fn visit_fields(&mut self, i: &'ast Fields) {
326 visit_fields(self, i)
327 }
328 #[cfg(any(feature = "full", feature = "derive"))]
329 fn visit_fields_named(&mut self, i: &'ast FieldsNamed) {
330 visit_fields_named(self, i)
331 }
332 #[cfg(any(feature = "full", feature = "derive"))]
333 fn visit_fields_unnamed(&mut self, i: &'ast FieldsUnnamed) {
334 visit_fields_unnamed(self, i)
335 }
336 #[cfg(feature = "full")]
337 fn visit_file(&mut self, i: &'ast File) {
338 visit_file(self, i)
339 }
340 #[cfg(feature = "full")]
341 fn visit_fn_arg(&mut self, i: &'ast FnArg) {
342 visit_fn_arg(self, i)
343 }
344 #[cfg(feature = "full")]
345 fn visit_fn_decl(&mut self, i: &'ast FnDecl) {
346 visit_fn_decl(self, i)
347 }
348 #[cfg(feature = "full")]
349 fn visit_foreign_item(&mut self, i: &'ast ForeignItem) {
350 visit_foreign_item(self, i)
351 }
352 #[cfg(feature = "full")]
353 fn visit_foreign_item_fn(&mut self, i: &'ast ForeignItemFn) {
354 visit_foreign_item_fn(self, i)
355 }
356 #[cfg(feature = "full")]
357 fn visit_foreign_item_static(&mut self, i: &'ast ForeignItemStatic) {
358 visit_foreign_item_static(self, i)
359 }
360 #[cfg(feature = "full")]
361 fn visit_foreign_item_type(&mut self, i: &'ast ForeignItemType) {
362 visit_foreign_item_type(self, i)
363 }
364 #[cfg(feature = "full")]
365 fn visit_foreign_item_verbatim(&mut self, i: &'ast ForeignItemVerbatim) {
366 visit_foreign_item_verbatim(self, i)
367 }
368 #[cfg(any(feature = "full", feature = "derive"))]
369 fn visit_generic_argument(&mut self, i: &'ast GenericArgument) {
370 visit_generic_argument(self, i)
371 }
372 #[cfg(any(feature = "full", feature = "derive"))]
373 #[cfg(feature = "full")]
374 fn visit_generic_method_argument(&mut self, i: &'ast GenericMethodArgument) {
375 visit_generic_method_argument(self, i)
376 }
377 #[cfg(any(feature = "full", feature = "derive"))]
378 fn visit_generic_param(&mut self, i: &'ast GenericParam) {
379 visit_generic_param(self, i)
380 }
381 #[cfg(any(feature = "full", feature = "derive"))]
382 fn visit_generics(&mut self, i: &'ast Generics) {
383 visit_generics(self, i)
384 }
David Tolnay8c81f622018-07-31 23:34:35 -0700385 fn visit_ident(&mut self, i: &'ast Ident) {
386 visit_ident(self, i)
387 }
388 #[cfg(feature = "full")]
389 fn visit_impl_item(&mut self, i: &'ast ImplItem) {
390 visit_impl_item(self, i)
391 }
392 #[cfg(feature = "full")]
393 fn visit_impl_item_const(&mut self, i: &'ast ImplItemConst) {
394 visit_impl_item_const(self, i)
395 }
396 #[cfg(feature = "full")]
397 fn visit_impl_item_macro(&mut self, i: &'ast ImplItemMacro) {
398 visit_impl_item_macro(self, i)
399 }
400 #[cfg(feature = "full")]
401 fn visit_impl_item_method(&mut self, i: &'ast ImplItemMethod) {
402 visit_impl_item_method(self, i)
403 }
404 #[cfg(feature = "full")]
405 fn visit_impl_item_type(&mut self, i: &'ast ImplItemType) {
406 visit_impl_item_type(self, i)
407 }
408 #[cfg(feature = "full")]
409 fn visit_impl_item_verbatim(&mut self, i: &'ast ImplItemVerbatim) {
410 visit_impl_item_verbatim(self, i)
411 }
412 #[cfg(any(feature = "full", feature = "derive"))]
413 fn visit_index(&mut self, i: &'ast Index) {
414 visit_index(self, i)
415 }
416 #[cfg(feature = "full")]
417 fn visit_item(&mut self, i: &'ast Item) {
418 visit_item(self, i)
419 }
420 #[cfg(feature = "full")]
421 fn visit_item_const(&mut self, i: &'ast ItemConst) {
422 visit_item_const(self, i)
423 }
424 #[cfg(feature = "full")]
425 fn visit_item_enum(&mut self, i: &'ast ItemEnum) {
426 visit_item_enum(self, i)
427 }
428 #[cfg(feature = "full")]
429 fn visit_item_extern_crate(&mut self, i: &'ast ItemExternCrate) {
430 visit_item_extern_crate(self, i)
431 }
432 #[cfg(feature = "full")]
433 fn visit_item_fn(&mut self, i: &'ast ItemFn) {
434 visit_item_fn(self, i)
435 }
436 #[cfg(feature = "full")]
437 fn visit_item_foreign_mod(&mut self, i: &'ast ItemForeignMod) {
438 visit_item_foreign_mod(self, i)
439 }
440 #[cfg(feature = "full")]
441 fn visit_item_impl(&mut self, i: &'ast ItemImpl) {
442 visit_item_impl(self, i)
443 }
444 #[cfg(feature = "full")]
445 fn visit_item_macro(&mut self, i: &'ast ItemMacro) {
446 visit_item_macro(self, i)
447 }
448 #[cfg(feature = "full")]
449 fn visit_item_macro2(&mut self, i: &'ast ItemMacro2) {
450 visit_item_macro2(self, i)
451 }
452 #[cfg(feature = "full")]
453 fn visit_item_mod(&mut self, i: &'ast ItemMod) {
454 visit_item_mod(self, i)
455 }
456 #[cfg(feature = "full")]
457 fn visit_item_static(&mut self, i: &'ast ItemStatic) {
458 visit_item_static(self, i)
459 }
460 #[cfg(feature = "full")]
461 fn visit_item_struct(&mut self, i: &'ast ItemStruct) {
462 visit_item_struct(self, i)
463 }
464 #[cfg(feature = "full")]
465 fn visit_item_trait(&mut self, i: &'ast ItemTrait) {
466 visit_item_trait(self, i)
467 }
468 #[cfg(feature = "full")]
469 fn visit_item_type(&mut self, i: &'ast ItemType) {
470 visit_item_type(self, i)
471 }
472 #[cfg(feature = "full")]
473 fn visit_item_union(&mut self, i: &'ast ItemUnion) {
474 visit_item_union(self, i)
475 }
476 #[cfg(feature = "full")]
477 fn visit_item_use(&mut self, i: &'ast ItemUse) {
478 visit_item_use(self, i)
479 }
480 #[cfg(feature = "full")]
481 fn visit_item_verbatim(&mut self, i: &'ast ItemVerbatim) {
482 visit_item_verbatim(self, i)
483 }
484 #[cfg(any(feature = "full", feature = "derive"))]
485 #[cfg(feature = "full")]
486 fn visit_label(&mut self, i: &'ast Label) {
487 visit_label(self, i)
488 }
489 #[cfg(any(feature = "full", feature = "derive"))]
490 fn visit_lifetime(&mut self, i: &'ast Lifetime) {
491 visit_lifetime(self, i)
492 }
493 #[cfg(any(feature = "full", feature = "derive"))]
494 fn visit_lifetime_def(&mut self, i: &'ast LifetimeDef) {
495 visit_lifetime_def(self, i)
496 }
497 #[cfg(any(feature = "full", feature = "derive"))]
498 fn visit_lit(&mut self, i: &'ast Lit) {
499 visit_lit(self, i)
500 }
501 #[cfg(any(feature = "full", feature = "derive"))]
502 fn visit_lit_bool(&mut self, i: &'ast LitBool) {
503 visit_lit_bool(self, i)
504 }
505 #[cfg(any(feature = "full", feature = "derive"))]
506 fn visit_lit_byte(&mut self, i: &'ast LitByte) {
507 visit_lit_byte(self, i)
508 }
509 #[cfg(any(feature = "full", feature = "derive"))]
510 fn visit_lit_byte_str(&mut self, i: &'ast LitByteStr) {
511 visit_lit_byte_str(self, i)
512 }
513 #[cfg(any(feature = "full", feature = "derive"))]
514 fn visit_lit_char(&mut self, i: &'ast LitChar) {
515 visit_lit_char(self, i)
516 }
517 #[cfg(any(feature = "full", feature = "derive"))]
518 fn visit_lit_float(&mut self, i: &'ast LitFloat) {
519 visit_lit_float(self, i)
520 }
521 #[cfg(any(feature = "full", feature = "derive"))]
522 fn visit_lit_int(&mut self, i: &'ast LitInt) {
523 visit_lit_int(self, i)
524 }
525 #[cfg(any(feature = "full", feature = "derive"))]
526 fn visit_lit_str(&mut self, i: &'ast LitStr) {
527 visit_lit_str(self, i)
528 }
529 #[cfg(any(feature = "full", feature = "derive"))]
530 fn visit_lit_verbatim(&mut self, i: &'ast LitVerbatim) {
531 visit_lit_verbatim(self, i)
532 }
533 #[cfg(any(feature = "full", feature = "derive"))]
534 #[cfg(feature = "full")]
535 fn visit_local(&mut self, i: &'ast Local) {
536 visit_local(self, i)
537 }
538 #[cfg(any(feature = "full", feature = "derive"))]
539 fn visit_macro(&mut self, i: &'ast Macro) {
540 visit_macro(self, i)
541 }
542 #[cfg(any(feature = "full", feature = "derive"))]
543 fn visit_macro_delimiter(&mut self, i: &'ast MacroDelimiter) {
544 visit_macro_delimiter(self, i)
545 }
546 #[cfg(any(feature = "full", feature = "derive"))]
547 fn visit_member(&mut self, i: &'ast Member) {
548 visit_member(self, i)
549 }
550 #[cfg(any(feature = "full", feature = "derive"))]
551 fn visit_meta(&mut self, i: &'ast Meta) {
552 visit_meta(self, i)
553 }
554 #[cfg(any(feature = "full", feature = "derive"))]
555 fn visit_meta_list(&mut self, i: &'ast MetaList) {
556 visit_meta_list(self, i)
557 }
558 #[cfg(any(feature = "full", feature = "derive"))]
559 fn visit_meta_name_value(&mut self, i: &'ast MetaNameValue) {
560 visit_meta_name_value(self, i)
561 }
562 #[cfg(feature = "full")]
563 fn visit_method_sig(&mut self, i: &'ast MethodSig) {
564 visit_method_sig(self, i)
565 }
566 #[cfg(any(feature = "full", feature = "derive"))]
567 #[cfg(feature = "full")]
568 fn visit_method_turbofish(&mut self, i: &'ast MethodTurbofish) {
569 visit_method_turbofish(self, i)
570 }
571 #[cfg(any(feature = "full", feature = "derive"))]
572 fn visit_nested_meta(&mut self, i: &'ast NestedMeta) {
573 visit_nested_meta(self, i)
574 }
575 #[cfg(any(feature = "full", feature = "derive"))]
576 fn visit_parenthesized_generic_arguments(&mut self, i: &'ast ParenthesizedGenericArguments) {
577 visit_parenthesized_generic_arguments(self, i)
578 }
579 #[cfg(any(feature = "full", feature = "derive"))]
580 #[cfg(feature = "full")]
581 fn visit_pat(&mut self, i: &'ast Pat) {
582 visit_pat(self, i)
583 }
584 #[cfg(any(feature = "full", feature = "derive"))]
585 #[cfg(feature = "full")]
586 fn visit_pat_box(&mut self, i: &'ast PatBox) {
587 visit_pat_box(self, i)
588 }
589 #[cfg(any(feature = "full", feature = "derive"))]
590 #[cfg(feature = "full")]
591 fn visit_pat_ident(&mut self, i: &'ast PatIdent) {
592 visit_pat_ident(self, i)
593 }
594 #[cfg(any(feature = "full", feature = "derive"))]
595 #[cfg(feature = "full")]
596 fn visit_pat_lit(&mut self, i: &'ast PatLit) {
597 visit_pat_lit(self, i)
598 }
599 #[cfg(any(feature = "full", feature = "derive"))]
600 #[cfg(feature = "full")]
601 fn visit_pat_macro(&mut self, i: &'ast PatMacro) {
602 visit_pat_macro(self, i)
603 }
604 #[cfg(any(feature = "full", feature = "derive"))]
605 #[cfg(feature = "full")]
606 fn visit_pat_path(&mut self, i: &'ast PatPath) {
607 visit_pat_path(self, i)
608 }
609 #[cfg(any(feature = "full", feature = "derive"))]
610 #[cfg(feature = "full")]
611 fn visit_pat_range(&mut self, i: &'ast PatRange) {
612 visit_pat_range(self, i)
613 }
614 #[cfg(any(feature = "full", feature = "derive"))]
615 #[cfg(feature = "full")]
616 fn visit_pat_ref(&mut self, i: &'ast PatRef) {
617 visit_pat_ref(self, i)
618 }
619 #[cfg(any(feature = "full", feature = "derive"))]
620 #[cfg(feature = "full")]
621 fn visit_pat_slice(&mut self, i: &'ast PatSlice) {
622 visit_pat_slice(self, i)
623 }
624 #[cfg(any(feature = "full", feature = "derive"))]
625 #[cfg(feature = "full")]
626 fn visit_pat_struct(&mut self, i: &'ast PatStruct) {
627 visit_pat_struct(self, i)
628 }
629 #[cfg(any(feature = "full", feature = "derive"))]
630 #[cfg(feature = "full")]
631 fn visit_pat_tuple(&mut self, i: &'ast PatTuple) {
632 visit_pat_tuple(self, i)
633 }
634 #[cfg(any(feature = "full", feature = "derive"))]
635 #[cfg(feature = "full")]
636 fn visit_pat_tuple_struct(&mut self, i: &'ast PatTupleStruct) {
637 visit_pat_tuple_struct(self, i)
638 }
639 #[cfg(any(feature = "full", feature = "derive"))]
640 #[cfg(feature = "full")]
641 fn visit_pat_verbatim(&mut self, i: &'ast PatVerbatim) {
642 visit_pat_verbatim(self, i)
643 }
644 #[cfg(any(feature = "full", feature = "derive"))]
645 #[cfg(feature = "full")]
646 fn visit_pat_wild(&mut self, i: &'ast PatWild) {
647 visit_pat_wild(self, i)
648 }
649 #[cfg(any(feature = "full", feature = "derive"))]
650 fn visit_path(&mut self, i: &'ast Path) {
651 visit_path(self, i)
652 }
653 #[cfg(any(feature = "full", feature = "derive"))]
654 fn visit_path_arguments(&mut self, i: &'ast PathArguments) {
655 visit_path_arguments(self, i)
656 }
657 #[cfg(any(feature = "full", feature = "derive"))]
658 fn visit_path_segment(&mut self, i: &'ast PathSegment) {
659 visit_path_segment(self, i)
660 }
661 #[cfg(any(feature = "full", feature = "derive"))]
662 fn visit_predicate_eq(&mut self, i: &'ast PredicateEq) {
663 visit_predicate_eq(self, i)
664 }
665 #[cfg(any(feature = "full", feature = "derive"))]
666 fn visit_predicate_lifetime(&mut self, i: &'ast PredicateLifetime) {
667 visit_predicate_lifetime(self, i)
668 }
669 #[cfg(any(feature = "full", feature = "derive"))]
670 fn visit_predicate_type(&mut self, i: &'ast PredicateType) {
671 visit_predicate_type(self, i)
672 }
673 #[cfg(any(feature = "full", feature = "derive"))]
674 fn visit_qself(&mut self, i: &'ast QSelf) {
675 visit_qself(self, i)
676 }
677 #[cfg(any(feature = "full", feature = "derive"))]
678 #[cfg(feature = "full")]
679 fn visit_range_limits(&mut self, i: &'ast RangeLimits) {
680 visit_range_limits(self, i)
681 }
682 #[cfg(any(feature = "full", feature = "derive"))]
683 fn visit_return_type(&mut self, i: &'ast ReturnType) {
684 visit_return_type(self, i)
685 }
David Tolnay8c81f622018-07-31 23:34:35 -0700686 fn visit_span(&mut self, i: &'ast Span) {
687 visit_span(self, i)
688 }
689 #[cfg(any(feature = "full", feature = "derive"))]
690 #[cfg(feature = "full")]
691 fn visit_stmt(&mut self, i: &'ast Stmt) {
692 visit_stmt(self, i)
693 }
694 #[cfg(any(feature = "full", feature = "derive"))]
695 fn visit_trait_bound(&mut self, i: &'ast TraitBound) {
696 visit_trait_bound(self, i)
697 }
698 #[cfg(any(feature = "full", feature = "derive"))]
699 fn visit_trait_bound_modifier(&mut self, i: &'ast TraitBoundModifier) {
700 visit_trait_bound_modifier(self, i)
701 }
702 #[cfg(feature = "full")]
703 fn visit_trait_item(&mut self, i: &'ast TraitItem) {
704 visit_trait_item(self, i)
705 }
706 #[cfg(feature = "full")]
707 fn visit_trait_item_const(&mut self, i: &'ast TraitItemConst) {
708 visit_trait_item_const(self, i)
709 }
710 #[cfg(feature = "full")]
711 fn visit_trait_item_macro(&mut self, i: &'ast TraitItemMacro) {
712 visit_trait_item_macro(self, i)
713 }
714 #[cfg(feature = "full")]
715 fn visit_trait_item_method(&mut self, i: &'ast TraitItemMethod) {
716 visit_trait_item_method(self, i)
717 }
718 #[cfg(feature = "full")]
719 fn visit_trait_item_type(&mut self, i: &'ast TraitItemType) {
720 visit_trait_item_type(self, i)
721 }
722 #[cfg(feature = "full")]
723 fn visit_trait_item_verbatim(&mut self, i: &'ast TraitItemVerbatim) {
724 visit_trait_item_verbatim(self, i)
725 }
726 #[cfg(any(feature = "full", feature = "derive"))]
727 fn visit_type(&mut self, i: &'ast Type) {
728 visit_type(self, i)
729 }
730 #[cfg(any(feature = "full", feature = "derive"))]
731 fn visit_type_array(&mut self, i: &'ast TypeArray) {
732 visit_type_array(self, i)
733 }
734 #[cfg(any(feature = "full", feature = "derive"))]
735 fn visit_type_bare_fn(&mut self, i: &'ast TypeBareFn) {
736 visit_type_bare_fn(self, i)
737 }
738 #[cfg(any(feature = "full", feature = "derive"))]
739 fn visit_type_group(&mut self, i: &'ast TypeGroup) {
740 visit_type_group(self, i)
741 }
742 #[cfg(any(feature = "full", feature = "derive"))]
743 fn visit_type_impl_trait(&mut self, i: &'ast TypeImplTrait) {
744 visit_type_impl_trait(self, i)
745 }
746 #[cfg(any(feature = "full", feature = "derive"))]
747 fn visit_type_infer(&mut self, i: &'ast TypeInfer) {
748 visit_type_infer(self, i)
749 }
750 #[cfg(any(feature = "full", feature = "derive"))]
751 fn visit_type_macro(&mut self, i: &'ast TypeMacro) {
752 visit_type_macro(self, i)
753 }
754 #[cfg(any(feature = "full", feature = "derive"))]
755 fn visit_type_never(&mut self, i: &'ast TypeNever) {
756 visit_type_never(self, i)
757 }
758 #[cfg(any(feature = "full", feature = "derive"))]
759 fn visit_type_param(&mut self, i: &'ast TypeParam) {
760 visit_type_param(self, i)
761 }
762 #[cfg(any(feature = "full", feature = "derive"))]
763 fn visit_type_param_bound(&mut self, i: &'ast TypeParamBound) {
764 visit_type_param_bound(self, i)
765 }
766 #[cfg(any(feature = "full", feature = "derive"))]
767 fn visit_type_paren(&mut self, i: &'ast TypeParen) {
768 visit_type_paren(self, i)
769 }
770 #[cfg(any(feature = "full", feature = "derive"))]
771 fn visit_type_path(&mut self, i: &'ast TypePath) {
772 visit_type_path(self, i)
773 }
774 #[cfg(any(feature = "full", feature = "derive"))]
775 fn visit_type_ptr(&mut self, i: &'ast TypePtr) {
776 visit_type_ptr(self, i)
777 }
778 #[cfg(any(feature = "full", feature = "derive"))]
779 fn visit_type_reference(&mut self, i: &'ast TypeReference) {
780 visit_type_reference(self, i)
781 }
782 #[cfg(any(feature = "full", feature = "derive"))]
783 fn visit_type_slice(&mut self, i: &'ast TypeSlice) {
784 visit_type_slice(self, i)
785 }
786 #[cfg(any(feature = "full", feature = "derive"))]
787 fn visit_type_trait_object(&mut self, i: &'ast TypeTraitObject) {
788 visit_type_trait_object(self, i)
789 }
790 #[cfg(any(feature = "full", feature = "derive"))]
791 fn visit_type_tuple(&mut self, i: &'ast TypeTuple) {
792 visit_type_tuple(self, i)
793 }
794 #[cfg(any(feature = "full", feature = "derive"))]
795 fn visit_type_verbatim(&mut self, i: &'ast TypeVerbatim) {
796 visit_type_verbatim(self, i)
797 }
798 #[cfg(any(feature = "full", feature = "derive"))]
799 fn visit_un_op(&mut self, i: &'ast UnOp) {
800 visit_un_op(self, i)
801 }
802 #[cfg(feature = "full")]
803 fn visit_use_glob(&mut self, i: &'ast UseGlob) {
804 visit_use_glob(self, i)
805 }
806 #[cfg(feature = "full")]
807 fn visit_use_group(&mut self, i: &'ast UseGroup) {
808 visit_use_group(self, i)
809 }
810 #[cfg(feature = "full")]
811 fn visit_use_name(&mut self, i: &'ast UseName) {
812 visit_use_name(self, i)
813 }
814 #[cfg(feature = "full")]
815 fn visit_use_path(&mut self, i: &'ast UsePath) {
816 visit_use_path(self, i)
817 }
818 #[cfg(feature = "full")]
819 fn visit_use_rename(&mut self, i: &'ast UseRename) {
820 visit_use_rename(self, i)
821 }
822 #[cfg(feature = "full")]
823 fn visit_use_tree(&mut self, i: &'ast UseTree) {
824 visit_use_tree(self, i)
825 }
826 #[cfg(any(feature = "full", feature = "derive"))]
827 fn visit_variant(&mut self, i: &'ast Variant) {
828 visit_variant(self, i)
829 }
830 #[cfg(any(feature = "full", feature = "derive"))]
831 fn visit_vis_crate(&mut self, i: &'ast VisCrate) {
832 visit_vis_crate(self, i)
833 }
834 #[cfg(any(feature = "full", feature = "derive"))]
835 fn visit_vis_public(&mut self, i: &'ast VisPublic) {
836 visit_vis_public(self, i)
837 }
838 #[cfg(any(feature = "full", feature = "derive"))]
839 fn visit_vis_restricted(&mut self, i: &'ast VisRestricted) {
840 visit_vis_restricted(self, i)
841 }
842 #[cfg(any(feature = "full", feature = "derive"))]
843 fn visit_visibility(&mut self, i: &'ast Visibility) {
844 visit_visibility(self, i)
845 }
846 #[cfg(any(feature = "full", feature = "derive"))]
847 fn visit_where_clause(&mut self, i: &'ast WhereClause) {
848 visit_where_clause(self, i)
849 }
850 #[cfg(any(feature = "full", feature = "derive"))]
851 fn visit_where_predicate(&mut self, i: &'ast WherePredicate) {
852 visit_where_predicate(self, i)
853 }
Nika Layzell27726662017-10-24 23:16:35 -0400854}
David Tolnay8c81f622018-07-31 23:34:35 -0700855#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800856pub fn visit_abi<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Abi) {
David Tolnay8c81f622018-07-31 23:34:35 -0700857 tokens_helper(_visitor, &(_i.extern_token).0);
858 if let Some(ref it) = _i.name {
859 _visitor.visit_lit_str(it)
860 };
Nika Layzell27726662017-10-24 23:16:35 -0400861}
David Tolnay8c81f622018-07-31 23:34:35 -0700862#[cfg(any(feature = "full", feature = "derive"))]
863pub fn visit_angle_bracketed_generic_arguments<'ast, V: Visit<'ast> + ?Sized>(
864 _visitor: &mut V,
865 _i: &'ast AngleBracketedGenericArguments,
866) {
867 if let Some(ref it) = _i.colon2_token {
868 tokens_helper(_visitor, &(it).0)
869 };
870 tokens_helper(_visitor, &(_i.lt_token).0);
871 for el in Punctuated::pairs(&_i.args) {
872 let it = el.value();
873 _visitor.visit_generic_argument(it)
874 }
875 tokens_helper(_visitor, &(_i.gt_token).0);
Nika Layzell27726662017-10-24 23:16:35 -0400876}
David Tolnay8c81f622018-07-31 23:34:35 -0700877#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800878pub fn visit_arg_captured<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ArgCaptured) {
David Tolnay8c81f622018-07-31 23:34:35 -0700879 _visitor.visit_pat(&_i.pat);
880 tokens_helper(_visitor, &(_i.colon_token).0);
881 _visitor.visit_type(&_i.ty);
Nika Layzell27726662017-10-24 23:16:35 -0400882}
David Tolnay8c81f622018-07-31 23:34:35 -0700883#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800884pub fn visit_arg_self<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ArgSelf) {
David Tolnay8c81f622018-07-31 23:34:35 -0700885 if let Some(ref it) = _i.mutability {
886 tokens_helper(_visitor, &(it).0)
887 };
888 tokens_helper(_visitor, &(_i.self_token).0);
Nika Layzell27726662017-10-24 23:16:35 -0400889}
David Tolnay8c81f622018-07-31 23:34:35 -0700890#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800891pub fn visit_arg_self_ref<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ArgSelfRef) {
David Tolnay8c81f622018-07-31 23:34:35 -0700892 tokens_helper(_visitor, &(_i.and_token).0);
893 if let Some(ref it) = _i.lifetime {
894 _visitor.visit_lifetime(it)
895 };
896 if let Some(ref it) = _i.mutability {
897 tokens_helper(_visitor, &(it).0)
898 };
899 tokens_helper(_visitor, &(_i.self_token).0);
Nika Layzell27726662017-10-24 23:16:35 -0400900}
David Tolnay8c81f622018-07-31 23:34:35 -0700901#[cfg(any(feature = "full", feature = "derive"))]
902#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800903pub fn visit_arm<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Arm) {
David Tolnay8c81f622018-07-31 23:34:35 -0700904 for it in &_i.attrs {
905 _visitor.visit_attribute(it)
906 }
907 if let Some(ref it) = _i.leading_vert {
908 tokens_helper(_visitor, &(it).0)
909 };
910 for el in Punctuated::pairs(&_i.pats) {
911 let it = el.value();
912 _visitor.visit_pat(it)
913 }
914 if let Some(ref it) = _i.guard {
915 tokens_helper(_visitor, &((it).0).0);
916 _visitor.visit_expr(&*(it).1);
917 };
918 tokens_helper(_visitor, &(_i.fat_arrow_token).0);
919 _visitor.visit_expr(&*_i.body);
920 if let Some(ref it) = _i.comma {
921 tokens_helper(_visitor, &(it).0)
922 };
Nika Layzell27726662017-10-24 23:16:35 -0400923}
David Tolnay8c81f622018-07-31 23:34:35 -0700924#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800925pub fn visit_attr_style<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast AttrStyle) {
Nika Layzell27726662017-10-24 23:16:35 -0400926 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -0700927 AttrStyle::Outer => {}
928 AttrStyle::Inner(ref _binding_0) => {
David Tolnaycc0f0372017-12-28 19:11:04 -0500929 tokens_helper(_visitor, &(_binding_0).0);
Nika Layzell27726662017-10-24 23:16:35 -0400930 }
931 }
932}
David Tolnay8c81f622018-07-31 23:34:35 -0700933#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800934pub fn visit_attribute<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Attribute) {
David Tolnay8c81f622018-07-31 23:34:35 -0700935 tokens_helper(_visitor, &(_i.pound_token).0);
936 _visitor.visit_attr_style(&_i.style);
937 tokens_helper(_visitor, &(_i.bracket_token).0);
938 _visitor.visit_path(&_i.path);
David Tolnay6af48992018-08-01 11:16:28 -0700939 skip!(_i.tts);
940 skip!(_i.is_sugared_doc);
Nika Layzell27726662017-10-24 23:16:35 -0400941}
David Tolnay8c81f622018-07-31 23:34:35 -0700942#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800943pub fn visit_bare_fn_arg<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast BareFnArg) {
David Tolnay8c81f622018-07-31 23:34:35 -0700944 if let Some(ref it) = _i.name {
945 _visitor.visit_bare_fn_arg_name(&(it).0);
946 tokens_helper(_visitor, &((it).1).0);
947 };
948 _visitor.visit_type(&_i.ty);
Nika Layzell27726662017-10-24 23:16:35 -0400949}
David Tolnay8c81f622018-07-31 23:34:35 -0700950#[cfg(any(feature = "full", feature = "derive"))]
951pub fn visit_bare_fn_arg_name<'ast, V: Visit<'ast> + ?Sized>(
952 _visitor: &mut V,
953 _i: &'ast BareFnArgName,
954) {
Nika Layzell27726662017-10-24 23:16:35 -0400955 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -0700956 BareFnArgName::Named(ref _binding_0) => {
Alex Crichtond261d092018-05-18 13:47:35 -0700957 _visitor.visit_ident(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -0400958 }
David Tolnay8c81f622018-07-31 23:34:35 -0700959 BareFnArgName::Wild(ref _binding_0) => {
David Tolnaycc0f0372017-12-28 19:11:04 -0500960 tokens_helper(_visitor, &(_binding_0).0);
Nika Layzell27726662017-10-24 23:16:35 -0400961 }
962 }
963}
David Tolnay8c81f622018-07-31 23:34:35 -0700964#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800965pub fn visit_bin_op<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast BinOp) {
Nika Layzell27726662017-10-24 23:16:35 -0400966 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -0700967 BinOp::Add(ref _binding_0) => {
David Tolnaycc0f0372017-12-28 19:11:04 -0500968 tokens_helper(_visitor, &(_binding_0).0);
Nika Layzell27726662017-10-24 23:16:35 -0400969 }
David Tolnay8c81f622018-07-31 23:34:35 -0700970 BinOp::Sub(ref _binding_0) => {
David Tolnaycc0f0372017-12-28 19:11:04 -0500971 tokens_helper(_visitor, &(_binding_0).0);
Nika Layzell27726662017-10-24 23:16:35 -0400972 }
David Tolnay8c81f622018-07-31 23:34:35 -0700973 BinOp::Mul(ref _binding_0) => {
David Tolnaycc0f0372017-12-28 19:11:04 -0500974 tokens_helper(_visitor, &(_binding_0).0);
Nika Layzell27726662017-10-24 23:16:35 -0400975 }
David Tolnay8c81f622018-07-31 23:34:35 -0700976 BinOp::Div(ref _binding_0) => {
David Tolnaycc0f0372017-12-28 19:11:04 -0500977 tokens_helper(_visitor, &(_binding_0).0);
Nika Layzell27726662017-10-24 23:16:35 -0400978 }
David Tolnay8c81f622018-07-31 23:34:35 -0700979 BinOp::Rem(ref _binding_0) => {
David Tolnaycc0f0372017-12-28 19:11:04 -0500980 tokens_helper(_visitor, &(_binding_0).0);
Nika Layzell27726662017-10-24 23:16:35 -0400981 }
David Tolnay8c81f622018-07-31 23:34:35 -0700982 BinOp::And(ref _binding_0) => {
David Tolnaycc0f0372017-12-28 19:11:04 -0500983 tokens_helper(_visitor, &(_binding_0).0);
Nika Layzell27726662017-10-24 23:16:35 -0400984 }
David Tolnay8c81f622018-07-31 23:34:35 -0700985 BinOp::Or(ref _binding_0) => {
David Tolnaycc0f0372017-12-28 19:11:04 -0500986 tokens_helper(_visitor, &(_binding_0).0);
Nika Layzell27726662017-10-24 23:16:35 -0400987 }
David Tolnay8c81f622018-07-31 23:34:35 -0700988 BinOp::BitXor(ref _binding_0) => {
David Tolnaycc0f0372017-12-28 19:11:04 -0500989 tokens_helper(_visitor, &(_binding_0).0);
Nika Layzell27726662017-10-24 23:16:35 -0400990 }
David Tolnay8c81f622018-07-31 23:34:35 -0700991 BinOp::BitAnd(ref _binding_0) => {
David Tolnaycc0f0372017-12-28 19:11:04 -0500992 tokens_helper(_visitor, &(_binding_0).0);
Nika Layzell27726662017-10-24 23:16:35 -0400993 }
David Tolnay8c81f622018-07-31 23:34:35 -0700994 BinOp::BitOr(ref _binding_0) => {
David Tolnaycc0f0372017-12-28 19:11:04 -0500995 tokens_helper(_visitor, &(_binding_0).0);
Nika Layzell27726662017-10-24 23:16:35 -0400996 }
David Tolnay8c81f622018-07-31 23:34:35 -0700997 BinOp::Shl(ref _binding_0) => {
David Tolnaycc0f0372017-12-28 19:11:04 -0500998 tokens_helper(_visitor, &(_binding_0).0);
Nika Layzell27726662017-10-24 23:16:35 -0400999 }
David Tolnay8c81f622018-07-31 23:34:35 -07001000 BinOp::Shr(ref _binding_0) => {
David Tolnaycc0f0372017-12-28 19:11:04 -05001001 tokens_helper(_visitor, &(_binding_0).0);
Nika Layzell27726662017-10-24 23:16:35 -04001002 }
David Tolnay8c81f622018-07-31 23:34:35 -07001003 BinOp::Eq(ref _binding_0) => {
David Tolnaycc0f0372017-12-28 19:11:04 -05001004 tokens_helper(_visitor, &(_binding_0).0);
Nika Layzell27726662017-10-24 23:16:35 -04001005 }
David Tolnay8c81f622018-07-31 23:34:35 -07001006 BinOp::Lt(ref _binding_0) => {
David Tolnaycc0f0372017-12-28 19:11:04 -05001007 tokens_helper(_visitor, &(_binding_0).0);
Nika Layzell27726662017-10-24 23:16:35 -04001008 }
David Tolnay8c81f622018-07-31 23:34:35 -07001009 BinOp::Le(ref _binding_0) => {
David Tolnaycc0f0372017-12-28 19:11:04 -05001010 tokens_helper(_visitor, &(_binding_0).0);
Nika Layzell27726662017-10-24 23:16:35 -04001011 }
David Tolnay8c81f622018-07-31 23:34:35 -07001012 BinOp::Ne(ref _binding_0) => {
David Tolnaycc0f0372017-12-28 19:11:04 -05001013 tokens_helper(_visitor, &(_binding_0).0);
Nika Layzell27726662017-10-24 23:16:35 -04001014 }
David Tolnay8c81f622018-07-31 23:34:35 -07001015 BinOp::Ge(ref _binding_0) => {
David Tolnaycc0f0372017-12-28 19:11:04 -05001016 tokens_helper(_visitor, &(_binding_0).0);
Nika Layzell27726662017-10-24 23:16:35 -04001017 }
David Tolnay8c81f622018-07-31 23:34:35 -07001018 BinOp::Gt(ref _binding_0) => {
David Tolnaycc0f0372017-12-28 19:11:04 -05001019 tokens_helper(_visitor, &(_binding_0).0);
Nika Layzell27726662017-10-24 23:16:35 -04001020 }
David Tolnay8c81f622018-07-31 23:34:35 -07001021 BinOp::AddEq(ref _binding_0) => {
David Tolnaycc0f0372017-12-28 19:11:04 -05001022 tokens_helper(_visitor, &(_binding_0).0);
Nika Layzell27726662017-10-24 23:16:35 -04001023 }
David Tolnay8c81f622018-07-31 23:34:35 -07001024 BinOp::SubEq(ref _binding_0) => {
David Tolnaycc0f0372017-12-28 19:11:04 -05001025 tokens_helper(_visitor, &(_binding_0).0);
Nika Layzell27726662017-10-24 23:16:35 -04001026 }
David Tolnay8c81f622018-07-31 23:34:35 -07001027 BinOp::MulEq(ref _binding_0) => {
David Tolnaycc0f0372017-12-28 19:11:04 -05001028 tokens_helper(_visitor, &(_binding_0).0);
Nika Layzell27726662017-10-24 23:16:35 -04001029 }
David Tolnay8c81f622018-07-31 23:34:35 -07001030 BinOp::DivEq(ref _binding_0) => {
David Tolnaycc0f0372017-12-28 19:11:04 -05001031 tokens_helper(_visitor, &(_binding_0).0);
Nika Layzell27726662017-10-24 23:16:35 -04001032 }
David Tolnay8c81f622018-07-31 23:34:35 -07001033 BinOp::RemEq(ref _binding_0) => {
David Tolnaycc0f0372017-12-28 19:11:04 -05001034 tokens_helper(_visitor, &(_binding_0).0);
Nika Layzell27726662017-10-24 23:16:35 -04001035 }
David Tolnay8c81f622018-07-31 23:34:35 -07001036 BinOp::BitXorEq(ref _binding_0) => {
David Tolnaycc0f0372017-12-28 19:11:04 -05001037 tokens_helper(_visitor, &(_binding_0).0);
Nika Layzell27726662017-10-24 23:16:35 -04001038 }
David Tolnay8c81f622018-07-31 23:34:35 -07001039 BinOp::BitAndEq(ref _binding_0) => {
David Tolnaycc0f0372017-12-28 19:11:04 -05001040 tokens_helper(_visitor, &(_binding_0).0);
Nika Layzell27726662017-10-24 23:16:35 -04001041 }
David Tolnay8c81f622018-07-31 23:34:35 -07001042 BinOp::BitOrEq(ref _binding_0) => {
David Tolnaycc0f0372017-12-28 19:11:04 -05001043 tokens_helper(_visitor, &(_binding_0).0);
Nika Layzell27726662017-10-24 23:16:35 -04001044 }
David Tolnay8c81f622018-07-31 23:34:35 -07001045 BinOp::ShlEq(ref _binding_0) => {
David Tolnaycc0f0372017-12-28 19:11:04 -05001046 tokens_helper(_visitor, &(_binding_0).0);
Nika Layzell27726662017-10-24 23:16:35 -04001047 }
David Tolnay8c81f622018-07-31 23:34:35 -07001048 BinOp::ShrEq(ref _binding_0) => {
David Tolnaycc0f0372017-12-28 19:11:04 -05001049 tokens_helper(_visitor, &(_binding_0).0);
Nika Layzell27726662017-10-24 23:16:35 -04001050 }
1051 }
1052}
David Tolnay8c81f622018-07-31 23:34:35 -07001053#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001054pub fn visit_binding<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Binding) {
David Tolnay8c81f622018-07-31 23:34:35 -07001055 _visitor.visit_ident(&_i.ident);
1056 tokens_helper(_visitor, &(_i.eq_token).0);
1057 _visitor.visit_type(&_i.ty);
David Tolnay506e43a2017-12-29 11:34:36 -05001058}
David Tolnay8c81f622018-07-31 23:34:35 -07001059#[cfg(any(feature = "full", feature = "derive"))]
1060#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001061pub fn visit_block<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Block) {
David Tolnay8c81f622018-07-31 23:34:35 -07001062 tokens_helper(_visitor, &(_i.brace_token).0);
1063 for it in &_i.stmts {
1064 _visitor.visit_stmt(it)
1065 }
Nika Layzell27726662017-10-24 23:16:35 -04001066}
David Tolnay8c81f622018-07-31 23:34:35 -07001067#[cfg(any(feature = "full", feature = "derive"))]
1068pub fn visit_bound_lifetimes<'ast, V: Visit<'ast> + ?Sized>(
1069 _visitor: &mut V,
1070 _i: &'ast BoundLifetimes,
1071) {
1072 tokens_helper(_visitor, &(_i.for_token).0);
1073 tokens_helper(_visitor, &(_i.lt_token).0);
1074 for el in Punctuated::pairs(&_i.lifetimes) {
1075 let it = el.value();
1076 _visitor.visit_lifetime_def(it)
1077 }
1078 tokens_helper(_visitor, &(_i.gt_token).0);
Nika Layzell27726662017-10-24 23:16:35 -04001079}
David Tolnay8c81f622018-07-31 23:34:35 -07001080#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001081pub fn visit_const_param<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ConstParam) {
David Tolnay8c81f622018-07-31 23:34:35 -07001082 for it in &_i.attrs {
1083 _visitor.visit_attribute(it)
1084 }
1085 tokens_helper(_visitor, &(_i.const_token).0);
1086 _visitor.visit_ident(&_i.ident);
1087 tokens_helper(_visitor, &(_i.colon_token).0);
1088 _visitor.visit_type(&_i.ty);
1089 if let Some(ref it) = _i.eq_token {
1090 tokens_helper(_visitor, &(it).0)
1091 };
1092 if let Some(ref it) = _i.default {
1093 _visitor.visit_expr(it)
1094 };
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001095}
David Tolnay8c81f622018-07-31 23:34:35 -07001096#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001097pub fn visit_data<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Data) {
David Tolnaye3d41b72017-12-31 15:24:00 -05001098 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001099 Data::Struct(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05001100 _visitor.visit_data_struct(_binding_0);
1101 }
David Tolnay8c81f622018-07-31 23:34:35 -07001102 Data::Enum(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05001103 _visitor.visit_data_enum(_binding_0);
1104 }
David Tolnay8c81f622018-07-31 23:34:35 -07001105 Data::Union(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05001106 _visitor.visit_data_union(_binding_0);
1107 }
1108 }
1109}
David Tolnay8c81f622018-07-31 23:34:35 -07001110#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001111pub fn visit_data_enum<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataEnum) {
David Tolnay8c81f622018-07-31 23:34:35 -07001112 tokens_helper(_visitor, &(_i.enum_token).0);
1113 tokens_helper(_visitor, &(_i.brace_token).0);
1114 for el in Punctuated::pairs(&_i.variants) {
1115 let it = el.value();
1116 _visitor.visit_variant(it)
1117 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001118}
David Tolnay8c81f622018-07-31 23:34:35 -07001119#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001120pub fn visit_data_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataStruct) {
David Tolnay8c81f622018-07-31 23:34:35 -07001121 tokens_helper(_visitor, &(_i.struct_token).0);
1122 _visitor.visit_fields(&_i.fields);
1123 if let Some(ref it) = _i.semi_token {
1124 tokens_helper(_visitor, &(it).0)
1125 };
David Tolnaye3d41b72017-12-31 15:24:00 -05001126}
David Tolnay8c81f622018-07-31 23:34:35 -07001127#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001128pub fn visit_data_union<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataUnion) {
David Tolnay8c81f622018-07-31 23:34:35 -07001129 tokens_helper(_visitor, &(_i.union_token).0);
1130 _visitor.visit_fields_named(&_i.fields);
David Tolnaye3d41b72017-12-31 15:24:00 -05001131}
David Tolnay8c81f622018-07-31 23:34:35 -07001132#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001133pub fn visit_derive_input<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DeriveInput) {
David Tolnay8c81f622018-07-31 23:34:35 -07001134 for it in &_i.attrs {
1135 _visitor.visit_attribute(it)
1136 }
1137 _visitor.visit_visibility(&_i.vis);
1138 _visitor.visit_ident(&_i.ident);
1139 _visitor.visit_generics(&_i.generics);
1140 _visitor.visit_data(&_i.data);
Nika Layzell27726662017-10-24 23:16:35 -04001141}
David Tolnay8c81f622018-07-31 23:34:35 -07001142#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001143pub fn visit_expr<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Expr) {
Nika Layzell27726662017-10-24 23:16:35 -04001144 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001145 Expr::Box(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001146 full!(_visitor.visit_expr_box(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001147 }
David Tolnay8c81f622018-07-31 23:34:35 -07001148 Expr::InPlace(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001149 full!(_visitor.visit_expr_in_place(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001150 }
David Tolnay8c81f622018-07-31 23:34:35 -07001151 Expr::Array(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001152 full!(_visitor.visit_expr_array(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001153 }
David Tolnay8c81f622018-07-31 23:34:35 -07001154 Expr::Call(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001155 _visitor.visit_expr_call(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001156 }
David Tolnay8c81f622018-07-31 23:34:35 -07001157 Expr::MethodCall(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001158 full!(_visitor.visit_expr_method_call(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001159 }
David Tolnay8c81f622018-07-31 23:34:35 -07001160 Expr::Tuple(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001161 full!(_visitor.visit_expr_tuple(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001162 }
David Tolnay8c81f622018-07-31 23:34:35 -07001163 Expr::Binary(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001164 _visitor.visit_expr_binary(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001165 }
David Tolnay8c81f622018-07-31 23:34:35 -07001166 Expr::Unary(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001167 _visitor.visit_expr_unary(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001168 }
David Tolnay8c81f622018-07-31 23:34:35 -07001169 Expr::Lit(ref _binding_0) => {
David Tolnay8c91b882017-12-28 23:04:32 -05001170 _visitor.visit_expr_lit(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001171 }
David Tolnay8c81f622018-07-31 23:34:35 -07001172 Expr::Cast(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001173 _visitor.visit_expr_cast(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001174 }
David Tolnay8c81f622018-07-31 23:34:35 -07001175 Expr::Type(ref _binding_0) => {
David Tolnay0cf94f22017-12-28 23:46:26 -05001176 full!(_visitor.visit_expr_type(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001177 }
David Tolnay8c81f622018-07-31 23:34:35 -07001178 Expr::If(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001179 full!(_visitor.visit_expr_if(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001180 }
David Tolnay8c81f622018-07-31 23:34:35 -07001181 Expr::IfLet(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001182 full!(_visitor.visit_expr_if_let(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001183 }
David Tolnay8c81f622018-07-31 23:34:35 -07001184 Expr::While(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001185 full!(_visitor.visit_expr_while(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001186 }
David Tolnay8c81f622018-07-31 23:34:35 -07001187 Expr::WhileLet(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001188 full!(_visitor.visit_expr_while_let(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001189 }
David Tolnay8c81f622018-07-31 23:34:35 -07001190 Expr::ForLoop(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001191 full!(_visitor.visit_expr_for_loop(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001192 }
David Tolnay8c81f622018-07-31 23:34:35 -07001193 Expr::Loop(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001194 full!(_visitor.visit_expr_loop(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001195 }
David Tolnay8c81f622018-07-31 23:34:35 -07001196 Expr::Match(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001197 full!(_visitor.visit_expr_match(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001198 }
David Tolnay8c81f622018-07-31 23:34:35 -07001199 Expr::Closure(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001200 full!(_visitor.visit_expr_closure(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001201 }
David Tolnay8c81f622018-07-31 23:34:35 -07001202 Expr::Unsafe(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001203 full!(_visitor.visit_expr_unsafe(_binding_0));
Nika Layzell640832a2017-12-04 13:37:09 -05001204 }
David Tolnay8c81f622018-07-31 23:34:35 -07001205 Expr::Block(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001206 full!(_visitor.visit_expr_block(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001207 }
David Tolnay8c81f622018-07-31 23:34:35 -07001208 Expr::Assign(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001209 full!(_visitor.visit_expr_assign(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001210 }
David Tolnay8c81f622018-07-31 23:34:35 -07001211 Expr::AssignOp(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001212 full!(_visitor.visit_expr_assign_op(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001213 }
David Tolnay8c81f622018-07-31 23:34:35 -07001214 Expr::Field(ref _binding_0) => {
David Tolnayd093fa92018-06-30 10:23:25 -07001215 _visitor.visit_expr_field(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001216 }
David Tolnay8c81f622018-07-31 23:34:35 -07001217 Expr::Index(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001218 _visitor.visit_expr_index(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001219 }
David Tolnay8c81f622018-07-31 23:34:35 -07001220 Expr::Range(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001221 full!(_visitor.visit_expr_range(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001222 }
David Tolnay8c81f622018-07-31 23:34:35 -07001223 Expr::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001224 _visitor.visit_expr_path(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001225 }
David Tolnay8c81f622018-07-31 23:34:35 -07001226 Expr::Reference(ref _binding_0) => {
David Tolnay00674ba2018-03-31 18:14:11 +02001227 full!(_visitor.visit_expr_reference(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001228 }
David Tolnay8c81f622018-07-31 23:34:35 -07001229 Expr::Break(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001230 full!(_visitor.visit_expr_break(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001231 }
David Tolnay8c81f622018-07-31 23:34:35 -07001232 Expr::Continue(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001233 full!(_visitor.visit_expr_continue(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001234 }
David Tolnay8c81f622018-07-31 23:34:35 -07001235 Expr::Return(ref _binding_0) => {
David Tolnayc246cd32017-12-28 23:14:32 -05001236 full!(_visitor.visit_expr_return(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001237 }
David Tolnay8c81f622018-07-31 23:34:35 -07001238 Expr::Macro(ref _binding_0) => {
David Tolnay8c91b882017-12-28 23:04:32 -05001239 full!(_visitor.visit_expr_macro(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001240 }
David Tolnay8c81f622018-07-31 23:34:35 -07001241 Expr::Struct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001242 full!(_visitor.visit_expr_struct(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001243 }
David Tolnay8c81f622018-07-31 23:34:35 -07001244 Expr::Repeat(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001245 full!(_visitor.visit_expr_repeat(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001246 }
David Tolnay8c81f622018-07-31 23:34:35 -07001247 Expr::Paren(ref _binding_0) => {
David Tolnay81ab4f62018-01-27 19:02:51 -08001248 _visitor.visit_expr_paren(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001249 }
David Tolnay8c81f622018-07-31 23:34:35 -07001250 Expr::Group(ref _binding_0) => {
David Tolnaye98775f2017-12-28 23:17:00 -05001251 full!(_visitor.visit_expr_group(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001252 }
David Tolnay8c81f622018-07-31 23:34:35 -07001253 Expr::Try(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001254 full!(_visitor.visit_expr_try(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001255 }
David Tolnay8c81f622018-07-31 23:34:35 -07001256 Expr::Catch(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001257 full!(_visitor.visit_expr_catch(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001258 }
David Tolnay8c81f622018-07-31 23:34:35 -07001259 Expr::Yield(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001260 full!(_visitor.visit_expr_yield(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001261 }
David Tolnay8c81f622018-07-31 23:34:35 -07001262 Expr::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05001263 _visitor.visit_expr_verbatim(_binding_0);
1264 }
Nika Layzell27726662017-10-24 23:16:35 -04001265 }
1266}
David Tolnay8c81f622018-07-31 23:34:35 -07001267#[cfg(feature = "full")]
1268#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001269pub fn visit_expr_array<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprArray) {
David Tolnay8c81f622018-07-31 23:34:35 -07001270 for it in &_i.attrs {
1271 _visitor.visit_attribute(it)
1272 }
1273 tokens_helper(_visitor, &(_i.bracket_token).0);
1274 for el in Punctuated::pairs(&_i.elems) {
1275 let it = el.value();
1276 _visitor.visit_expr(it)
David Tolnaye3d41b72017-12-31 15:24:00 -05001277 }
1278}
David Tolnay8c81f622018-07-31 23:34:35 -07001279#[cfg(feature = "full")]
1280#[cfg(any(feature = "full", feature = "derive"))]
1281pub fn visit_expr_assign<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprAssign) {
1282 for it in &_i.attrs {
1283 _visitor.visit_attribute(it)
1284 }
1285 _visitor.visit_expr(&*_i.left);
1286 tokens_helper(_visitor, &(_i.eq_token).0);
1287 _visitor.visit_expr(&*_i.right);
1288}
1289#[cfg(feature = "full")]
1290#[cfg(any(feature = "full", feature = "derive"))]
1291pub fn visit_expr_assign_op<'ast, V: Visit<'ast> + ?Sized>(
1292 _visitor: &mut V,
1293 _i: &'ast ExprAssignOp,
1294) {
1295 for it in &_i.attrs {
1296 _visitor.visit_attribute(it)
1297 }
1298 _visitor.visit_expr(&*_i.left);
1299 _visitor.visit_bin_op(&_i.op);
1300 _visitor.visit_expr(&*_i.right);
1301}
1302#[cfg(any(feature = "full", feature = "derive"))]
1303pub fn visit_expr_binary<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBinary) {
1304 for it in &_i.attrs {
1305 _visitor.visit_attribute(it)
1306 }
1307 _visitor.visit_expr(&*_i.left);
1308 _visitor.visit_bin_op(&_i.op);
1309 _visitor.visit_expr(&*_i.right);
1310}
1311#[cfg(feature = "full")]
1312#[cfg(any(feature = "full", feature = "derive"))]
1313pub fn visit_expr_block<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBlock) {
1314 for it in &_i.attrs {
1315 _visitor.visit_attribute(it)
1316 }
1317 _visitor.visit_block(&_i.block);
1318}
1319#[cfg(feature = "full")]
1320#[cfg(any(feature = "full", feature = "derive"))]
1321pub fn visit_expr_box<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBox) {
1322 for it in &_i.attrs {
1323 _visitor.visit_attribute(it)
1324 }
1325 tokens_helper(_visitor, &(_i.box_token).0);
1326 _visitor.visit_expr(&*_i.expr);
1327}
1328#[cfg(feature = "full")]
1329#[cfg(any(feature = "full", feature = "derive"))]
1330pub fn visit_expr_break<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBreak) {
1331 for it in &_i.attrs {
1332 _visitor.visit_attribute(it)
1333 }
1334 tokens_helper(_visitor, &(_i.break_token).0);
1335 if let Some(ref it) = _i.label {
1336 _visitor.visit_lifetime(it)
1337 };
1338 if let Some(ref it) = _i.expr {
1339 _visitor.visit_expr(&**it)
1340 };
1341}
1342#[cfg(any(feature = "full", feature = "derive"))]
1343pub fn visit_expr_call<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprCall) {
1344 for it in &_i.attrs {
1345 _visitor.visit_attribute(it)
1346 }
1347 _visitor.visit_expr(&*_i.func);
1348 tokens_helper(_visitor, &(_i.paren_token).0);
1349 for el in Punctuated::pairs(&_i.args) {
1350 let it = el.value();
1351 _visitor.visit_expr(it)
1352 }
1353}
1354#[cfg(any(feature = "full", feature = "derive"))]
1355pub fn visit_expr_cast<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprCast) {
1356 for it in &_i.attrs {
1357 _visitor.visit_attribute(it)
1358 }
1359 _visitor.visit_expr(&*_i.expr);
1360 tokens_helper(_visitor, &(_i.as_token).0);
1361 _visitor.visit_type(&*_i.ty);
1362}
1363#[cfg(feature = "full")]
1364#[cfg(any(feature = "full", feature = "derive"))]
1365pub fn visit_expr_catch<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprCatch) {
1366 for it in &_i.attrs {
1367 _visitor.visit_attribute(it)
1368 }
1369 tokens_helper(_visitor, &(_i.do_token).0);
1370 tokens_helper(_visitor, &(_i.catch_token).0);
1371 _visitor.visit_block(&_i.block);
1372}
1373#[cfg(feature = "full")]
1374#[cfg(any(feature = "full", feature = "derive"))]
1375pub fn visit_expr_closure<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprClosure) {
1376 for it in &_i.attrs {
1377 _visitor.visit_attribute(it)
1378 }
1379 if let Some(ref it) = _i.movability {
1380 tokens_helper(_visitor, &(it).0)
1381 };
1382 if let Some(ref it) = _i.capture {
1383 tokens_helper(_visitor, &(it).0)
1384 };
1385 tokens_helper(_visitor, &(_i.or1_token).0);
1386 for el in Punctuated::pairs(&_i.inputs) {
1387 let it = el.value();
1388 _visitor.visit_fn_arg(it)
1389 }
1390 tokens_helper(_visitor, &(_i.or2_token).0);
1391 _visitor.visit_return_type(&_i.output);
1392 _visitor.visit_expr(&*_i.body);
1393}
1394#[cfg(feature = "full")]
1395#[cfg(any(feature = "full", feature = "derive"))]
1396pub fn visit_expr_continue<'ast, V: Visit<'ast> + ?Sized>(
1397 _visitor: &mut V,
1398 _i: &'ast ExprContinue,
1399) {
1400 for it in &_i.attrs {
1401 _visitor.visit_attribute(it)
1402 }
1403 tokens_helper(_visitor, &(_i.continue_token).0);
1404 if let Some(ref it) = _i.label {
1405 _visitor.visit_lifetime(it)
1406 };
1407}
1408#[cfg(any(feature = "full", feature = "derive"))]
1409pub fn visit_expr_field<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprField) {
1410 for it in &_i.attrs {
1411 _visitor.visit_attribute(it)
1412 }
1413 _visitor.visit_expr(&*_i.base);
1414 tokens_helper(_visitor, &(_i.dot_token).0);
1415 _visitor.visit_member(&_i.member);
1416}
1417#[cfg(feature = "full")]
1418#[cfg(any(feature = "full", feature = "derive"))]
1419pub fn visit_expr_for_loop<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprForLoop) {
1420 for it in &_i.attrs {
1421 _visitor.visit_attribute(it)
1422 }
1423 if let Some(ref it) = _i.label {
1424 _visitor.visit_label(it)
1425 };
1426 tokens_helper(_visitor, &(_i.for_token).0);
1427 _visitor.visit_pat(&*_i.pat);
1428 tokens_helper(_visitor, &(_i.in_token).0);
1429 _visitor.visit_expr(&*_i.expr);
1430 _visitor.visit_block(&_i.body);
1431}
1432#[cfg(feature = "full")]
1433#[cfg(any(feature = "full", feature = "derive"))]
1434pub fn visit_expr_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprGroup) {
1435 for it in &_i.attrs {
1436 _visitor.visit_attribute(it)
1437 }
1438 tokens_helper(_visitor, &(_i.group_token).0);
1439 _visitor.visit_expr(&*_i.expr);
1440}
1441#[cfg(feature = "full")]
1442#[cfg(any(feature = "full", feature = "derive"))]
1443pub fn visit_expr_if<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprIf) {
1444 for it in &_i.attrs {
1445 _visitor.visit_attribute(it)
1446 }
1447 tokens_helper(_visitor, &(_i.if_token).0);
1448 _visitor.visit_expr(&*_i.cond);
1449 _visitor.visit_block(&_i.then_branch);
1450 if let Some(ref it) = _i.else_branch {
1451 tokens_helper(_visitor, &((it).0).0);
1452 _visitor.visit_expr(&*(it).1);
1453 };
1454}
1455#[cfg(feature = "full")]
1456#[cfg(any(feature = "full", feature = "derive"))]
1457pub fn visit_expr_if_let<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprIfLet) {
1458 for it in &_i.attrs {
1459 _visitor.visit_attribute(it)
1460 }
1461 tokens_helper(_visitor, &(_i.if_token).0);
1462 tokens_helper(_visitor, &(_i.let_token).0);
1463 for el in Punctuated::pairs(&_i.pats) {
1464 let it = el.value();
1465 _visitor.visit_pat(it)
1466 }
1467 tokens_helper(_visitor, &(_i.eq_token).0);
1468 _visitor.visit_expr(&*_i.expr);
1469 _visitor.visit_block(&_i.then_branch);
1470 if let Some(ref it) = _i.else_branch {
1471 tokens_helper(_visitor, &((it).0).0);
1472 _visitor.visit_expr(&*(it).1);
1473 };
1474}
1475#[cfg(feature = "full")]
1476#[cfg(any(feature = "full", feature = "derive"))]
1477pub fn visit_expr_in_place<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprInPlace) {
1478 for it in &_i.attrs {
1479 _visitor.visit_attribute(it)
1480 }
1481 _visitor.visit_expr(&*_i.place);
1482 tokens_helper(_visitor, &(_i.arrow_token).0);
1483 _visitor.visit_expr(&*_i.value);
1484}
1485#[cfg(any(feature = "full", feature = "derive"))]
1486pub fn visit_expr_index<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprIndex) {
1487 for it in &_i.attrs {
1488 _visitor.visit_attribute(it)
1489 }
1490 _visitor.visit_expr(&*_i.expr);
1491 tokens_helper(_visitor, &(_i.bracket_token).0);
1492 _visitor.visit_expr(&*_i.index);
1493}
1494#[cfg(any(feature = "full", feature = "derive"))]
1495pub fn visit_expr_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprLit) {
1496 for it in &_i.attrs {
1497 _visitor.visit_attribute(it)
1498 }
1499 _visitor.visit_lit(&_i.lit);
1500}
1501#[cfg(feature = "full")]
1502#[cfg(any(feature = "full", feature = "derive"))]
1503pub fn visit_expr_loop<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprLoop) {
1504 for it in &_i.attrs {
1505 _visitor.visit_attribute(it)
1506 }
1507 if let Some(ref it) = _i.label {
1508 _visitor.visit_label(it)
1509 };
1510 tokens_helper(_visitor, &(_i.loop_token).0);
1511 _visitor.visit_block(&_i.body);
1512}
1513#[cfg(feature = "full")]
1514#[cfg(any(feature = "full", feature = "derive"))]
1515pub fn visit_expr_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprMacro) {
1516 for it in &_i.attrs {
1517 _visitor.visit_attribute(it)
1518 }
1519 _visitor.visit_macro(&_i.mac);
1520}
1521#[cfg(feature = "full")]
1522#[cfg(any(feature = "full", feature = "derive"))]
1523pub fn visit_expr_match<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprMatch) {
1524 for it in &_i.attrs {
1525 _visitor.visit_attribute(it)
1526 }
1527 tokens_helper(_visitor, &(_i.match_token).0);
1528 _visitor.visit_expr(&*_i.expr);
1529 tokens_helper(_visitor, &(_i.brace_token).0);
1530 for it in &_i.arms {
1531 _visitor.visit_arm(it)
1532 }
1533}
1534#[cfg(feature = "full")]
1535#[cfg(any(feature = "full", feature = "derive"))]
1536pub fn visit_expr_method_call<'ast, V: Visit<'ast> + ?Sized>(
1537 _visitor: &mut V,
1538 _i: &'ast ExprMethodCall,
1539) {
1540 for it in &_i.attrs {
1541 _visitor.visit_attribute(it)
1542 }
1543 _visitor.visit_expr(&*_i.receiver);
1544 tokens_helper(_visitor, &(_i.dot_token).0);
1545 _visitor.visit_ident(&_i.method);
1546 if let Some(ref it) = _i.turbofish {
1547 _visitor.visit_method_turbofish(it)
1548 };
1549 tokens_helper(_visitor, &(_i.paren_token).0);
1550 for el in Punctuated::pairs(&_i.args) {
1551 let it = el.value();
1552 _visitor.visit_expr(it)
1553 }
1554}
1555#[cfg(any(feature = "full", feature = "derive"))]
1556pub fn visit_expr_paren<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprParen) {
1557 for it in &_i.attrs {
1558 _visitor.visit_attribute(it)
1559 }
1560 tokens_helper(_visitor, &(_i.paren_token).0);
1561 _visitor.visit_expr(&*_i.expr);
1562}
1563#[cfg(any(feature = "full", feature = "derive"))]
1564pub fn visit_expr_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprPath) {
1565 for it in &_i.attrs {
1566 _visitor.visit_attribute(it)
1567 }
1568 if let Some(ref it) = _i.qself {
1569 _visitor.visit_qself(it)
1570 };
1571 _visitor.visit_path(&_i.path);
1572}
1573#[cfg(feature = "full")]
1574#[cfg(any(feature = "full", feature = "derive"))]
1575pub fn visit_expr_range<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprRange) {
1576 for it in &_i.attrs {
1577 _visitor.visit_attribute(it)
1578 }
1579 if let Some(ref it) = _i.from {
1580 _visitor.visit_expr(&**it)
1581 };
1582 _visitor.visit_range_limits(&_i.limits);
1583 if let Some(ref it) = _i.to {
1584 _visitor.visit_expr(&**it)
1585 };
1586}
1587#[cfg(feature = "full")]
1588#[cfg(any(feature = "full", feature = "derive"))]
1589pub fn visit_expr_reference<'ast, V: Visit<'ast> + ?Sized>(
1590 _visitor: &mut V,
1591 _i: &'ast ExprReference,
1592) {
1593 for it in &_i.attrs {
1594 _visitor.visit_attribute(it)
1595 }
1596 tokens_helper(_visitor, &(_i.and_token).0);
1597 if let Some(ref it) = _i.mutability {
1598 tokens_helper(_visitor, &(it).0)
1599 };
1600 _visitor.visit_expr(&*_i.expr);
1601}
1602#[cfg(feature = "full")]
1603#[cfg(any(feature = "full", feature = "derive"))]
1604pub fn visit_expr_repeat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprRepeat) {
1605 for it in &_i.attrs {
1606 _visitor.visit_attribute(it)
1607 }
1608 tokens_helper(_visitor, &(_i.bracket_token).0);
1609 _visitor.visit_expr(&*_i.expr);
1610 tokens_helper(_visitor, &(_i.semi_token).0);
1611 _visitor.visit_expr(&*_i.len);
1612}
1613#[cfg(feature = "full")]
1614#[cfg(any(feature = "full", feature = "derive"))]
1615pub fn visit_expr_return<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprReturn) {
1616 for it in &_i.attrs {
1617 _visitor.visit_attribute(it)
1618 }
1619 tokens_helper(_visitor, &(_i.return_token).0);
1620 if let Some(ref it) = _i.expr {
1621 _visitor.visit_expr(&**it)
1622 };
1623}
1624#[cfg(feature = "full")]
1625#[cfg(any(feature = "full", feature = "derive"))]
1626pub fn visit_expr_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprStruct) {
1627 for it in &_i.attrs {
1628 _visitor.visit_attribute(it)
1629 }
1630 _visitor.visit_path(&_i.path);
1631 tokens_helper(_visitor, &(_i.brace_token).0);
1632 for el in Punctuated::pairs(&_i.fields) {
1633 let it = el.value();
1634 _visitor.visit_field_value(it)
1635 }
1636 if let Some(ref it) = _i.dot2_token {
1637 tokens_helper(_visitor, &(it).0)
1638 };
1639 if let Some(ref it) = _i.rest {
1640 _visitor.visit_expr(&**it)
1641 };
1642}
1643#[cfg(feature = "full")]
1644#[cfg(any(feature = "full", feature = "derive"))]
1645pub fn visit_expr_try<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprTry) {
1646 for it in &_i.attrs {
1647 _visitor.visit_attribute(it)
1648 }
1649 _visitor.visit_expr(&*_i.expr);
1650 tokens_helper(_visitor, &(_i.question_token).0);
1651}
1652#[cfg(feature = "full")]
1653#[cfg(any(feature = "full", feature = "derive"))]
1654pub fn visit_expr_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprTuple) {
1655 for it in &_i.attrs {
1656 _visitor.visit_attribute(it)
1657 }
1658 tokens_helper(_visitor, &(_i.paren_token).0);
1659 for el in Punctuated::pairs(&_i.elems) {
1660 let it = el.value();
1661 _visitor.visit_expr(it)
1662 }
1663}
1664#[cfg(feature = "full")]
1665#[cfg(any(feature = "full", feature = "derive"))]
1666pub fn visit_expr_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprType) {
1667 for it in &_i.attrs {
1668 _visitor.visit_attribute(it)
1669 }
1670 _visitor.visit_expr(&*_i.expr);
1671 tokens_helper(_visitor, &(_i.colon_token).0);
1672 _visitor.visit_type(&*_i.ty);
1673}
1674#[cfg(any(feature = "full", feature = "derive"))]
1675pub fn visit_expr_unary<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprUnary) {
1676 for it in &_i.attrs {
1677 _visitor.visit_attribute(it)
1678 }
1679 _visitor.visit_un_op(&_i.op);
1680 _visitor.visit_expr(&*_i.expr);
1681}
1682#[cfg(feature = "full")]
1683#[cfg(any(feature = "full", feature = "derive"))]
1684pub fn visit_expr_unsafe<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprUnsafe) {
1685 for it in &_i.attrs {
1686 _visitor.visit_attribute(it)
1687 }
1688 tokens_helper(_visitor, &(_i.unsafe_token).0);
1689 _visitor.visit_block(&_i.block);
1690}
1691#[cfg(any(feature = "full", feature = "derive"))]
1692pub fn visit_expr_verbatim<'ast, V: Visit<'ast> + ?Sized>(
1693 _visitor: &mut V,
1694 _i: &'ast ExprVerbatim,
1695) {
David Tolnay6af48992018-08-01 11:16:28 -07001696 skip!(_i.tts);
David Tolnay8c81f622018-07-31 23:34:35 -07001697}
1698#[cfg(feature = "full")]
1699#[cfg(any(feature = "full", feature = "derive"))]
1700pub fn visit_expr_while<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprWhile) {
1701 for it in &_i.attrs {
1702 _visitor.visit_attribute(it)
1703 }
1704 if let Some(ref it) = _i.label {
1705 _visitor.visit_label(it)
1706 };
1707 tokens_helper(_visitor, &(_i.while_token).0);
1708 _visitor.visit_expr(&*_i.cond);
1709 _visitor.visit_block(&_i.body);
1710}
1711#[cfg(feature = "full")]
1712#[cfg(any(feature = "full", feature = "derive"))]
1713pub fn visit_expr_while_let<'ast, V: Visit<'ast> + ?Sized>(
1714 _visitor: &mut V,
1715 _i: &'ast ExprWhileLet,
1716) {
1717 for it in &_i.attrs {
1718 _visitor.visit_attribute(it)
1719 }
1720 if let Some(ref it) = _i.label {
1721 _visitor.visit_label(it)
1722 };
1723 tokens_helper(_visitor, &(_i.while_token).0);
1724 tokens_helper(_visitor, &(_i.let_token).0);
1725 for el in Punctuated::pairs(&_i.pats) {
1726 let it = el.value();
1727 _visitor.visit_pat(it)
1728 }
1729 tokens_helper(_visitor, &(_i.eq_token).0);
1730 _visitor.visit_expr(&*_i.expr);
1731 _visitor.visit_block(&_i.body);
1732}
1733#[cfg(feature = "full")]
1734#[cfg(any(feature = "full", feature = "derive"))]
1735pub fn visit_expr_yield<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprYield) {
1736 for it in &_i.attrs {
1737 _visitor.visit_attribute(it)
1738 }
1739 tokens_helper(_visitor, &(_i.yield_token).0);
1740 if let Some(ref it) = _i.expr {
1741 _visitor.visit_expr(&**it)
1742 };
1743}
1744#[cfg(any(feature = "full", feature = "derive"))]
1745pub fn visit_field<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Field) {
1746 for it in &_i.attrs {
1747 _visitor.visit_attribute(it)
1748 }
1749 _visitor.visit_visibility(&_i.vis);
1750 if let Some(ref it) = _i.ident {
1751 _visitor.visit_ident(it)
1752 };
1753 if let Some(ref it) = _i.colon_token {
1754 tokens_helper(_visitor, &(it).0)
1755 };
1756 _visitor.visit_type(&_i.ty);
1757}
1758#[cfg(any(feature = "full", feature = "derive"))]
1759#[cfg(feature = "full")]
1760pub fn visit_field_pat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldPat) {
1761 for it in &_i.attrs {
1762 _visitor.visit_attribute(it)
1763 }
1764 _visitor.visit_member(&_i.member);
1765 if let Some(ref it) = _i.colon_token {
1766 tokens_helper(_visitor, &(it).0)
1767 };
1768 _visitor.visit_pat(&*_i.pat);
1769}
1770#[cfg(any(feature = "full", feature = "derive"))]
1771#[cfg(feature = "full")]
1772pub fn visit_field_value<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldValue) {
1773 for it in &_i.attrs {
1774 _visitor.visit_attribute(it)
1775 }
1776 _visitor.visit_member(&_i.member);
1777 if let Some(ref it) = _i.colon_token {
1778 tokens_helper(_visitor, &(it).0)
1779 };
1780 _visitor.visit_expr(&_i.expr);
1781}
1782#[cfg(any(feature = "full", feature = "derive"))]
1783pub fn visit_fields<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Fields) {
1784 match *_i {
1785 Fields::Named(ref _binding_0) => {
1786 _visitor.visit_fields_named(_binding_0);
1787 }
1788 Fields::Unnamed(ref _binding_0) => {
1789 _visitor.visit_fields_unnamed(_binding_0);
1790 }
1791 Fields::Unit => {}
1792 }
1793}
1794#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001795pub fn visit_fields_named<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldsNamed) {
David Tolnay8c81f622018-07-31 23:34:35 -07001796 tokens_helper(_visitor, &(_i.brace_token).0);
1797 for el in Punctuated::pairs(&_i.named) {
1798 let it = el.value();
1799 _visitor.visit_field(it)
1800 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001801}
David Tolnay8c81f622018-07-31 23:34:35 -07001802#[cfg(any(feature = "full", feature = "derive"))]
1803pub fn visit_fields_unnamed<'ast, V: Visit<'ast> + ?Sized>(
1804 _visitor: &mut V,
1805 _i: &'ast FieldsUnnamed,
1806) {
1807 tokens_helper(_visitor, &(_i.paren_token).0);
1808 for el in Punctuated::pairs(&_i.unnamed) {
1809 let it = el.value();
1810 _visitor.visit_field(it)
1811 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001812}
David Tolnay8c81f622018-07-31 23:34:35 -07001813#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001814pub fn visit_file<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast File) {
David Tolnay6af48992018-08-01 11:16:28 -07001815 skip!(_i.shebang);
David Tolnay8c81f622018-07-31 23:34:35 -07001816 for it in &_i.attrs {
1817 _visitor.visit_attribute(it)
1818 }
1819 for it in &_i.items {
1820 _visitor.visit_item(it)
1821 }
Nika Layzell27726662017-10-24 23:16:35 -04001822}
David Tolnay8c81f622018-07-31 23:34:35 -07001823#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001824pub fn visit_fn_arg<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FnArg) {
Nika Layzell27726662017-10-24 23:16:35 -04001825 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001826 FnArg::SelfRef(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001827 _visitor.visit_arg_self_ref(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001828 }
David Tolnay8c81f622018-07-31 23:34:35 -07001829 FnArg::SelfValue(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001830 _visitor.visit_arg_self(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001831 }
David Tolnay8c81f622018-07-31 23:34:35 -07001832 FnArg::Captured(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001833 _visitor.visit_arg_captured(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001834 }
David Tolnay8c81f622018-07-31 23:34:35 -07001835 FnArg::Inferred(ref _binding_0) => {
David Tolnay80ed55f2017-12-27 22:54:40 -05001836 _visitor.visit_pat(_binding_0);
1837 }
David Tolnay8c81f622018-07-31 23:34:35 -07001838 FnArg::Ignored(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001839 _visitor.visit_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001840 }
1841 }
1842}
David Tolnay8c81f622018-07-31 23:34:35 -07001843#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001844pub fn visit_fn_decl<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FnDecl) {
David Tolnay8c81f622018-07-31 23:34:35 -07001845 tokens_helper(_visitor, &(_i.fn_token).0);
1846 _visitor.visit_generics(&_i.generics);
1847 tokens_helper(_visitor, &(_i.paren_token).0);
1848 for el in Punctuated::pairs(&_i.inputs) {
1849 let it = el.value();
1850 _visitor.visit_fn_arg(it)
1851 }
1852 if let Some(ref it) = _i.variadic {
1853 tokens_helper(_visitor, &(it).0)
1854 };
1855 _visitor.visit_return_type(&_i.output);
Nika Layzell27726662017-10-24 23:16:35 -04001856}
David Tolnay8c81f622018-07-31 23:34:35 -07001857#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001858pub fn visit_foreign_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ForeignItem) {
Nika Layzell27726662017-10-24 23:16:35 -04001859 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001860 ForeignItem::Fn(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001861 _visitor.visit_foreign_item_fn(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001862 }
David Tolnay8c81f622018-07-31 23:34:35 -07001863 ForeignItem::Static(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001864 _visitor.visit_foreign_item_static(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001865 }
David Tolnay8c81f622018-07-31 23:34:35 -07001866 ForeignItem::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001867 _visitor.visit_foreign_item_type(_binding_0);
David Tolnay199bcbb2017-11-12 10:33:52 -08001868 }
David Tolnay8c81f622018-07-31 23:34:35 -07001869 ForeignItem::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05001870 _visitor.visit_foreign_item_verbatim(_binding_0);
1871 }
Nika Layzell27726662017-10-24 23:16:35 -04001872 }
1873}
David Tolnay8c81f622018-07-31 23:34:35 -07001874#[cfg(feature = "full")]
1875pub fn visit_foreign_item_fn<'ast, V: Visit<'ast> + ?Sized>(
1876 _visitor: &mut V,
1877 _i: &'ast ForeignItemFn,
1878) {
1879 for it in &_i.attrs {
1880 _visitor.visit_attribute(it)
1881 }
1882 _visitor.visit_visibility(&_i.vis);
1883 _visitor.visit_ident(&_i.ident);
1884 _visitor.visit_fn_decl(&*_i.decl);
1885 tokens_helper(_visitor, &(_i.semi_token).0);
David Tolnay8894f602017-11-11 12:11:04 -08001886}
David Tolnay8c81f622018-07-31 23:34:35 -07001887#[cfg(feature = "full")]
1888pub fn visit_foreign_item_static<'ast, V: Visit<'ast> + ?Sized>(
1889 _visitor: &mut V,
1890 _i: &'ast ForeignItemStatic,
1891) {
1892 for it in &_i.attrs {
1893 _visitor.visit_attribute(it)
1894 }
1895 _visitor.visit_visibility(&_i.vis);
1896 tokens_helper(_visitor, &(_i.static_token).0);
1897 if let Some(ref it) = _i.mutability {
1898 tokens_helper(_visitor, &(it).0)
1899 };
1900 _visitor.visit_ident(&_i.ident);
1901 tokens_helper(_visitor, &(_i.colon_token).0);
1902 _visitor.visit_type(&*_i.ty);
1903 tokens_helper(_visitor, &(_i.semi_token).0);
Nika Layzell27726662017-10-24 23:16:35 -04001904}
David Tolnay8c81f622018-07-31 23:34:35 -07001905#[cfg(feature = "full")]
1906pub fn visit_foreign_item_type<'ast, V: Visit<'ast> + ?Sized>(
1907 _visitor: &mut V,
1908 _i: &'ast ForeignItemType,
1909) {
1910 for it in &_i.attrs {
1911 _visitor.visit_attribute(it)
1912 }
1913 _visitor.visit_visibility(&_i.vis);
1914 tokens_helper(_visitor, &(_i.type_token).0);
1915 _visitor.visit_ident(&_i.ident);
1916 tokens_helper(_visitor, &(_i.semi_token).0);
David Tolnay199bcbb2017-11-12 10:33:52 -08001917}
David Tolnay8c81f622018-07-31 23:34:35 -07001918#[cfg(feature = "full")]
1919pub fn visit_foreign_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
1920 _visitor: &mut V,
1921 _i: &'ast ForeignItemVerbatim,
1922) {
David Tolnay6af48992018-08-01 11:16:28 -07001923 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05001924}
David Tolnay8c81f622018-07-31 23:34:35 -07001925#[cfg(any(feature = "full", feature = "derive"))]
1926pub fn visit_generic_argument<'ast, V: Visit<'ast> + ?Sized>(
1927 _visitor: &mut V,
1928 _i: &'ast GenericArgument,
1929) {
Nika Layzell357885a2017-12-04 15:47:07 -05001930 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001931 GenericArgument::Lifetime(ref _binding_0) => {
David Tolnay4ba63a02017-12-28 15:53:05 -05001932 _visitor.visit_lifetime(_binding_0);
Nika Layzell357885a2017-12-04 15:47:07 -05001933 }
David Tolnay8c81f622018-07-31 23:34:35 -07001934 GenericArgument::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001935 _visitor.visit_type(_binding_0);
Nika Layzell357885a2017-12-04 15:47:07 -05001936 }
David Tolnay8c81f622018-07-31 23:34:35 -07001937 GenericArgument::Binding(ref _binding_0) => {
David Tolnay506e43a2017-12-29 11:34:36 -05001938 _visitor.visit_binding(_binding_0);
Nika Layzell357885a2017-12-04 15:47:07 -05001939 }
David Tolnay8c81f622018-07-31 23:34:35 -07001940 GenericArgument::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001941 _visitor.visit_expr(_binding_0);
Nika Layzellc680e612017-12-04 19:07:20 -05001942 }
Nika Layzell357885a2017-12-04 15:47:07 -05001943 }
1944}
David Tolnay8c81f622018-07-31 23:34:35 -07001945#[cfg(any(feature = "full", feature = "derive"))]
1946#[cfg(feature = "full")]
1947pub fn visit_generic_method_argument<'ast, V: Visit<'ast> + ?Sized>(
1948 _visitor: &mut V,
1949 _i: &'ast GenericMethodArgument,
1950) {
David Tolnayd60cfec2017-12-29 00:21:38 -05001951 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001952 GenericMethodArgument::Type(ref _binding_0) => {
David Tolnayd60cfec2017-12-29 00:21:38 -05001953 _visitor.visit_type(_binding_0);
1954 }
David Tolnay8c81f622018-07-31 23:34:35 -07001955 GenericMethodArgument::Const(ref _binding_0) => {
David Tolnayd60cfec2017-12-29 00:21:38 -05001956 _visitor.visit_expr(_binding_0);
1957 }
1958 }
1959}
David Tolnay8c81f622018-07-31 23:34:35 -07001960#[cfg(any(feature = "full", feature = "derive"))]
1961pub fn visit_generic_param<'ast, V: Visit<'ast> + ?Sized>(
1962 _visitor: &mut V,
1963 _i: &'ast GenericParam,
1964) {
David Tolnayc2f1aba2017-11-12 20:29:22 -08001965 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001966 GenericParam::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001967 _visitor.visit_type_param(_binding_0);
David Tolnayc2f1aba2017-11-12 20:29:22 -08001968 }
David Tolnay8c81f622018-07-31 23:34:35 -07001969 GenericParam::Lifetime(ref _binding_0) => {
David Tolnay517f3692018-01-01 20:17:23 -08001970 _visitor.visit_lifetime_def(_binding_0);
1971 }
David Tolnay8c81f622018-07-31 23:34:35 -07001972 GenericParam::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001973 _visitor.visit_const_param(_binding_0);
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001974 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08001975 }
1976}
David Tolnay8c81f622018-07-31 23:34:35 -07001977#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001978pub fn visit_generics<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Generics) {
David Tolnay8c81f622018-07-31 23:34:35 -07001979 if let Some(ref it) = _i.lt_token {
1980 tokens_helper(_visitor, &(it).0)
1981 };
1982 for el in Punctuated::pairs(&_i.params) {
1983 let it = el.value();
1984 _visitor.visit_generic_param(it)
1985 }
1986 if let Some(ref it) = _i.gt_token {
1987 tokens_helper(_visitor, &(it).0)
1988 };
1989 if let Some(ref it) = _i.where_clause {
1990 _visitor.visit_where_clause(it)
1991 };
Nika Layzell27726662017-10-24 23:16:35 -04001992}
David Tolnay8c81f622018-07-31 23:34:35 -07001993pub fn visit_ident<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Ident) {}
1994#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001995pub fn visit_impl_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ImplItem) {
Nika Layzell27726662017-10-24 23:16:35 -04001996 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001997 ImplItem::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001998 _visitor.visit_impl_item_const(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001999 }
David Tolnay8c81f622018-07-31 23:34:35 -07002000 ImplItem::Method(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002001 _visitor.visit_impl_item_method(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002002 }
David Tolnay8c81f622018-07-31 23:34:35 -07002003 ImplItem::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002004 _visitor.visit_impl_item_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002005 }
David Tolnay8c81f622018-07-31 23:34:35 -07002006 ImplItem::Macro(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002007 _visitor.visit_impl_item_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002008 }
David Tolnay8c81f622018-07-31 23:34:35 -07002009 ImplItem::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002010 _visitor.visit_impl_item_verbatim(_binding_0);
2011 }
Nika Layzell27726662017-10-24 23:16:35 -04002012 }
2013}
David Tolnay8c81f622018-07-31 23:34:35 -07002014#[cfg(feature = "full")]
2015pub fn visit_impl_item_const<'ast, V: Visit<'ast> + ?Sized>(
2016 _visitor: &mut V,
2017 _i: &'ast ImplItemConst,
2018) {
2019 for it in &_i.attrs {
2020 _visitor.visit_attribute(it)
2021 }
2022 _visitor.visit_visibility(&_i.vis);
2023 if let Some(ref it) = _i.defaultness {
2024 tokens_helper(_visitor, &(it).0)
2025 };
2026 tokens_helper(_visitor, &(_i.const_token).0);
2027 _visitor.visit_ident(&_i.ident);
2028 tokens_helper(_visitor, &(_i.colon_token).0);
2029 _visitor.visit_type(&_i.ty);
2030 tokens_helper(_visitor, &(_i.eq_token).0);
2031 _visitor.visit_expr(&_i.expr);
2032 tokens_helper(_visitor, &(_i.semi_token).0);
David Tolnay857628c2017-11-11 12:25:31 -08002033}
David Tolnay8c81f622018-07-31 23:34:35 -07002034#[cfg(feature = "full")]
2035pub fn visit_impl_item_macro<'ast, V: Visit<'ast> + ?Sized>(
2036 _visitor: &mut V,
2037 _i: &'ast ImplItemMacro,
2038) {
2039 for it in &_i.attrs {
2040 _visitor.visit_attribute(it)
2041 }
2042 _visitor.visit_macro(&_i.mac);
2043 if let Some(ref it) = _i.semi_token {
2044 tokens_helper(_visitor, &(it).0)
2045 };
David Tolnay857628c2017-11-11 12:25:31 -08002046}
David Tolnay8c81f622018-07-31 23:34:35 -07002047#[cfg(feature = "full")]
2048pub fn visit_impl_item_method<'ast, V: Visit<'ast> + ?Sized>(
2049 _visitor: &mut V,
2050 _i: &'ast ImplItemMethod,
2051) {
2052 for it in &_i.attrs {
2053 _visitor.visit_attribute(it)
2054 }
2055 _visitor.visit_visibility(&_i.vis);
2056 if let Some(ref it) = _i.defaultness {
2057 tokens_helper(_visitor, &(it).0)
2058 };
2059 _visitor.visit_method_sig(&_i.sig);
2060 _visitor.visit_block(&_i.block);
Nika Layzell27726662017-10-24 23:16:35 -04002061}
David Tolnay8c81f622018-07-31 23:34:35 -07002062#[cfg(feature = "full")]
2063pub fn visit_impl_item_type<'ast, V: Visit<'ast> + ?Sized>(
2064 _visitor: &mut V,
2065 _i: &'ast ImplItemType,
2066) {
2067 for it in &_i.attrs {
2068 _visitor.visit_attribute(it)
2069 }
2070 _visitor.visit_visibility(&_i.vis);
2071 if let Some(ref it) = _i.defaultness {
2072 tokens_helper(_visitor, &(it).0)
2073 };
2074 tokens_helper(_visitor, &(_i.type_token).0);
2075 _visitor.visit_ident(&_i.ident);
2076 _visitor.visit_generics(&_i.generics);
2077 tokens_helper(_visitor, &(_i.eq_token).0);
2078 _visitor.visit_type(&_i.ty);
2079 tokens_helper(_visitor, &(_i.semi_token).0);
Nika Layzell27726662017-10-24 23:16:35 -04002080}
David Tolnay8c81f622018-07-31 23:34:35 -07002081#[cfg(feature = "full")]
2082pub fn visit_impl_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
2083 _visitor: &mut V,
2084 _i: &'ast ImplItemVerbatim,
2085) {
David Tolnay6af48992018-08-01 11:16:28 -07002086 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05002087}
David Tolnay8c81f622018-07-31 23:34:35 -07002088#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002089pub fn visit_index<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Index) {
David Tolnay6af48992018-08-01 11:16:28 -07002090 skip!(_i.index);
David Tolnay8c81f622018-07-31 23:34:35 -07002091 _visitor.visit_span(&_i.span);
David Tolnay85b69a42017-12-27 20:43:10 -05002092}
David Tolnay8c81f622018-07-31 23:34:35 -07002093#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002094pub fn visit_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Item) {
Nika Layzell27726662017-10-24 23:16:35 -04002095 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002096 Item::ExternCrate(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002097 _visitor.visit_item_extern_crate(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002098 }
David Tolnay8c81f622018-07-31 23:34:35 -07002099 Item::Use(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002100 _visitor.visit_item_use(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002101 }
David Tolnay8c81f622018-07-31 23:34:35 -07002102 Item::Static(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002103 _visitor.visit_item_static(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002104 }
David Tolnay8c81f622018-07-31 23:34:35 -07002105 Item::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002106 _visitor.visit_item_const(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002107 }
David Tolnay8c81f622018-07-31 23:34:35 -07002108 Item::Fn(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002109 _visitor.visit_item_fn(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002110 }
David Tolnay8c81f622018-07-31 23:34:35 -07002111 Item::Mod(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002112 _visitor.visit_item_mod(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002113 }
David Tolnay8c81f622018-07-31 23:34:35 -07002114 Item::ForeignMod(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002115 _visitor.visit_item_foreign_mod(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002116 }
David Tolnay8c81f622018-07-31 23:34:35 -07002117 Item::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002118 _visitor.visit_item_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002119 }
David Tolnay8c81f622018-07-31 23:34:35 -07002120 Item::Struct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002121 _visitor.visit_item_struct(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002122 }
David Tolnay8c81f622018-07-31 23:34:35 -07002123 Item::Enum(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05002124 _visitor.visit_item_enum(_binding_0);
2125 }
David Tolnay8c81f622018-07-31 23:34:35 -07002126 Item::Union(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002127 _visitor.visit_item_union(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002128 }
David Tolnay8c81f622018-07-31 23:34:35 -07002129 Item::Trait(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002130 _visitor.visit_item_trait(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002131 }
David Tolnay8c81f622018-07-31 23:34:35 -07002132 Item::Impl(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002133 _visitor.visit_item_impl(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002134 }
David Tolnay8c81f622018-07-31 23:34:35 -07002135 Item::Macro(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002136 _visitor.visit_item_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002137 }
David Tolnay8c81f622018-07-31 23:34:35 -07002138 Item::Macro2(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002139 _visitor.visit_item_macro2(_binding_0);
David Tolnay500d8322017-12-18 00:32:51 -08002140 }
David Tolnay8c81f622018-07-31 23:34:35 -07002141 Item::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002142 _visitor.visit_item_verbatim(_binding_0);
2143 }
Nika Layzell27726662017-10-24 23:16:35 -04002144 }
2145}
David Tolnay8c81f622018-07-31 23:34:35 -07002146#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002147pub fn visit_item_const<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemConst) {
David Tolnay8c81f622018-07-31 23:34:35 -07002148 for it in &_i.attrs {
2149 _visitor.visit_attribute(it)
2150 }
2151 _visitor.visit_visibility(&_i.vis);
2152 tokens_helper(_visitor, &(_i.const_token).0);
2153 _visitor.visit_ident(&_i.ident);
2154 tokens_helper(_visitor, &(_i.colon_token).0);
2155 _visitor.visit_type(&*_i.ty);
2156 tokens_helper(_visitor, &(_i.eq_token).0);
2157 _visitor.visit_expr(&*_i.expr);
2158 tokens_helper(_visitor, &(_i.semi_token).0);
David Tolnayc6b55bc2017-11-09 22:48:38 -08002159}
David Tolnay8c81f622018-07-31 23:34:35 -07002160#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002161pub fn visit_item_enum<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemEnum) {
David Tolnay8c81f622018-07-31 23:34:35 -07002162 for it in &_i.attrs {
2163 _visitor.visit_attribute(it)
2164 }
2165 _visitor.visit_visibility(&_i.vis);
2166 tokens_helper(_visitor, &(_i.enum_token).0);
2167 _visitor.visit_ident(&_i.ident);
2168 _visitor.visit_generics(&_i.generics);
2169 tokens_helper(_visitor, &(_i.brace_token).0);
2170 for el in Punctuated::pairs(&_i.variants) {
2171 let it = el.value();
2172 _visitor.visit_variant(it)
2173 }
David Tolnayc6b55bc2017-11-09 22:48:38 -08002174}
David Tolnay8c81f622018-07-31 23:34:35 -07002175#[cfg(feature = "full")]
2176pub fn visit_item_extern_crate<'ast, V: Visit<'ast> + ?Sized>(
2177 _visitor: &mut V,
2178 _i: &'ast ItemExternCrate,
2179) {
2180 for it in &_i.attrs {
2181 _visitor.visit_attribute(it)
2182 }
2183 _visitor.visit_visibility(&_i.vis);
2184 tokens_helper(_visitor, &(_i.extern_token).0);
2185 tokens_helper(_visitor, &(_i.crate_token).0);
2186 _visitor.visit_ident(&_i.ident);
2187 if let Some(ref it) = _i.rename {
2188 tokens_helper(_visitor, &((it).0).0);
2189 _visitor.visit_ident(&(it).1);
2190 };
2191 tokens_helper(_visitor, &(_i.semi_token).0);
David Tolnayc6b55bc2017-11-09 22:48:38 -08002192}
David Tolnay8c81f622018-07-31 23:34:35 -07002193#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002194pub fn visit_item_fn<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemFn) {
David Tolnay8c81f622018-07-31 23:34:35 -07002195 for it in &_i.attrs {
2196 _visitor.visit_attribute(it)
2197 }
2198 _visitor.visit_visibility(&_i.vis);
2199 if let Some(ref it) = _i.constness {
2200 tokens_helper(_visitor, &(it).0)
2201 };
2202 if let Some(ref it) = _i.unsafety {
2203 tokens_helper(_visitor, &(it).0)
2204 };
2205 if let Some(ref it) = _i.abi {
2206 _visitor.visit_abi(it)
2207 };
2208 _visitor.visit_ident(&_i.ident);
2209 _visitor.visit_fn_decl(&*_i.decl);
2210 _visitor.visit_block(&*_i.block);
David Tolnayc6b55bc2017-11-09 22:48:38 -08002211}
David Tolnay8c81f622018-07-31 23:34:35 -07002212#[cfg(feature = "full")]
2213pub fn visit_item_foreign_mod<'ast, V: Visit<'ast> + ?Sized>(
2214 _visitor: &mut V,
2215 _i: &'ast ItemForeignMod,
2216) {
2217 for it in &_i.attrs {
2218 _visitor.visit_attribute(it)
2219 }
2220 _visitor.visit_abi(&_i.abi);
2221 tokens_helper(_visitor, &(_i.brace_token).0);
2222 for it in &_i.items {
2223 _visitor.visit_foreign_item(it)
2224 }
David Tolnayc6b55bc2017-11-09 22:48:38 -08002225}
David Tolnay8c81f622018-07-31 23:34:35 -07002226#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002227pub fn visit_item_impl<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemImpl) {
David Tolnay8c81f622018-07-31 23:34:35 -07002228 for it in &_i.attrs {
2229 _visitor.visit_attribute(it)
2230 }
2231 if let Some(ref it) = _i.defaultness {
2232 tokens_helper(_visitor, &(it).0)
2233 };
2234 if let Some(ref it) = _i.unsafety {
2235 tokens_helper(_visitor, &(it).0)
2236 };
2237 tokens_helper(_visitor, &(_i.impl_token).0);
2238 _visitor.visit_generics(&_i.generics);
2239 if let Some(ref it) = _i.trait_ {
2240 if let Some(ref it) = (it).0 {
2241 tokens_helper(_visitor, &(it).0)
2242 };
2243 _visitor.visit_path(&(it).1);
2244 tokens_helper(_visitor, &((it).2).0);
2245 };
2246 _visitor.visit_type(&*_i.self_ty);
2247 tokens_helper(_visitor, &(_i.brace_token).0);
2248 for it in &_i.items {
2249 _visitor.visit_impl_item(it)
2250 }
David Tolnayc6b55bc2017-11-09 22:48:38 -08002251}
David Tolnay8c81f622018-07-31 23:34:35 -07002252#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002253pub fn visit_item_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemMacro) {
David Tolnay8c81f622018-07-31 23:34:35 -07002254 for it in &_i.attrs {
2255 _visitor.visit_attribute(it)
2256 }
2257 if let Some(ref it) = _i.ident {
2258 _visitor.visit_ident(it)
2259 };
2260 _visitor.visit_macro(&_i.mac);
2261 if let Some(ref it) = _i.semi_token {
2262 tokens_helper(_visitor, &(it).0)
2263 };
David Tolnayc6b55bc2017-11-09 22:48:38 -08002264}
David Tolnay8c81f622018-07-31 23:34:35 -07002265#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002266pub fn visit_item_macro2<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemMacro2) {
David Tolnay8c81f622018-07-31 23:34:35 -07002267 for it in &_i.attrs {
2268 _visitor.visit_attribute(it)
2269 }
2270 _visitor.visit_visibility(&_i.vis);
2271 tokens_helper(_visitor, &(_i.macro_token).0);
2272 _visitor.visit_ident(&_i.ident);
2273 tokens_helper(_visitor, &(_i.paren_token).0);
David Tolnay6af48992018-08-01 11:16:28 -07002274 skip!(_i.args);
David Tolnay8c81f622018-07-31 23:34:35 -07002275 tokens_helper(_visitor, &(_i.brace_token).0);
David Tolnay6af48992018-08-01 11:16:28 -07002276 skip!(_i.body);
David Tolnay500d8322017-12-18 00:32:51 -08002277}
David Tolnay8c81f622018-07-31 23:34:35 -07002278#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002279pub fn visit_item_mod<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemMod) {
David Tolnay8c81f622018-07-31 23:34:35 -07002280 for it in &_i.attrs {
2281 _visitor.visit_attribute(it)
2282 }
2283 _visitor.visit_visibility(&_i.vis);
2284 tokens_helper(_visitor, &(_i.mod_token).0);
2285 _visitor.visit_ident(&_i.ident);
2286 if let Some(ref it) = _i.content {
2287 tokens_helper(_visitor, &((it).0).0);
2288 for it in &(it).1 {
2289 _visitor.visit_item(it)
2290 }
2291 };
2292 if let Some(ref it) = _i.semi {
2293 tokens_helper(_visitor, &(it).0)
2294 };
Nika Layzell27726662017-10-24 23:16:35 -04002295}
David Tolnay8c81f622018-07-31 23:34:35 -07002296#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002297pub fn visit_item_static<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemStatic) {
David Tolnay8c81f622018-07-31 23:34:35 -07002298 for it in &_i.attrs {
2299 _visitor.visit_attribute(it)
2300 }
2301 _visitor.visit_visibility(&_i.vis);
2302 tokens_helper(_visitor, &(_i.static_token).0);
2303 if let Some(ref it) = _i.mutability {
2304 tokens_helper(_visitor, &(it).0)
2305 };
2306 _visitor.visit_ident(&_i.ident);
2307 tokens_helper(_visitor, &(_i.colon_token).0);
2308 _visitor.visit_type(&*_i.ty);
2309 tokens_helper(_visitor, &(_i.eq_token).0);
2310 _visitor.visit_expr(&*_i.expr);
2311 tokens_helper(_visitor, &(_i.semi_token).0);
Nika Layzell27726662017-10-24 23:16:35 -04002312}
David Tolnay8c81f622018-07-31 23:34:35 -07002313#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002314pub fn visit_item_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemStruct) {
David Tolnay8c81f622018-07-31 23:34:35 -07002315 for it in &_i.attrs {
2316 _visitor.visit_attribute(it)
2317 }
2318 _visitor.visit_visibility(&_i.vis);
2319 tokens_helper(_visitor, &(_i.struct_token).0);
2320 _visitor.visit_ident(&_i.ident);
2321 _visitor.visit_generics(&_i.generics);
2322 _visitor.visit_fields(&_i.fields);
2323 if let Some(ref it) = _i.semi_token {
2324 tokens_helper(_visitor, &(it).0)
2325 };
Nika Layzell27726662017-10-24 23:16:35 -04002326}
David Tolnay8c81f622018-07-31 23:34:35 -07002327#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002328pub fn visit_item_trait<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemTrait) {
David Tolnay8c81f622018-07-31 23:34:35 -07002329 for it in &_i.attrs {
2330 _visitor.visit_attribute(it)
2331 }
2332 _visitor.visit_visibility(&_i.vis);
2333 if let Some(ref it) = _i.unsafety {
2334 tokens_helper(_visitor, &(it).0)
2335 };
2336 if let Some(ref it) = _i.auto_token {
2337 tokens_helper(_visitor, &(it).0)
2338 };
2339 tokens_helper(_visitor, &(_i.trait_token).0);
2340 _visitor.visit_ident(&_i.ident);
2341 _visitor.visit_generics(&_i.generics);
2342 if let Some(ref it) = _i.colon_token {
2343 tokens_helper(_visitor, &(it).0)
2344 };
2345 for el in Punctuated::pairs(&_i.supertraits) {
2346 let it = el.value();
2347 _visitor.visit_type_param_bound(it)
2348 }
2349 tokens_helper(_visitor, &(_i.brace_token).0);
2350 for it in &_i.items {
2351 _visitor.visit_trait_item(it)
2352 }
Nika Layzell27726662017-10-24 23:16:35 -04002353}
David Tolnay8c81f622018-07-31 23:34:35 -07002354#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002355pub fn visit_item_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemType) {
David Tolnay8c81f622018-07-31 23:34:35 -07002356 for it in &_i.attrs {
2357 _visitor.visit_attribute(it)
2358 }
2359 _visitor.visit_visibility(&_i.vis);
2360 tokens_helper(_visitor, &(_i.type_token).0);
2361 _visitor.visit_ident(&_i.ident);
2362 _visitor.visit_generics(&_i.generics);
2363 tokens_helper(_visitor, &(_i.eq_token).0);
2364 _visitor.visit_type(&*_i.ty);
2365 tokens_helper(_visitor, &(_i.semi_token).0);
Nika Layzell27726662017-10-24 23:16:35 -04002366}
David Tolnay8c81f622018-07-31 23:34:35 -07002367#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002368pub fn visit_item_union<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemUnion) {
David Tolnay8c81f622018-07-31 23:34:35 -07002369 for it in &_i.attrs {
2370 _visitor.visit_attribute(it)
2371 }
2372 _visitor.visit_visibility(&_i.vis);
2373 tokens_helper(_visitor, &(_i.union_token).0);
2374 _visitor.visit_ident(&_i.ident);
2375 _visitor.visit_generics(&_i.generics);
2376 _visitor.visit_fields_named(&_i.fields);
Nika Layzell27726662017-10-24 23:16:35 -04002377}
David Tolnay8c81f622018-07-31 23:34:35 -07002378#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002379pub fn visit_item_use<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemUse) {
David Tolnay8c81f622018-07-31 23:34:35 -07002380 for it in &_i.attrs {
2381 _visitor.visit_attribute(it)
2382 }
2383 _visitor.visit_visibility(&_i.vis);
2384 tokens_helper(_visitor, &(_i.use_token).0);
2385 if let Some(ref it) = _i.leading_colon {
2386 tokens_helper(_visitor, &(it).0)
2387 };
2388 _visitor.visit_use_tree(&_i.tree);
2389 tokens_helper(_visitor, &(_i.semi_token).0);
Nika Layzell27726662017-10-24 23:16:35 -04002390}
David Tolnay8c81f622018-07-31 23:34:35 -07002391#[cfg(feature = "full")]
2392pub fn visit_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
2393 _visitor: &mut V,
2394 _i: &'ast ItemVerbatim,
2395) {
David Tolnay6af48992018-08-01 11:16:28 -07002396 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05002397}
David Tolnay8c81f622018-07-31 23:34:35 -07002398#[cfg(any(feature = "full", feature = "derive"))]
2399#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002400pub fn visit_label<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Label) {
David Tolnay8c81f622018-07-31 23:34:35 -07002401 _visitor.visit_lifetime(&_i.name);
2402 tokens_helper(_visitor, &(_i.colon_token).0);
David Tolnaybcd498f2017-12-29 12:02:33 -05002403}
David Tolnay8c81f622018-07-31 23:34:35 -07002404#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002405pub fn visit_lifetime<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Lifetime) {
David Tolnay6af48992018-08-01 11:16:28 -07002406 skip!(_i.apostrophe);
David Tolnay8c81f622018-07-31 23:34:35 -07002407 _visitor.visit_ident(&_i.ident);
David Tolnay4ba63a02017-12-28 15:53:05 -05002408}
David Tolnay8c81f622018-07-31 23:34:35 -07002409#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002410pub fn visit_lifetime_def<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LifetimeDef) {
David Tolnay8c81f622018-07-31 23:34:35 -07002411 for it in &_i.attrs {
2412 _visitor.visit_attribute(it)
2413 }
2414 _visitor.visit_lifetime(&_i.lifetime);
2415 if let Some(ref it) = _i.colon_token {
2416 tokens_helper(_visitor, &(it).0)
2417 };
2418 for el in Punctuated::pairs(&_i.bounds) {
2419 let it = el.value();
2420 _visitor.visit_lifetime(it)
2421 }
David Tolnay4ba63a02017-12-28 15:53:05 -05002422}
David Tolnay8c81f622018-07-31 23:34:35 -07002423#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002424pub fn visit_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Lit) {
David Tolnay360efd22018-01-04 23:35:26 -08002425 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002426 Lit::Str(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002427 _visitor.visit_lit_str(_binding_0);
2428 }
David Tolnay8c81f622018-07-31 23:34:35 -07002429 Lit::ByteStr(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002430 _visitor.visit_lit_byte_str(_binding_0);
2431 }
David Tolnay8c81f622018-07-31 23:34:35 -07002432 Lit::Byte(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002433 _visitor.visit_lit_byte(_binding_0);
2434 }
David Tolnay8c81f622018-07-31 23:34:35 -07002435 Lit::Char(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002436 _visitor.visit_lit_char(_binding_0);
2437 }
David Tolnay8c81f622018-07-31 23:34:35 -07002438 Lit::Int(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002439 _visitor.visit_lit_int(_binding_0);
2440 }
David Tolnay8c81f622018-07-31 23:34:35 -07002441 Lit::Float(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002442 _visitor.visit_lit_float(_binding_0);
2443 }
David Tolnay8c81f622018-07-31 23:34:35 -07002444 Lit::Bool(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002445 _visitor.visit_lit_bool(_binding_0);
2446 }
David Tolnay8c81f622018-07-31 23:34:35 -07002447 Lit::Verbatim(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002448 _visitor.visit_lit_verbatim(_binding_0);
2449 }
2450 }
2451}
David Tolnay8c81f622018-07-31 23:34:35 -07002452#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002453pub fn visit_lit_bool<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitBool) {
David Tolnay6af48992018-08-01 11:16:28 -07002454 skip!(_i.value);
David Tolnay8c81f622018-07-31 23:34:35 -07002455 _visitor.visit_span(&_i.span);
Nika Layzell27726662017-10-24 23:16:35 -04002456}
David Tolnay8c81f622018-07-31 23:34:35 -07002457#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002458pub fn visit_lit_byte<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitByte) {
David Tolnay6af48992018-08-01 11:16:28 -07002459 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002460}
David Tolnay8c81f622018-07-31 23:34:35 -07002461#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002462pub fn visit_lit_byte_str<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitByteStr) {
David Tolnay6af48992018-08-01 11:16:28 -07002463 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002464}
David Tolnay8c81f622018-07-31 23:34:35 -07002465#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002466pub fn visit_lit_char<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitChar) {
David Tolnay6af48992018-08-01 11:16:28 -07002467 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002468}
David Tolnay8c81f622018-07-31 23:34:35 -07002469#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002470pub fn visit_lit_float<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitFloat) {
David Tolnay6af48992018-08-01 11:16:28 -07002471 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002472}
David Tolnay8c81f622018-07-31 23:34:35 -07002473#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002474pub fn visit_lit_int<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitInt) {
David Tolnay6af48992018-08-01 11:16:28 -07002475 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002476}
David Tolnay8c81f622018-07-31 23:34:35 -07002477#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002478pub fn visit_lit_str<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitStr) {
David Tolnay6af48992018-08-01 11:16:28 -07002479 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002480}
David Tolnay8c81f622018-07-31 23:34:35 -07002481#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002482pub fn visit_lit_verbatim<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitVerbatim) {
David Tolnay6af48992018-08-01 11:16:28 -07002483 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002484}
David Tolnay8c81f622018-07-31 23:34:35 -07002485#[cfg(any(feature = "full", feature = "derive"))]
2486#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002487pub fn visit_local<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Local) {
David Tolnay8c81f622018-07-31 23:34:35 -07002488 for it in &_i.attrs {
2489 _visitor.visit_attribute(it)
2490 }
2491 tokens_helper(_visitor, &(_i.let_token).0);
2492 for el in Punctuated::pairs(&_i.pats) {
2493 let it = el.value();
2494 _visitor.visit_pat(it)
2495 }
2496 if let Some(ref it) = _i.ty {
2497 tokens_helper(_visitor, &((it).0).0);
2498 _visitor.visit_type(&*(it).1);
2499 };
2500 if let Some(ref it) = _i.init {
2501 tokens_helper(_visitor, &((it).0).0);
2502 _visitor.visit_expr(&*(it).1);
2503 };
2504 tokens_helper(_visitor, &(_i.semi_token).0);
Nika Layzell27726662017-10-24 23:16:35 -04002505}
David Tolnay8c81f622018-07-31 23:34:35 -07002506#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002507pub fn visit_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Macro) {
David Tolnay8c81f622018-07-31 23:34:35 -07002508 _visitor.visit_path(&_i.path);
2509 tokens_helper(_visitor, &(_i.bang_token).0);
2510 _visitor.visit_macro_delimiter(&_i.delimiter);
David Tolnay6af48992018-08-01 11:16:28 -07002511 skip!(_i.tts);
David Tolnayab919512017-12-30 23:31:51 -05002512}
David Tolnay8c81f622018-07-31 23:34:35 -07002513#[cfg(any(feature = "full", feature = "derive"))]
2514pub fn visit_macro_delimiter<'ast, V: Visit<'ast> + ?Sized>(
2515 _visitor: &mut V,
2516 _i: &'ast MacroDelimiter,
2517) {
David Tolnayab919512017-12-30 23:31:51 -05002518 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002519 MacroDelimiter::Paren(ref _binding_0) => {
David Tolnayab919512017-12-30 23:31:51 -05002520 tokens_helper(_visitor, &(_binding_0).0);
2521 }
David Tolnay8c81f622018-07-31 23:34:35 -07002522 MacroDelimiter::Brace(ref _binding_0) => {
David Tolnayab919512017-12-30 23:31:51 -05002523 tokens_helper(_visitor, &(_binding_0).0);
2524 }
David Tolnay8c81f622018-07-31 23:34:35 -07002525 MacroDelimiter::Bracket(ref _binding_0) => {
David Tolnayab919512017-12-30 23:31:51 -05002526 tokens_helper(_visitor, &(_binding_0).0);
2527 }
2528 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002529}
David Tolnay8c81f622018-07-31 23:34:35 -07002530#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002531pub fn visit_member<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Member) {
David Tolnay85b69a42017-12-27 20:43:10 -05002532 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002533 Member::Named(ref _binding_0) => {
Alex Crichtond261d092018-05-18 13:47:35 -07002534 _visitor.visit_ident(_binding_0);
David Tolnay85b69a42017-12-27 20:43:10 -05002535 }
David Tolnay8c81f622018-07-31 23:34:35 -07002536 Member::Unnamed(ref _binding_0) => {
David Tolnay85b69a42017-12-27 20:43:10 -05002537 _visitor.visit_index(_binding_0);
2538 }
2539 }
2540}
David Tolnay8c81f622018-07-31 23:34:35 -07002541#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayaaadd782018-01-06 22:58:13 -08002542pub fn visit_meta<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Meta) {
Nika Layzell27726662017-10-24 23:16:35 -04002543 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002544 Meta::Word(ref _binding_0) => {
Alex Crichtond261d092018-05-18 13:47:35 -07002545 _visitor.visit_ident(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002546 }
David Tolnay8c81f622018-07-31 23:34:35 -07002547 Meta::List(ref _binding_0) => {
David Tolnayaaadd782018-01-06 22:58:13 -08002548 _visitor.visit_meta_list(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002549 }
David Tolnay8c81f622018-07-31 23:34:35 -07002550 Meta::NameValue(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002551 _visitor.visit_meta_name_value(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002552 }
2553 }
2554}
David Tolnay8c81f622018-07-31 23:34:35 -07002555#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayaaadd782018-01-06 22:58:13 -08002556pub fn visit_meta_list<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast MetaList) {
David Tolnay8c81f622018-07-31 23:34:35 -07002557 _visitor.visit_ident(&_i.ident);
2558 tokens_helper(_visitor, &(_i.paren_token).0);
2559 for el in Punctuated::pairs(&_i.nested) {
2560 let it = el.value();
2561 _visitor.visit_nested_meta(it)
2562 }
Nika Layzell27726662017-10-24 23:16:35 -04002563}
David Tolnay8c81f622018-07-31 23:34:35 -07002564#[cfg(any(feature = "full", feature = "derive"))]
2565pub fn visit_meta_name_value<'ast, V: Visit<'ast> + ?Sized>(
2566 _visitor: &mut V,
2567 _i: &'ast MetaNameValue,
2568) {
2569 _visitor.visit_ident(&_i.ident);
2570 tokens_helper(_visitor, &(_i.eq_token).0);
2571 _visitor.visit_lit(&_i.lit);
Nika Layzell27726662017-10-24 23:16:35 -04002572}
David Tolnay8c81f622018-07-31 23:34:35 -07002573#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002574pub fn visit_method_sig<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast MethodSig) {
David Tolnay8c81f622018-07-31 23:34:35 -07002575 if let Some(ref it) = _i.constness {
2576 tokens_helper(_visitor, &(it).0)
2577 };
2578 if let Some(ref it) = _i.unsafety {
2579 tokens_helper(_visitor, &(it).0)
2580 };
2581 if let Some(ref it) = _i.abi {
2582 _visitor.visit_abi(it)
2583 };
2584 _visitor.visit_ident(&_i.ident);
2585 _visitor.visit_fn_decl(&_i.decl);
Nika Layzell27726662017-10-24 23:16:35 -04002586}
David Tolnay8c81f622018-07-31 23:34:35 -07002587#[cfg(any(feature = "full", feature = "derive"))]
2588#[cfg(feature = "full")]
2589pub fn visit_method_turbofish<'ast, V: Visit<'ast> + ?Sized>(
2590 _visitor: &mut V,
2591 _i: &'ast MethodTurbofish,
2592) {
2593 tokens_helper(_visitor, &(_i.colon2_token).0);
2594 tokens_helper(_visitor, &(_i.lt_token).0);
2595 for el in Punctuated::pairs(&_i.args) {
2596 let it = el.value();
2597 _visitor.visit_generic_method_argument(it)
2598 }
2599 tokens_helper(_visitor, &(_i.gt_token).0);
David Tolnayd60cfec2017-12-29 00:21:38 -05002600}
David Tolnay8c81f622018-07-31 23:34:35 -07002601#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayaaadd782018-01-06 22:58:13 -08002602pub fn visit_nested_meta<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast NestedMeta) {
Nika Layzell27726662017-10-24 23:16:35 -04002603 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002604 NestedMeta::Meta(ref _binding_0) => {
David Tolnayaaadd782018-01-06 22:58:13 -08002605 _visitor.visit_meta(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002606 }
David Tolnay8c81f622018-07-31 23:34:35 -07002607 NestedMeta::Literal(ref _binding_0) => {
David Tolnay4ba63a02017-12-28 15:53:05 -05002608 _visitor.visit_lit(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002609 }
2610 }
2611}
David Tolnay8c81f622018-07-31 23:34:35 -07002612#[cfg(any(feature = "full", feature = "derive"))]
2613pub fn visit_parenthesized_generic_arguments<'ast, V: Visit<'ast> + ?Sized>(
2614 _visitor: &mut V,
2615 _i: &'ast ParenthesizedGenericArguments,
2616) {
2617 tokens_helper(_visitor, &(_i.paren_token).0);
2618 for el in Punctuated::pairs(&_i.inputs) {
2619 let it = el.value();
2620 _visitor.visit_type(it)
2621 }
2622 _visitor.visit_return_type(&_i.output);
Nika Layzell27726662017-10-24 23:16:35 -04002623}
David Tolnay8c81f622018-07-31 23:34:35 -07002624#[cfg(any(feature = "full", feature = "derive"))]
2625#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002626pub fn visit_pat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Pat) {
Nika Layzell27726662017-10-24 23:16:35 -04002627 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002628 Pat::Wild(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002629 _visitor.visit_pat_wild(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002630 }
David Tolnay8c81f622018-07-31 23:34:35 -07002631 Pat::Ident(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002632 _visitor.visit_pat_ident(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002633 }
David Tolnay8c81f622018-07-31 23:34:35 -07002634 Pat::Struct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002635 _visitor.visit_pat_struct(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002636 }
David Tolnay8c81f622018-07-31 23:34:35 -07002637 Pat::TupleStruct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002638 _visitor.visit_pat_tuple_struct(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002639 }
David Tolnay8c81f622018-07-31 23:34:35 -07002640 Pat::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002641 _visitor.visit_pat_path(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002642 }
David Tolnay8c81f622018-07-31 23:34:35 -07002643 Pat::Tuple(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002644 _visitor.visit_pat_tuple(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002645 }
David Tolnay8c81f622018-07-31 23:34:35 -07002646 Pat::Box(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002647 _visitor.visit_pat_box(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002648 }
David Tolnay8c81f622018-07-31 23:34:35 -07002649 Pat::Ref(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002650 _visitor.visit_pat_ref(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002651 }
David Tolnay8c81f622018-07-31 23:34:35 -07002652 Pat::Lit(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002653 _visitor.visit_pat_lit(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002654 }
David Tolnay8c81f622018-07-31 23:34:35 -07002655 Pat::Range(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002656 _visitor.visit_pat_range(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002657 }
David Tolnay8c81f622018-07-31 23:34:35 -07002658 Pat::Slice(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002659 _visitor.visit_pat_slice(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002660 }
David Tolnay8c81f622018-07-31 23:34:35 -07002661 Pat::Macro(ref _binding_0) => {
David Tolnay323279a2017-12-29 11:26:32 -05002662 _visitor.visit_pat_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002663 }
David Tolnay8c81f622018-07-31 23:34:35 -07002664 Pat::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002665 _visitor.visit_pat_verbatim(_binding_0);
2666 }
Nika Layzell27726662017-10-24 23:16:35 -04002667 }
2668}
David Tolnay8c81f622018-07-31 23:34:35 -07002669#[cfg(any(feature = "full", feature = "derive"))]
2670#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002671pub fn visit_pat_box<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatBox) {
David Tolnay8c81f622018-07-31 23:34:35 -07002672 tokens_helper(_visitor, &(_i.box_token).0);
2673 _visitor.visit_pat(&*_i.pat);
Nika Layzell27726662017-10-24 23:16:35 -04002674}
David Tolnay8c81f622018-07-31 23:34:35 -07002675#[cfg(any(feature = "full", feature = "derive"))]
2676#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002677pub fn visit_pat_ident<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatIdent) {
David Tolnay8c81f622018-07-31 23:34:35 -07002678 if let Some(ref it) = _i.by_ref {
2679 tokens_helper(_visitor, &(it).0)
2680 };
2681 if let Some(ref it) = _i.mutability {
2682 tokens_helper(_visitor, &(it).0)
2683 };
2684 _visitor.visit_ident(&_i.ident);
2685 if let Some(ref it) = _i.subpat {
2686 tokens_helper(_visitor, &((it).0).0);
2687 _visitor.visit_pat(&*(it).1);
2688 };
Nika Layzell27726662017-10-24 23:16:35 -04002689}
David Tolnay8c81f622018-07-31 23:34:35 -07002690#[cfg(any(feature = "full", feature = "derive"))]
2691#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002692pub fn visit_pat_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatLit) {
David Tolnay8c81f622018-07-31 23:34:35 -07002693 _visitor.visit_expr(&*_i.expr);
Nika Layzell27726662017-10-24 23:16:35 -04002694}
David Tolnay8c81f622018-07-31 23:34:35 -07002695#[cfg(any(feature = "full", feature = "derive"))]
2696#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002697pub fn visit_pat_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatMacro) {
David Tolnay8c81f622018-07-31 23:34:35 -07002698 _visitor.visit_macro(&_i.mac);
David Tolnay323279a2017-12-29 11:26:32 -05002699}
David Tolnay8c81f622018-07-31 23:34:35 -07002700#[cfg(any(feature = "full", feature = "derive"))]
2701#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002702pub fn visit_pat_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatPath) {
David Tolnay8c81f622018-07-31 23:34:35 -07002703 if let Some(ref it) = _i.qself {
2704 _visitor.visit_qself(it)
2705 };
2706 _visitor.visit_path(&_i.path);
Nika Layzell27726662017-10-24 23:16:35 -04002707}
David Tolnay8c81f622018-07-31 23:34:35 -07002708#[cfg(any(feature = "full", feature = "derive"))]
2709#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002710pub fn visit_pat_range<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatRange) {
David Tolnay8c81f622018-07-31 23:34:35 -07002711 _visitor.visit_expr(&*_i.lo);
2712 _visitor.visit_range_limits(&_i.limits);
2713 _visitor.visit_expr(&*_i.hi);
Nika Layzell27726662017-10-24 23:16:35 -04002714}
David Tolnay8c81f622018-07-31 23:34:35 -07002715#[cfg(any(feature = "full", feature = "derive"))]
2716#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002717pub fn visit_pat_ref<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatRef) {
David Tolnay8c81f622018-07-31 23:34:35 -07002718 tokens_helper(_visitor, &(_i.and_token).0);
2719 if let Some(ref it) = _i.mutability {
2720 tokens_helper(_visitor, &(it).0)
2721 };
2722 _visitor.visit_pat(&*_i.pat);
Nika Layzell27726662017-10-24 23:16:35 -04002723}
David Tolnay8c81f622018-07-31 23:34:35 -07002724#[cfg(any(feature = "full", feature = "derive"))]
2725#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002726pub fn visit_pat_slice<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatSlice) {
David Tolnay8c81f622018-07-31 23:34:35 -07002727 tokens_helper(_visitor, &(_i.bracket_token).0);
2728 for el in Punctuated::pairs(&_i.front) {
2729 let it = el.value();
2730 _visitor.visit_pat(it)
2731 }
2732 if let Some(ref it) = _i.middle {
2733 _visitor.visit_pat(&**it)
2734 };
2735 if let Some(ref it) = _i.dot2_token {
2736 tokens_helper(_visitor, &(it).0)
2737 };
2738 if let Some(ref it) = _i.comma_token {
2739 tokens_helper(_visitor, &(it).0)
2740 };
2741 for el in Punctuated::pairs(&_i.back) {
2742 let it = el.value();
2743 _visitor.visit_pat(it)
2744 }
Nika Layzell27726662017-10-24 23:16:35 -04002745}
David Tolnay8c81f622018-07-31 23:34:35 -07002746#[cfg(any(feature = "full", feature = "derive"))]
2747#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002748pub fn visit_pat_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatStruct) {
David Tolnay8c81f622018-07-31 23:34:35 -07002749 _visitor.visit_path(&_i.path);
2750 tokens_helper(_visitor, &(_i.brace_token).0);
2751 for el in Punctuated::pairs(&_i.fields) {
2752 let it = el.value();
2753 _visitor.visit_field_pat(it)
2754 }
2755 if let Some(ref it) = _i.dot2_token {
2756 tokens_helper(_visitor, &(it).0)
2757 };
Nika Layzell27726662017-10-24 23:16:35 -04002758}
David Tolnay8c81f622018-07-31 23:34:35 -07002759#[cfg(any(feature = "full", feature = "derive"))]
2760#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002761pub fn visit_pat_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatTuple) {
David Tolnay8c81f622018-07-31 23:34:35 -07002762 tokens_helper(_visitor, &(_i.paren_token).0);
2763 for el in Punctuated::pairs(&_i.front) {
2764 let it = el.value();
2765 _visitor.visit_pat(it)
2766 }
2767 if let Some(ref it) = _i.dot2_token {
2768 tokens_helper(_visitor, &(it).0)
2769 };
2770 if let Some(ref it) = _i.comma_token {
2771 tokens_helper(_visitor, &(it).0)
2772 };
2773 for el in Punctuated::pairs(&_i.back) {
2774 let it = el.value();
2775 _visitor.visit_pat(it)
2776 }
Nika Layzell27726662017-10-24 23:16:35 -04002777}
David Tolnay8c81f622018-07-31 23:34:35 -07002778#[cfg(any(feature = "full", feature = "derive"))]
2779#[cfg(feature = "full")]
2780pub fn visit_pat_tuple_struct<'ast, V: Visit<'ast> + ?Sized>(
2781 _visitor: &mut V,
2782 _i: &'ast PatTupleStruct,
2783) {
2784 _visitor.visit_path(&_i.path);
2785 _visitor.visit_pat_tuple(&_i.pat);
Nika Layzell27726662017-10-24 23:16:35 -04002786}
David Tolnay8c81f622018-07-31 23:34:35 -07002787#[cfg(any(feature = "full", feature = "derive"))]
2788#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002789pub fn visit_pat_verbatim<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatVerbatim) {
David Tolnay6af48992018-08-01 11:16:28 -07002790 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05002791}
David Tolnay8c81f622018-07-31 23:34:35 -07002792#[cfg(any(feature = "full", feature = "derive"))]
2793#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002794pub fn visit_pat_wild<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatWild) {
David Tolnay8c81f622018-07-31 23:34:35 -07002795 tokens_helper(_visitor, &(_i.underscore_token).0);
Nika Layzell27726662017-10-24 23:16:35 -04002796}
David Tolnay8c81f622018-07-31 23:34:35 -07002797#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002798pub fn visit_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Path) {
David Tolnay8c81f622018-07-31 23:34:35 -07002799 if let Some(ref it) = _i.leading_colon {
2800 tokens_helper(_visitor, &(it).0)
2801 };
2802 for el in Punctuated::pairs(&_i.segments) {
2803 let it = el.value();
2804 _visitor.visit_path_segment(it)
2805 }
Nika Layzell27726662017-10-24 23:16:35 -04002806}
David Tolnay8c81f622018-07-31 23:34:35 -07002807#[cfg(any(feature = "full", feature = "derive"))]
2808pub fn visit_path_arguments<'ast, V: Visit<'ast> + ?Sized>(
2809 _visitor: &mut V,
2810 _i: &'ast PathArguments,
2811) {
Nika Layzellc08227a2017-12-04 16:30:17 -05002812 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002813 PathArguments::None => {}
2814 PathArguments::AngleBracketed(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002815 _visitor.visit_angle_bracketed_generic_arguments(_binding_0);
Nika Layzellc08227a2017-12-04 16:30:17 -05002816 }
David Tolnay8c81f622018-07-31 23:34:35 -07002817 PathArguments::Parenthesized(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002818 _visitor.visit_parenthesized_generic_arguments(_binding_0);
Nika Layzellc08227a2017-12-04 16:30:17 -05002819 }
2820 }
2821}
David Tolnay8c81f622018-07-31 23:34:35 -07002822#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002823pub fn visit_path_segment<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PathSegment) {
David Tolnay8c81f622018-07-31 23:34:35 -07002824 _visitor.visit_ident(&_i.ident);
2825 _visitor.visit_path_arguments(&_i.arguments);
Nika Layzell27726662017-10-24 23:16:35 -04002826}
David Tolnay8c81f622018-07-31 23:34:35 -07002827#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002828pub fn visit_predicate_eq<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PredicateEq) {
David Tolnay8c81f622018-07-31 23:34:35 -07002829 _visitor.visit_type(&_i.lhs_ty);
2830 tokens_helper(_visitor, &(_i.eq_token).0);
2831 _visitor.visit_type(&_i.rhs_ty);
David Tolnayd4add852018-01-01 20:13:24 -08002832}
David Tolnay8c81f622018-07-31 23:34:35 -07002833#[cfg(any(feature = "full", feature = "derive"))]
2834pub fn visit_predicate_lifetime<'ast, V: Visit<'ast> + ?Sized>(
2835 _visitor: &mut V,
2836 _i: &'ast PredicateLifetime,
2837) {
2838 _visitor.visit_lifetime(&_i.lifetime);
2839 if let Some(ref it) = _i.colon_token {
2840 tokens_helper(_visitor, &(it).0)
2841 };
2842 for el in Punctuated::pairs(&_i.bounds) {
2843 let it = el.value();
2844 _visitor.visit_lifetime(it)
2845 }
David Tolnayd4add852018-01-01 20:13:24 -08002846}
David Tolnay8c81f622018-07-31 23:34:35 -07002847#[cfg(any(feature = "full", feature = "derive"))]
2848pub fn visit_predicate_type<'ast, V: Visit<'ast> + ?Sized>(
2849 _visitor: &mut V,
2850 _i: &'ast PredicateType,
2851) {
2852 if let Some(ref it) = _i.lifetimes {
2853 _visitor.visit_bound_lifetimes(it)
2854 };
2855 _visitor.visit_type(&_i.bounded_ty);
2856 tokens_helper(_visitor, &(_i.colon_token).0);
2857 for el in Punctuated::pairs(&_i.bounds) {
2858 let it = el.value();
2859 _visitor.visit_type_param_bound(it)
2860 }
David Tolnayd4add852018-01-01 20:13:24 -08002861}
David Tolnay8c81f622018-07-31 23:34:35 -07002862#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002863pub fn visit_qself<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast QSelf) {
David Tolnay8c81f622018-07-31 23:34:35 -07002864 tokens_helper(_visitor, &(_i.lt_token).0);
2865 _visitor.visit_type(&*_i.ty);
David Tolnay6af48992018-08-01 11:16:28 -07002866 skip!(_i.position);
David Tolnay8c81f622018-07-31 23:34:35 -07002867 if let Some(ref it) = _i.as_token {
2868 tokens_helper(_visitor, &(it).0)
2869 };
2870 tokens_helper(_visitor, &(_i.gt_token).0);
Nika Layzell27726662017-10-24 23:16:35 -04002871}
David Tolnay8c81f622018-07-31 23:34:35 -07002872#[cfg(any(feature = "full", feature = "derive"))]
2873#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002874pub fn visit_range_limits<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast RangeLimits) {
Nika Layzell27726662017-10-24 23:16:35 -04002875 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002876 RangeLimits::HalfOpen(ref _binding_0) => {
David Tolnaycc0f0372017-12-28 19:11:04 -05002877 tokens_helper(_visitor, &(_binding_0).0);
Nika Layzell27726662017-10-24 23:16:35 -04002878 }
David Tolnay8c81f622018-07-31 23:34:35 -07002879 RangeLimits::Closed(ref _binding_0) => {
David Tolnaycc0f0372017-12-28 19:11:04 -05002880 tokens_helper(_visitor, &(_binding_0).0);
Nika Layzell27726662017-10-24 23:16:35 -04002881 }
2882 }
2883}
David Tolnay8c81f622018-07-31 23:34:35 -07002884#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002885pub fn visit_return_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ReturnType) {
David Tolnayf93b90d2017-11-11 19:21:26 -08002886 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002887 ReturnType::Default => {}
2888 ReturnType::Type(ref _binding_0, ref _binding_1) => {
David Tolnay4a3f59a2017-12-28 21:21:12 -05002889 tokens_helper(_visitor, &(_binding_0).0);
David Tolnay8c81f622018-07-31 23:34:35 -07002890 _visitor.visit_type(&**_binding_1);
David Tolnayf93b90d2017-11-11 19:21:26 -08002891 }
2892 }
2893}
David Tolnay8c81f622018-07-31 23:34:35 -07002894pub fn visit_span<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Span) {}
2895#[cfg(any(feature = "full", feature = "derive"))]
2896#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002897pub fn visit_stmt<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Stmt) {
Nika Layzell27726662017-10-24 23:16:35 -04002898 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002899 Stmt::Local(ref _binding_0) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08002900 _visitor.visit_local(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002901 }
David Tolnay8c81f622018-07-31 23:34:35 -07002902 Stmt::Item(ref _binding_0) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08002903 _visitor.visit_item(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002904 }
David Tolnay8c81f622018-07-31 23:34:35 -07002905 Stmt::Expr(ref _binding_0) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08002906 _visitor.visit_expr(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002907 }
David Tolnay8c81f622018-07-31 23:34:35 -07002908 Stmt::Semi(ref _binding_0, ref _binding_1) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08002909 _visitor.visit_expr(_binding_0);
David Tolnaycc0f0372017-12-28 19:11:04 -05002910 tokens_helper(_visitor, &(_binding_1).0);
Nika Layzell27726662017-10-24 23:16:35 -04002911 }
Nika Layzell27726662017-10-24 23:16:35 -04002912 }
2913}
David Tolnay8c81f622018-07-31 23:34:35 -07002914#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002915pub fn visit_trait_bound<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TraitBound) {
David Tolnay8c81f622018-07-31 23:34:35 -07002916 if let Some(ref it) = _i.paren_token {
2917 tokens_helper(_visitor, &(it).0)
2918 };
2919 _visitor.visit_trait_bound_modifier(&_i.modifier);
2920 if let Some(ref it) = _i.lifetimes {
2921 _visitor.visit_bound_lifetimes(it)
2922 };
2923 _visitor.visit_path(&_i.path);
David Tolnay40fb8ce2018-01-02 10:53:46 -08002924}
David Tolnay8c81f622018-07-31 23:34:35 -07002925#[cfg(any(feature = "full", feature = "derive"))]
2926pub fn visit_trait_bound_modifier<'ast, V: Visit<'ast> + ?Sized>(
2927 _visitor: &mut V,
2928 _i: &'ast TraitBoundModifier,
2929) {
Nika Layzell27726662017-10-24 23:16:35 -04002930 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002931 TraitBoundModifier::None => {}
2932 TraitBoundModifier::Maybe(ref _binding_0) => {
David Tolnaycc0f0372017-12-28 19:11:04 -05002933 tokens_helper(_visitor, &(_binding_0).0);
Nika Layzell27726662017-10-24 23:16:35 -04002934 }
2935 }
2936}
David Tolnay8c81f622018-07-31 23:34:35 -07002937#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002938pub fn visit_trait_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TraitItem) {
Nika Layzell27726662017-10-24 23:16:35 -04002939 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002940 TraitItem::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002941 _visitor.visit_trait_item_const(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002942 }
David Tolnay8c81f622018-07-31 23:34:35 -07002943 TraitItem::Method(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002944 _visitor.visit_trait_item_method(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002945 }
David Tolnay8c81f622018-07-31 23:34:35 -07002946 TraitItem::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002947 _visitor.visit_trait_item_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002948 }
David Tolnay8c81f622018-07-31 23:34:35 -07002949 TraitItem::Macro(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002950 _visitor.visit_trait_item_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002951 }
David Tolnay8c81f622018-07-31 23:34:35 -07002952 TraitItem::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002953 _visitor.visit_trait_item_verbatim(_binding_0);
2954 }
Nika Layzell27726662017-10-24 23:16:35 -04002955 }
2956}
David Tolnay8c81f622018-07-31 23:34:35 -07002957#[cfg(feature = "full")]
2958pub fn visit_trait_item_const<'ast, V: Visit<'ast> + ?Sized>(
2959 _visitor: &mut V,
2960 _i: &'ast TraitItemConst,
2961) {
2962 for it in &_i.attrs {
2963 _visitor.visit_attribute(it)
2964 }
2965 tokens_helper(_visitor, &(_i.const_token).0);
2966 _visitor.visit_ident(&_i.ident);
2967 tokens_helper(_visitor, &(_i.colon_token).0);
2968 _visitor.visit_type(&_i.ty);
2969 if let Some(ref it) = _i.default {
2970 tokens_helper(_visitor, &((it).0).0);
2971 _visitor.visit_expr(&(it).1);
2972 };
2973 tokens_helper(_visitor, &(_i.semi_token).0);
David Tolnayda705bd2017-11-10 21:58:05 -08002974}
David Tolnay8c81f622018-07-31 23:34:35 -07002975#[cfg(feature = "full")]
2976pub fn visit_trait_item_macro<'ast, V: Visit<'ast> + ?Sized>(
2977 _visitor: &mut V,
2978 _i: &'ast TraitItemMacro,
2979) {
2980 for it in &_i.attrs {
2981 _visitor.visit_attribute(it)
2982 }
2983 _visitor.visit_macro(&_i.mac);
2984 if let Some(ref it) = _i.semi_token {
2985 tokens_helper(_visitor, &(it).0)
2986 };
David Tolnayda705bd2017-11-10 21:58:05 -08002987}
David Tolnay8c81f622018-07-31 23:34:35 -07002988#[cfg(feature = "full")]
2989pub fn visit_trait_item_method<'ast, V: Visit<'ast> + ?Sized>(
2990 _visitor: &mut V,
2991 _i: &'ast TraitItemMethod,
2992) {
2993 for it in &_i.attrs {
2994 _visitor.visit_attribute(it)
2995 }
2996 _visitor.visit_method_sig(&_i.sig);
2997 if let Some(ref it) = _i.default {
2998 _visitor.visit_block(it)
2999 };
3000 if let Some(ref it) = _i.semi_token {
3001 tokens_helper(_visitor, &(it).0)
3002 };
Nika Layzell27726662017-10-24 23:16:35 -04003003}
David Tolnay8c81f622018-07-31 23:34:35 -07003004#[cfg(feature = "full")]
3005pub fn visit_trait_item_type<'ast, V: Visit<'ast> + ?Sized>(
3006 _visitor: &mut V,
3007 _i: &'ast TraitItemType,
3008) {
3009 for it in &_i.attrs {
3010 _visitor.visit_attribute(it)
3011 }
3012 tokens_helper(_visitor, &(_i.type_token).0);
3013 _visitor.visit_ident(&_i.ident);
3014 _visitor.visit_generics(&_i.generics);
3015 if let Some(ref it) = _i.colon_token {
3016 tokens_helper(_visitor, &(it).0)
3017 };
3018 for el in Punctuated::pairs(&_i.bounds) {
3019 let it = el.value();
3020 _visitor.visit_type_param_bound(it)
3021 }
3022 if let Some(ref it) = _i.default {
3023 tokens_helper(_visitor, &((it).0).0);
3024 _visitor.visit_type(&(it).1);
3025 };
3026 tokens_helper(_visitor, &(_i.semi_token).0);
Nika Layzell27726662017-10-24 23:16:35 -04003027}
David Tolnay8c81f622018-07-31 23:34:35 -07003028#[cfg(feature = "full")]
3029pub fn visit_trait_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
3030 _visitor: &mut V,
3031 _i: &'ast TraitItemVerbatim,
3032) {
David Tolnay6af48992018-08-01 11:16:28 -07003033 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05003034}
David Tolnay8c81f622018-07-31 23:34:35 -07003035#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003036pub fn visit_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Type) {
Nika Layzell27726662017-10-24 23:16:35 -04003037 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003038 Type::Slice(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003039 _visitor.visit_type_slice(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003040 }
David Tolnay8c81f622018-07-31 23:34:35 -07003041 Type::Array(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003042 _visitor.visit_type_array(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003043 }
David Tolnay8c81f622018-07-31 23:34:35 -07003044 Type::Ptr(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003045 _visitor.visit_type_ptr(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003046 }
David Tolnay8c81f622018-07-31 23:34:35 -07003047 Type::Reference(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003048 _visitor.visit_type_reference(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003049 }
David Tolnay8c81f622018-07-31 23:34:35 -07003050 Type::BareFn(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003051 _visitor.visit_type_bare_fn(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003052 }
David Tolnay8c81f622018-07-31 23:34:35 -07003053 Type::Never(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003054 _visitor.visit_type_never(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003055 }
David Tolnay8c81f622018-07-31 23:34:35 -07003056 Type::Tuple(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003057 _visitor.visit_type_tuple(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003058 }
David Tolnay8c81f622018-07-31 23:34:35 -07003059 Type::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003060 _visitor.visit_type_path(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003061 }
David Tolnay8c81f622018-07-31 23:34:35 -07003062 Type::TraitObject(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003063 _visitor.visit_type_trait_object(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003064 }
David Tolnay8c81f622018-07-31 23:34:35 -07003065 Type::ImplTrait(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003066 _visitor.visit_type_impl_trait(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003067 }
David Tolnay8c81f622018-07-31 23:34:35 -07003068 Type::Paren(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003069 _visitor.visit_type_paren(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003070 }
David Tolnay8c81f622018-07-31 23:34:35 -07003071 Type::Group(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003072 _visitor.visit_type_group(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003073 }
David Tolnay8c81f622018-07-31 23:34:35 -07003074 Type::Infer(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003075 _visitor.visit_type_infer(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003076 }
David Tolnay8c81f622018-07-31 23:34:35 -07003077 Type::Macro(ref _binding_0) => {
David Tolnay323279a2017-12-29 11:26:32 -05003078 _visitor.visit_type_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003079 }
David Tolnay8c81f622018-07-31 23:34:35 -07003080 Type::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05003081 _visitor.visit_type_verbatim(_binding_0);
3082 }
Nika Layzell27726662017-10-24 23:16:35 -04003083 }
3084}
David Tolnay8c81f622018-07-31 23:34:35 -07003085#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003086pub fn visit_type_array<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeArray) {
David Tolnay8c81f622018-07-31 23:34:35 -07003087 tokens_helper(_visitor, &(_i.bracket_token).0);
3088 _visitor.visit_type(&*_i.elem);
3089 tokens_helper(_visitor, &(_i.semi_token).0);
3090 _visitor.visit_expr(&_i.len);
Nika Layzell27726662017-10-24 23:16:35 -04003091}
David Tolnay8c81f622018-07-31 23:34:35 -07003092#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003093pub fn visit_type_bare_fn<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeBareFn) {
David Tolnay8c81f622018-07-31 23:34:35 -07003094 if let Some(ref it) = _i.unsafety {
3095 tokens_helper(_visitor, &(it).0)
3096 };
3097 if let Some(ref it) = _i.abi {
3098 _visitor.visit_abi(it)
3099 };
3100 tokens_helper(_visitor, &(_i.fn_token).0);
3101 if let Some(ref it) = _i.lifetimes {
3102 _visitor.visit_bound_lifetimes(it)
3103 };
3104 tokens_helper(_visitor, &(_i.paren_token).0);
3105 for el in Punctuated::pairs(&_i.inputs) {
3106 let it = el.value();
3107 _visitor.visit_bare_fn_arg(it)
3108 }
3109 if let Some(ref it) = _i.variadic {
3110 tokens_helper(_visitor, &(it).0)
3111 };
3112 _visitor.visit_return_type(&_i.output);
Nika Layzell27726662017-10-24 23:16:35 -04003113}
David Tolnay8c81f622018-07-31 23:34:35 -07003114#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003115pub fn visit_type_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeGroup) {
David Tolnay8c81f622018-07-31 23:34:35 -07003116 tokens_helper(_visitor, &(_i.group_token).0);
3117 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003118}
David Tolnay8c81f622018-07-31 23:34:35 -07003119#[cfg(any(feature = "full", feature = "derive"))]
3120pub fn visit_type_impl_trait<'ast, V: Visit<'ast> + ?Sized>(
3121 _visitor: &mut V,
3122 _i: &'ast TypeImplTrait,
3123) {
3124 tokens_helper(_visitor, &(_i.impl_token).0);
3125 for el in Punctuated::pairs(&_i.bounds) {
3126 let it = el.value();
3127 _visitor.visit_type_param_bound(it)
3128 }
Nika Layzell27726662017-10-24 23:16:35 -04003129}
David Tolnay8c81f622018-07-31 23:34:35 -07003130#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003131pub fn visit_type_infer<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeInfer) {
David Tolnay8c81f622018-07-31 23:34:35 -07003132 tokens_helper(_visitor, &(_i.underscore_token).0);
Nika Layzell27726662017-10-24 23:16:35 -04003133}
David Tolnay8c81f622018-07-31 23:34:35 -07003134#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003135pub fn visit_type_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeMacro) {
David Tolnay8c81f622018-07-31 23:34:35 -07003136 _visitor.visit_macro(&_i.mac);
David Tolnay323279a2017-12-29 11:26:32 -05003137}
David Tolnay8c81f622018-07-31 23:34:35 -07003138#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003139pub fn visit_type_never<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeNever) {
David Tolnay8c81f622018-07-31 23:34:35 -07003140 tokens_helper(_visitor, &(_i.bang_token).0);
Nika Layzell27726662017-10-24 23:16:35 -04003141}
David Tolnay8c81f622018-07-31 23:34:35 -07003142#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003143pub fn visit_type_param<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeParam) {
David Tolnay8c81f622018-07-31 23:34:35 -07003144 for it in &_i.attrs {
3145 _visitor.visit_attribute(it)
3146 }
3147 _visitor.visit_ident(&_i.ident);
3148 if let Some(ref it) = _i.colon_token {
3149 tokens_helper(_visitor, &(it).0)
3150 };
3151 for el in Punctuated::pairs(&_i.bounds) {
3152 let it = el.value();
3153 _visitor.visit_type_param_bound(it)
3154 }
3155 if let Some(ref it) = _i.eq_token {
3156 tokens_helper(_visitor, &(it).0)
3157 };
3158 if let Some(ref it) = _i.default {
3159 _visitor.visit_type(it)
3160 };
Nika Layzell27726662017-10-24 23:16:35 -04003161}
David Tolnay8c81f622018-07-31 23:34:35 -07003162#[cfg(any(feature = "full", feature = "derive"))]
3163pub fn visit_type_param_bound<'ast, V: Visit<'ast> + ?Sized>(
3164 _visitor: &mut V,
3165 _i: &'ast TypeParamBound,
3166) {
Nika Layzell27726662017-10-24 23:16:35 -04003167 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003168 TypeParamBound::Trait(ref _binding_0) => {
David Tolnay40fb8ce2018-01-02 10:53:46 -08003169 _visitor.visit_trait_bound(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003170 }
David Tolnay8c81f622018-07-31 23:34:35 -07003171 TypeParamBound::Lifetime(ref _binding_0) => {
David Tolnay4ba63a02017-12-28 15:53:05 -05003172 _visitor.visit_lifetime(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003173 }
3174 }
3175}
David Tolnay8c81f622018-07-31 23:34:35 -07003176#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003177pub fn visit_type_paren<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeParen) {
David Tolnay8c81f622018-07-31 23:34:35 -07003178 tokens_helper(_visitor, &(_i.paren_token).0);
3179 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003180}
David Tolnay8c81f622018-07-31 23:34:35 -07003181#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003182pub fn visit_type_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypePath) {
David Tolnay8c81f622018-07-31 23:34:35 -07003183 if let Some(ref it) = _i.qself {
3184 _visitor.visit_qself(it)
3185 };
3186 _visitor.visit_path(&_i.path);
Nika Layzell27726662017-10-24 23:16:35 -04003187}
David Tolnay8c81f622018-07-31 23:34:35 -07003188#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003189pub fn visit_type_ptr<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypePtr) {
David Tolnay8c81f622018-07-31 23:34:35 -07003190 tokens_helper(_visitor, &(_i.star_token).0);
3191 if let Some(ref it) = _i.const_token {
3192 tokens_helper(_visitor, &(it).0)
3193 };
3194 if let Some(ref it) = _i.mutability {
3195 tokens_helper(_visitor, &(it).0)
3196 };
3197 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003198}
David Tolnay8c81f622018-07-31 23:34:35 -07003199#[cfg(any(feature = "full", feature = "derive"))]
3200pub fn visit_type_reference<'ast, V: Visit<'ast> + ?Sized>(
3201 _visitor: &mut V,
3202 _i: &'ast TypeReference,
3203) {
3204 tokens_helper(_visitor, &(_i.and_token).0);
3205 if let Some(ref it) = _i.lifetime {
3206 _visitor.visit_lifetime(it)
3207 };
3208 if let Some(ref it) = _i.mutability {
3209 tokens_helper(_visitor, &(it).0)
3210 };
3211 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003212}
David Tolnay8c81f622018-07-31 23:34:35 -07003213#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003214pub fn visit_type_slice<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeSlice) {
David Tolnay8c81f622018-07-31 23:34:35 -07003215 tokens_helper(_visitor, &(_i.bracket_token).0);
3216 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003217}
David Tolnay8c81f622018-07-31 23:34:35 -07003218#[cfg(any(feature = "full", feature = "derive"))]
3219pub fn visit_type_trait_object<'ast, V: Visit<'ast> + ?Sized>(
3220 _visitor: &mut V,
3221 _i: &'ast TypeTraitObject,
3222) {
3223 if let Some(ref it) = _i.dyn_token {
3224 tokens_helper(_visitor, &(it).0)
3225 };
3226 for el in Punctuated::pairs(&_i.bounds) {
3227 let it = el.value();
3228 _visitor.visit_type_param_bound(it)
3229 }
Nika Layzell27726662017-10-24 23:16:35 -04003230}
David Tolnay8c81f622018-07-31 23:34:35 -07003231#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003232pub fn visit_type_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeTuple) {
David Tolnay8c81f622018-07-31 23:34:35 -07003233 tokens_helper(_visitor, &(_i.paren_token).0);
3234 for el in Punctuated::pairs(&_i.elems) {
3235 let it = el.value();
3236 _visitor.visit_type(it)
3237 }
Nika Layzell27726662017-10-24 23:16:35 -04003238}
David Tolnay8c81f622018-07-31 23:34:35 -07003239#[cfg(any(feature = "full", feature = "derive"))]
3240pub fn visit_type_verbatim<'ast, V: Visit<'ast> + ?Sized>(
3241 _visitor: &mut V,
3242 _i: &'ast TypeVerbatim,
3243) {
David Tolnay6af48992018-08-01 11:16:28 -07003244 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05003245}
David Tolnay8c81f622018-07-31 23:34:35 -07003246#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003247pub fn visit_un_op<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UnOp) {
Nika Layzell27726662017-10-24 23:16:35 -04003248 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003249 UnOp::Deref(ref _binding_0) => {
David Tolnaycc0f0372017-12-28 19:11:04 -05003250 tokens_helper(_visitor, &(_binding_0).0);
Nika Layzell27726662017-10-24 23:16:35 -04003251 }
David Tolnay8c81f622018-07-31 23:34:35 -07003252 UnOp::Not(ref _binding_0) => {
David Tolnaycc0f0372017-12-28 19:11:04 -05003253 tokens_helper(_visitor, &(_binding_0).0);
Nika Layzell27726662017-10-24 23:16:35 -04003254 }
David Tolnay8c81f622018-07-31 23:34:35 -07003255 UnOp::Neg(ref _binding_0) => {
David Tolnaycc0f0372017-12-28 19:11:04 -05003256 tokens_helper(_visitor, &(_binding_0).0);
Nika Layzell27726662017-10-24 23:16:35 -04003257 }
3258 }
3259}
David Tolnay8c81f622018-07-31 23:34:35 -07003260#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003261pub fn visit_use_glob<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseGlob) {
David Tolnay8c81f622018-07-31 23:34:35 -07003262 tokens_helper(_visitor, &(_i.star_token).0);
David Tolnay5f332a92017-12-26 00:42:45 -05003263}
David Tolnay8c81f622018-07-31 23:34:35 -07003264#[cfg(feature = "full")]
David Tolnayd97a7d22018-03-31 19:17:01 +02003265pub fn visit_use_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseGroup) {
David Tolnay8c81f622018-07-31 23:34:35 -07003266 tokens_helper(_visitor, &(_i.brace_token).0);
3267 for el in Punctuated::pairs(&_i.items) {
3268 let it = el.value();
3269 _visitor.visit_use_tree(it)
3270 }
David Tolnay5f332a92017-12-26 00:42:45 -05003271}
David Tolnay8c81f622018-07-31 23:34:35 -07003272#[cfg(feature = "full")]
David Tolnayd97a7d22018-03-31 19:17:01 +02003273pub fn visit_use_name<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseName) {
David Tolnay8c81f622018-07-31 23:34:35 -07003274 _visitor.visit_ident(&_i.ident);
David Tolnayd97a7d22018-03-31 19:17:01 +02003275}
David Tolnay8c81f622018-07-31 23:34:35 -07003276#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003277pub fn visit_use_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UsePath) {
David Tolnay8c81f622018-07-31 23:34:35 -07003278 _visitor.visit_ident(&_i.ident);
3279 tokens_helper(_visitor, &(_i.colon2_token).0);
3280 _visitor.visit_use_tree(&*_i.tree);
David Tolnayd97a7d22018-03-31 19:17:01 +02003281}
David Tolnay8c81f622018-07-31 23:34:35 -07003282#[cfg(feature = "full")]
David Tolnayd97a7d22018-03-31 19:17:01 +02003283pub fn visit_use_rename<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseRename) {
David Tolnay8c81f622018-07-31 23:34:35 -07003284 _visitor.visit_ident(&_i.ident);
3285 tokens_helper(_visitor, &(_i.as_token).0);
3286 _visitor.visit_ident(&_i.rename);
David Tolnay5f332a92017-12-26 00:42:45 -05003287}
David Tolnay8c81f622018-07-31 23:34:35 -07003288#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003289pub fn visit_use_tree<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseTree) {
David Tolnay5f332a92017-12-26 00:42:45 -05003290 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003291 UseTree::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003292 _visitor.visit_use_path(_binding_0);
David Tolnay5f332a92017-12-26 00:42:45 -05003293 }
David Tolnay8c81f622018-07-31 23:34:35 -07003294 UseTree::Name(ref _binding_0) => {
David Tolnayd97a7d22018-03-31 19:17:01 +02003295 _visitor.visit_use_name(_binding_0);
3296 }
David Tolnay8c81f622018-07-31 23:34:35 -07003297 UseTree::Rename(ref _binding_0) => {
David Tolnayd97a7d22018-03-31 19:17:01 +02003298 _visitor.visit_use_rename(_binding_0);
3299 }
David Tolnay8c81f622018-07-31 23:34:35 -07003300 UseTree::Glob(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003301 _visitor.visit_use_glob(_binding_0);
David Tolnay5f332a92017-12-26 00:42:45 -05003302 }
David Tolnay8c81f622018-07-31 23:34:35 -07003303 UseTree::Group(ref _binding_0) => {
David Tolnayd97a7d22018-03-31 19:17:01 +02003304 _visitor.visit_use_group(_binding_0);
David Tolnay5f332a92017-12-26 00:42:45 -05003305 }
3306 }
3307}
David Tolnay8c81f622018-07-31 23:34:35 -07003308#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003309pub fn visit_variant<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Variant) {
David Tolnay8c81f622018-07-31 23:34:35 -07003310 for it in &_i.attrs {
3311 _visitor.visit_attribute(it)
3312 }
3313 _visitor.visit_ident(&_i.ident);
3314 _visitor.visit_fields(&_i.fields);
3315 if let Some(ref it) = _i.discriminant {
3316 tokens_helper(_visitor, &((it).0).0);
3317 _visitor.visit_expr(&(it).1);
3318 };
Nika Layzell27726662017-10-24 23:16:35 -04003319}
David Tolnay8c81f622018-07-31 23:34:35 -07003320#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003321pub fn visit_vis_crate<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast VisCrate) {
David Tolnay8c81f622018-07-31 23:34:35 -07003322 tokens_helper(_visitor, &(_i.crate_token).0);
Nika Layzell27726662017-10-24 23:16:35 -04003323}
David Tolnay8c81f622018-07-31 23:34:35 -07003324#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003325pub fn visit_vis_public<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast VisPublic) {
David Tolnay8c81f622018-07-31 23:34:35 -07003326 tokens_helper(_visitor, &(_i.pub_token).0);
Nika Layzell27726662017-10-24 23:16:35 -04003327}
David Tolnay8c81f622018-07-31 23:34:35 -07003328#[cfg(any(feature = "full", feature = "derive"))]
3329pub fn visit_vis_restricted<'ast, V: Visit<'ast> + ?Sized>(
3330 _visitor: &mut V,
3331 _i: &'ast VisRestricted,
3332) {
3333 tokens_helper(_visitor, &(_i.pub_token).0);
3334 tokens_helper(_visitor, &(_i.paren_token).0);
3335 if let Some(ref it) = _i.in_token {
3336 tokens_helper(_visitor, &(it).0)
3337 };
3338 _visitor.visit_path(&*_i.path);
Nika Layzell27726662017-10-24 23:16:35 -04003339}
David Tolnay8c81f622018-07-31 23:34:35 -07003340#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003341pub fn visit_visibility<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Visibility) {
Nika Layzell27726662017-10-24 23:16:35 -04003342 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003343 Visibility::Public(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003344 _visitor.visit_vis_public(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003345 }
David Tolnay8c81f622018-07-31 23:34:35 -07003346 Visibility::Crate(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003347 _visitor.visit_vis_crate(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003348 }
David Tolnay8c81f622018-07-31 23:34:35 -07003349 Visibility::Restricted(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003350 _visitor.visit_vis_restricted(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003351 }
David Tolnay8c81f622018-07-31 23:34:35 -07003352 Visibility::Inherited => {}
Nika Layzell27726662017-10-24 23:16:35 -04003353 }
3354}
David Tolnay8c81f622018-07-31 23:34:35 -07003355#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003356pub fn visit_where_clause<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast WhereClause) {
David Tolnay8c81f622018-07-31 23:34:35 -07003357 tokens_helper(_visitor, &(_i.where_token).0);
3358 for el in Punctuated::pairs(&_i.predicates) {
3359 let it = el.value();
3360 _visitor.visit_where_predicate(it)
3361 }
Nika Layzell27726662017-10-24 23:16:35 -04003362}
David Tolnay8c81f622018-07-31 23:34:35 -07003363#[cfg(any(feature = "full", feature = "derive"))]
3364pub fn visit_where_predicate<'ast, V: Visit<'ast> + ?Sized>(
3365 _visitor: &mut V,
3366 _i: &'ast WherePredicate,
3367) {
Nika Layzell27726662017-10-24 23:16:35 -04003368 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003369 WherePredicate::Type(ref _binding_0) => {
David Tolnayd4add852018-01-01 20:13:24 -08003370 _visitor.visit_predicate_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003371 }
David Tolnay8c81f622018-07-31 23:34:35 -07003372 WherePredicate::Lifetime(ref _binding_0) => {
David Tolnayd4add852018-01-01 20:13:24 -08003373 _visitor.visit_predicate_lifetime(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003374 }
David Tolnay8c81f622018-07-31 23:34:35 -07003375 WherePredicate::Eq(ref _binding_0) => {
David Tolnayd4add852018-01-01 20:13:24 -08003376 _visitor.visit_predicate_eq(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003377 }
3378 }
3379}