blob: 931c4fb2b2f133b016abc5c10ec83af293dc2e57 [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))]
4
David Tolnay0a0d78c2018-01-05 15:24:01 -08005#[cfg(any(feature = "full", feature = "derive"))]
David Tolnaycc0f0372017-12-28 19:11:04 -05006use gen::helper::visit::*;
David Tolnay8c81f622018-07-31 23:34:35 -07007use proc_macro2::Span;
8#[cfg(any(feature = "full", feature = "derive"))]
9use punctuated::Punctuated;
10use *;
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040011
12#[cfg(feature = "full")]
13macro_rules! full {
David Tolnay8c81f622018-07-31 23:34:35 -070014 ($e:expr) => {
15 $e
16 };
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040017}
18
David Tolnay0a0d78c2018-01-05 15:24:01 -080019#[cfg(all(feature = "derive", not(feature = "full")))]
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040020macro_rules! full {
David Tolnay8c81f622018-07-31 23:34:35 -070021 ($e:expr) => {
22 unreachable!()
23 };
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040024}
25
David Tolnayded2d682018-01-06 18:53:53 -080026/// Syntax tree traversal to walk a shared borrow of a syntax tree.
Nika Layzell27726662017-10-24 23:16:35 -040027///
David Tolnayded2d682018-01-06 18:53:53 -080028/// See the [module documentation] for details.
29///
30/// [module documentation]: index.html
David Tolnay12374262018-01-07 12:38:34 -080031///
32/// *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 }
Alex Crichtond261d092018-05-18 13:47:35 -0700385
David Tolnay8c81f622018-07-31 23:34:35 -0700386 fn visit_ident(&mut self, i: &'ast Ident) {
387 visit_ident(self, i)
388 }
389 #[cfg(feature = "full")]
390 fn visit_impl_item(&mut self, i: &'ast ImplItem) {
391 visit_impl_item(self, i)
392 }
393 #[cfg(feature = "full")]
394 fn visit_impl_item_const(&mut self, i: &'ast ImplItemConst) {
395 visit_impl_item_const(self, i)
396 }
397 #[cfg(feature = "full")]
398 fn visit_impl_item_macro(&mut self, i: &'ast ImplItemMacro) {
399 visit_impl_item_macro(self, i)
400 }
401 #[cfg(feature = "full")]
402 fn visit_impl_item_method(&mut self, i: &'ast ImplItemMethod) {
403 visit_impl_item_method(self, i)
404 }
405 #[cfg(feature = "full")]
406 fn visit_impl_item_type(&mut self, i: &'ast ImplItemType) {
407 visit_impl_item_type(self, i)
408 }
409 #[cfg(feature = "full")]
410 fn visit_impl_item_verbatim(&mut self, i: &'ast ImplItemVerbatim) {
411 visit_impl_item_verbatim(self, i)
412 }
413 #[cfg(any(feature = "full", feature = "derive"))]
414 fn visit_index(&mut self, i: &'ast Index) {
415 visit_index(self, i)
416 }
417 #[cfg(feature = "full")]
418 fn visit_item(&mut self, i: &'ast Item) {
419 visit_item(self, i)
420 }
421 #[cfg(feature = "full")]
422 fn visit_item_const(&mut self, i: &'ast ItemConst) {
423 visit_item_const(self, i)
424 }
425 #[cfg(feature = "full")]
426 fn visit_item_enum(&mut self, i: &'ast ItemEnum) {
427 visit_item_enum(self, i)
428 }
429 #[cfg(feature = "full")]
430 fn visit_item_extern_crate(&mut self, i: &'ast ItemExternCrate) {
431 visit_item_extern_crate(self, i)
432 }
433 #[cfg(feature = "full")]
434 fn visit_item_fn(&mut self, i: &'ast ItemFn) {
435 visit_item_fn(self, i)
436 }
437 #[cfg(feature = "full")]
438 fn visit_item_foreign_mod(&mut self, i: &'ast ItemForeignMod) {
439 visit_item_foreign_mod(self, i)
440 }
441 #[cfg(feature = "full")]
442 fn visit_item_impl(&mut self, i: &'ast ItemImpl) {
443 visit_item_impl(self, i)
444 }
445 #[cfg(feature = "full")]
446 fn visit_item_macro(&mut self, i: &'ast ItemMacro) {
447 visit_item_macro(self, i)
448 }
449 #[cfg(feature = "full")]
450 fn visit_item_macro2(&mut self, i: &'ast ItemMacro2) {
451 visit_item_macro2(self, i)
452 }
453 #[cfg(feature = "full")]
454 fn visit_item_mod(&mut self, i: &'ast ItemMod) {
455 visit_item_mod(self, i)
456 }
457 #[cfg(feature = "full")]
458 fn visit_item_static(&mut self, i: &'ast ItemStatic) {
459 visit_item_static(self, i)
460 }
461 #[cfg(feature = "full")]
462 fn visit_item_struct(&mut self, i: &'ast ItemStruct) {
463 visit_item_struct(self, i)
464 }
465 #[cfg(feature = "full")]
466 fn visit_item_trait(&mut self, i: &'ast ItemTrait) {
467 visit_item_trait(self, i)
468 }
469 #[cfg(feature = "full")]
470 fn visit_item_type(&mut self, i: &'ast ItemType) {
471 visit_item_type(self, i)
472 }
473 #[cfg(feature = "full")]
474 fn visit_item_union(&mut self, i: &'ast ItemUnion) {
475 visit_item_union(self, i)
476 }
477 #[cfg(feature = "full")]
478 fn visit_item_use(&mut self, i: &'ast ItemUse) {
479 visit_item_use(self, i)
480 }
481 #[cfg(feature = "full")]
482 fn visit_item_verbatim(&mut self, i: &'ast ItemVerbatim) {
483 visit_item_verbatim(self, i)
484 }
485 #[cfg(any(feature = "full", feature = "derive"))]
486 #[cfg(feature = "full")]
487 fn visit_label(&mut self, i: &'ast Label) {
488 visit_label(self, i)
489 }
490 #[cfg(any(feature = "full", feature = "derive"))]
491 fn visit_lifetime(&mut self, i: &'ast Lifetime) {
492 visit_lifetime(self, i)
493 }
494 #[cfg(any(feature = "full", feature = "derive"))]
495 fn visit_lifetime_def(&mut self, i: &'ast LifetimeDef) {
496 visit_lifetime_def(self, i)
497 }
498 #[cfg(any(feature = "full", feature = "derive"))]
499 fn visit_lit(&mut self, i: &'ast Lit) {
500 visit_lit(self, i)
501 }
502 #[cfg(any(feature = "full", feature = "derive"))]
503 fn visit_lit_bool(&mut self, i: &'ast LitBool) {
504 visit_lit_bool(self, i)
505 }
506 #[cfg(any(feature = "full", feature = "derive"))]
507 fn visit_lit_byte(&mut self, i: &'ast LitByte) {
508 visit_lit_byte(self, i)
509 }
510 #[cfg(any(feature = "full", feature = "derive"))]
511 fn visit_lit_byte_str(&mut self, i: &'ast LitByteStr) {
512 visit_lit_byte_str(self, i)
513 }
514 #[cfg(any(feature = "full", feature = "derive"))]
515 fn visit_lit_char(&mut self, i: &'ast LitChar) {
516 visit_lit_char(self, i)
517 }
518 #[cfg(any(feature = "full", feature = "derive"))]
519 fn visit_lit_float(&mut self, i: &'ast LitFloat) {
520 visit_lit_float(self, i)
521 }
522 #[cfg(any(feature = "full", feature = "derive"))]
523 fn visit_lit_int(&mut self, i: &'ast LitInt) {
524 visit_lit_int(self, i)
525 }
526 #[cfg(any(feature = "full", feature = "derive"))]
527 fn visit_lit_str(&mut self, i: &'ast LitStr) {
528 visit_lit_str(self, i)
529 }
530 #[cfg(any(feature = "full", feature = "derive"))]
531 fn visit_lit_verbatim(&mut self, i: &'ast LitVerbatim) {
532 visit_lit_verbatim(self, i)
533 }
534 #[cfg(any(feature = "full", feature = "derive"))]
535 #[cfg(feature = "full")]
536 fn visit_local(&mut self, i: &'ast Local) {
537 visit_local(self, i)
538 }
539 #[cfg(any(feature = "full", feature = "derive"))]
540 fn visit_macro(&mut self, i: &'ast Macro) {
541 visit_macro(self, i)
542 }
543 #[cfg(any(feature = "full", feature = "derive"))]
544 fn visit_macro_delimiter(&mut self, i: &'ast MacroDelimiter) {
545 visit_macro_delimiter(self, i)
546 }
547 #[cfg(any(feature = "full", feature = "derive"))]
548 fn visit_member(&mut self, i: &'ast Member) {
549 visit_member(self, i)
550 }
551 #[cfg(any(feature = "full", feature = "derive"))]
552 fn visit_meta(&mut self, i: &'ast Meta) {
553 visit_meta(self, i)
554 }
555 #[cfg(any(feature = "full", feature = "derive"))]
556 fn visit_meta_list(&mut self, i: &'ast MetaList) {
557 visit_meta_list(self, i)
558 }
559 #[cfg(any(feature = "full", feature = "derive"))]
560 fn visit_meta_name_value(&mut self, i: &'ast MetaNameValue) {
561 visit_meta_name_value(self, i)
562 }
563 #[cfg(feature = "full")]
564 fn visit_method_sig(&mut self, i: &'ast MethodSig) {
565 visit_method_sig(self, i)
566 }
567 #[cfg(any(feature = "full", feature = "derive"))]
568 #[cfg(feature = "full")]
569 fn visit_method_turbofish(&mut self, i: &'ast MethodTurbofish) {
570 visit_method_turbofish(self, i)
571 }
572 #[cfg(any(feature = "full", feature = "derive"))]
573 fn visit_nested_meta(&mut self, i: &'ast NestedMeta) {
574 visit_nested_meta(self, i)
575 }
576 #[cfg(any(feature = "full", feature = "derive"))]
577 fn visit_parenthesized_generic_arguments(&mut self, i: &'ast ParenthesizedGenericArguments) {
578 visit_parenthesized_generic_arguments(self, i)
579 }
580 #[cfg(any(feature = "full", feature = "derive"))]
581 #[cfg(feature = "full")]
582 fn visit_pat(&mut self, i: &'ast Pat) {
583 visit_pat(self, i)
584 }
585 #[cfg(any(feature = "full", feature = "derive"))]
586 #[cfg(feature = "full")]
587 fn visit_pat_box(&mut self, i: &'ast PatBox) {
588 visit_pat_box(self, i)
589 }
590 #[cfg(any(feature = "full", feature = "derive"))]
591 #[cfg(feature = "full")]
592 fn visit_pat_ident(&mut self, i: &'ast PatIdent) {
593 visit_pat_ident(self, i)
594 }
595 #[cfg(any(feature = "full", feature = "derive"))]
596 #[cfg(feature = "full")]
597 fn visit_pat_lit(&mut self, i: &'ast PatLit) {
598 visit_pat_lit(self, i)
599 }
600 #[cfg(any(feature = "full", feature = "derive"))]
601 #[cfg(feature = "full")]
602 fn visit_pat_macro(&mut self, i: &'ast PatMacro) {
603 visit_pat_macro(self, i)
604 }
605 #[cfg(any(feature = "full", feature = "derive"))]
606 #[cfg(feature = "full")]
607 fn visit_pat_path(&mut self, i: &'ast PatPath) {
608 visit_pat_path(self, i)
609 }
610 #[cfg(any(feature = "full", feature = "derive"))]
611 #[cfg(feature = "full")]
612 fn visit_pat_range(&mut self, i: &'ast PatRange) {
613 visit_pat_range(self, i)
614 }
615 #[cfg(any(feature = "full", feature = "derive"))]
616 #[cfg(feature = "full")]
617 fn visit_pat_ref(&mut self, i: &'ast PatRef) {
618 visit_pat_ref(self, i)
619 }
620 #[cfg(any(feature = "full", feature = "derive"))]
621 #[cfg(feature = "full")]
622 fn visit_pat_slice(&mut self, i: &'ast PatSlice) {
623 visit_pat_slice(self, i)
624 }
625 #[cfg(any(feature = "full", feature = "derive"))]
626 #[cfg(feature = "full")]
627 fn visit_pat_struct(&mut self, i: &'ast PatStruct) {
628 visit_pat_struct(self, i)
629 }
630 #[cfg(any(feature = "full", feature = "derive"))]
631 #[cfg(feature = "full")]
632 fn visit_pat_tuple(&mut self, i: &'ast PatTuple) {
633 visit_pat_tuple(self, i)
634 }
635 #[cfg(any(feature = "full", feature = "derive"))]
636 #[cfg(feature = "full")]
637 fn visit_pat_tuple_struct(&mut self, i: &'ast PatTupleStruct) {
638 visit_pat_tuple_struct(self, i)
639 }
640 #[cfg(any(feature = "full", feature = "derive"))]
641 #[cfg(feature = "full")]
642 fn visit_pat_verbatim(&mut self, i: &'ast PatVerbatim) {
643 visit_pat_verbatim(self, i)
644 }
645 #[cfg(any(feature = "full", feature = "derive"))]
646 #[cfg(feature = "full")]
647 fn visit_pat_wild(&mut self, i: &'ast PatWild) {
648 visit_pat_wild(self, i)
649 }
650 #[cfg(any(feature = "full", feature = "derive"))]
651 fn visit_path(&mut self, i: &'ast Path) {
652 visit_path(self, i)
653 }
654 #[cfg(any(feature = "full", feature = "derive"))]
655 fn visit_path_arguments(&mut self, i: &'ast PathArguments) {
656 visit_path_arguments(self, i)
657 }
658 #[cfg(any(feature = "full", feature = "derive"))]
659 fn visit_path_segment(&mut self, i: &'ast PathSegment) {
660 visit_path_segment(self, i)
661 }
662 #[cfg(any(feature = "full", feature = "derive"))]
663 fn visit_predicate_eq(&mut self, i: &'ast PredicateEq) {
664 visit_predicate_eq(self, i)
665 }
666 #[cfg(any(feature = "full", feature = "derive"))]
667 fn visit_predicate_lifetime(&mut self, i: &'ast PredicateLifetime) {
668 visit_predicate_lifetime(self, i)
669 }
670 #[cfg(any(feature = "full", feature = "derive"))]
671 fn visit_predicate_type(&mut self, i: &'ast PredicateType) {
672 visit_predicate_type(self, i)
673 }
674 #[cfg(any(feature = "full", feature = "derive"))]
675 fn visit_qself(&mut self, i: &'ast QSelf) {
676 visit_qself(self, i)
677 }
678 #[cfg(any(feature = "full", feature = "derive"))]
679 #[cfg(feature = "full")]
680 fn visit_range_limits(&mut self, i: &'ast RangeLimits) {
681 visit_range_limits(self, i)
682 }
683 #[cfg(any(feature = "full", feature = "derive"))]
684 fn visit_return_type(&mut self, i: &'ast ReturnType) {
685 visit_return_type(self, i)
686 }
Nika Layzellefb83ba2017-12-19 18:23:55 -0500687
David Tolnay8c81f622018-07-31 23:34:35 -0700688 fn visit_span(&mut self, i: &'ast Span) {
689 visit_span(self, i)
690 }
691 #[cfg(any(feature = "full", feature = "derive"))]
692 #[cfg(feature = "full")]
693 fn visit_stmt(&mut self, i: &'ast Stmt) {
694 visit_stmt(self, i)
695 }
696 #[cfg(any(feature = "full", feature = "derive"))]
697 fn visit_trait_bound(&mut self, i: &'ast TraitBound) {
698 visit_trait_bound(self, i)
699 }
700 #[cfg(any(feature = "full", feature = "derive"))]
701 fn visit_trait_bound_modifier(&mut self, i: &'ast TraitBoundModifier) {
702 visit_trait_bound_modifier(self, i)
703 }
704 #[cfg(feature = "full")]
705 fn visit_trait_item(&mut self, i: &'ast TraitItem) {
706 visit_trait_item(self, i)
707 }
708 #[cfg(feature = "full")]
709 fn visit_trait_item_const(&mut self, i: &'ast TraitItemConst) {
710 visit_trait_item_const(self, i)
711 }
712 #[cfg(feature = "full")]
713 fn visit_trait_item_macro(&mut self, i: &'ast TraitItemMacro) {
714 visit_trait_item_macro(self, i)
715 }
716 #[cfg(feature = "full")]
717 fn visit_trait_item_method(&mut self, i: &'ast TraitItemMethod) {
718 visit_trait_item_method(self, i)
719 }
720 #[cfg(feature = "full")]
721 fn visit_trait_item_type(&mut self, i: &'ast TraitItemType) {
722 visit_trait_item_type(self, i)
723 }
724 #[cfg(feature = "full")]
725 fn visit_trait_item_verbatim(&mut self, i: &'ast TraitItemVerbatim) {
726 visit_trait_item_verbatim(self, i)
727 }
728 #[cfg(any(feature = "full", feature = "derive"))]
729 fn visit_type(&mut self, i: &'ast Type) {
730 visit_type(self, i)
731 }
732 #[cfg(any(feature = "full", feature = "derive"))]
733 fn visit_type_array(&mut self, i: &'ast TypeArray) {
734 visit_type_array(self, i)
735 }
736 #[cfg(any(feature = "full", feature = "derive"))]
737 fn visit_type_bare_fn(&mut self, i: &'ast TypeBareFn) {
738 visit_type_bare_fn(self, i)
739 }
740 #[cfg(any(feature = "full", feature = "derive"))]
741 fn visit_type_group(&mut self, i: &'ast TypeGroup) {
742 visit_type_group(self, i)
743 }
744 #[cfg(any(feature = "full", feature = "derive"))]
745 fn visit_type_impl_trait(&mut self, i: &'ast TypeImplTrait) {
746 visit_type_impl_trait(self, i)
747 }
748 #[cfg(any(feature = "full", feature = "derive"))]
749 fn visit_type_infer(&mut self, i: &'ast TypeInfer) {
750 visit_type_infer(self, i)
751 }
752 #[cfg(any(feature = "full", feature = "derive"))]
753 fn visit_type_macro(&mut self, i: &'ast TypeMacro) {
754 visit_type_macro(self, i)
755 }
756 #[cfg(any(feature = "full", feature = "derive"))]
757 fn visit_type_never(&mut self, i: &'ast TypeNever) {
758 visit_type_never(self, i)
759 }
760 #[cfg(any(feature = "full", feature = "derive"))]
761 fn visit_type_param(&mut self, i: &'ast TypeParam) {
762 visit_type_param(self, i)
763 }
764 #[cfg(any(feature = "full", feature = "derive"))]
765 fn visit_type_param_bound(&mut self, i: &'ast TypeParamBound) {
766 visit_type_param_bound(self, i)
767 }
768 #[cfg(any(feature = "full", feature = "derive"))]
769 fn visit_type_paren(&mut self, i: &'ast TypeParen) {
770 visit_type_paren(self, i)
771 }
772 #[cfg(any(feature = "full", feature = "derive"))]
773 fn visit_type_path(&mut self, i: &'ast TypePath) {
774 visit_type_path(self, i)
775 }
776 #[cfg(any(feature = "full", feature = "derive"))]
777 fn visit_type_ptr(&mut self, i: &'ast TypePtr) {
778 visit_type_ptr(self, i)
779 }
780 #[cfg(any(feature = "full", feature = "derive"))]
781 fn visit_type_reference(&mut self, i: &'ast TypeReference) {
782 visit_type_reference(self, i)
783 }
784 #[cfg(any(feature = "full", feature = "derive"))]
785 fn visit_type_slice(&mut self, i: &'ast TypeSlice) {
786 visit_type_slice(self, i)
787 }
788 #[cfg(any(feature = "full", feature = "derive"))]
789 fn visit_type_trait_object(&mut self, i: &'ast TypeTraitObject) {
790 visit_type_trait_object(self, i)
791 }
792 #[cfg(any(feature = "full", feature = "derive"))]
793 fn visit_type_tuple(&mut self, i: &'ast TypeTuple) {
794 visit_type_tuple(self, i)
795 }
796 #[cfg(any(feature = "full", feature = "derive"))]
797 fn visit_type_verbatim(&mut self, i: &'ast TypeVerbatim) {
798 visit_type_verbatim(self, i)
799 }
800 #[cfg(any(feature = "full", feature = "derive"))]
801 fn visit_un_op(&mut self, i: &'ast UnOp) {
802 visit_un_op(self, i)
803 }
804 #[cfg(feature = "full")]
805 fn visit_use_glob(&mut self, i: &'ast UseGlob) {
806 visit_use_glob(self, i)
807 }
808 #[cfg(feature = "full")]
809 fn visit_use_group(&mut self, i: &'ast UseGroup) {
810 visit_use_group(self, i)
811 }
812 #[cfg(feature = "full")]
813 fn visit_use_name(&mut self, i: &'ast UseName) {
814 visit_use_name(self, i)
815 }
816 #[cfg(feature = "full")]
817 fn visit_use_path(&mut self, i: &'ast UsePath) {
818 visit_use_path(self, i)
819 }
820 #[cfg(feature = "full")]
821 fn visit_use_rename(&mut self, i: &'ast UseRename) {
822 visit_use_rename(self, i)
823 }
824 #[cfg(feature = "full")]
825 fn visit_use_tree(&mut self, i: &'ast UseTree) {
826 visit_use_tree(self, i)
827 }
828 #[cfg(any(feature = "full", feature = "derive"))]
829 fn visit_variant(&mut self, i: &'ast Variant) {
830 visit_variant(self, i)
831 }
832 #[cfg(any(feature = "full", feature = "derive"))]
833 fn visit_vis_crate(&mut self, i: &'ast VisCrate) {
834 visit_vis_crate(self, i)
835 }
836 #[cfg(any(feature = "full", feature = "derive"))]
837 fn visit_vis_public(&mut self, i: &'ast VisPublic) {
838 visit_vis_public(self, i)
839 }
840 #[cfg(any(feature = "full", feature = "derive"))]
841 fn visit_vis_restricted(&mut self, i: &'ast VisRestricted) {
842 visit_vis_restricted(self, i)
843 }
844 #[cfg(any(feature = "full", feature = "derive"))]
845 fn visit_visibility(&mut self, i: &'ast Visibility) {
846 visit_visibility(self, i)
847 }
848 #[cfg(any(feature = "full", feature = "derive"))]
849 fn visit_where_clause(&mut self, i: &'ast WhereClause) {
850 visit_where_clause(self, i)
851 }
852 #[cfg(any(feature = "full", feature = "derive"))]
853 fn visit_where_predicate(&mut self, i: &'ast WherePredicate) {
854 visit_where_predicate(self, i)
855 }
Nika Layzell27726662017-10-24 23:16:35 -0400856}
857
David Tolnay8c81f622018-07-31 23:34:35 -0700858#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800859pub fn visit_abi<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Abi) {
David Tolnay8c81f622018-07-31 23:34:35 -0700860 tokens_helper(_visitor, &(_i.extern_token).0);
861 if let Some(ref it) = _i.name {
862 _visitor.visit_lit_str(it)
863 };
Nika Layzell27726662017-10-24 23:16:35 -0400864}
David Tolnay8c81f622018-07-31 23:34:35 -0700865#[cfg(any(feature = "full", feature = "derive"))]
866pub fn visit_angle_bracketed_generic_arguments<'ast, V: Visit<'ast> + ?Sized>(
867 _visitor: &mut V,
868 _i: &'ast AngleBracketedGenericArguments,
869) {
870 if let Some(ref it) = _i.colon2_token {
871 tokens_helper(_visitor, &(it).0)
872 };
873 tokens_helper(_visitor, &(_i.lt_token).0);
874 for el in Punctuated::pairs(&_i.args) {
875 let it = el.value();
876 _visitor.visit_generic_argument(it)
877 }
878 tokens_helper(_visitor, &(_i.gt_token).0);
Nika Layzell27726662017-10-24 23:16:35 -0400879}
David Tolnay8c81f622018-07-31 23:34:35 -0700880#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800881pub fn visit_arg_captured<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ArgCaptured) {
David Tolnay8c81f622018-07-31 23:34:35 -0700882 _visitor.visit_pat(&_i.pat);
883 tokens_helper(_visitor, &(_i.colon_token).0);
884 _visitor.visit_type(&_i.ty);
Nika Layzell27726662017-10-24 23:16:35 -0400885}
David Tolnay8c81f622018-07-31 23:34:35 -0700886#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800887pub fn visit_arg_self<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ArgSelf) {
David Tolnay8c81f622018-07-31 23:34:35 -0700888 if let Some(ref it) = _i.mutability {
889 tokens_helper(_visitor, &(it).0)
890 };
891 tokens_helper(_visitor, &(_i.self_token).0);
Nika Layzell27726662017-10-24 23:16:35 -0400892}
David Tolnay8c81f622018-07-31 23:34:35 -0700893#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800894pub fn visit_arg_self_ref<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ArgSelfRef) {
David Tolnay8c81f622018-07-31 23:34:35 -0700895 tokens_helper(_visitor, &(_i.and_token).0);
896 if let Some(ref it) = _i.lifetime {
897 _visitor.visit_lifetime(it)
898 };
899 if let Some(ref it) = _i.mutability {
900 tokens_helper(_visitor, &(it).0)
901 };
902 tokens_helper(_visitor, &(_i.self_token).0);
Nika Layzell27726662017-10-24 23:16:35 -0400903}
David Tolnay8c81f622018-07-31 23:34:35 -0700904#[cfg(any(feature = "full", feature = "derive"))]
905#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800906pub fn visit_arm<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Arm) {
David Tolnay8c81f622018-07-31 23:34:35 -0700907 for it in &_i.attrs {
908 _visitor.visit_attribute(it)
909 }
910 if let Some(ref it) = _i.leading_vert {
911 tokens_helper(_visitor, &(it).0)
912 };
913 for el in Punctuated::pairs(&_i.pats) {
914 let it = el.value();
915 _visitor.visit_pat(it)
916 }
917 if let Some(ref it) = _i.guard {
918 tokens_helper(_visitor, &((it).0).0);
919 _visitor.visit_expr(&*(it).1);
920 };
921 tokens_helper(_visitor, &(_i.fat_arrow_token).0);
922 _visitor.visit_expr(&*_i.body);
923 if let Some(ref it) = _i.comma {
924 tokens_helper(_visitor, &(it).0)
925 };
Nika Layzell27726662017-10-24 23:16:35 -0400926}
David Tolnay8c81f622018-07-31 23:34:35 -0700927#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800928pub fn visit_attr_style<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast AttrStyle) {
Nika Layzell27726662017-10-24 23:16:35 -0400929 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -0700930 AttrStyle::Outer => {}
931 AttrStyle::Inner(ref _binding_0) => {
David Tolnaycc0f0372017-12-28 19:11:04 -0500932 tokens_helper(_visitor, &(_binding_0).0);
Nika Layzell27726662017-10-24 23:16:35 -0400933 }
934 }
935}
David Tolnay8c81f622018-07-31 23:34:35 -0700936#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800937pub fn visit_attribute<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Attribute) {
David Tolnay8c81f622018-07-31 23:34:35 -0700938 tokens_helper(_visitor, &(_i.pound_token).0);
939 _visitor.visit_attr_style(&_i.style);
940 tokens_helper(_visitor, &(_i.bracket_token).0);
941 _visitor.visit_path(&_i.path);
Nika Layzell27726662017-10-24 23:16:35 -0400942 // Skipped field _i . tts;
943 // Skipped field _i . is_sugared_doc;
944}
David Tolnay8c81f622018-07-31 23:34:35 -0700945#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800946pub fn visit_bare_fn_arg<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast BareFnArg) {
David Tolnay8c81f622018-07-31 23:34:35 -0700947 if let Some(ref it) = _i.name {
948 _visitor.visit_bare_fn_arg_name(&(it).0);
949 tokens_helper(_visitor, &((it).1).0);
950 };
951 _visitor.visit_type(&_i.ty);
Nika Layzell27726662017-10-24 23:16:35 -0400952}
David Tolnay8c81f622018-07-31 23:34:35 -0700953#[cfg(any(feature = "full", feature = "derive"))]
954pub fn visit_bare_fn_arg_name<'ast, V: Visit<'ast> + ?Sized>(
955 _visitor: &mut V,
956 _i: &'ast BareFnArgName,
957) {
Nika Layzell27726662017-10-24 23:16:35 -0400958 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -0700959 BareFnArgName::Named(ref _binding_0) => {
Alex Crichtond261d092018-05-18 13:47:35 -0700960 _visitor.visit_ident(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -0400961 }
David Tolnay8c81f622018-07-31 23:34:35 -0700962 BareFnArgName::Wild(ref _binding_0) => {
David Tolnaycc0f0372017-12-28 19:11:04 -0500963 tokens_helper(_visitor, &(_binding_0).0);
Nika Layzell27726662017-10-24 23:16:35 -0400964 }
965 }
966}
David Tolnay8c81f622018-07-31 23:34:35 -0700967#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800968pub fn visit_bin_op<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast BinOp) {
Nika Layzell27726662017-10-24 23:16:35 -0400969 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -0700970 BinOp::Add(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::Sub(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::Mul(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::Div(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::Rem(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::And(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::Or(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::BitXor(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::BitAnd(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::BitOr(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::Shl(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::Shr(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::Eq(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::Lt(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::Le(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::Ne(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::Ge(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::Gt(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::AddEq(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::SubEq(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::MulEq(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::DivEq(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::RemEq(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::BitXorEq(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::BitAndEq(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::BitOrEq(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::ShlEq(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 }
David Tolnay8c81f622018-07-31 23:34:35 -07001051 BinOp::ShrEq(ref _binding_0) => {
David Tolnaycc0f0372017-12-28 19:11:04 -05001052 tokens_helper(_visitor, &(_binding_0).0);
Nika Layzell27726662017-10-24 23:16:35 -04001053 }
1054 }
1055}
David Tolnay8c81f622018-07-31 23:34:35 -07001056#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001057pub fn visit_binding<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Binding) {
David Tolnay8c81f622018-07-31 23:34:35 -07001058 _visitor.visit_ident(&_i.ident);
1059 tokens_helper(_visitor, &(_i.eq_token).0);
1060 _visitor.visit_type(&_i.ty);
David Tolnay506e43a2017-12-29 11:34:36 -05001061}
David Tolnay8c81f622018-07-31 23:34:35 -07001062#[cfg(any(feature = "full", feature = "derive"))]
1063#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001064pub fn visit_block<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Block) {
David Tolnay8c81f622018-07-31 23:34:35 -07001065 tokens_helper(_visitor, &(_i.brace_token).0);
1066 for it in &_i.stmts {
1067 _visitor.visit_stmt(it)
1068 }
Nika Layzell27726662017-10-24 23:16:35 -04001069}
David Tolnay8c81f622018-07-31 23:34:35 -07001070#[cfg(any(feature = "full", feature = "derive"))]
1071pub fn visit_bound_lifetimes<'ast, V: Visit<'ast> + ?Sized>(
1072 _visitor: &mut V,
1073 _i: &'ast BoundLifetimes,
1074) {
1075 tokens_helper(_visitor, &(_i.for_token).0);
1076 tokens_helper(_visitor, &(_i.lt_token).0);
1077 for el in Punctuated::pairs(&_i.lifetimes) {
1078 let it = el.value();
1079 _visitor.visit_lifetime_def(it)
1080 }
1081 tokens_helper(_visitor, &(_i.gt_token).0);
Nika Layzell27726662017-10-24 23:16:35 -04001082}
David Tolnay8c81f622018-07-31 23:34:35 -07001083#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001084pub fn visit_const_param<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ConstParam) {
David Tolnay8c81f622018-07-31 23:34:35 -07001085 for it in &_i.attrs {
1086 _visitor.visit_attribute(it)
1087 }
1088 tokens_helper(_visitor, &(_i.const_token).0);
1089 _visitor.visit_ident(&_i.ident);
1090 tokens_helper(_visitor, &(_i.colon_token).0);
1091 _visitor.visit_type(&_i.ty);
1092 if let Some(ref it) = _i.eq_token {
1093 tokens_helper(_visitor, &(it).0)
1094 };
1095 if let Some(ref it) = _i.default {
1096 _visitor.visit_expr(it)
1097 };
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001098}
David Tolnay8c81f622018-07-31 23:34:35 -07001099#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001100pub fn visit_data<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Data) {
David Tolnaye3d41b72017-12-31 15:24:00 -05001101 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001102 Data::Struct(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05001103 _visitor.visit_data_struct(_binding_0);
1104 }
David Tolnay8c81f622018-07-31 23:34:35 -07001105 Data::Enum(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05001106 _visitor.visit_data_enum(_binding_0);
1107 }
David Tolnay8c81f622018-07-31 23:34:35 -07001108 Data::Union(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05001109 _visitor.visit_data_union(_binding_0);
1110 }
1111 }
1112}
David Tolnay8c81f622018-07-31 23:34:35 -07001113#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001114pub fn visit_data_enum<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataEnum) {
David Tolnay8c81f622018-07-31 23:34:35 -07001115 tokens_helper(_visitor, &(_i.enum_token).0);
1116 tokens_helper(_visitor, &(_i.brace_token).0);
1117 for el in Punctuated::pairs(&_i.variants) {
1118 let it = el.value();
1119 _visitor.visit_variant(it)
1120 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001121}
David Tolnay8c81f622018-07-31 23:34:35 -07001122#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001123pub fn visit_data_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataStruct) {
David Tolnay8c81f622018-07-31 23:34:35 -07001124 tokens_helper(_visitor, &(_i.struct_token).0);
1125 _visitor.visit_fields(&_i.fields);
1126 if let Some(ref it) = _i.semi_token {
1127 tokens_helper(_visitor, &(it).0)
1128 };
David Tolnaye3d41b72017-12-31 15:24:00 -05001129}
David Tolnay8c81f622018-07-31 23:34:35 -07001130#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001131pub fn visit_data_union<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataUnion) {
David Tolnay8c81f622018-07-31 23:34:35 -07001132 tokens_helper(_visitor, &(_i.union_token).0);
1133 _visitor.visit_fields_named(&_i.fields);
David Tolnaye3d41b72017-12-31 15:24:00 -05001134}
David Tolnay8c81f622018-07-31 23:34:35 -07001135#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001136pub fn visit_derive_input<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DeriveInput) {
David Tolnay8c81f622018-07-31 23:34:35 -07001137 for it in &_i.attrs {
1138 _visitor.visit_attribute(it)
1139 }
1140 _visitor.visit_visibility(&_i.vis);
1141 _visitor.visit_ident(&_i.ident);
1142 _visitor.visit_generics(&_i.generics);
1143 _visitor.visit_data(&_i.data);
Nika Layzell27726662017-10-24 23:16:35 -04001144}
David Tolnay8c81f622018-07-31 23:34:35 -07001145#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001146pub fn visit_expr<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Expr) {
Nika Layzell27726662017-10-24 23:16:35 -04001147 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001148 Expr::Box(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001149 full!(_visitor.visit_expr_box(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001150 }
David Tolnay8c81f622018-07-31 23:34:35 -07001151 Expr::InPlace(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001152 full!(_visitor.visit_expr_in_place(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001153 }
David Tolnay8c81f622018-07-31 23:34:35 -07001154 Expr::Array(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001155 full!(_visitor.visit_expr_array(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001156 }
David Tolnay8c81f622018-07-31 23:34:35 -07001157 Expr::Call(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001158 _visitor.visit_expr_call(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001159 }
David Tolnay8c81f622018-07-31 23:34:35 -07001160 Expr::MethodCall(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001161 full!(_visitor.visit_expr_method_call(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001162 }
David Tolnay8c81f622018-07-31 23:34:35 -07001163 Expr::Tuple(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001164 full!(_visitor.visit_expr_tuple(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001165 }
David Tolnay8c81f622018-07-31 23:34:35 -07001166 Expr::Binary(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001167 _visitor.visit_expr_binary(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001168 }
David Tolnay8c81f622018-07-31 23:34:35 -07001169 Expr::Unary(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001170 _visitor.visit_expr_unary(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001171 }
David Tolnay8c81f622018-07-31 23:34:35 -07001172 Expr::Lit(ref _binding_0) => {
David Tolnay8c91b882017-12-28 23:04:32 -05001173 _visitor.visit_expr_lit(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001174 }
David Tolnay8c81f622018-07-31 23:34:35 -07001175 Expr::Cast(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001176 _visitor.visit_expr_cast(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001177 }
David Tolnay8c81f622018-07-31 23:34:35 -07001178 Expr::Type(ref _binding_0) => {
David Tolnay0cf94f22017-12-28 23:46:26 -05001179 full!(_visitor.visit_expr_type(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001180 }
David Tolnay8c81f622018-07-31 23:34:35 -07001181 Expr::If(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001182 full!(_visitor.visit_expr_if(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001183 }
David Tolnay8c81f622018-07-31 23:34:35 -07001184 Expr::IfLet(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001185 full!(_visitor.visit_expr_if_let(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001186 }
David Tolnay8c81f622018-07-31 23:34:35 -07001187 Expr::While(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001188 full!(_visitor.visit_expr_while(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001189 }
David Tolnay8c81f622018-07-31 23:34:35 -07001190 Expr::WhileLet(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001191 full!(_visitor.visit_expr_while_let(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001192 }
David Tolnay8c81f622018-07-31 23:34:35 -07001193 Expr::ForLoop(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001194 full!(_visitor.visit_expr_for_loop(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001195 }
David Tolnay8c81f622018-07-31 23:34:35 -07001196 Expr::Loop(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001197 full!(_visitor.visit_expr_loop(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001198 }
David Tolnay8c81f622018-07-31 23:34:35 -07001199 Expr::Match(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001200 full!(_visitor.visit_expr_match(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001201 }
David Tolnay8c81f622018-07-31 23:34:35 -07001202 Expr::Closure(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001203 full!(_visitor.visit_expr_closure(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001204 }
David Tolnay8c81f622018-07-31 23:34:35 -07001205 Expr::Unsafe(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001206 full!(_visitor.visit_expr_unsafe(_binding_0));
Nika Layzell640832a2017-12-04 13:37:09 -05001207 }
David Tolnay8c81f622018-07-31 23:34:35 -07001208 Expr::Block(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001209 full!(_visitor.visit_expr_block(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001210 }
David Tolnay8c81f622018-07-31 23:34:35 -07001211 Expr::Assign(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001212 full!(_visitor.visit_expr_assign(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001213 }
David Tolnay8c81f622018-07-31 23:34:35 -07001214 Expr::AssignOp(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001215 full!(_visitor.visit_expr_assign_op(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001216 }
David Tolnay8c81f622018-07-31 23:34:35 -07001217 Expr::Field(ref _binding_0) => {
David Tolnayd093fa92018-06-30 10:23:25 -07001218 _visitor.visit_expr_field(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001219 }
David Tolnay8c81f622018-07-31 23:34:35 -07001220 Expr::Index(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001221 _visitor.visit_expr_index(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001222 }
David Tolnay8c81f622018-07-31 23:34:35 -07001223 Expr::Range(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001224 full!(_visitor.visit_expr_range(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001225 }
David Tolnay8c81f622018-07-31 23:34:35 -07001226 Expr::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001227 _visitor.visit_expr_path(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001228 }
David Tolnay8c81f622018-07-31 23:34:35 -07001229 Expr::Reference(ref _binding_0) => {
David Tolnay00674ba2018-03-31 18:14:11 +02001230 full!(_visitor.visit_expr_reference(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001231 }
David Tolnay8c81f622018-07-31 23:34:35 -07001232 Expr::Break(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001233 full!(_visitor.visit_expr_break(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001234 }
David Tolnay8c81f622018-07-31 23:34:35 -07001235 Expr::Continue(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001236 full!(_visitor.visit_expr_continue(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001237 }
David Tolnay8c81f622018-07-31 23:34:35 -07001238 Expr::Return(ref _binding_0) => {
David Tolnayc246cd32017-12-28 23:14:32 -05001239 full!(_visitor.visit_expr_return(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001240 }
David Tolnay8c81f622018-07-31 23:34:35 -07001241 Expr::Macro(ref _binding_0) => {
David Tolnay8c91b882017-12-28 23:04:32 -05001242 full!(_visitor.visit_expr_macro(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001243 }
David Tolnay8c81f622018-07-31 23:34:35 -07001244 Expr::Struct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001245 full!(_visitor.visit_expr_struct(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001246 }
David Tolnay8c81f622018-07-31 23:34:35 -07001247 Expr::Repeat(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001248 full!(_visitor.visit_expr_repeat(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001249 }
David Tolnay8c81f622018-07-31 23:34:35 -07001250 Expr::Paren(ref _binding_0) => {
David Tolnay81ab4f62018-01-27 19:02:51 -08001251 _visitor.visit_expr_paren(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001252 }
David Tolnay8c81f622018-07-31 23:34:35 -07001253 Expr::Group(ref _binding_0) => {
David Tolnaye98775f2017-12-28 23:17:00 -05001254 full!(_visitor.visit_expr_group(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001255 }
David Tolnay8c81f622018-07-31 23:34:35 -07001256 Expr::Try(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001257 full!(_visitor.visit_expr_try(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001258 }
David Tolnay8c81f622018-07-31 23:34:35 -07001259 Expr::Catch(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001260 full!(_visitor.visit_expr_catch(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001261 }
David Tolnay8c81f622018-07-31 23:34:35 -07001262 Expr::Yield(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001263 full!(_visitor.visit_expr_yield(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001264 }
David Tolnay8c81f622018-07-31 23:34:35 -07001265 Expr::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05001266 _visitor.visit_expr_verbatim(_binding_0);
1267 }
Nika Layzell27726662017-10-24 23:16:35 -04001268 }
1269}
David Tolnay8c81f622018-07-31 23:34:35 -07001270#[cfg(feature = "full")]
1271#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001272pub fn visit_expr_array<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprArray) {
David Tolnay8c81f622018-07-31 23:34:35 -07001273 for it in &_i.attrs {
1274 _visitor.visit_attribute(it)
1275 }
1276 tokens_helper(_visitor, &(_i.bracket_token).0);
1277 for el in Punctuated::pairs(&_i.elems) {
1278 let it = el.value();
1279 _visitor.visit_expr(it)
David Tolnaye3d41b72017-12-31 15:24:00 -05001280 }
1281}
David Tolnay8c81f622018-07-31 23:34:35 -07001282#[cfg(feature = "full")]
1283#[cfg(any(feature = "full", feature = "derive"))]
1284pub fn visit_expr_assign<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprAssign) {
1285 for it in &_i.attrs {
1286 _visitor.visit_attribute(it)
1287 }
1288 _visitor.visit_expr(&*_i.left);
1289 tokens_helper(_visitor, &(_i.eq_token).0);
1290 _visitor.visit_expr(&*_i.right);
1291}
1292#[cfg(feature = "full")]
1293#[cfg(any(feature = "full", feature = "derive"))]
1294pub fn visit_expr_assign_op<'ast, V: Visit<'ast> + ?Sized>(
1295 _visitor: &mut V,
1296 _i: &'ast ExprAssignOp,
1297) {
1298 for it in &_i.attrs {
1299 _visitor.visit_attribute(it)
1300 }
1301 _visitor.visit_expr(&*_i.left);
1302 _visitor.visit_bin_op(&_i.op);
1303 _visitor.visit_expr(&*_i.right);
1304}
1305#[cfg(any(feature = "full", feature = "derive"))]
1306pub fn visit_expr_binary<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBinary) {
1307 for it in &_i.attrs {
1308 _visitor.visit_attribute(it)
1309 }
1310 _visitor.visit_expr(&*_i.left);
1311 _visitor.visit_bin_op(&_i.op);
1312 _visitor.visit_expr(&*_i.right);
1313}
1314#[cfg(feature = "full")]
1315#[cfg(any(feature = "full", feature = "derive"))]
1316pub fn visit_expr_block<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBlock) {
1317 for it in &_i.attrs {
1318 _visitor.visit_attribute(it)
1319 }
1320 _visitor.visit_block(&_i.block);
1321}
1322#[cfg(feature = "full")]
1323#[cfg(any(feature = "full", feature = "derive"))]
1324pub fn visit_expr_box<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBox) {
1325 for it in &_i.attrs {
1326 _visitor.visit_attribute(it)
1327 }
1328 tokens_helper(_visitor, &(_i.box_token).0);
1329 _visitor.visit_expr(&*_i.expr);
1330}
1331#[cfg(feature = "full")]
1332#[cfg(any(feature = "full", feature = "derive"))]
1333pub fn visit_expr_break<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBreak) {
1334 for it in &_i.attrs {
1335 _visitor.visit_attribute(it)
1336 }
1337 tokens_helper(_visitor, &(_i.break_token).0);
1338 if let Some(ref it) = _i.label {
1339 _visitor.visit_lifetime(it)
1340 };
1341 if let Some(ref it) = _i.expr {
1342 _visitor.visit_expr(&**it)
1343 };
1344}
1345#[cfg(any(feature = "full", feature = "derive"))]
1346pub fn visit_expr_call<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprCall) {
1347 for it in &_i.attrs {
1348 _visitor.visit_attribute(it)
1349 }
1350 _visitor.visit_expr(&*_i.func);
1351 tokens_helper(_visitor, &(_i.paren_token).0);
1352 for el in Punctuated::pairs(&_i.args) {
1353 let it = el.value();
1354 _visitor.visit_expr(it)
1355 }
1356}
1357#[cfg(any(feature = "full", feature = "derive"))]
1358pub fn visit_expr_cast<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprCast) {
1359 for it in &_i.attrs {
1360 _visitor.visit_attribute(it)
1361 }
1362 _visitor.visit_expr(&*_i.expr);
1363 tokens_helper(_visitor, &(_i.as_token).0);
1364 _visitor.visit_type(&*_i.ty);
1365}
1366#[cfg(feature = "full")]
1367#[cfg(any(feature = "full", feature = "derive"))]
1368pub fn visit_expr_catch<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprCatch) {
1369 for it in &_i.attrs {
1370 _visitor.visit_attribute(it)
1371 }
1372 tokens_helper(_visitor, &(_i.do_token).0);
1373 tokens_helper(_visitor, &(_i.catch_token).0);
1374 _visitor.visit_block(&_i.block);
1375}
1376#[cfg(feature = "full")]
1377#[cfg(any(feature = "full", feature = "derive"))]
1378pub fn visit_expr_closure<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprClosure) {
1379 for it in &_i.attrs {
1380 _visitor.visit_attribute(it)
1381 }
1382 if let Some(ref it) = _i.movability {
1383 tokens_helper(_visitor, &(it).0)
1384 };
1385 if let Some(ref it) = _i.capture {
1386 tokens_helper(_visitor, &(it).0)
1387 };
1388 tokens_helper(_visitor, &(_i.or1_token).0);
1389 for el in Punctuated::pairs(&_i.inputs) {
1390 let it = el.value();
1391 _visitor.visit_fn_arg(it)
1392 }
1393 tokens_helper(_visitor, &(_i.or2_token).0);
1394 _visitor.visit_return_type(&_i.output);
1395 _visitor.visit_expr(&*_i.body);
1396}
1397#[cfg(feature = "full")]
1398#[cfg(any(feature = "full", feature = "derive"))]
1399pub fn visit_expr_continue<'ast, V: Visit<'ast> + ?Sized>(
1400 _visitor: &mut V,
1401 _i: &'ast ExprContinue,
1402) {
1403 for it in &_i.attrs {
1404 _visitor.visit_attribute(it)
1405 }
1406 tokens_helper(_visitor, &(_i.continue_token).0);
1407 if let Some(ref it) = _i.label {
1408 _visitor.visit_lifetime(it)
1409 };
1410}
1411#[cfg(any(feature = "full", feature = "derive"))]
1412pub fn visit_expr_field<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprField) {
1413 for it in &_i.attrs {
1414 _visitor.visit_attribute(it)
1415 }
1416 _visitor.visit_expr(&*_i.base);
1417 tokens_helper(_visitor, &(_i.dot_token).0);
1418 _visitor.visit_member(&_i.member);
1419}
1420#[cfg(feature = "full")]
1421#[cfg(any(feature = "full", feature = "derive"))]
1422pub fn visit_expr_for_loop<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprForLoop) {
1423 for it in &_i.attrs {
1424 _visitor.visit_attribute(it)
1425 }
1426 if let Some(ref it) = _i.label {
1427 _visitor.visit_label(it)
1428 };
1429 tokens_helper(_visitor, &(_i.for_token).0);
1430 _visitor.visit_pat(&*_i.pat);
1431 tokens_helper(_visitor, &(_i.in_token).0);
1432 _visitor.visit_expr(&*_i.expr);
1433 _visitor.visit_block(&_i.body);
1434}
1435#[cfg(feature = "full")]
1436#[cfg(any(feature = "full", feature = "derive"))]
1437pub fn visit_expr_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprGroup) {
1438 for it in &_i.attrs {
1439 _visitor.visit_attribute(it)
1440 }
1441 tokens_helper(_visitor, &(_i.group_token).0);
1442 _visitor.visit_expr(&*_i.expr);
1443}
1444#[cfg(feature = "full")]
1445#[cfg(any(feature = "full", feature = "derive"))]
1446pub fn visit_expr_if<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprIf) {
1447 for it in &_i.attrs {
1448 _visitor.visit_attribute(it)
1449 }
1450 tokens_helper(_visitor, &(_i.if_token).0);
1451 _visitor.visit_expr(&*_i.cond);
1452 _visitor.visit_block(&_i.then_branch);
1453 if let Some(ref it) = _i.else_branch {
1454 tokens_helper(_visitor, &((it).0).0);
1455 _visitor.visit_expr(&*(it).1);
1456 };
1457}
1458#[cfg(feature = "full")]
1459#[cfg(any(feature = "full", feature = "derive"))]
1460pub fn visit_expr_if_let<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprIfLet) {
1461 for it in &_i.attrs {
1462 _visitor.visit_attribute(it)
1463 }
1464 tokens_helper(_visitor, &(_i.if_token).0);
1465 tokens_helper(_visitor, &(_i.let_token).0);
1466 for el in Punctuated::pairs(&_i.pats) {
1467 let it = el.value();
1468 _visitor.visit_pat(it)
1469 }
1470 tokens_helper(_visitor, &(_i.eq_token).0);
1471 _visitor.visit_expr(&*_i.expr);
1472 _visitor.visit_block(&_i.then_branch);
1473 if let Some(ref it) = _i.else_branch {
1474 tokens_helper(_visitor, &((it).0).0);
1475 _visitor.visit_expr(&*(it).1);
1476 };
1477}
1478#[cfg(feature = "full")]
1479#[cfg(any(feature = "full", feature = "derive"))]
1480pub fn visit_expr_in_place<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprInPlace) {
1481 for it in &_i.attrs {
1482 _visitor.visit_attribute(it)
1483 }
1484 _visitor.visit_expr(&*_i.place);
1485 tokens_helper(_visitor, &(_i.arrow_token).0);
1486 _visitor.visit_expr(&*_i.value);
1487}
1488#[cfg(any(feature = "full", feature = "derive"))]
1489pub fn visit_expr_index<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprIndex) {
1490 for it in &_i.attrs {
1491 _visitor.visit_attribute(it)
1492 }
1493 _visitor.visit_expr(&*_i.expr);
1494 tokens_helper(_visitor, &(_i.bracket_token).0);
1495 _visitor.visit_expr(&*_i.index);
1496}
1497#[cfg(any(feature = "full", feature = "derive"))]
1498pub fn visit_expr_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprLit) {
1499 for it in &_i.attrs {
1500 _visitor.visit_attribute(it)
1501 }
1502 _visitor.visit_lit(&_i.lit);
1503}
1504#[cfg(feature = "full")]
1505#[cfg(any(feature = "full", feature = "derive"))]
1506pub fn visit_expr_loop<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprLoop) {
1507 for it in &_i.attrs {
1508 _visitor.visit_attribute(it)
1509 }
1510 if let Some(ref it) = _i.label {
1511 _visitor.visit_label(it)
1512 };
1513 tokens_helper(_visitor, &(_i.loop_token).0);
1514 _visitor.visit_block(&_i.body);
1515}
1516#[cfg(feature = "full")]
1517#[cfg(any(feature = "full", feature = "derive"))]
1518pub fn visit_expr_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprMacro) {
1519 for it in &_i.attrs {
1520 _visitor.visit_attribute(it)
1521 }
1522 _visitor.visit_macro(&_i.mac);
1523}
1524#[cfg(feature = "full")]
1525#[cfg(any(feature = "full", feature = "derive"))]
1526pub fn visit_expr_match<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprMatch) {
1527 for it in &_i.attrs {
1528 _visitor.visit_attribute(it)
1529 }
1530 tokens_helper(_visitor, &(_i.match_token).0);
1531 _visitor.visit_expr(&*_i.expr);
1532 tokens_helper(_visitor, &(_i.brace_token).0);
1533 for it in &_i.arms {
1534 _visitor.visit_arm(it)
1535 }
1536}
1537#[cfg(feature = "full")]
1538#[cfg(any(feature = "full", feature = "derive"))]
1539pub fn visit_expr_method_call<'ast, V: Visit<'ast> + ?Sized>(
1540 _visitor: &mut V,
1541 _i: &'ast ExprMethodCall,
1542) {
1543 for it in &_i.attrs {
1544 _visitor.visit_attribute(it)
1545 }
1546 _visitor.visit_expr(&*_i.receiver);
1547 tokens_helper(_visitor, &(_i.dot_token).0);
1548 _visitor.visit_ident(&_i.method);
1549 if let Some(ref it) = _i.turbofish {
1550 _visitor.visit_method_turbofish(it)
1551 };
1552 tokens_helper(_visitor, &(_i.paren_token).0);
1553 for el in Punctuated::pairs(&_i.args) {
1554 let it = el.value();
1555 _visitor.visit_expr(it)
1556 }
1557}
1558#[cfg(any(feature = "full", feature = "derive"))]
1559pub fn visit_expr_paren<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprParen) {
1560 for it in &_i.attrs {
1561 _visitor.visit_attribute(it)
1562 }
1563 tokens_helper(_visitor, &(_i.paren_token).0);
1564 _visitor.visit_expr(&*_i.expr);
1565}
1566#[cfg(any(feature = "full", feature = "derive"))]
1567pub fn visit_expr_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprPath) {
1568 for it in &_i.attrs {
1569 _visitor.visit_attribute(it)
1570 }
1571 if let Some(ref it) = _i.qself {
1572 _visitor.visit_qself(it)
1573 };
1574 _visitor.visit_path(&_i.path);
1575}
1576#[cfg(feature = "full")]
1577#[cfg(any(feature = "full", feature = "derive"))]
1578pub fn visit_expr_range<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprRange) {
1579 for it in &_i.attrs {
1580 _visitor.visit_attribute(it)
1581 }
1582 if let Some(ref it) = _i.from {
1583 _visitor.visit_expr(&**it)
1584 };
1585 _visitor.visit_range_limits(&_i.limits);
1586 if let Some(ref it) = _i.to {
1587 _visitor.visit_expr(&**it)
1588 };
1589}
1590#[cfg(feature = "full")]
1591#[cfg(any(feature = "full", feature = "derive"))]
1592pub fn visit_expr_reference<'ast, V: Visit<'ast> + ?Sized>(
1593 _visitor: &mut V,
1594 _i: &'ast ExprReference,
1595) {
1596 for it in &_i.attrs {
1597 _visitor.visit_attribute(it)
1598 }
1599 tokens_helper(_visitor, &(_i.and_token).0);
1600 if let Some(ref it) = _i.mutability {
1601 tokens_helper(_visitor, &(it).0)
1602 };
1603 _visitor.visit_expr(&*_i.expr);
1604}
1605#[cfg(feature = "full")]
1606#[cfg(any(feature = "full", feature = "derive"))]
1607pub fn visit_expr_repeat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprRepeat) {
1608 for it in &_i.attrs {
1609 _visitor.visit_attribute(it)
1610 }
1611 tokens_helper(_visitor, &(_i.bracket_token).0);
1612 _visitor.visit_expr(&*_i.expr);
1613 tokens_helper(_visitor, &(_i.semi_token).0);
1614 _visitor.visit_expr(&*_i.len);
1615}
1616#[cfg(feature = "full")]
1617#[cfg(any(feature = "full", feature = "derive"))]
1618pub fn visit_expr_return<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprReturn) {
1619 for it in &_i.attrs {
1620 _visitor.visit_attribute(it)
1621 }
1622 tokens_helper(_visitor, &(_i.return_token).0);
1623 if let Some(ref it) = _i.expr {
1624 _visitor.visit_expr(&**it)
1625 };
1626}
1627#[cfg(feature = "full")]
1628#[cfg(any(feature = "full", feature = "derive"))]
1629pub fn visit_expr_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprStruct) {
1630 for it in &_i.attrs {
1631 _visitor.visit_attribute(it)
1632 }
1633 _visitor.visit_path(&_i.path);
1634 tokens_helper(_visitor, &(_i.brace_token).0);
1635 for el in Punctuated::pairs(&_i.fields) {
1636 let it = el.value();
1637 _visitor.visit_field_value(it)
1638 }
1639 if let Some(ref it) = _i.dot2_token {
1640 tokens_helper(_visitor, &(it).0)
1641 };
1642 if let Some(ref it) = _i.rest {
1643 _visitor.visit_expr(&**it)
1644 };
1645}
1646#[cfg(feature = "full")]
1647#[cfg(any(feature = "full", feature = "derive"))]
1648pub fn visit_expr_try<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprTry) {
1649 for it in &_i.attrs {
1650 _visitor.visit_attribute(it)
1651 }
1652 _visitor.visit_expr(&*_i.expr);
1653 tokens_helper(_visitor, &(_i.question_token).0);
1654}
1655#[cfg(feature = "full")]
1656#[cfg(any(feature = "full", feature = "derive"))]
1657pub fn visit_expr_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprTuple) {
1658 for it in &_i.attrs {
1659 _visitor.visit_attribute(it)
1660 }
1661 tokens_helper(_visitor, &(_i.paren_token).0);
1662 for el in Punctuated::pairs(&_i.elems) {
1663 let it = el.value();
1664 _visitor.visit_expr(it)
1665 }
1666}
1667#[cfg(feature = "full")]
1668#[cfg(any(feature = "full", feature = "derive"))]
1669pub fn visit_expr_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprType) {
1670 for it in &_i.attrs {
1671 _visitor.visit_attribute(it)
1672 }
1673 _visitor.visit_expr(&*_i.expr);
1674 tokens_helper(_visitor, &(_i.colon_token).0);
1675 _visitor.visit_type(&*_i.ty);
1676}
1677#[cfg(any(feature = "full", feature = "derive"))]
1678pub fn visit_expr_unary<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprUnary) {
1679 for it in &_i.attrs {
1680 _visitor.visit_attribute(it)
1681 }
1682 _visitor.visit_un_op(&_i.op);
1683 _visitor.visit_expr(&*_i.expr);
1684}
1685#[cfg(feature = "full")]
1686#[cfg(any(feature = "full", feature = "derive"))]
1687pub fn visit_expr_unsafe<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprUnsafe) {
1688 for it in &_i.attrs {
1689 _visitor.visit_attribute(it)
1690 }
1691 tokens_helper(_visitor, &(_i.unsafe_token).0);
1692 _visitor.visit_block(&_i.block);
1693}
1694#[cfg(any(feature = "full", feature = "derive"))]
1695pub fn visit_expr_verbatim<'ast, V: Visit<'ast> + ?Sized>(
1696 _visitor: &mut V,
1697 _i: &'ast ExprVerbatim,
1698) {
1699 // Skipped field _i . tts;
1700}
1701#[cfg(feature = "full")]
1702#[cfg(any(feature = "full", feature = "derive"))]
1703pub fn visit_expr_while<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprWhile) {
1704 for it in &_i.attrs {
1705 _visitor.visit_attribute(it)
1706 }
1707 if let Some(ref it) = _i.label {
1708 _visitor.visit_label(it)
1709 };
1710 tokens_helper(_visitor, &(_i.while_token).0);
1711 _visitor.visit_expr(&*_i.cond);
1712 _visitor.visit_block(&_i.body);
1713}
1714#[cfg(feature = "full")]
1715#[cfg(any(feature = "full", feature = "derive"))]
1716pub fn visit_expr_while_let<'ast, V: Visit<'ast> + ?Sized>(
1717 _visitor: &mut V,
1718 _i: &'ast ExprWhileLet,
1719) {
1720 for it in &_i.attrs {
1721 _visitor.visit_attribute(it)
1722 }
1723 if let Some(ref it) = _i.label {
1724 _visitor.visit_label(it)
1725 };
1726 tokens_helper(_visitor, &(_i.while_token).0);
1727 tokens_helper(_visitor, &(_i.let_token).0);
1728 for el in Punctuated::pairs(&_i.pats) {
1729 let it = el.value();
1730 _visitor.visit_pat(it)
1731 }
1732 tokens_helper(_visitor, &(_i.eq_token).0);
1733 _visitor.visit_expr(&*_i.expr);
1734 _visitor.visit_block(&_i.body);
1735}
1736#[cfg(feature = "full")]
1737#[cfg(any(feature = "full", feature = "derive"))]
1738pub fn visit_expr_yield<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprYield) {
1739 for it in &_i.attrs {
1740 _visitor.visit_attribute(it)
1741 }
1742 tokens_helper(_visitor, &(_i.yield_token).0);
1743 if let Some(ref it) = _i.expr {
1744 _visitor.visit_expr(&**it)
1745 };
1746}
1747#[cfg(any(feature = "full", feature = "derive"))]
1748pub fn visit_field<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Field) {
1749 for it in &_i.attrs {
1750 _visitor.visit_attribute(it)
1751 }
1752 _visitor.visit_visibility(&_i.vis);
1753 if let Some(ref it) = _i.ident {
1754 _visitor.visit_ident(it)
1755 };
1756 if let Some(ref it) = _i.colon_token {
1757 tokens_helper(_visitor, &(it).0)
1758 };
1759 _visitor.visit_type(&_i.ty);
1760}
1761#[cfg(any(feature = "full", feature = "derive"))]
1762#[cfg(feature = "full")]
1763pub fn visit_field_pat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldPat) {
1764 for it in &_i.attrs {
1765 _visitor.visit_attribute(it)
1766 }
1767 _visitor.visit_member(&_i.member);
1768 if let Some(ref it) = _i.colon_token {
1769 tokens_helper(_visitor, &(it).0)
1770 };
1771 _visitor.visit_pat(&*_i.pat);
1772}
1773#[cfg(any(feature = "full", feature = "derive"))]
1774#[cfg(feature = "full")]
1775pub fn visit_field_value<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldValue) {
1776 for it in &_i.attrs {
1777 _visitor.visit_attribute(it)
1778 }
1779 _visitor.visit_member(&_i.member);
1780 if let Some(ref it) = _i.colon_token {
1781 tokens_helper(_visitor, &(it).0)
1782 };
1783 _visitor.visit_expr(&_i.expr);
1784}
1785#[cfg(any(feature = "full", feature = "derive"))]
1786pub fn visit_fields<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Fields) {
1787 match *_i {
1788 Fields::Named(ref _binding_0) => {
1789 _visitor.visit_fields_named(_binding_0);
1790 }
1791 Fields::Unnamed(ref _binding_0) => {
1792 _visitor.visit_fields_unnamed(_binding_0);
1793 }
1794 Fields::Unit => {}
1795 }
1796}
1797#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001798pub fn visit_fields_named<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldsNamed) {
David Tolnay8c81f622018-07-31 23:34:35 -07001799 tokens_helper(_visitor, &(_i.brace_token).0);
1800 for el in Punctuated::pairs(&_i.named) {
1801 let it = el.value();
1802 _visitor.visit_field(it)
1803 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001804}
David Tolnay8c81f622018-07-31 23:34:35 -07001805#[cfg(any(feature = "full", feature = "derive"))]
1806pub fn visit_fields_unnamed<'ast, V: Visit<'ast> + ?Sized>(
1807 _visitor: &mut V,
1808 _i: &'ast FieldsUnnamed,
1809) {
1810 tokens_helper(_visitor, &(_i.paren_token).0);
1811 for el in Punctuated::pairs(&_i.unnamed) {
1812 let it = el.value();
1813 _visitor.visit_field(it)
1814 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001815}
David Tolnay8c81f622018-07-31 23:34:35 -07001816#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001817pub fn visit_file<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast File) {
Nika Layzell27726662017-10-24 23:16:35 -04001818 // Skipped field _i . shebang;
David Tolnay8c81f622018-07-31 23:34:35 -07001819 for it in &_i.attrs {
1820 _visitor.visit_attribute(it)
1821 }
1822 for it in &_i.items {
1823 _visitor.visit_item(it)
1824 }
Nika Layzell27726662017-10-24 23:16:35 -04001825}
David Tolnay8c81f622018-07-31 23:34:35 -07001826#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001827pub fn visit_fn_arg<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FnArg) {
Nika Layzell27726662017-10-24 23:16:35 -04001828 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001829 FnArg::SelfRef(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001830 _visitor.visit_arg_self_ref(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001831 }
David Tolnay8c81f622018-07-31 23:34:35 -07001832 FnArg::SelfValue(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001833 _visitor.visit_arg_self(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001834 }
David Tolnay8c81f622018-07-31 23:34:35 -07001835 FnArg::Captured(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001836 _visitor.visit_arg_captured(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001837 }
David Tolnay8c81f622018-07-31 23:34:35 -07001838 FnArg::Inferred(ref _binding_0) => {
David Tolnay80ed55f2017-12-27 22:54:40 -05001839 _visitor.visit_pat(_binding_0);
1840 }
David Tolnay8c81f622018-07-31 23:34:35 -07001841 FnArg::Ignored(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001842 _visitor.visit_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001843 }
1844 }
1845}
David Tolnay8c81f622018-07-31 23:34:35 -07001846#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001847pub fn visit_fn_decl<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FnDecl) {
David Tolnay8c81f622018-07-31 23:34:35 -07001848 tokens_helper(_visitor, &(_i.fn_token).0);
1849 _visitor.visit_generics(&_i.generics);
1850 tokens_helper(_visitor, &(_i.paren_token).0);
1851 for el in Punctuated::pairs(&_i.inputs) {
1852 let it = el.value();
1853 _visitor.visit_fn_arg(it)
1854 }
1855 if let Some(ref it) = _i.variadic {
1856 tokens_helper(_visitor, &(it).0)
1857 };
1858 _visitor.visit_return_type(&_i.output);
Nika Layzell27726662017-10-24 23:16:35 -04001859}
David Tolnay8c81f622018-07-31 23:34:35 -07001860#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001861pub fn visit_foreign_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ForeignItem) {
Nika Layzell27726662017-10-24 23:16:35 -04001862 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001863 ForeignItem::Fn(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001864 _visitor.visit_foreign_item_fn(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001865 }
David Tolnay8c81f622018-07-31 23:34:35 -07001866 ForeignItem::Static(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001867 _visitor.visit_foreign_item_static(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001868 }
David Tolnay8c81f622018-07-31 23:34:35 -07001869 ForeignItem::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001870 _visitor.visit_foreign_item_type(_binding_0);
David Tolnay199bcbb2017-11-12 10:33:52 -08001871 }
David Tolnay8c81f622018-07-31 23:34:35 -07001872 ForeignItem::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05001873 _visitor.visit_foreign_item_verbatim(_binding_0);
1874 }
Nika Layzell27726662017-10-24 23:16:35 -04001875 }
1876}
David Tolnay8c81f622018-07-31 23:34:35 -07001877#[cfg(feature = "full")]
1878pub fn visit_foreign_item_fn<'ast, V: Visit<'ast> + ?Sized>(
1879 _visitor: &mut V,
1880 _i: &'ast ForeignItemFn,
1881) {
1882 for it in &_i.attrs {
1883 _visitor.visit_attribute(it)
1884 }
1885 _visitor.visit_visibility(&_i.vis);
1886 _visitor.visit_ident(&_i.ident);
1887 _visitor.visit_fn_decl(&*_i.decl);
1888 tokens_helper(_visitor, &(_i.semi_token).0);
David Tolnay8894f602017-11-11 12:11:04 -08001889}
David Tolnay8c81f622018-07-31 23:34:35 -07001890#[cfg(feature = "full")]
1891pub fn visit_foreign_item_static<'ast, V: Visit<'ast> + ?Sized>(
1892 _visitor: &mut V,
1893 _i: &'ast ForeignItemStatic,
1894) {
1895 for it in &_i.attrs {
1896 _visitor.visit_attribute(it)
1897 }
1898 _visitor.visit_visibility(&_i.vis);
1899 tokens_helper(_visitor, &(_i.static_token).0);
1900 if let Some(ref it) = _i.mutability {
1901 tokens_helper(_visitor, &(it).0)
1902 };
1903 _visitor.visit_ident(&_i.ident);
1904 tokens_helper(_visitor, &(_i.colon_token).0);
1905 _visitor.visit_type(&*_i.ty);
1906 tokens_helper(_visitor, &(_i.semi_token).0);
Nika Layzell27726662017-10-24 23:16:35 -04001907}
David Tolnay8c81f622018-07-31 23:34:35 -07001908#[cfg(feature = "full")]
1909pub fn visit_foreign_item_type<'ast, V: Visit<'ast> + ?Sized>(
1910 _visitor: &mut V,
1911 _i: &'ast ForeignItemType,
1912) {
1913 for it in &_i.attrs {
1914 _visitor.visit_attribute(it)
1915 }
1916 _visitor.visit_visibility(&_i.vis);
1917 tokens_helper(_visitor, &(_i.type_token).0);
1918 _visitor.visit_ident(&_i.ident);
1919 tokens_helper(_visitor, &(_i.semi_token).0);
David Tolnay199bcbb2017-11-12 10:33:52 -08001920}
David Tolnay8c81f622018-07-31 23:34:35 -07001921#[cfg(feature = "full")]
1922pub fn visit_foreign_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
1923 _visitor: &mut V,
1924 _i: &'ast ForeignItemVerbatim,
1925) {
David Tolnay2ae520a2017-12-29 11:19:50 -05001926 // Skipped field _i . tts;
1927}
David Tolnay8c81f622018-07-31 23:34:35 -07001928#[cfg(any(feature = "full", feature = "derive"))]
1929pub fn visit_generic_argument<'ast, V: Visit<'ast> + ?Sized>(
1930 _visitor: &mut V,
1931 _i: &'ast GenericArgument,
1932) {
Nika Layzell357885a2017-12-04 15:47:07 -05001933 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001934 GenericArgument::Lifetime(ref _binding_0) => {
David Tolnay4ba63a02017-12-28 15:53:05 -05001935 _visitor.visit_lifetime(_binding_0);
Nika Layzell357885a2017-12-04 15:47:07 -05001936 }
David Tolnay8c81f622018-07-31 23:34:35 -07001937 GenericArgument::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001938 _visitor.visit_type(_binding_0);
Nika Layzell357885a2017-12-04 15:47:07 -05001939 }
David Tolnay8c81f622018-07-31 23:34:35 -07001940 GenericArgument::Binding(ref _binding_0) => {
David Tolnay506e43a2017-12-29 11:34:36 -05001941 _visitor.visit_binding(_binding_0);
Nika Layzell357885a2017-12-04 15:47:07 -05001942 }
David Tolnay8c81f622018-07-31 23:34:35 -07001943 GenericArgument::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001944 _visitor.visit_expr(_binding_0);
Nika Layzellc680e612017-12-04 19:07:20 -05001945 }
Nika Layzell357885a2017-12-04 15:47:07 -05001946 }
1947}
David Tolnay8c81f622018-07-31 23:34:35 -07001948#[cfg(any(feature = "full", feature = "derive"))]
1949#[cfg(feature = "full")]
1950pub fn visit_generic_method_argument<'ast, V: Visit<'ast> + ?Sized>(
1951 _visitor: &mut V,
1952 _i: &'ast GenericMethodArgument,
1953) {
David Tolnayd60cfec2017-12-29 00:21:38 -05001954 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001955 GenericMethodArgument::Type(ref _binding_0) => {
David Tolnayd60cfec2017-12-29 00:21:38 -05001956 _visitor.visit_type(_binding_0);
1957 }
David Tolnay8c81f622018-07-31 23:34:35 -07001958 GenericMethodArgument::Const(ref _binding_0) => {
David Tolnayd60cfec2017-12-29 00:21:38 -05001959 _visitor.visit_expr(_binding_0);
1960 }
1961 }
1962}
David Tolnay8c81f622018-07-31 23:34:35 -07001963#[cfg(any(feature = "full", feature = "derive"))]
1964pub fn visit_generic_param<'ast, V: Visit<'ast> + ?Sized>(
1965 _visitor: &mut V,
1966 _i: &'ast GenericParam,
1967) {
David Tolnayc2f1aba2017-11-12 20:29:22 -08001968 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001969 GenericParam::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001970 _visitor.visit_type_param(_binding_0);
David Tolnayc2f1aba2017-11-12 20:29:22 -08001971 }
David Tolnay8c81f622018-07-31 23:34:35 -07001972 GenericParam::Lifetime(ref _binding_0) => {
David Tolnay517f3692018-01-01 20:17:23 -08001973 _visitor.visit_lifetime_def(_binding_0);
1974 }
David Tolnay8c81f622018-07-31 23:34:35 -07001975 GenericParam::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001976 _visitor.visit_const_param(_binding_0);
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001977 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08001978 }
1979}
David Tolnay8c81f622018-07-31 23:34:35 -07001980#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001981pub fn visit_generics<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Generics) {
David Tolnay8c81f622018-07-31 23:34:35 -07001982 if let Some(ref it) = _i.lt_token {
1983 tokens_helper(_visitor, &(it).0)
1984 };
1985 for el in Punctuated::pairs(&_i.params) {
1986 let it = el.value();
1987 _visitor.visit_generic_param(it)
1988 }
1989 if let Some(ref it) = _i.gt_token {
1990 tokens_helper(_visitor, &(it).0)
1991 };
1992 if let Some(ref it) = _i.where_clause {
1993 _visitor.visit_where_clause(it)
1994 };
Nika Layzell27726662017-10-24 23:16:35 -04001995}
Alex Crichtond261d092018-05-18 13:47:35 -07001996
David Tolnay8c81f622018-07-31 23:34:35 -07001997pub fn visit_ident<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Ident) {}
1998#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001999pub fn visit_impl_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ImplItem) {
Nika Layzell27726662017-10-24 23:16:35 -04002000 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002001 ImplItem::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002002 _visitor.visit_impl_item_const(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002003 }
David Tolnay8c81f622018-07-31 23:34:35 -07002004 ImplItem::Method(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002005 _visitor.visit_impl_item_method(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002006 }
David Tolnay8c81f622018-07-31 23:34:35 -07002007 ImplItem::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002008 _visitor.visit_impl_item_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002009 }
David Tolnay8c81f622018-07-31 23:34:35 -07002010 ImplItem::Macro(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002011 _visitor.visit_impl_item_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002012 }
David Tolnay8c81f622018-07-31 23:34:35 -07002013 ImplItem::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002014 _visitor.visit_impl_item_verbatim(_binding_0);
2015 }
Nika Layzell27726662017-10-24 23:16:35 -04002016 }
2017}
David Tolnay8c81f622018-07-31 23:34:35 -07002018#[cfg(feature = "full")]
2019pub fn visit_impl_item_const<'ast, V: Visit<'ast> + ?Sized>(
2020 _visitor: &mut V,
2021 _i: &'ast ImplItemConst,
2022) {
2023 for it in &_i.attrs {
2024 _visitor.visit_attribute(it)
2025 }
2026 _visitor.visit_visibility(&_i.vis);
2027 if let Some(ref it) = _i.defaultness {
2028 tokens_helper(_visitor, &(it).0)
2029 };
2030 tokens_helper(_visitor, &(_i.const_token).0);
2031 _visitor.visit_ident(&_i.ident);
2032 tokens_helper(_visitor, &(_i.colon_token).0);
2033 _visitor.visit_type(&_i.ty);
2034 tokens_helper(_visitor, &(_i.eq_token).0);
2035 _visitor.visit_expr(&_i.expr);
2036 tokens_helper(_visitor, &(_i.semi_token).0);
David Tolnay857628c2017-11-11 12:25:31 -08002037}
David Tolnay8c81f622018-07-31 23:34:35 -07002038#[cfg(feature = "full")]
2039pub fn visit_impl_item_macro<'ast, V: Visit<'ast> + ?Sized>(
2040 _visitor: &mut V,
2041 _i: &'ast ImplItemMacro,
2042) {
2043 for it in &_i.attrs {
2044 _visitor.visit_attribute(it)
2045 }
2046 _visitor.visit_macro(&_i.mac);
2047 if let Some(ref it) = _i.semi_token {
2048 tokens_helper(_visitor, &(it).0)
2049 };
David Tolnay857628c2017-11-11 12:25:31 -08002050}
David Tolnay8c81f622018-07-31 23:34:35 -07002051#[cfg(feature = "full")]
2052pub fn visit_impl_item_method<'ast, V: Visit<'ast> + ?Sized>(
2053 _visitor: &mut V,
2054 _i: &'ast ImplItemMethod,
2055) {
2056 for it in &_i.attrs {
2057 _visitor.visit_attribute(it)
2058 }
2059 _visitor.visit_visibility(&_i.vis);
2060 if let Some(ref it) = _i.defaultness {
2061 tokens_helper(_visitor, &(it).0)
2062 };
2063 _visitor.visit_method_sig(&_i.sig);
2064 _visitor.visit_block(&_i.block);
Nika Layzell27726662017-10-24 23:16:35 -04002065}
David Tolnay8c81f622018-07-31 23:34:35 -07002066#[cfg(feature = "full")]
2067pub fn visit_impl_item_type<'ast, V: Visit<'ast> + ?Sized>(
2068 _visitor: &mut V,
2069 _i: &'ast ImplItemType,
2070) {
2071 for it in &_i.attrs {
2072 _visitor.visit_attribute(it)
2073 }
2074 _visitor.visit_visibility(&_i.vis);
2075 if let Some(ref it) = _i.defaultness {
2076 tokens_helper(_visitor, &(it).0)
2077 };
2078 tokens_helper(_visitor, &(_i.type_token).0);
2079 _visitor.visit_ident(&_i.ident);
2080 _visitor.visit_generics(&_i.generics);
2081 tokens_helper(_visitor, &(_i.eq_token).0);
2082 _visitor.visit_type(&_i.ty);
2083 tokens_helper(_visitor, &(_i.semi_token).0);
Nika Layzell27726662017-10-24 23:16:35 -04002084}
David Tolnay8c81f622018-07-31 23:34:35 -07002085#[cfg(feature = "full")]
2086pub fn visit_impl_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
2087 _visitor: &mut V,
2088 _i: &'ast ImplItemVerbatim,
2089) {
David Tolnay2ae520a2017-12-29 11:19:50 -05002090 // Skipped field _i . tts;
2091}
David Tolnay8c81f622018-07-31 23:34:35 -07002092#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002093pub fn visit_index<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Index) {
David Tolnay85b69a42017-12-27 20:43:10 -05002094 // Skipped field _i . index;
David Tolnay8c81f622018-07-31 23:34:35 -07002095 _visitor.visit_span(&_i.span);
David Tolnay85b69a42017-12-27 20:43:10 -05002096}
David Tolnay8c81f622018-07-31 23:34:35 -07002097#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002098pub fn visit_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Item) {
Nika Layzell27726662017-10-24 23:16:35 -04002099 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002100 Item::ExternCrate(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002101 _visitor.visit_item_extern_crate(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002102 }
David Tolnay8c81f622018-07-31 23:34:35 -07002103 Item::Use(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002104 _visitor.visit_item_use(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002105 }
David Tolnay8c81f622018-07-31 23:34:35 -07002106 Item::Static(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002107 _visitor.visit_item_static(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002108 }
David Tolnay8c81f622018-07-31 23:34:35 -07002109 Item::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002110 _visitor.visit_item_const(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002111 }
David Tolnay8c81f622018-07-31 23:34:35 -07002112 Item::Fn(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002113 _visitor.visit_item_fn(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002114 }
David Tolnay8c81f622018-07-31 23:34:35 -07002115 Item::Mod(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002116 _visitor.visit_item_mod(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002117 }
David Tolnay8c81f622018-07-31 23:34:35 -07002118 Item::ForeignMod(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002119 _visitor.visit_item_foreign_mod(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002120 }
David Tolnay8c81f622018-07-31 23:34:35 -07002121 Item::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002122 _visitor.visit_item_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002123 }
David Tolnay8c81f622018-07-31 23:34:35 -07002124 Item::Struct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002125 _visitor.visit_item_struct(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002126 }
David Tolnay8c81f622018-07-31 23:34:35 -07002127 Item::Enum(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05002128 _visitor.visit_item_enum(_binding_0);
2129 }
David Tolnay8c81f622018-07-31 23:34:35 -07002130 Item::Union(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002131 _visitor.visit_item_union(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002132 }
David Tolnay8c81f622018-07-31 23:34:35 -07002133 Item::Trait(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002134 _visitor.visit_item_trait(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002135 }
David Tolnay8c81f622018-07-31 23:34:35 -07002136 Item::Impl(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002137 _visitor.visit_item_impl(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002138 }
David Tolnay8c81f622018-07-31 23:34:35 -07002139 Item::Macro(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002140 _visitor.visit_item_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002141 }
David Tolnay8c81f622018-07-31 23:34:35 -07002142 Item::Macro2(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002143 _visitor.visit_item_macro2(_binding_0);
David Tolnay500d8322017-12-18 00:32:51 -08002144 }
David Tolnay8c81f622018-07-31 23:34:35 -07002145 Item::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002146 _visitor.visit_item_verbatim(_binding_0);
2147 }
Nika Layzell27726662017-10-24 23:16:35 -04002148 }
2149}
David Tolnay8c81f622018-07-31 23:34:35 -07002150#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002151pub fn visit_item_const<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemConst) {
David Tolnay8c81f622018-07-31 23:34:35 -07002152 for it in &_i.attrs {
2153 _visitor.visit_attribute(it)
2154 }
2155 _visitor.visit_visibility(&_i.vis);
2156 tokens_helper(_visitor, &(_i.const_token).0);
2157 _visitor.visit_ident(&_i.ident);
2158 tokens_helper(_visitor, &(_i.colon_token).0);
2159 _visitor.visit_type(&*_i.ty);
2160 tokens_helper(_visitor, &(_i.eq_token).0);
2161 _visitor.visit_expr(&*_i.expr);
2162 tokens_helper(_visitor, &(_i.semi_token).0);
David Tolnayc6b55bc2017-11-09 22:48:38 -08002163}
David Tolnay8c81f622018-07-31 23:34:35 -07002164#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002165pub fn visit_item_enum<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemEnum) {
David Tolnay8c81f622018-07-31 23:34:35 -07002166 for it in &_i.attrs {
2167 _visitor.visit_attribute(it)
2168 }
2169 _visitor.visit_visibility(&_i.vis);
2170 tokens_helper(_visitor, &(_i.enum_token).0);
2171 _visitor.visit_ident(&_i.ident);
2172 _visitor.visit_generics(&_i.generics);
2173 tokens_helper(_visitor, &(_i.brace_token).0);
2174 for el in Punctuated::pairs(&_i.variants) {
2175 let it = el.value();
2176 _visitor.visit_variant(it)
2177 }
David Tolnayc6b55bc2017-11-09 22:48:38 -08002178}
David Tolnay8c81f622018-07-31 23:34:35 -07002179#[cfg(feature = "full")]
2180pub fn visit_item_extern_crate<'ast, V: Visit<'ast> + ?Sized>(
2181 _visitor: &mut V,
2182 _i: &'ast ItemExternCrate,
2183) {
2184 for it in &_i.attrs {
2185 _visitor.visit_attribute(it)
2186 }
2187 _visitor.visit_visibility(&_i.vis);
2188 tokens_helper(_visitor, &(_i.extern_token).0);
2189 tokens_helper(_visitor, &(_i.crate_token).0);
2190 _visitor.visit_ident(&_i.ident);
2191 if let Some(ref it) = _i.rename {
2192 tokens_helper(_visitor, &((it).0).0);
2193 _visitor.visit_ident(&(it).1);
2194 };
2195 tokens_helper(_visitor, &(_i.semi_token).0);
David Tolnayc6b55bc2017-11-09 22:48:38 -08002196}
David Tolnay8c81f622018-07-31 23:34:35 -07002197#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002198pub fn visit_item_fn<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemFn) {
David Tolnay8c81f622018-07-31 23:34:35 -07002199 for it in &_i.attrs {
2200 _visitor.visit_attribute(it)
2201 }
2202 _visitor.visit_visibility(&_i.vis);
2203 if let Some(ref it) = _i.constness {
2204 tokens_helper(_visitor, &(it).0)
2205 };
2206 if let Some(ref it) = _i.unsafety {
2207 tokens_helper(_visitor, &(it).0)
2208 };
2209 if let Some(ref it) = _i.abi {
2210 _visitor.visit_abi(it)
2211 };
2212 _visitor.visit_ident(&_i.ident);
2213 _visitor.visit_fn_decl(&*_i.decl);
2214 _visitor.visit_block(&*_i.block);
David Tolnayc6b55bc2017-11-09 22:48:38 -08002215}
David Tolnay8c81f622018-07-31 23:34:35 -07002216#[cfg(feature = "full")]
2217pub fn visit_item_foreign_mod<'ast, V: Visit<'ast> + ?Sized>(
2218 _visitor: &mut V,
2219 _i: &'ast ItemForeignMod,
2220) {
2221 for it in &_i.attrs {
2222 _visitor.visit_attribute(it)
2223 }
2224 _visitor.visit_abi(&_i.abi);
2225 tokens_helper(_visitor, &(_i.brace_token).0);
2226 for it in &_i.items {
2227 _visitor.visit_foreign_item(it)
2228 }
David Tolnayc6b55bc2017-11-09 22:48:38 -08002229}
David Tolnay8c81f622018-07-31 23:34:35 -07002230#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002231pub fn visit_item_impl<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemImpl) {
David Tolnay8c81f622018-07-31 23:34:35 -07002232 for it in &_i.attrs {
2233 _visitor.visit_attribute(it)
2234 }
2235 if let Some(ref it) = _i.defaultness {
2236 tokens_helper(_visitor, &(it).0)
2237 };
2238 if let Some(ref it) = _i.unsafety {
2239 tokens_helper(_visitor, &(it).0)
2240 };
2241 tokens_helper(_visitor, &(_i.impl_token).0);
2242 _visitor.visit_generics(&_i.generics);
2243 if let Some(ref it) = _i.trait_ {
2244 if let Some(ref it) = (it).0 {
2245 tokens_helper(_visitor, &(it).0)
2246 };
2247 _visitor.visit_path(&(it).1);
2248 tokens_helper(_visitor, &((it).2).0);
2249 };
2250 _visitor.visit_type(&*_i.self_ty);
2251 tokens_helper(_visitor, &(_i.brace_token).0);
2252 for it in &_i.items {
2253 _visitor.visit_impl_item(it)
2254 }
David Tolnayc6b55bc2017-11-09 22:48:38 -08002255}
David Tolnay8c81f622018-07-31 23:34:35 -07002256#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002257pub fn visit_item_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemMacro) {
David Tolnay8c81f622018-07-31 23:34:35 -07002258 for it in &_i.attrs {
2259 _visitor.visit_attribute(it)
2260 }
2261 if let Some(ref it) = _i.ident {
2262 _visitor.visit_ident(it)
2263 };
2264 _visitor.visit_macro(&_i.mac);
2265 if let Some(ref it) = _i.semi_token {
2266 tokens_helper(_visitor, &(it).0)
2267 };
David Tolnayc6b55bc2017-11-09 22:48:38 -08002268}
David Tolnay8c81f622018-07-31 23:34:35 -07002269#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002270pub fn visit_item_macro2<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemMacro2) {
David Tolnay8c81f622018-07-31 23:34:35 -07002271 for it in &_i.attrs {
2272 _visitor.visit_attribute(it)
2273 }
2274 _visitor.visit_visibility(&_i.vis);
2275 tokens_helper(_visitor, &(_i.macro_token).0);
2276 _visitor.visit_ident(&_i.ident);
2277 tokens_helper(_visitor, &(_i.paren_token).0);
David Tolnay500d8322017-12-18 00:32:51 -08002278 // Skipped field _i . args;
David Tolnay8c81f622018-07-31 23:34:35 -07002279 tokens_helper(_visitor, &(_i.brace_token).0);
David Tolnay500d8322017-12-18 00:32:51 -08002280 // Skipped field _i . body;
2281}
David Tolnay8c81f622018-07-31 23:34:35 -07002282#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002283pub fn visit_item_mod<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemMod) {
David Tolnay8c81f622018-07-31 23:34:35 -07002284 for it in &_i.attrs {
2285 _visitor.visit_attribute(it)
2286 }
2287 _visitor.visit_visibility(&_i.vis);
2288 tokens_helper(_visitor, &(_i.mod_token).0);
2289 _visitor.visit_ident(&_i.ident);
2290 if let Some(ref it) = _i.content {
2291 tokens_helper(_visitor, &((it).0).0);
2292 for it in &(it).1 {
2293 _visitor.visit_item(it)
2294 }
2295 };
2296 if let Some(ref it) = _i.semi {
2297 tokens_helper(_visitor, &(it).0)
2298 };
Nika Layzell27726662017-10-24 23:16:35 -04002299}
David Tolnay8c81f622018-07-31 23:34:35 -07002300#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002301pub fn visit_item_static<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemStatic) {
David Tolnay8c81f622018-07-31 23:34:35 -07002302 for it in &_i.attrs {
2303 _visitor.visit_attribute(it)
2304 }
2305 _visitor.visit_visibility(&_i.vis);
2306 tokens_helper(_visitor, &(_i.static_token).0);
2307 if let Some(ref it) = _i.mutability {
2308 tokens_helper(_visitor, &(it).0)
2309 };
2310 _visitor.visit_ident(&_i.ident);
2311 tokens_helper(_visitor, &(_i.colon_token).0);
2312 _visitor.visit_type(&*_i.ty);
2313 tokens_helper(_visitor, &(_i.eq_token).0);
2314 _visitor.visit_expr(&*_i.expr);
2315 tokens_helper(_visitor, &(_i.semi_token).0);
Nika Layzell27726662017-10-24 23:16:35 -04002316}
David Tolnay8c81f622018-07-31 23:34:35 -07002317#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002318pub fn visit_item_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemStruct) {
David Tolnay8c81f622018-07-31 23:34:35 -07002319 for it in &_i.attrs {
2320 _visitor.visit_attribute(it)
2321 }
2322 _visitor.visit_visibility(&_i.vis);
2323 tokens_helper(_visitor, &(_i.struct_token).0);
2324 _visitor.visit_ident(&_i.ident);
2325 _visitor.visit_generics(&_i.generics);
2326 _visitor.visit_fields(&_i.fields);
2327 if let Some(ref it) = _i.semi_token {
2328 tokens_helper(_visitor, &(it).0)
2329 };
Nika Layzell27726662017-10-24 23:16:35 -04002330}
David Tolnay8c81f622018-07-31 23:34:35 -07002331#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002332pub fn visit_item_trait<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemTrait) {
David Tolnay8c81f622018-07-31 23:34:35 -07002333 for it in &_i.attrs {
2334 _visitor.visit_attribute(it)
2335 }
2336 _visitor.visit_visibility(&_i.vis);
2337 if let Some(ref it) = _i.unsafety {
2338 tokens_helper(_visitor, &(it).0)
2339 };
2340 if let Some(ref it) = _i.auto_token {
2341 tokens_helper(_visitor, &(it).0)
2342 };
2343 tokens_helper(_visitor, &(_i.trait_token).0);
2344 _visitor.visit_ident(&_i.ident);
2345 _visitor.visit_generics(&_i.generics);
2346 if let Some(ref it) = _i.colon_token {
2347 tokens_helper(_visitor, &(it).0)
2348 };
2349 for el in Punctuated::pairs(&_i.supertraits) {
2350 let it = el.value();
2351 _visitor.visit_type_param_bound(it)
2352 }
2353 tokens_helper(_visitor, &(_i.brace_token).0);
2354 for it in &_i.items {
2355 _visitor.visit_trait_item(it)
2356 }
Nika Layzell27726662017-10-24 23:16:35 -04002357}
David Tolnay8c81f622018-07-31 23:34:35 -07002358#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002359pub fn visit_item_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemType) {
David Tolnay8c81f622018-07-31 23:34:35 -07002360 for it in &_i.attrs {
2361 _visitor.visit_attribute(it)
2362 }
2363 _visitor.visit_visibility(&_i.vis);
2364 tokens_helper(_visitor, &(_i.type_token).0);
2365 _visitor.visit_ident(&_i.ident);
2366 _visitor.visit_generics(&_i.generics);
2367 tokens_helper(_visitor, &(_i.eq_token).0);
2368 _visitor.visit_type(&*_i.ty);
2369 tokens_helper(_visitor, &(_i.semi_token).0);
Nika Layzell27726662017-10-24 23:16:35 -04002370}
David Tolnay8c81f622018-07-31 23:34:35 -07002371#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002372pub fn visit_item_union<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemUnion) {
David Tolnay8c81f622018-07-31 23:34:35 -07002373 for it in &_i.attrs {
2374 _visitor.visit_attribute(it)
2375 }
2376 _visitor.visit_visibility(&_i.vis);
2377 tokens_helper(_visitor, &(_i.union_token).0);
2378 _visitor.visit_ident(&_i.ident);
2379 _visitor.visit_generics(&_i.generics);
2380 _visitor.visit_fields_named(&_i.fields);
Nika Layzell27726662017-10-24 23:16:35 -04002381}
David Tolnay8c81f622018-07-31 23:34:35 -07002382#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002383pub fn visit_item_use<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemUse) {
David Tolnay8c81f622018-07-31 23:34:35 -07002384 for it in &_i.attrs {
2385 _visitor.visit_attribute(it)
2386 }
2387 _visitor.visit_visibility(&_i.vis);
2388 tokens_helper(_visitor, &(_i.use_token).0);
2389 if let Some(ref it) = _i.leading_colon {
2390 tokens_helper(_visitor, &(it).0)
2391 };
2392 _visitor.visit_use_tree(&_i.tree);
2393 tokens_helper(_visitor, &(_i.semi_token).0);
Nika Layzell27726662017-10-24 23:16:35 -04002394}
David Tolnay8c81f622018-07-31 23:34:35 -07002395#[cfg(feature = "full")]
2396pub fn visit_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
2397 _visitor: &mut V,
2398 _i: &'ast ItemVerbatim,
2399) {
David Tolnay2ae520a2017-12-29 11:19:50 -05002400 // Skipped field _i . tts;
2401}
David Tolnay8c81f622018-07-31 23:34:35 -07002402#[cfg(any(feature = "full", feature = "derive"))]
2403#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002404pub fn visit_label<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Label) {
David Tolnay8c81f622018-07-31 23:34:35 -07002405 _visitor.visit_lifetime(&_i.name);
2406 tokens_helper(_visitor, &(_i.colon_token).0);
David Tolnaybcd498f2017-12-29 12:02:33 -05002407}
David Tolnay8c81f622018-07-31 23:34:35 -07002408#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002409pub fn visit_lifetime<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Lifetime) {
Alex Crichton131308c2018-05-18 14:00:24 -07002410 // Skipped field _i . apostrophe;
David Tolnay8c81f622018-07-31 23:34:35 -07002411 _visitor.visit_ident(&_i.ident);
David Tolnay4ba63a02017-12-28 15:53:05 -05002412}
David Tolnay8c81f622018-07-31 23:34:35 -07002413#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002414pub fn visit_lifetime_def<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LifetimeDef) {
David Tolnay8c81f622018-07-31 23:34:35 -07002415 for it in &_i.attrs {
2416 _visitor.visit_attribute(it)
2417 }
2418 _visitor.visit_lifetime(&_i.lifetime);
2419 if let Some(ref it) = _i.colon_token {
2420 tokens_helper(_visitor, &(it).0)
2421 };
2422 for el in Punctuated::pairs(&_i.bounds) {
2423 let it = el.value();
2424 _visitor.visit_lifetime(it)
2425 }
David Tolnay4ba63a02017-12-28 15:53:05 -05002426}
David Tolnay8c81f622018-07-31 23:34:35 -07002427#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002428pub fn visit_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Lit) {
David Tolnay360efd22018-01-04 23:35:26 -08002429 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002430 Lit::Str(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002431 _visitor.visit_lit_str(_binding_0);
2432 }
David Tolnay8c81f622018-07-31 23:34:35 -07002433 Lit::ByteStr(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002434 _visitor.visit_lit_byte_str(_binding_0);
2435 }
David Tolnay8c81f622018-07-31 23:34:35 -07002436 Lit::Byte(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002437 _visitor.visit_lit_byte(_binding_0);
2438 }
David Tolnay8c81f622018-07-31 23:34:35 -07002439 Lit::Char(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002440 _visitor.visit_lit_char(_binding_0);
2441 }
David Tolnay8c81f622018-07-31 23:34:35 -07002442 Lit::Int(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002443 _visitor.visit_lit_int(_binding_0);
2444 }
David Tolnay8c81f622018-07-31 23:34:35 -07002445 Lit::Float(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002446 _visitor.visit_lit_float(_binding_0);
2447 }
David Tolnay8c81f622018-07-31 23:34:35 -07002448 Lit::Bool(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002449 _visitor.visit_lit_bool(_binding_0);
2450 }
David Tolnay8c81f622018-07-31 23:34:35 -07002451 Lit::Verbatim(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002452 _visitor.visit_lit_verbatim(_binding_0);
2453 }
2454 }
2455}
David Tolnay8c81f622018-07-31 23:34:35 -07002456#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002457pub fn visit_lit_bool<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitBool) {
David Tolnay4ba63a02017-12-28 15:53:05 -05002458 // Skipped field _i . value;
David Tolnay8c81f622018-07-31 23:34:35 -07002459 _visitor.visit_span(&_i.span);
Nika Layzell27726662017-10-24 23:16:35 -04002460}
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<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitByte) {
David Tolnay360efd22018-01-04 23:35:26 -08002463 // Skipped field _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_byte_str<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitByteStr) {
David Tolnay360efd22018-01-04 23:35:26 -08002467 // Skipped field _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_char<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitChar) {
David Tolnay360efd22018-01-04 23:35:26 -08002471 // Skipped field _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_float<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitFloat) {
David Tolnay360efd22018-01-04 23:35:26 -08002475 // Skipped field _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_int<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitInt) {
David Tolnay360efd22018-01-04 23:35:26 -08002479 // Skipped field _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_str<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitStr) {
David Tolnay360efd22018-01-04 23:35:26 -08002483 // Skipped field _i . token;
David Tolnay360efd22018-01-04 23:35:26 -08002484}
David Tolnay8c81f622018-07-31 23:34:35 -07002485#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002486pub fn visit_lit_verbatim<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitVerbatim) {
David Tolnay360efd22018-01-04 23:35:26 -08002487 // Skipped field _i . token;
David Tolnay360efd22018-01-04 23:35:26 -08002488}
David Tolnay8c81f622018-07-31 23:34:35 -07002489#[cfg(any(feature = "full", feature = "derive"))]
2490#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002491pub fn visit_local<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Local) {
David Tolnay8c81f622018-07-31 23:34:35 -07002492 for it in &_i.attrs {
2493 _visitor.visit_attribute(it)
2494 }
2495 tokens_helper(_visitor, &(_i.let_token).0);
2496 for el in Punctuated::pairs(&_i.pats) {
2497 let it = el.value();
2498 _visitor.visit_pat(it)
2499 }
2500 if let Some(ref it) = _i.ty {
2501 tokens_helper(_visitor, &((it).0).0);
2502 _visitor.visit_type(&*(it).1);
2503 };
2504 if let Some(ref it) = _i.init {
2505 tokens_helper(_visitor, &((it).0).0);
2506 _visitor.visit_expr(&*(it).1);
2507 };
2508 tokens_helper(_visitor, &(_i.semi_token).0);
Nika Layzell27726662017-10-24 23:16:35 -04002509}
David Tolnay8c81f622018-07-31 23:34:35 -07002510#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002511pub fn visit_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Macro) {
David Tolnay8c81f622018-07-31 23:34:35 -07002512 _visitor.visit_path(&_i.path);
2513 tokens_helper(_visitor, &(_i.bang_token).0);
2514 _visitor.visit_macro_delimiter(&_i.delimiter);
David Tolnayab919512017-12-30 23:31:51 -05002515 // Skipped field _i . tts;
2516}
David Tolnay8c81f622018-07-31 23:34:35 -07002517#[cfg(any(feature = "full", feature = "derive"))]
2518pub fn visit_macro_delimiter<'ast, V: Visit<'ast> + ?Sized>(
2519 _visitor: &mut V,
2520 _i: &'ast MacroDelimiter,
2521) {
David Tolnayab919512017-12-30 23:31:51 -05002522 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002523 MacroDelimiter::Paren(ref _binding_0) => {
David Tolnayab919512017-12-30 23:31:51 -05002524 tokens_helper(_visitor, &(_binding_0).0);
2525 }
David Tolnay8c81f622018-07-31 23:34:35 -07002526 MacroDelimiter::Brace(ref _binding_0) => {
David Tolnayab919512017-12-30 23:31:51 -05002527 tokens_helper(_visitor, &(_binding_0).0);
2528 }
David Tolnay8c81f622018-07-31 23:34:35 -07002529 MacroDelimiter::Bracket(ref _binding_0) => {
David Tolnayab919512017-12-30 23:31:51 -05002530 tokens_helper(_visitor, &(_binding_0).0);
2531 }
2532 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002533}
David Tolnay8c81f622018-07-31 23:34:35 -07002534#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002535pub fn visit_member<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Member) {
David Tolnay85b69a42017-12-27 20:43:10 -05002536 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002537 Member::Named(ref _binding_0) => {
Alex Crichtond261d092018-05-18 13:47:35 -07002538 _visitor.visit_ident(_binding_0);
David Tolnay85b69a42017-12-27 20:43:10 -05002539 }
David Tolnay8c81f622018-07-31 23:34:35 -07002540 Member::Unnamed(ref _binding_0) => {
David Tolnay85b69a42017-12-27 20:43:10 -05002541 _visitor.visit_index(_binding_0);
2542 }
2543 }
2544}
David Tolnay8c81f622018-07-31 23:34:35 -07002545#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayaaadd782018-01-06 22:58:13 -08002546pub fn visit_meta<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Meta) {
Nika Layzell27726662017-10-24 23:16:35 -04002547 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002548 Meta::Word(ref _binding_0) => {
Alex Crichtond261d092018-05-18 13:47:35 -07002549 _visitor.visit_ident(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002550 }
David Tolnay8c81f622018-07-31 23:34:35 -07002551 Meta::List(ref _binding_0) => {
David Tolnayaaadd782018-01-06 22:58:13 -08002552 _visitor.visit_meta_list(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002553 }
David Tolnay8c81f622018-07-31 23:34:35 -07002554 Meta::NameValue(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002555 _visitor.visit_meta_name_value(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002556 }
2557 }
2558}
David Tolnay8c81f622018-07-31 23:34:35 -07002559#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayaaadd782018-01-06 22:58:13 -08002560pub fn visit_meta_list<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast MetaList) {
David Tolnay8c81f622018-07-31 23:34:35 -07002561 _visitor.visit_ident(&_i.ident);
2562 tokens_helper(_visitor, &(_i.paren_token).0);
2563 for el in Punctuated::pairs(&_i.nested) {
2564 let it = el.value();
2565 _visitor.visit_nested_meta(it)
2566 }
Nika Layzell27726662017-10-24 23:16:35 -04002567}
David Tolnay8c81f622018-07-31 23:34:35 -07002568#[cfg(any(feature = "full", feature = "derive"))]
2569pub fn visit_meta_name_value<'ast, V: Visit<'ast> + ?Sized>(
2570 _visitor: &mut V,
2571 _i: &'ast MetaNameValue,
2572) {
2573 _visitor.visit_ident(&_i.ident);
2574 tokens_helper(_visitor, &(_i.eq_token).0);
2575 _visitor.visit_lit(&_i.lit);
Nika Layzell27726662017-10-24 23:16:35 -04002576}
David Tolnay8c81f622018-07-31 23:34:35 -07002577#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002578pub fn visit_method_sig<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast MethodSig) {
David Tolnay8c81f622018-07-31 23:34:35 -07002579 if let Some(ref it) = _i.constness {
2580 tokens_helper(_visitor, &(it).0)
2581 };
2582 if let Some(ref it) = _i.unsafety {
2583 tokens_helper(_visitor, &(it).0)
2584 };
2585 if let Some(ref it) = _i.abi {
2586 _visitor.visit_abi(it)
2587 };
2588 _visitor.visit_ident(&_i.ident);
2589 _visitor.visit_fn_decl(&_i.decl);
Nika Layzell27726662017-10-24 23:16:35 -04002590}
David Tolnay8c81f622018-07-31 23:34:35 -07002591#[cfg(any(feature = "full", feature = "derive"))]
2592#[cfg(feature = "full")]
2593pub fn visit_method_turbofish<'ast, V: Visit<'ast> + ?Sized>(
2594 _visitor: &mut V,
2595 _i: &'ast MethodTurbofish,
2596) {
2597 tokens_helper(_visitor, &(_i.colon2_token).0);
2598 tokens_helper(_visitor, &(_i.lt_token).0);
2599 for el in Punctuated::pairs(&_i.args) {
2600 let it = el.value();
2601 _visitor.visit_generic_method_argument(it)
2602 }
2603 tokens_helper(_visitor, &(_i.gt_token).0);
David Tolnayd60cfec2017-12-29 00:21:38 -05002604}
David Tolnay8c81f622018-07-31 23:34:35 -07002605#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayaaadd782018-01-06 22:58:13 -08002606pub fn visit_nested_meta<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast NestedMeta) {
Nika Layzell27726662017-10-24 23:16:35 -04002607 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002608 NestedMeta::Meta(ref _binding_0) => {
David Tolnayaaadd782018-01-06 22:58:13 -08002609 _visitor.visit_meta(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002610 }
David Tolnay8c81f622018-07-31 23:34:35 -07002611 NestedMeta::Literal(ref _binding_0) => {
David Tolnay4ba63a02017-12-28 15:53:05 -05002612 _visitor.visit_lit(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002613 }
2614 }
2615}
David Tolnay8c81f622018-07-31 23:34:35 -07002616#[cfg(any(feature = "full", feature = "derive"))]
2617pub fn visit_parenthesized_generic_arguments<'ast, V: Visit<'ast> + ?Sized>(
2618 _visitor: &mut V,
2619 _i: &'ast ParenthesizedGenericArguments,
2620) {
2621 tokens_helper(_visitor, &(_i.paren_token).0);
2622 for el in Punctuated::pairs(&_i.inputs) {
2623 let it = el.value();
2624 _visitor.visit_type(it)
2625 }
2626 _visitor.visit_return_type(&_i.output);
Nika Layzell27726662017-10-24 23:16:35 -04002627}
David Tolnay8c81f622018-07-31 23:34:35 -07002628#[cfg(any(feature = "full", feature = "derive"))]
2629#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002630pub fn visit_pat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Pat) {
Nika Layzell27726662017-10-24 23:16:35 -04002631 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002632 Pat::Wild(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002633 _visitor.visit_pat_wild(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002634 }
David Tolnay8c81f622018-07-31 23:34:35 -07002635 Pat::Ident(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002636 _visitor.visit_pat_ident(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002637 }
David Tolnay8c81f622018-07-31 23:34:35 -07002638 Pat::Struct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002639 _visitor.visit_pat_struct(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002640 }
David Tolnay8c81f622018-07-31 23:34:35 -07002641 Pat::TupleStruct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002642 _visitor.visit_pat_tuple_struct(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002643 }
David Tolnay8c81f622018-07-31 23:34:35 -07002644 Pat::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002645 _visitor.visit_pat_path(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002646 }
David Tolnay8c81f622018-07-31 23:34:35 -07002647 Pat::Tuple(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002648 _visitor.visit_pat_tuple(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002649 }
David Tolnay8c81f622018-07-31 23:34:35 -07002650 Pat::Box(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002651 _visitor.visit_pat_box(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002652 }
David Tolnay8c81f622018-07-31 23:34:35 -07002653 Pat::Ref(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002654 _visitor.visit_pat_ref(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002655 }
David Tolnay8c81f622018-07-31 23:34:35 -07002656 Pat::Lit(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002657 _visitor.visit_pat_lit(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002658 }
David Tolnay8c81f622018-07-31 23:34:35 -07002659 Pat::Range(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002660 _visitor.visit_pat_range(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002661 }
David Tolnay8c81f622018-07-31 23:34:35 -07002662 Pat::Slice(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002663 _visitor.visit_pat_slice(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002664 }
David Tolnay8c81f622018-07-31 23:34:35 -07002665 Pat::Macro(ref _binding_0) => {
David Tolnay323279a2017-12-29 11:26:32 -05002666 _visitor.visit_pat_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002667 }
David Tolnay8c81f622018-07-31 23:34:35 -07002668 Pat::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002669 _visitor.visit_pat_verbatim(_binding_0);
2670 }
Nika Layzell27726662017-10-24 23:16:35 -04002671 }
2672}
David Tolnay8c81f622018-07-31 23:34:35 -07002673#[cfg(any(feature = "full", feature = "derive"))]
2674#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002675pub fn visit_pat_box<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatBox) {
David Tolnay8c81f622018-07-31 23:34:35 -07002676 tokens_helper(_visitor, &(_i.box_token).0);
2677 _visitor.visit_pat(&*_i.pat);
Nika Layzell27726662017-10-24 23:16:35 -04002678}
David Tolnay8c81f622018-07-31 23:34:35 -07002679#[cfg(any(feature = "full", feature = "derive"))]
2680#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002681pub fn visit_pat_ident<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatIdent) {
David Tolnay8c81f622018-07-31 23:34:35 -07002682 if let Some(ref it) = _i.by_ref {
2683 tokens_helper(_visitor, &(it).0)
2684 };
2685 if let Some(ref it) = _i.mutability {
2686 tokens_helper(_visitor, &(it).0)
2687 };
2688 _visitor.visit_ident(&_i.ident);
2689 if let Some(ref it) = _i.subpat {
2690 tokens_helper(_visitor, &((it).0).0);
2691 _visitor.visit_pat(&*(it).1);
2692 };
Nika Layzell27726662017-10-24 23:16:35 -04002693}
David Tolnay8c81f622018-07-31 23:34:35 -07002694#[cfg(any(feature = "full", feature = "derive"))]
2695#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002696pub fn visit_pat_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatLit) {
David Tolnay8c81f622018-07-31 23:34:35 -07002697 _visitor.visit_expr(&*_i.expr);
Nika Layzell27726662017-10-24 23:16:35 -04002698}
David Tolnay8c81f622018-07-31 23:34:35 -07002699#[cfg(any(feature = "full", feature = "derive"))]
2700#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002701pub fn visit_pat_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatMacro) {
David Tolnay8c81f622018-07-31 23:34:35 -07002702 _visitor.visit_macro(&_i.mac);
David Tolnay323279a2017-12-29 11:26:32 -05002703}
David Tolnay8c81f622018-07-31 23:34:35 -07002704#[cfg(any(feature = "full", feature = "derive"))]
2705#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002706pub fn visit_pat_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatPath) {
David Tolnay8c81f622018-07-31 23:34:35 -07002707 if let Some(ref it) = _i.qself {
2708 _visitor.visit_qself(it)
2709 };
2710 _visitor.visit_path(&_i.path);
Nika Layzell27726662017-10-24 23:16:35 -04002711}
David Tolnay8c81f622018-07-31 23:34:35 -07002712#[cfg(any(feature = "full", feature = "derive"))]
2713#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002714pub fn visit_pat_range<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatRange) {
David Tolnay8c81f622018-07-31 23:34:35 -07002715 _visitor.visit_expr(&*_i.lo);
2716 _visitor.visit_range_limits(&_i.limits);
2717 _visitor.visit_expr(&*_i.hi);
Nika Layzell27726662017-10-24 23:16:35 -04002718}
David Tolnay8c81f622018-07-31 23:34:35 -07002719#[cfg(any(feature = "full", feature = "derive"))]
2720#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002721pub fn visit_pat_ref<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatRef) {
David Tolnay8c81f622018-07-31 23:34:35 -07002722 tokens_helper(_visitor, &(_i.and_token).0);
2723 if let Some(ref it) = _i.mutability {
2724 tokens_helper(_visitor, &(it).0)
2725 };
2726 _visitor.visit_pat(&*_i.pat);
Nika Layzell27726662017-10-24 23:16:35 -04002727}
David Tolnay8c81f622018-07-31 23:34:35 -07002728#[cfg(any(feature = "full", feature = "derive"))]
2729#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002730pub fn visit_pat_slice<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatSlice) {
David Tolnay8c81f622018-07-31 23:34:35 -07002731 tokens_helper(_visitor, &(_i.bracket_token).0);
2732 for el in Punctuated::pairs(&_i.front) {
2733 let it = el.value();
2734 _visitor.visit_pat(it)
2735 }
2736 if let Some(ref it) = _i.middle {
2737 _visitor.visit_pat(&**it)
2738 };
2739 if let Some(ref it) = _i.dot2_token {
2740 tokens_helper(_visitor, &(it).0)
2741 };
2742 if let Some(ref it) = _i.comma_token {
2743 tokens_helper(_visitor, &(it).0)
2744 };
2745 for el in Punctuated::pairs(&_i.back) {
2746 let it = el.value();
2747 _visitor.visit_pat(it)
2748 }
Nika Layzell27726662017-10-24 23:16:35 -04002749}
David Tolnay8c81f622018-07-31 23:34:35 -07002750#[cfg(any(feature = "full", feature = "derive"))]
2751#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002752pub fn visit_pat_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatStruct) {
David Tolnay8c81f622018-07-31 23:34:35 -07002753 _visitor.visit_path(&_i.path);
2754 tokens_helper(_visitor, &(_i.brace_token).0);
2755 for el in Punctuated::pairs(&_i.fields) {
2756 let it = el.value();
2757 _visitor.visit_field_pat(it)
2758 }
2759 if let Some(ref it) = _i.dot2_token {
2760 tokens_helper(_visitor, &(it).0)
2761 };
Nika Layzell27726662017-10-24 23:16:35 -04002762}
David Tolnay8c81f622018-07-31 23:34:35 -07002763#[cfg(any(feature = "full", feature = "derive"))]
2764#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002765pub fn visit_pat_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatTuple) {
David Tolnay8c81f622018-07-31 23:34:35 -07002766 tokens_helper(_visitor, &(_i.paren_token).0);
2767 for el in Punctuated::pairs(&_i.front) {
2768 let it = el.value();
2769 _visitor.visit_pat(it)
2770 }
2771 if let Some(ref it) = _i.dot2_token {
2772 tokens_helper(_visitor, &(it).0)
2773 };
2774 if let Some(ref it) = _i.comma_token {
2775 tokens_helper(_visitor, &(it).0)
2776 };
2777 for el in Punctuated::pairs(&_i.back) {
2778 let it = el.value();
2779 _visitor.visit_pat(it)
2780 }
Nika Layzell27726662017-10-24 23:16:35 -04002781}
David Tolnay8c81f622018-07-31 23:34:35 -07002782#[cfg(any(feature = "full", feature = "derive"))]
2783#[cfg(feature = "full")]
2784pub fn visit_pat_tuple_struct<'ast, V: Visit<'ast> + ?Sized>(
2785 _visitor: &mut V,
2786 _i: &'ast PatTupleStruct,
2787) {
2788 _visitor.visit_path(&_i.path);
2789 _visitor.visit_pat_tuple(&_i.pat);
Nika Layzell27726662017-10-24 23:16:35 -04002790}
David Tolnay8c81f622018-07-31 23:34:35 -07002791#[cfg(any(feature = "full", feature = "derive"))]
2792#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002793pub fn visit_pat_verbatim<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatVerbatim) {
David Tolnay2ae520a2017-12-29 11:19:50 -05002794 // Skipped field _i . tts;
2795}
David Tolnay8c81f622018-07-31 23:34:35 -07002796#[cfg(any(feature = "full", feature = "derive"))]
2797#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002798pub fn visit_pat_wild<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatWild) {
David Tolnay8c81f622018-07-31 23:34:35 -07002799 tokens_helper(_visitor, &(_i.underscore_token).0);
Nika Layzell27726662017-10-24 23:16:35 -04002800}
David Tolnay8c81f622018-07-31 23:34:35 -07002801#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002802pub fn visit_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Path) {
David Tolnay8c81f622018-07-31 23:34:35 -07002803 if let Some(ref it) = _i.leading_colon {
2804 tokens_helper(_visitor, &(it).0)
2805 };
2806 for el in Punctuated::pairs(&_i.segments) {
2807 let it = el.value();
2808 _visitor.visit_path_segment(it)
2809 }
Nika Layzell27726662017-10-24 23:16:35 -04002810}
David Tolnay8c81f622018-07-31 23:34:35 -07002811#[cfg(any(feature = "full", feature = "derive"))]
2812pub fn visit_path_arguments<'ast, V: Visit<'ast> + ?Sized>(
2813 _visitor: &mut V,
2814 _i: &'ast PathArguments,
2815) {
Nika Layzellc08227a2017-12-04 16:30:17 -05002816 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002817 PathArguments::None => {}
2818 PathArguments::AngleBracketed(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002819 _visitor.visit_angle_bracketed_generic_arguments(_binding_0);
Nika Layzellc08227a2017-12-04 16:30:17 -05002820 }
David Tolnay8c81f622018-07-31 23:34:35 -07002821 PathArguments::Parenthesized(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002822 _visitor.visit_parenthesized_generic_arguments(_binding_0);
Nika Layzellc08227a2017-12-04 16:30:17 -05002823 }
2824 }
2825}
David Tolnay8c81f622018-07-31 23:34:35 -07002826#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002827pub fn visit_path_segment<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PathSegment) {
David Tolnay8c81f622018-07-31 23:34:35 -07002828 _visitor.visit_ident(&_i.ident);
2829 _visitor.visit_path_arguments(&_i.arguments);
Nika Layzell27726662017-10-24 23:16:35 -04002830}
David Tolnay8c81f622018-07-31 23:34:35 -07002831#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002832pub fn visit_predicate_eq<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PredicateEq) {
David Tolnay8c81f622018-07-31 23:34:35 -07002833 _visitor.visit_type(&_i.lhs_ty);
2834 tokens_helper(_visitor, &(_i.eq_token).0);
2835 _visitor.visit_type(&_i.rhs_ty);
David Tolnayd4add852018-01-01 20:13:24 -08002836}
David Tolnay8c81f622018-07-31 23:34:35 -07002837#[cfg(any(feature = "full", feature = "derive"))]
2838pub fn visit_predicate_lifetime<'ast, V: Visit<'ast> + ?Sized>(
2839 _visitor: &mut V,
2840 _i: &'ast PredicateLifetime,
2841) {
2842 _visitor.visit_lifetime(&_i.lifetime);
2843 if let Some(ref it) = _i.colon_token {
2844 tokens_helper(_visitor, &(it).0)
2845 };
2846 for el in Punctuated::pairs(&_i.bounds) {
2847 let it = el.value();
2848 _visitor.visit_lifetime(it)
2849 }
David Tolnayd4add852018-01-01 20:13:24 -08002850}
David Tolnay8c81f622018-07-31 23:34:35 -07002851#[cfg(any(feature = "full", feature = "derive"))]
2852pub fn visit_predicate_type<'ast, V: Visit<'ast> + ?Sized>(
2853 _visitor: &mut V,
2854 _i: &'ast PredicateType,
2855) {
2856 if let Some(ref it) = _i.lifetimes {
2857 _visitor.visit_bound_lifetimes(it)
2858 };
2859 _visitor.visit_type(&_i.bounded_ty);
2860 tokens_helper(_visitor, &(_i.colon_token).0);
2861 for el in Punctuated::pairs(&_i.bounds) {
2862 let it = el.value();
2863 _visitor.visit_type_param_bound(it)
2864 }
David Tolnayd4add852018-01-01 20:13:24 -08002865}
David Tolnay8c81f622018-07-31 23:34:35 -07002866#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002867pub fn visit_qself<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast QSelf) {
David Tolnay8c81f622018-07-31 23:34:35 -07002868 tokens_helper(_visitor, &(_i.lt_token).0);
2869 _visitor.visit_type(&*_i.ty);
Nika Layzell27726662017-10-24 23:16:35 -04002870 // Skipped field _i . position;
David Tolnay8c81f622018-07-31 23:34:35 -07002871 if let Some(ref it) = _i.as_token {
2872 tokens_helper(_visitor, &(it).0)
2873 };
2874 tokens_helper(_visitor, &(_i.gt_token).0);
Nika Layzell27726662017-10-24 23:16:35 -04002875}
David Tolnay8c81f622018-07-31 23:34:35 -07002876#[cfg(any(feature = "full", feature = "derive"))]
2877#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002878pub fn visit_range_limits<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast RangeLimits) {
Nika Layzell27726662017-10-24 23:16:35 -04002879 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002880 RangeLimits::HalfOpen(ref _binding_0) => {
David Tolnaycc0f0372017-12-28 19:11:04 -05002881 tokens_helper(_visitor, &(_binding_0).0);
Nika Layzell27726662017-10-24 23:16:35 -04002882 }
David Tolnay8c81f622018-07-31 23:34:35 -07002883 RangeLimits::Closed(ref _binding_0) => {
David Tolnaycc0f0372017-12-28 19:11:04 -05002884 tokens_helper(_visitor, &(_binding_0).0);
Nika Layzell27726662017-10-24 23:16:35 -04002885 }
2886 }
2887}
David Tolnay8c81f622018-07-31 23:34:35 -07002888#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002889pub fn visit_return_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ReturnType) {
David Tolnayf93b90d2017-11-11 19:21:26 -08002890 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002891 ReturnType::Default => {}
2892 ReturnType::Type(ref _binding_0, ref _binding_1) => {
David Tolnay4a3f59a2017-12-28 21:21:12 -05002893 tokens_helper(_visitor, &(_binding_0).0);
David Tolnay8c81f622018-07-31 23:34:35 -07002894 _visitor.visit_type(&**_binding_1);
David Tolnayf93b90d2017-11-11 19:21:26 -08002895 }
2896 }
2897}
Nika Layzellefb83ba2017-12-19 18:23:55 -05002898
David Tolnay8c81f622018-07-31 23:34:35 -07002899pub fn visit_span<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Span) {}
2900#[cfg(any(feature = "full", feature = "derive"))]
2901#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002902pub fn visit_stmt<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Stmt) {
Nika Layzell27726662017-10-24 23:16:35 -04002903 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002904 Stmt::Local(ref _binding_0) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08002905 _visitor.visit_local(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002906 }
David Tolnay8c81f622018-07-31 23:34:35 -07002907 Stmt::Item(ref _binding_0) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08002908 _visitor.visit_item(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002909 }
David Tolnay8c81f622018-07-31 23:34:35 -07002910 Stmt::Expr(ref _binding_0) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08002911 _visitor.visit_expr(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002912 }
David Tolnay8c81f622018-07-31 23:34:35 -07002913 Stmt::Semi(ref _binding_0, ref _binding_1) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08002914 _visitor.visit_expr(_binding_0);
David Tolnaycc0f0372017-12-28 19:11:04 -05002915 tokens_helper(_visitor, &(_binding_1).0);
Nika Layzell27726662017-10-24 23:16:35 -04002916 }
Nika Layzell27726662017-10-24 23:16:35 -04002917 }
2918}
David Tolnay8c81f622018-07-31 23:34:35 -07002919#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002920pub fn visit_trait_bound<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TraitBound) {
David Tolnay8c81f622018-07-31 23:34:35 -07002921 if let Some(ref it) = _i.paren_token {
2922 tokens_helper(_visitor, &(it).0)
2923 };
2924 _visitor.visit_trait_bound_modifier(&_i.modifier);
2925 if let Some(ref it) = _i.lifetimes {
2926 _visitor.visit_bound_lifetimes(it)
2927 };
2928 _visitor.visit_path(&_i.path);
David Tolnay40fb8ce2018-01-02 10:53:46 -08002929}
David Tolnay8c81f622018-07-31 23:34:35 -07002930#[cfg(any(feature = "full", feature = "derive"))]
2931pub fn visit_trait_bound_modifier<'ast, V: Visit<'ast> + ?Sized>(
2932 _visitor: &mut V,
2933 _i: &'ast TraitBoundModifier,
2934) {
Nika Layzell27726662017-10-24 23:16:35 -04002935 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002936 TraitBoundModifier::None => {}
2937 TraitBoundModifier::Maybe(ref _binding_0) => {
David Tolnaycc0f0372017-12-28 19:11:04 -05002938 tokens_helper(_visitor, &(_binding_0).0);
Nika Layzell27726662017-10-24 23:16:35 -04002939 }
2940 }
2941}
David Tolnay8c81f622018-07-31 23:34:35 -07002942#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002943pub fn visit_trait_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TraitItem) {
Nika Layzell27726662017-10-24 23:16:35 -04002944 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002945 TraitItem::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002946 _visitor.visit_trait_item_const(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002947 }
David Tolnay8c81f622018-07-31 23:34:35 -07002948 TraitItem::Method(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002949 _visitor.visit_trait_item_method(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002950 }
David Tolnay8c81f622018-07-31 23:34:35 -07002951 TraitItem::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002952 _visitor.visit_trait_item_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002953 }
David Tolnay8c81f622018-07-31 23:34:35 -07002954 TraitItem::Macro(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002955 _visitor.visit_trait_item_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002956 }
David Tolnay8c81f622018-07-31 23:34:35 -07002957 TraitItem::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002958 _visitor.visit_trait_item_verbatim(_binding_0);
2959 }
Nika Layzell27726662017-10-24 23:16:35 -04002960 }
2961}
David Tolnay8c81f622018-07-31 23:34:35 -07002962#[cfg(feature = "full")]
2963pub fn visit_trait_item_const<'ast, V: Visit<'ast> + ?Sized>(
2964 _visitor: &mut V,
2965 _i: &'ast TraitItemConst,
2966) {
2967 for it in &_i.attrs {
2968 _visitor.visit_attribute(it)
2969 }
2970 tokens_helper(_visitor, &(_i.const_token).0);
2971 _visitor.visit_ident(&_i.ident);
2972 tokens_helper(_visitor, &(_i.colon_token).0);
2973 _visitor.visit_type(&_i.ty);
2974 if let Some(ref it) = _i.default {
2975 tokens_helper(_visitor, &((it).0).0);
2976 _visitor.visit_expr(&(it).1);
2977 };
2978 tokens_helper(_visitor, &(_i.semi_token).0);
David Tolnayda705bd2017-11-10 21:58:05 -08002979}
David Tolnay8c81f622018-07-31 23:34:35 -07002980#[cfg(feature = "full")]
2981pub fn visit_trait_item_macro<'ast, V: Visit<'ast> + ?Sized>(
2982 _visitor: &mut V,
2983 _i: &'ast TraitItemMacro,
2984) {
2985 for it in &_i.attrs {
2986 _visitor.visit_attribute(it)
2987 }
2988 _visitor.visit_macro(&_i.mac);
2989 if let Some(ref it) = _i.semi_token {
2990 tokens_helper(_visitor, &(it).0)
2991 };
David Tolnayda705bd2017-11-10 21:58:05 -08002992}
David Tolnay8c81f622018-07-31 23:34:35 -07002993#[cfg(feature = "full")]
2994pub fn visit_trait_item_method<'ast, V: Visit<'ast> + ?Sized>(
2995 _visitor: &mut V,
2996 _i: &'ast TraitItemMethod,
2997) {
2998 for it in &_i.attrs {
2999 _visitor.visit_attribute(it)
3000 }
3001 _visitor.visit_method_sig(&_i.sig);
3002 if let Some(ref it) = _i.default {
3003 _visitor.visit_block(it)
3004 };
3005 if let Some(ref it) = _i.semi_token {
3006 tokens_helper(_visitor, &(it).0)
3007 };
Nika Layzell27726662017-10-24 23:16:35 -04003008}
David Tolnay8c81f622018-07-31 23:34:35 -07003009#[cfg(feature = "full")]
3010pub fn visit_trait_item_type<'ast, V: Visit<'ast> + ?Sized>(
3011 _visitor: &mut V,
3012 _i: &'ast TraitItemType,
3013) {
3014 for it in &_i.attrs {
3015 _visitor.visit_attribute(it)
3016 }
3017 tokens_helper(_visitor, &(_i.type_token).0);
3018 _visitor.visit_ident(&_i.ident);
3019 _visitor.visit_generics(&_i.generics);
3020 if let Some(ref it) = _i.colon_token {
3021 tokens_helper(_visitor, &(it).0)
3022 };
3023 for el in Punctuated::pairs(&_i.bounds) {
3024 let it = el.value();
3025 _visitor.visit_type_param_bound(it)
3026 }
3027 if let Some(ref it) = _i.default {
3028 tokens_helper(_visitor, &((it).0).0);
3029 _visitor.visit_type(&(it).1);
3030 };
3031 tokens_helper(_visitor, &(_i.semi_token).0);
Nika Layzell27726662017-10-24 23:16:35 -04003032}
David Tolnay8c81f622018-07-31 23:34:35 -07003033#[cfg(feature = "full")]
3034pub fn visit_trait_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
3035 _visitor: &mut V,
3036 _i: &'ast TraitItemVerbatim,
3037) {
David Tolnay2ae520a2017-12-29 11:19:50 -05003038 // Skipped field _i . tts;
3039}
David Tolnay8c81f622018-07-31 23:34:35 -07003040#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003041pub fn visit_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Type) {
Nika Layzell27726662017-10-24 23:16:35 -04003042 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003043 Type::Slice(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003044 _visitor.visit_type_slice(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003045 }
David Tolnay8c81f622018-07-31 23:34:35 -07003046 Type::Array(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003047 _visitor.visit_type_array(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003048 }
David Tolnay8c81f622018-07-31 23:34:35 -07003049 Type::Ptr(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003050 _visitor.visit_type_ptr(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003051 }
David Tolnay8c81f622018-07-31 23:34:35 -07003052 Type::Reference(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003053 _visitor.visit_type_reference(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003054 }
David Tolnay8c81f622018-07-31 23:34:35 -07003055 Type::BareFn(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003056 _visitor.visit_type_bare_fn(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003057 }
David Tolnay8c81f622018-07-31 23:34:35 -07003058 Type::Never(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003059 _visitor.visit_type_never(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003060 }
David Tolnay8c81f622018-07-31 23:34:35 -07003061 Type::Tuple(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003062 _visitor.visit_type_tuple(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003063 }
David Tolnay8c81f622018-07-31 23:34:35 -07003064 Type::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003065 _visitor.visit_type_path(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003066 }
David Tolnay8c81f622018-07-31 23:34:35 -07003067 Type::TraitObject(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003068 _visitor.visit_type_trait_object(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003069 }
David Tolnay8c81f622018-07-31 23:34:35 -07003070 Type::ImplTrait(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003071 _visitor.visit_type_impl_trait(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003072 }
David Tolnay8c81f622018-07-31 23:34:35 -07003073 Type::Paren(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003074 _visitor.visit_type_paren(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003075 }
David Tolnay8c81f622018-07-31 23:34:35 -07003076 Type::Group(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003077 _visitor.visit_type_group(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003078 }
David Tolnay8c81f622018-07-31 23:34:35 -07003079 Type::Infer(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003080 _visitor.visit_type_infer(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003081 }
David Tolnay8c81f622018-07-31 23:34:35 -07003082 Type::Macro(ref _binding_0) => {
David Tolnay323279a2017-12-29 11:26:32 -05003083 _visitor.visit_type_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003084 }
David Tolnay8c81f622018-07-31 23:34:35 -07003085 Type::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05003086 _visitor.visit_type_verbatim(_binding_0);
3087 }
Nika Layzell27726662017-10-24 23:16:35 -04003088 }
3089}
David Tolnay8c81f622018-07-31 23:34:35 -07003090#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003091pub fn visit_type_array<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeArray) {
David Tolnay8c81f622018-07-31 23:34:35 -07003092 tokens_helper(_visitor, &(_i.bracket_token).0);
3093 _visitor.visit_type(&*_i.elem);
3094 tokens_helper(_visitor, &(_i.semi_token).0);
3095 _visitor.visit_expr(&_i.len);
Nika Layzell27726662017-10-24 23:16:35 -04003096}
David Tolnay8c81f622018-07-31 23:34:35 -07003097#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003098pub fn visit_type_bare_fn<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeBareFn) {
David Tolnay8c81f622018-07-31 23:34:35 -07003099 if let Some(ref it) = _i.unsafety {
3100 tokens_helper(_visitor, &(it).0)
3101 };
3102 if let Some(ref it) = _i.abi {
3103 _visitor.visit_abi(it)
3104 };
3105 tokens_helper(_visitor, &(_i.fn_token).0);
3106 if let Some(ref it) = _i.lifetimes {
3107 _visitor.visit_bound_lifetimes(it)
3108 };
3109 tokens_helper(_visitor, &(_i.paren_token).0);
3110 for el in Punctuated::pairs(&_i.inputs) {
3111 let it = el.value();
3112 _visitor.visit_bare_fn_arg(it)
3113 }
3114 if let Some(ref it) = _i.variadic {
3115 tokens_helper(_visitor, &(it).0)
3116 };
3117 _visitor.visit_return_type(&_i.output);
Nika Layzell27726662017-10-24 23:16:35 -04003118}
David Tolnay8c81f622018-07-31 23:34:35 -07003119#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003120pub fn visit_type_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeGroup) {
David Tolnay8c81f622018-07-31 23:34:35 -07003121 tokens_helper(_visitor, &(_i.group_token).0);
3122 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003123}
David Tolnay8c81f622018-07-31 23:34:35 -07003124#[cfg(any(feature = "full", feature = "derive"))]
3125pub fn visit_type_impl_trait<'ast, V: Visit<'ast> + ?Sized>(
3126 _visitor: &mut V,
3127 _i: &'ast TypeImplTrait,
3128) {
3129 tokens_helper(_visitor, &(_i.impl_token).0);
3130 for el in Punctuated::pairs(&_i.bounds) {
3131 let it = el.value();
3132 _visitor.visit_type_param_bound(it)
3133 }
Nika Layzell27726662017-10-24 23:16:35 -04003134}
David Tolnay8c81f622018-07-31 23:34:35 -07003135#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003136pub fn visit_type_infer<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeInfer) {
David Tolnay8c81f622018-07-31 23:34:35 -07003137 tokens_helper(_visitor, &(_i.underscore_token).0);
Nika Layzell27726662017-10-24 23:16:35 -04003138}
David Tolnay8c81f622018-07-31 23:34:35 -07003139#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003140pub fn visit_type_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeMacro) {
David Tolnay8c81f622018-07-31 23:34:35 -07003141 _visitor.visit_macro(&_i.mac);
David Tolnay323279a2017-12-29 11:26:32 -05003142}
David Tolnay8c81f622018-07-31 23:34:35 -07003143#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003144pub fn visit_type_never<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeNever) {
David Tolnay8c81f622018-07-31 23:34:35 -07003145 tokens_helper(_visitor, &(_i.bang_token).0);
Nika Layzell27726662017-10-24 23:16:35 -04003146}
David Tolnay8c81f622018-07-31 23:34:35 -07003147#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003148pub fn visit_type_param<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeParam) {
David Tolnay8c81f622018-07-31 23:34:35 -07003149 for it in &_i.attrs {
3150 _visitor.visit_attribute(it)
3151 }
3152 _visitor.visit_ident(&_i.ident);
3153 if let Some(ref it) = _i.colon_token {
3154 tokens_helper(_visitor, &(it).0)
3155 };
3156 for el in Punctuated::pairs(&_i.bounds) {
3157 let it = el.value();
3158 _visitor.visit_type_param_bound(it)
3159 }
3160 if let Some(ref it) = _i.eq_token {
3161 tokens_helper(_visitor, &(it).0)
3162 };
3163 if let Some(ref it) = _i.default {
3164 _visitor.visit_type(it)
3165 };
Nika Layzell27726662017-10-24 23:16:35 -04003166}
David Tolnay8c81f622018-07-31 23:34:35 -07003167#[cfg(any(feature = "full", feature = "derive"))]
3168pub fn visit_type_param_bound<'ast, V: Visit<'ast> + ?Sized>(
3169 _visitor: &mut V,
3170 _i: &'ast TypeParamBound,
3171) {
Nika Layzell27726662017-10-24 23:16:35 -04003172 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003173 TypeParamBound::Trait(ref _binding_0) => {
David Tolnay40fb8ce2018-01-02 10:53:46 -08003174 _visitor.visit_trait_bound(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003175 }
David Tolnay8c81f622018-07-31 23:34:35 -07003176 TypeParamBound::Lifetime(ref _binding_0) => {
David Tolnay4ba63a02017-12-28 15:53:05 -05003177 _visitor.visit_lifetime(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003178 }
3179 }
3180}
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_paren<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeParen) {
David Tolnay8c81f622018-07-31 23:34:35 -07003183 tokens_helper(_visitor, &(_i.paren_token).0);
3184 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003185}
David Tolnay8c81f622018-07-31 23:34:35 -07003186#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003187pub fn visit_type_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypePath) {
David Tolnay8c81f622018-07-31 23:34:35 -07003188 if let Some(ref it) = _i.qself {
3189 _visitor.visit_qself(it)
3190 };
3191 _visitor.visit_path(&_i.path);
Nika Layzell27726662017-10-24 23:16:35 -04003192}
David Tolnay8c81f622018-07-31 23:34:35 -07003193#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003194pub fn visit_type_ptr<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypePtr) {
David Tolnay8c81f622018-07-31 23:34:35 -07003195 tokens_helper(_visitor, &(_i.star_token).0);
3196 if let Some(ref it) = _i.const_token {
3197 tokens_helper(_visitor, &(it).0)
3198 };
3199 if let Some(ref it) = _i.mutability {
3200 tokens_helper(_visitor, &(it).0)
3201 };
3202 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003203}
David Tolnay8c81f622018-07-31 23:34:35 -07003204#[cfg(any(feature = "full", feature = "derive"))]
3205pub fn visit_type_reference<'ast, V: Visit<'ast> + ?Sized>(
3206 _visitor: &mut V,
3207 _i: &'ast TypeReference,
3208) {
3209 tokens_helper(_visitor, &(_i.and_token).0);
3210 if let Some(ref it) = _i.lifetime {
3211 _visitor.visit_lifetime(it)
3212 };
3213 if let Some(ref it) = _i.mutability {
3214 tokens_helper(_visitor, &(it).0)
3215 };
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"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003219pub fn visit_type_slice<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeSlice) {
David Tolnay8c81f622018-07-31 23:34:35 -07003220 tokens_helper(_visitor, &(_i.bracket_token).0);
3221 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003222}
David Tolnay8c81f622018-07-31 23:34:35 -07003223#[cfg(any(feature = "full", feature = "derive"))]
3224pub fn visit_type_trait_object<'ast, V: Visit<'ast> + ?Sized>(
3225 _visitor: &mut V,
3226 _i: &'ast TypeTraitObject,
3227) {
3228 if let Some(ref it) = _i.dyn_token {
3229 tokens_helper(_visitor, &(it).0)
3230 };
3231 for el in Punctuated::pairs(&_i.bounds) {
3232 let it = el.value();
3233 _visitor.visit_type_param_bound(it)
3234 }
Nika Layzell27726662017-10-24 23:16:35 -04003235}
David Tolnay8c81f622018-07-31 23:34:35 -07003236#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003237pub fn visit_type_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeTuple) {
David Tolnay8c81f622018-07-31 23:34:35 -07003238 tokens_helper(_visitor, &(_i.paren_token).0);
3239 for el in Punctuated::pairs(&_i.elems) {
3240 let it = el.value();
3241 _visitor.visit_type(it)
3242 }
Nika Layzell27726662017-10-24 23:16:35 -04003243}
David Tolnay8c81f622018-07-31 23:34:35 -07003244#[cfg(any(feature = "full", feature = "derive"))]
3245pub fn visit_type_verbatim<'ast, V: Visit<'ast> + ?Sized>(
3246 _visitor: &mut V,
3247 _i: &'ast TypeVerbatim,
3248) {
David Tolnay2ae520a2017-12-29 11:19:50 -05003249 // Skipped field _i . tts;
3250}
David Tolnay8c81f622018-07-31 23:34:35 -07003251#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003252pub fn visit_un_op<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UnOp) {
Nika Layzell27726662017-10-24 23:16:35 -04003253 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003254 UnOp::Deref(ref _binding_0) => {
David Tolnaycc0f0372017-12-28 19:11:04 -05003255 tokens_helper(_visitor, &(_binding_0).0);
Nika Layzell27726662017-10-24 23:16:35 -04003256 }
David Tolnay8c81f622018-07-31 23:34:35 -07003257 UnOp::Not(ref _binding_0) => {
David Tolnaycc0f0372017-12-28 19:11:04 -05003258 tokens_helper(_visitor, &(_binding_0).0);
Nika Layzell27726662017-10-24 23:16:35 -04003259 }
David Tolnay8c81f622018-07-31 23:34:35 -07003260 UnOp::Neg(ref _binding_0) => {
David Tolnaycc0f0372017-12-28 19:11:04 -05003261 tokens_helper(_visitor, &(_binding_0).0);
Nika Layzell27726662017-10-24 23:16:35 -04003262 }
3263 }
3264}
David Tolnay8c81f622018-07-31 23:34:35 -07003265#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003266pub fn visit_use_glob<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseGlob) {
David Tolnay8c81f622018-07-31 23:34:35 -07003267 tokens_helper(_visitor, &(_i.star_token).0);
David Tolnay5f332a92017-12-26 00:42:45 -05003268}
David Tolnay8c81f622018-07-31 23:34:35 -07003269#[cfg(feature = "full")]
David Tolnayd97a7d22018-03-31 19:17:01 +02003270pub fn visit_use_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseGroup) {
David Tolnay8c81f622018-07-31 23:34:35 -07003271 tokens_helper(_visitor, &(_i.brace_token).0);
3272 for el in Punctuated::pairs(&_i.items) {
3273 let it = el.value();
3274 _visitor.visit_use_tree(it)
3275 }
David Tolnay5f332a92017-12-26 00:42:45 -05003276}
David Tolnay8c81f622018-07-31 23:34:35 -07003277#[cfg(feature = "full")]
David Tolnayd97a7d22018-03-31 19:17:01 +02003278pub fn visit_use_name<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseName) {
David Tolnay8c81f622018-07-31 23:34:35 -07003279 _visitor.visit_ident(&_i.ident);
David Tolnayd97a7d22018-03-31 19:17:01 +02003280}
David Tolnay8c81f622018-07-31 23:34:35 -07003281#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003282pub fn visit_use_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UsePath) {
David Tolnay8c81f622018-07-31 23:34:35 -07003283 _visitor.visit_ident(&_i.ident);
3284 tokens_helper(_visitor, &(_i.colon2_token).0);
3285 _visitor.visit_use_tree(&*_i.tree);
David Tolnayd97a7d22018-03-31 19:17:01 +02003286}
David Tolnay8c81f622018-07-31 23:34:35 -07003287#[cfg(feature = "full")]
David Tolnayd97a7d22018-03-31 19:17:01 +02003288pub fn visit_use_rename<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseRename) {
David Tolnay8c81f622018-07-31 23:34:35 -07003289 _visitor.visit_ident(&_i.ident);
3290 tokens_helper(_visitor, &(_i.as_token).0);
3291 _visitor.visit_ident(&_i.rename);
David Tolnay5f332a92017-12-26 00:42:45 -05003292}
David Tolnay8c81f622018-07-31 23:34:35 -07003293#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003294pub fn visit_use_tree<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseTree) {
David Tolnay5f332a92017-12-26 00:42:45 -05003295 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003296 UseTree::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003297 _visitor.visit_use_path(_binding_0);
David Tolnay5f332a92017-12-26 00:42:45 -05003298 }
David Tolnay8c81f622018-07-31 23:34:35 -07003299 UseTree::Name(ref _binding_0) => {
David Tolnayd97a7d22018-03-31 19:17:01 +02003300 _visitor.visit_use_name(_binding_0);
3301 }
David Tolnay8c81f622018-07-31 23:34:35 -07003302 UseTree::Rename(ref _binding_0) => {
David Tolnayd97a7d22018-03-31 19:17:01 +02003303 _visitor.visit_use_rename(_binding_0);
3304 }
David Tolnay8c81f622018-07-31 23:34:35 -07003305 UseTree::Glob(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003306 _visitor.visit_use_glob(_binding_0);
David Tolnay5f332a92017-12-26 00:42:45 -05003307 }
David Tolnay8c81f622018-07-31 23:34:35 -07003308 UseTree::Group(ref _binding_0) => {
David Tolnayd97a7d22018-03-31 19:17:01 +02003309 _visitor.visit_use_group(_binding_0);
David Tolnay5f332a92017-12-26 00:42:45 -05003310 }
3311 }
3312}
David Tolnay8c81f622018-07-31 23:34:35 -07003313#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003314pub fn visit_variant<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Variant) {
David Tolnay8c81f622018-07-31 23:34:35 -07003315 for it in &_i.attrs {
3316 _visitor.visit_attribute(it)
3317 }
3318 _visitor.visit_ident(&_i.ident);
3319 _visitor.visit_fields(&_i.fields);
3320 if let Some(ref it) = _i.discriminant {
3321 tokens_helper(_visitor, &((it).0).0);
3322 _visitor.visit_expr(&(it).1);
3323 };
Nika Layzell27726662017-10-24 23:16:35 -04003324}
David Tolnay8c81f622018-07-31 23:34:35 -07003325#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003326pub fn visit_vis_crate<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast VisCrate) {
David Tolnay8c81f622018-07-31 23:34:35 -07003327 tokens_helper(_visitor, &(_i.crate_token).0);
Nika Layzell27726662017-10-24 23:16:35 -04003328}
David Tolnay8c81f622018-07-31 23:34:35 -07003329#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003330pub fn visit_vis_public<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast VisPublic) {
David Tolnay8c81f622018-07-31 23:34:35 -07003331 tokens_helper(_visitor, &(_i.pub_token).0);
Nika Layzell27726662017-10-24 23:16:35 -04003332}
David Tolnay8c81f622018-07-31 23:34:35 -07003333#[cfg(any(feature = "full", feature = "derive"))]
3334pub fn visit_vis_restricted<'ast, V: Visit<'ast> + ?Sized>(
3335 _visitor: &mut V,
3336 _i: &'ast VisRestricted,
3337) {
3338 tokens_helper(_visitor, &(_i.pub_token).0);
3339 tokens_helper(_visitor, &(_i.paren_token).0);
3340 if let Some(ref it) = _i.in_token {
3341 tokens_helper(_visitor, &(it).0)
3342 };
3343 _visitor.visit_path(&*_i.path);
Nika Layzell27726662017-10-24 23:16:35 -04003344}
David Tolnay8c81f622018-07-31 23:34:35 -07003345#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003346pub fn visit_visibility<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Visibility) {
Nika Layzell27726662017-10-24 23:16:35 -04003347 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003348 Visibility::Public(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003349 _visitor.visit_vis_public(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003350 }
David Tolnay8c81f622018-07-31 23:34:35 -07003351 Visibility::Crate(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003352 _visitor.visit_vis_crate(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003353 }
David Tolnay8c81f622018-07-31 23:34:35 -07003354 Visibility::Restricted(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003355 _visitor.visit_vis_restricted(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003356 }
David Tolnay8c81f622018-07-31 23:34:35 -07003357 Visibility::Inherited => {}
Nika Layzell27726662017-10-24 23:16:35 -04003358 }
3359}
David Tolnay8c81f622018-07-31 23:34:35 -07003360#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003361pub fn visit_where_clause<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast WhereClause) {
David Tolnay8c81f622018-07-31 23:34:35 -07003362 tokens_helper(_visitor, &(_i.where_token).0);
3363 for el in Punctuated::pairs(&_i.predicates) {
3364 let it = el.value();
3365 _visitor.visit_where_predicate(it)
3366 }
Nika Layzell27726662017-10-24 23:16:35 -04003367}
David Tolnay8c81f622018-07-31 23:34:35 -07003368#[cfg(any(feature = "full", feature = "derive"))]
3369pub fn visit_where_predicate<'ast, V: Visit<'ast> + ?Sized>(
3370 _visitor: &mut V,
3371 _i: &'ast WherePredicate,
3372) {
Nika Layzell27726662017-10-24 23:16:35 -04003373 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003374 WherePredicate::Type(ref _binding_0) => {
David Tolnayd4add852018-01-01 20:13:24 -08003375 _visitor.visit_predicate_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003376 }
David Tolnay8c81f622018-07-31 23:34:35 -07003377 WherePredicate::Lifetime(ref _binding_0) => {
David Tolnayd4add852018-01-01 20:13:24 -08003378 _visitor.visit_predicate_lifetime(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003379 }
David Tolnay8c81f622018-07-31 23:34:35 -07003380 WherePredicate::Eq(ref _binding_0) => {
David Tolnayd4add852018-01-01 20:13:24 -08003381 _visitor.visit_predicate_eq(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003382 }
3383 }
3384}