blob: 65050450d8caa7dd535aef3f86d18e2cc7c39e3e [file] [log] [blame]
Nika Layzell27726662017-10-24 23:16:35 -04001// THIS FILE IS AUTOMATICALLY GENERATED; DO NOT EDIT
2
David Tolnayf0d63bf2017-12-26 12:29:47 -05003#![cfg_attr(feature = "cargo-clippy", allow(match_same_arms))]
David Tolnay0a0d78c2018-01-05 15:24:01 -08004#[cfg(any(feature = "full", feature = "derive"))]
David Tolnaycc0f0372017-12-28 19:11:04 -05005use gen::helper::visit::*;
David Tolnay8c81f622018-07-31 23:34:35 -07006use proc_macro2::Span;
7#[cfg(any(feature = "full", feature = "derive"))]
8use punctuated::Punctuated;
9use *;
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040010#[cfg(feature = "full")]
11macro_rules! full {
David Tolnay280202f2018-08-02 00:29:54 -070012 ($e:expr) => {
David Tolnay8c81f622018-07-31 23:34:35 -070013 $e
14 };
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040015}
David Tolnay0a0d78c2018-01-05 15:24:01 -080016#[cfg(all(feature = "derive", not(feature = "full")))]
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040017macro_rules! full {
David Tolnay280202f2018-08-02 00:29:54 -070018 ($e:expr) => {
David Tolnay8c81f622018-07-31 23:34:35 -070019 unreachable!()
20 };
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040021}
David Tolnay6af48992018-08-01 11:16:28 -070022#[cfg(any(feature = "full", feature = "derive"))]
23macro_rules! skip {
David Tolnay280202f2018-08-02 00:29:54 -070024 ($($tt:tt)*) => {};
David Tolnay6af48992018-08-01 11:16:28 -070025}
26#[doc = r" Syntax tree traversal to walk a shared borrow of a syntax tree."]
27#[doc = r""]
28#[doc = r" See the [module documentation] for details."]
29#[doc = r""]
30#[doc = r" [module documentation]: index.html"]
31#[doc = r""]
32#[doc = r#" *This trait is available if Syn is built with the `"visit"` feature.*"#]
David Tolnay4b4c4b62018-01-06 13:48:05 -080033pub trait Visit<'ast> {
David Tolnay8c81f622018-07-31 23:34:35 -070034 #[cfg(any(feature = "full", feature = "derive"))]
35 fn visit_abi(&mut self, i: &'ast Abi) {
36 visit_abi(self, i)
37 }
38 #[cfg(any(feature = "full", feature = "derive"))]
39 fn visit_angle_bracketed_generic_arguments(&mut self, i: &'ast AngleBracketedGenericArguments) {
40 visit_angle_bracketed_generic_arguments(self, i)
41 }
42 #[cfg(feature = "full")]
43 fn visit_arg_captured(&mut self, i: &'ast ArgCaptured) {
44 visit_arg_captured(self, i)
45 }
46 #[cfg(feature = "full")]
47 fn visit_arg_self(&mut self, i: &'ast ArgSelf) {
48 visit_arg_self(self, i)
49 }
50 #[cfg(feature = "full")]
51 fn visit_arg_self_ref(&mut self, i: &'ast ArgSelfRef) {
52 visit_arg_self_ref(self, i)
53 }
54 #[cfg(any(feature = "full", feature = "derive"))]
55 #[cfg(feature = "full")]
56 fn visit_arm(&mut self, i: &'ast Arm) {
57 visit_arm(self, i)
58 }
59 #[cfg(any(feature = "full", feature = "derive"))]
60 fn visit_attr_style(&mut self, i: &'ast AttrStyle) {
61 visit_attr_style(self, i)
62 }
63 #[cfg(any(feature = "full", feature = "derive"))]
64 fn visit_attribute(&mut self, i: &'ast Attribute) {
65 visit_attribute(self, i)
66 }
67 #[cfg(any(feature = "full", feature = "derive"))]
68 fn visit_bare_fn_arg(&mut self, i: &'ast BareFnArg) {
69 visit_bare_fn_arg(self, i)
70 }
71 #[cfg(any(feature = "full", feature = "derive"))]
72 fn visit_bare_fn_arg_name(&mut self, i: &'ast BareFnArgName) {
73 visit_bare_fn_arg_name(self, i)
74 }
75 #[cfg(any(feature = "full", feature = "derive"))]
76 fn visit_bin_op(&mut self, i: &'ast BinOp) {
77 visit_bin_op(self, i)
78 }
79 #[cfg(any(feature = "full", feature = "derive"))]
80 fn visit_binding(&mut self, i: &'ast Binding) {
81 visit_binding(self, i)
82 }
83 #[cfg(any(feature = "full", feature = "derive"))]
84 #[cfg(feature = "full")]
85 fn visit_block(&mut self, i: &'ast Block) {
86 visit_block(self, i)
87 }
88 #[cfg(any(feature = "full", feature = "derive"))]
89 fn visit_bound_lifetimes(&mut self, i: &'ast BoundLifetimes) {
90 visit_bound_lifetimes(self, i)
91 }
92 #[cfg(any(feature = "full", feature = "derive"))]
93 fn visit_const_param(&mut self, i: &'ast ConstParam) {
94 visit_const_param(self, i)
95 }
96 #[cfg(feature = "derive")]
97 fn visit_data(&mut self, i: &'ast Data) {
98 visit_data(self, i)
99 }
100 #[cfg(feature = "derive")]
101 fn visit_data_enum(&mut self, i: &'ast DataEnum) {
102 visit_data_enum(self, i)
103 }
104 #[cfg(feature = "derive")]
105 fn visit_data_struct(&mut self, i: &'ast DataStruct) {
106 visit_data_struct(self, i)
107 }
108 #[cfg(feature = "derive")]
109 fn visit_data_union(&mut self, i: &'ast DataUnion) {
110 visit_data_union(self, i)
111 }
112 #[cfg(feature = "derive")]
113 fn visit_derive_input(&mut self, i: &'ast DeriveInput) {
114 visit_derive_input(self, i)
115 }
116 #[cfg(any(feature = "full", feature = "derive"))]
117 fn visit_expr(&mut self, i: &'ast Expr) {
118 visit_expr(self, i)
119 }
120 #[cfg(feature = "full")]
121 #[cfg(any(feature = "full", feature = "derive"))]
122 fn visit_expr_array(&mut self, i: &'ast ExprArray) {
123 visit_expr_array(self, i)
124 }
125 #[cfg(feature = "full")]
126 #[cfg(any(feature = "full", feature = "derive"))]
127 fn visit_expr_assign(&mut self, i: &'ast ExprAssign) {
128 visit_expr_assign(self, i)
129 }
130 #[cfg(feature = "full")]
131 #[cfg(any(feature = "full", feature = "derive"))]
132 fn visit_expr_assign_op(&mut self, i: &'ast ExprAssignOp) {
133 visit_expr_assign_op(self, i)
134 }
135 #[cfg(any(feature = "full", feature = "derive"))]
136 fn visit_expr_binary(&mut self, i: &'ast ExprBinary) {
137 visit_expr_binary(self, i)
138 }
139 #[cfg(feature = "full")]
140 #[cfg(any(feature = "full", feature = "derive"))]
141 fn visit_expr_block(&mut self, i: &'ast ExprBlock) {
142 visit_expr_block(self, i)
143 }
144 #[cfg(feature = "full")]
145 #[cfg(any(feature = "full", feature = "derive"))]
146 fn visit_expr_box(&mut self, i: &'ast ExprBox) {
147 visit_expr_box(self, i)
148 }
149 #[cfg(feature = "full")]
150 #[cfg(any(feature = "full", feature = "derive"))]
151 fn visit_expr_break(&mut self, i: &'ast ExprBreak) {
152 visit_expr_break(self, i)
153 }
154 #[cfg(any(feature = "full", feature = "derive"))]
155 fn visit_expr_call(&mut self, i: &'ast ExprCall) {
156 visit_expr_call(self, i)
157 }
158 #[cfg(any(feature = "full", feature = "derive"))]
159 fn visit_expr_cast(&mut self, i: &'ast ExprCast) {
160 visit_expr_cast(self, i)
161 }
162 #[cfg(feature = "full")]
163 #[cfg(any(feature = "full", feature = "derive"))]
164 fn visit_expr_catch(&mut self, i: &'ast ExprCatch) {
165 visit_expr_catch(self, i)
166 }
167 #[cfg(feature = "full")]
168 #[cfg(any(feature = "full", feature = "derive"))]
169 fn visit_expr_closure(&mut self, i: &'ast ExprClosure) {
170 visit_expr_closure(self, i)
171 }
172 #[cfg(feature = "full")]
173 #[cfg(any(feature = "full", feature = "derive"))]
174 fn visit_expr_continue(&mut self, i: &'ast ExprContinue) {
175 visit_expr_continue(self, i)
176 }
177 #[cfg(any(feature = "full", feature = "derive"))]
178 fn visit_expr_field(&mut self, i: &'ast ExprField) {
179 visit_expr_field(self, i)
180 }
181 #[cfg(feature = "full")]
182 #[cfg(any(feature = "full", feature = "derive"))]
183 fn visit_expr_for_loop(&mut self, i: &'ast ExprForLoop) {
184 visit_expr_for_loop(self, i)
185 }
186 #[cfg(feature = "full")]
187 #[cfg(any(feature = "full", feature = "derive"))]
188 fn visit_expr_group(&mut self, i: &'ast ExprGroup) {
189 visit_expr_group(self, i)
190 }
191 #[cfg(feature = "full")]
192 #[cfg(any(feature = "full", feature = "derive"))]
193 fn visit_expr_if(&mut self, i: &'ast ExprIf) {
194 visit_expr_if(self, i)
195 }
196 #[cfg(feature = "full")]
197 #[cfg(any(feature = "full", feature = "derive"))]
198 fn visit_expr_if_let(&mut self, i: &'ast ExprIfLet) {
199 visit_expr_if_let(self, i)
200 }
201 #[cfg(feature = "full")]
202 #[cfg(any(feature = "full", feature = "derive"))]
203 fn visit_expr_in_place(&mut self, i: &'ast ExprInPlace) {
204 visit_expr_in_place(self, i)
205 }
206 #[cfg(any(feature = "full", feature = "derive"))]
207 fn visit_expr_index(&mut self, i: &'ast ExprIndex) {
208 visit_expr_index(self, i)
209 }
210 #[cfg(any(feature = "full", feature = "derive"))]
211 fn visit_expr_lit(&mut self, i: &'ast ExprLit) {
212 visit_expr_lit(self, i)
213 }
214 #[cfg(feature = "full")]
215 #[cfg(any(feature = "full", feature = "derive"))]
216 fn visit_expr_loop(&mut self, i: &'ast ExprLoop) {
217 visit_expr_loop(self, i)
218 }
219 #[cfg(feature = "full")]
220 #[cfg(any(feature = "full", feature = "derive"))]
221 fn visit_expr_macro(&mut self, i: &'ast ExprMacro) {
222 visit_expr_macro(self, i)
223 }
224 #[cfg(feature = "full")]
225 #[cfg(any(feature = "full", feature = "derive"))]
226 fn visit_expr_match(&mut self, i: &'ast ExprMatch) {
227 visit_expr_match(self, i)
228 }
229 #[cfg(feature = "full")]
230 #[cfg(any(feature = "full", feature = "derive"))]
231 fn visit_expr_method_call(&mut self, i: &'ast ExprMethodCall) {
232 visit_expr_method_call(self, i)
233 }
234 #[cfg(any(feature = "full", feature = "derive"))]
235 fn visit_expr_paren(&mut self, i: &'ast ExprParen) {
236 visit_expr_paren(self, i)
237 }
238 #[cfg(any(feature = "full", feature = "derive"))]
239 fn visit_expr_path(&mut self, i: &'ast ExprPath) {
240 visit_expr_path(self, i)
241 }
242 #[cfg(feature = "full")]
243 #[cfg(any(feature = "full", feature = "derive"))]
244 fn visit_expr_range(&mut self, i: &'ast ExprRange) {
245 visit_expr_range(self, i)
246 }
247 #[cfg(feature = "full")]
248 #[cfg(any(feature = "full", feature = "derive"))]
249 fn visit_expr_reference(&mut self, i: &'ast ExprReference) {
250 visit_expr_reference(self, i)
251 }
252 #[cfg(feature = "full")]
253 #[cfg(any(feature = "full", feature = "derive"))]
254 fn visit_expr_repeat(&mut self, i: &'ast ExprRepeat) {
255 visit_expr_repeat(self, i)
256 }
257 #[cfg(feature = "full")]
258 #[cfg(any(feature = "full", feature = "derive"))]
259 fn visit_expr_return(&mut self, i: &'ast ExprReturn) {
260 visit_expr_return(self, i)
261 }
262 #[cfg(feature = "full")]
263 #[cfg(any(feature = "full", feature = "derive"))]
264 fn visit_expr_struct(&mut self, i: &'ast ExprStruct) {
265 visit_expr_struct(self, i)
266 }
267 #[cfg(feature = "full")]
268 #[cfg(any(feature = "full", feature = "derive"))]
269 fn visit_expr_try(&mut self, i: &'ast ExprTry) {
270 visit_expr_try(self, i)
271 }
272 #[cfg(feature = "full")]
273 #[cfg(any(feature = "full", feature = "derive"))]
274 fn visit_expr_tuple(&mut self, i: &'ast ExprTuple) {
275 visit_expr_tuple(self, i)
276 }
277 #[cfg(feature = "full")]
278 #[cfg(any(feature = "full", feature = "derive"))]
279 fn visit_expr_type(&mut self, i: &'ast ExprType) {
280 visit_expr_type(self, i)
281 }
282 #[cfg(any(feature = "full", feature = "derive"))]
283 fn visit_expr_unary(&mut self, i: &'ast ExprUnary) {
284 visit_expr_unary(self, i)
285 }
286 #[cfg(feature = "full")]
287 #[cfg(any(feature = "full", feature = "derive"))]
288 fn visit_expr_unsafe(&mut self, i: &'ast ExprUnsafe) {
289 visit_expr_unsafe(self, i)
290 }
291 #[cfg(any(feature = "full", feature = "derive"))]
292 fn visit_expr_verbatim(&mut self, i: &'ast ExprVerbatim) {
293 visit_expr_verbatim(self, i)
294 }
295 #[cfg(feature = "full")]
296 #[cfg(any(feature = "full", feature = "derive"))]
297 fn visit_expr_while(&mut self, i: &'ast ExprWhile) {
298 visit_expr_while(self, i)
299 }
300 #[cfg(feature = "full")]
301 #[cfg(any(feature = "full", feature = "derive"))]
302 fn visit_expr_while_let(&mut self, i: &'ast ExprWhileLet) {
303 visit_expr_while_let(self, i)
304 }
305 #[cfg(feature = "full")]
306 #[cfg(any(feature = "full", feature = "derive"))]
307 fn visit_expr_yield(&mut self, i: &'ast ExprYield) {
308 visit_expr_yield(self, i)
309 }
310 #[cfg(any(feature = "full", feature = "derive"))]
311 fn visit_field(&mut self, i: &'ast Field) {
312 visit_field(self, i)
313 }
314 #[cfg(any(feature = "full", feature = "derive"))]
315 #[cfg(feature = "full")]
316 fn visit_field_pat(&mut self, i: &'ast FieldPat) {
317 visit_field_pat(self, i)
318 }
319 #[cfg(any(feature = "full", feature = "derive"))]
320 #[cfg(feature = "full")]
321 fn visit_field_value(&mut self, i: &'ast FieldValue) {
322 visit_field_value(self, i)
323 }
324 #[cfg(any(feature = "full", feature = "derive"))]
325 fn visit_fields(&mut self, i: &'ast Fields) {
326 visit_fields(self, i)
327 }
328 #[cfg(any(feature = "full", feature = "derive"))]
329 fn visit_fields_named(&mut self, i: &'ast FieldsNamed) {
330 visit_fields_named(self, i)
331 }
332 #[cfg(any(feature = "full", feature = "derive"))]
333 fn visit_fields_unnamed(&mut self, i: &'ast FieldsUnnamed) {
334 visit_fields_unnamed(self, i)
335 }
336 #[cfg(feature = "full")]
337 fn visit_file(&mut self, i: &'ast File) {
338 visit_file(self, i)
339 }
340 #[cfg(feature = "full")]
341 fn visit_fn_arg(&mut self, i: &'ast FnArg) {
342 visit_fn_arg(self, i)
343 }
344 #[cfg(feature = "full")]
345 fn visit_fn_decl(&mut self, i: &'ast FnDecl) {
346 visit_fn_decl(self, i)
347 }
348 #[cfg(feature = "full")]
349 fn visit_foreign_item(&mut self, i: &'ast ForeignItem) {
350 visit_foreign_item(self, i)
351 }
352 #[cfg(feature = "full")]
353 fn visit_foreign_item_fn(&mut self, i: &'ast ForeignItemFn) {
354 visit_foreign_item_fn(self, i)
355 }
356 #[cfg(feature = "full")]
357 fn visit_foreign_item_static(&mut self, i: &'ast ForeignItemStatic) {
358 visit_foreign_item_static(self, i)
359 }
360 #[cfg(feature = "full")]
361 fn visit_foreign_item_type(&mut self, i: &'ast ForeignItemType) {
362 visit_foreign_item_type(self, i)
363 }
364 #[cfg(feature = "full")]
365 fn visit_foreign_item_verbatim(&mut self, i: &'ast ForeignItemVerbatim) {
366 visit_foreign_item_verbatim(self, i)
367 }
368 #[cfg(any(feature = "full", feature = "derive"))]
369 fn visit_generic_argument(&mut self, i: &'ast GenericArgument) {
370 visit_generic_argument(self, i)
371 }
372 #[cfg(any(feature = "full", feature = "derive"))]
373 #[cfg(feature = "full")]
374 fn visit_generic_method_argument(&mut self, i: &'ast GenericMethodArgument) {
375 visit_generic_method_argument(self, i)
376 }
377 #[cfg(any(feature = "full", feature = "derive"))]
378 fn visit_generic_param(&mut self, i: &'ast GenericParam) {
379 visit_generic_param(self, i)
380 }
381 #[cfg(any(feature = "full", feature = "derive"))]
382 fn visit_generics(&mut self, i: &'ast Generics) {
383 visit_generics(self, i)
384 }
David Tolnay8c81f622018-07-31 23:34:35 -0700385 fn visit_ident(&mut self, i: &'ast Ident) {
386 visit_ident(self, i)
387 }
388 #[cfg(feature = "full")]
389 fn visit_impl_item(&mut self, i: &'ast ImplItem) {
390 visit_impl_item(self, i)
391 }
392 #[cfg(feature = "full")]
393 fn visit_impl_item_const(&mut self, i: &'ast ImplItemConst) {
394 visit_impl_item_const(self, i)
395 }
396 #[cfg(feature = "full")]
397 fn visit_impl_item_macro(&mut self, i: &'ast ImplItemMacro) {
398 visit_impl_item_macro(self, i)
399 }
400 #[cfg(feature = "full")]
401 fn visit_impl_item_method(&mut self, i: &'ast ImplItemMethod) {
402 visit_impl_item_method(self, i)
403 }
404 #[cfg(feature = "full")]
405 fn visit_impl_item_type(&mut self, i: &'ast ImplItemType) {
406 visit_impl_item_type(self, i)
407 }
408 #[cfg(feature = "full")]
409 fn visit_impl_item_verbatim(&mut self, i: &'ast ImplItemVerbatim) {
410 visit_impl_item_verbatim(self, i)
411 }
412 #[cfg(any(feature = "full", feature = "derive"))]
413 fn visit_index(&mut self, i: &'ast Index) {
414 visit_index(self, i)
415 }
416 #[cfg(feature = "full")]
417 fn visit_item(&mut self, i: &'ast Item) {
418 visit_item(self, i)
419 }
420 #[cfg(feature = "full")]
421 fn visit_item_const(&mut self, i: &'ast ItemConst) {
422 visit_item_const(self, i)
423 }
424 #[cfg(feature = "full")]
425 fn visit_item_enum(&mut self, i: &'ast ItemEnum) {
426 visit_item_enum(self, i)
427 }
428 #[cfg(feature = "full")]
429 fn visit_item_extern_crate(&mut self, i: &'ast ItemExternCrate) {
430 visit_item_extern_crate(self, i)
431 }
432 #[cfg(feature = "full")]
433 fn visit_item_fn(&mut self, i: &'ast ItemFn) {
434 visit_item_fn(self, i)
435 }
436 #[cfg(feature = "full")]
437 fn visit_item_foreign_mod(&mut self, i: &'ast ItemForeignMod) {
438 visit_item_foreign_mod(self, i)
439 }
440 #[cfg(feature = "full")]
441 fn visit_item_impl(&mut self, i: &'ast ItemImpl) {
442 visit_item_impl(self, i)
443 }
444 #[cfg(feature = "full")]
445 fn visit_item_macro(&mut self, i: &'ast ItemMacro) {
446 visit_item_macro(self, i)
447 }
448 #[cfg(feature = "full")]
449 fn visit_item_macro2(&mut self, i: &'ast ItemMacro2) {
450 visit_item_macro2(self, i)
451 }
452 #[cfg(feature = "full")]
453 fn visit_item_mod(&mut self, i: &'ast ItemMod) {
454 visit_item_mod(self, i)
455 }
456 #[cfg(feature = "full")]
457 fn visit_item_static(&mut self, i: &'ast ItemStatic) {
458 visit_item_static(self, i)
459 }
460 #[cfg(feature = "full")]
461 fn visit_item_struct(&mut self, i: &'ast ItemStruct) {
462 visit_item_struct(self, i)
463 }
464 #[cfg(feature = "full")]
465 fn visit_item_trait(&mut self, i: &'ast ItemTrait) {
466 visit_item_trait(self, i)
467 }
468 #[cfg(feature = "full")]
469 fn visit_item_type(&mut self, i: &'ast ItemType) {
470 visit_item_type(self, i)
471 }
472 #[cfg(feature = "full")]
473 fn visit_item_union(&mut self, i: &'ast ItemUnion) {
474 visit_item_union(self, i)
475 }
476 #[cfg(feature = "full")]
477 fn visit_item_use(&mut self, i: &'ast ItemUse) {
478 visit_item_use(self, i)
479 }
480 #[cfg(feature = "full")]
481 fn visit_item_verbatim(&mut self, i: &'ast ItemVerbatim) {
482 visit_item_verbatim(self, i)
483 }
484 #[cfg(any(feature = "full", feature = "derive"))]
485 #[cfg(feature = "full")]
486 fn visit_label(&mut self, i: &'ast Label) {
487 visit_label(self, i)
488 }
489 #[cfg(any(feature = "full", feature = "derive"))]
490 fn visit_lifetime(&mut self, i: &'ast Lifetime) {
491 visit_lifetime(self, i)
492 }
493 #[cfg(any(feature = "full", feature = "derive"))]
494 fn visit_lifetime_def(&mut self, i: &'ast LifetimeDef) {
495 visit_lifetime_def(self, i)
496 }
497 #[cfg(any(feature = "full", feature = "derive"))]
498 fn visit_lit(&mut self, i: &'ast Lit) {
499 visit_lit(self, i)
500 }
501 #[cfg(any(feature = "full", feature = "derive"))]
502 fn visit_lit_bool(&mut self, i: &'ast LitBool) {
503 visit_lit_bool(self, i)
504 }
505 #[cfg(any(feature = "full", feature = "derive"))]
506 fn visit_lit_byte(&mut self, i: &'ast LitByte) {
507 visit_lit_byte(self, i)
508 }
509 #[cfg(any(feature = "full", feature = "derive"))]
510 fn visit_lit_byte_str(&mut self, i: &'ast LitByteStr) {
511 visit_lit_byte_str(self, i)
512 }
513 #[cfg(any(feature = "full", feature = "derive"))]
514 fn visit_lit_char(&mut self, i: &'ast LitChar) {
515 visit_lit_char(self, i)
516 }
517 #[cfg(any(feature = "full", feature = "derive"))]
518 fn visit_lit_float(&mut self, i: &'ast LitFloat) {
519 visit_lit_float(self, i)
520 }
521 #[cfg(any(feature = "full", feature = "derive"))]
522 fn visit_lit_int(&mut self, i: &'ast LitInt) {
523 visit_lit_int(self, i)
524 }
525 #[cfg(any(feature = "full", feature = "derive"))]
526 fn visit_lit_str(&mut self, i: &'ast LitStr) {
527 visit_lit_str(self, i)
528 }
529 #[cfg(any(feature = "full", feature = "derive"))]
530 fn visit_lit_verbatim(&mut self, i: &'ast LitVerbatim) {
531 visit_lit_verbatim(self, i)
532 }
533 #[cfg(any(feature = "full", feature = "derive"))]
534 #[cfg(feature = "full")]
535 fn visit_local(&mut self, i: &'ast Local) {
536 visit_local(self, i)
537 }
538 #[cfg(any(feature = "full", feature = "derive"))]
539 fn visit_macro(&mut self, i: &'ast Macro) {
540 visit_macro(self, i)
541 }
542 #[cfg(any(feature = "full", feature = "derive"))]
543 fn visit_macro_delimiter(&mut self, i: &'ast MacroDelimiter) {
544 visit_macro_delimiter(self, i)
545 }
546 #[cfg(any(feature = "full", feature = "derive"))]
547 fn visit_member(&mut self, i: &'ast Member) {
548 visit_member(self, i)
549 }
550 #[cfg(any(feature = "full", feature = "derive"))]
551 fn visit_meta(&mut self, i: &'ast Meta) {
552 visit_meta(self, i)
553 }
554 #[cfg(any(feature = "full", feature = "derive"))]
555 fn visit_meta_list(&mut self, i: &'ast MetaList) {
556 visit_meta_list(self, i)
557 }
558 #[cfg(any(feature = "full", feature = "derive"))]
559 fn visit_meta_name_value(&mut self, i: &'ast MetaNameValue) {
560 visit_meta_name_value(self, i)
561 }
562 #[cfg(feature = "full")]
563 fn visit_method_sig(&mut self, i: &'ast MethodSig) {
564 visit_method_sig(self, i)
565 }
566 #[cfg(any(feature = "full", feature = "derive"))]
567 #[cfg(feature = "full")]
568 fn visit_method_turbofish(&mut self, i: &'ast MethodTurbofish) {
569 visit_method_turbofish(self, i)
570 }
571 #[cfg(any(feature = "full", feature = "derive"))]
572 fn visit_nested_meta(&mut self, i: &'ast NestedMeta) {
573 visit_nested_meta(self, i)
574 }
575 #[cfg(any(feature = "full", feature = "derive"))]
576 fn visit_parenthesized_generic_arguments(&mut self, i: &'ast ParenthesizedGenericArguments) {
577 visit_parenthesized_generic_arguments(self, i)
578 }
579 #[cfg(any(feature = "full", feature = "derive"))]
580 #[cfg(feature = "full")]
581 fn visit_pat(&mut self, i: &'ast Pat) {
582 visit_pat(self, i)
583 }
584 #[cfg(any(feature = "full", feature = "derive"))]
585 #[cfg(feature = "full")]
586 fn visit_pat_box(&mut self, i: &'ast PatBox) {
587 visit_pat_box(self, i)
588 }
589 #[cfg(any(feature = "full", feature = "derive"))]
590 #[cfg(feature = "full")]
591 fn visit_pat_ident(&mut self, i: &'ast PatIdent) {
592 visit_pat_ident(self, i)
593 }
594 #[cfg(any(feature = "full", feature = "derive"))]
595 #[cfg(feature = "full")]
596 fn visit_pat_lit(&mut self, i: &'ast PatLit) {
597 visit_pat_lit(self, i)
598 }
599 #[cfg(any(feature = "full", feature = "derive"))]
600 #[cfg(feature = "full")]
601 fn visit_pat_macro(&mut self, i: &'ast PatMacro) {
602 visit_pat_macro(self, i)
603 }
604 #[cfg(any(feature = "full", feature = "derive"))]
605 #[cfg(feature = "full")]
606 fn visit_pat_path(&mut self, i: &'ast PatPath) {
607 visit_pat_path(self, i)
608 }
609 #[cfg(any(feature = "full", feature = "derive"))]
610 #[cfg(feature = "full")]
611 fn visit_pat_range(&mut self, i: &'ast PatRange) {
612 visit_pat_range(self, i)
613 }
614 #[cfg(any(feature = "full", feature = "derive"))]
615 #[cfg(feature = "full")]
616 fn visit_pat_ref(&mut self, i: &'ast PatRef) {
617 visit_pat_ref(self, i)
618 }
619 #[cfg(any(feature = "full", feature = "derive"))]
620 #[cfg(feature = "full")]
621 fn visit_pat_slice(&mut self, i: &'ast PatSlice) {
622 visit_pat_slice(self, i)
623 }
624 #[cfg(any(feature = "full", feature = "derive"))]
625 #[cfg(feature = "full")]
626 fn visit_pat_struct(&mut self, i: &'ast PatStruct) {
627 visit_pat_struct(self, i)
628 }
629 #[cfg(any(feature = "full", feature = "derive"))]
630 #[cfg(feature = "full")]
631 fn visit_pat_tuple(&mut self, i: &'ast PatTuple) {
632 visit_pat_tuple(self, i)
633 }
634 #[cfg(any(feature = "full", feature = "derive"))]
635 #[cfg(feature = "full")]
636 fn visit_pat_tuple_struct(&mut self, i: &'ast PatTupleStruct) {
637 visit_pat_tuple_struct(self, i)
638 }
639 #[cfg(any(feature = "full", feature = "derive"))]
640 #[cfg(feature = "full")]
641 fn visit_pat_verbatim(&mut self, i: &'ast PatVerbatim) {
642 visit_pat_verbatim(self, i)
643 }
644 #[cfg(any(feature = "full", feature = "derive"))]
645 #[cfg(feature = "full")]
646 fn visit_pat_wild(&mut self, i: &'ast PatWild) {
647 visit_pat_wild(self, i)
648 }
649 #[cfg(any(feature = "full", feature = "derive"))]
650 fn visit_path(&mut self, i: &'ast Path) {
651 visit_path(self, i)
652 }
653 #[cfg(any(feature = "full", feature = "derive"))]
654 fn visit_path_arguments(&mut self, i: &'ast PathArguments) {
655 visit_path_arguments(self, i)
656 }
657 #[cfg(any(feature = "full", feature = "derive"))]
658 fn visit_path_segment(&mut self, i: &'ast PathSegment) {
659 visit_path_segment(self, i)
660 }
661 #[cfg(any(feature = "full", feature = "derive"))]
662 fn visit_predicate_eq(&mut self, i: &'ast PredicateEq) {
663 visit_predicate_eq(self, i)
664 }
665 #[cfg(any(feature = "full", feature = "derive"))]
666 fn visit_predicate_lifetime(&mut self, i: &'ast PredicateLifetime) {
667 visit_predicate_lifetime(self, i)
668 }
669 #[cfg(any(feature = "full", feature = "derive"))]
670 fn visit_predicate_type(&mut self, i: &'ast PredicateType) {
671 visit_predicate_type(self, i)
672 }
673 #[cfg(any(feature = "full", feature = "derive"))]
674 fn visit_qself(&mut self, i: &'ast QSelf) {
675 visit_qself(self, i)
676 }
677 #[cfg(any(feature = "full", feature = "derive"))]
678 #[cfg(feature = "full")]
679 fn visit_range_limits(&mut self, i: &'ast RangeLimits) {
680 visit_range_limits(self, i)
681 }
682 #[cfg(any(feature = "full", feature = "derive"))]
683 fn visit_return_type(&mut self, i: &'ast ReturnType) {
684 visit_return_type(self, i)
685 }
David Tolnay8c81f622018-07-31 23:34:35 -0700686 fn visit_span(&mut self, i: &'ast Span) {
687 visit_span(self, i)
688 }
689 #[cfg(any(feature = "full", feature = "derive"))]
690 #[cfg(feature = "full")]
691 fn visit_stmt(&mut self, i: &'ast Stmt) {
692 visit_stmt(self, i)
693 }
694 #[cfg(any(feature = "full", feature = "derive"))]
695 fn visit_trait_bound(&mut self, i: &'ast TraitBound) {
696 visit_trait_bound(self, i)
697 }
698 #[cfg(any(feature = "full", feature = "derive"))]
699 fn visit_trait_bound_modifier(&mut self, i: &'ast TraitBoundModifier) {
700 visit_trait_bound_modifier(self, i)
701 }
702 #[cfg(feature = "full")]
703 fn visit_trait_item(&mut self, i: &'ast TraitItem) {
704 visit_trait_item(self, i)
705 }
706 #[cfg(feature = "full")]
707 fn visit_trait_item_const(&mut self, i: &'ast TraitItemConst) {
708 visit_trait_item_const(self, i)
709 }
710 #[cfg(feature = "full")]
711 fn visit_trait_item_macro(&mut self, i: &'ast TraitItemMacro) {
712 visit_trait_item_macro(self, i)
713 }
714 #[cfg(feature = "full")]
715 fn visit_trait_item_method(&mut self, i: &'ast TraitItemMethod) {
716 visit_trait_item_method(self, i)
717 }
718 #[cfg(feature = "full")]
719 fn visit_trait_item_type(&mut self, i: &'ast TraitItemType) {
720 visit_trait_item_type(self, i)
721 }
722 #[cfg(feature = "full")]
723 fn visit_trait_item_verbatim(&mut self, i: &'ast TraitItemVerbatim) {
724 visit_trait_item_verbatim(self, i)
725 }
726 #[cfg(any(feature = "full", feature = "derive"))]
727 fn visit_type(&mut self, i: &'ast Type) {
728 visit_type(self, i)
729 }
730 #[cfg(any(feature = "full", feature = "derive"))]
731 fn visit_type_array(&mut self, i: &'ast TypeArray) {
732 visit_type_array(self, i)
733 }
734 #[cfg(any(feature = "full", feature = "derive"))]
735 fn visit_type_bare_fn(&mut self, i: &'ast TypeBareFn) {
736 visit_type_bare_fn(self, i)
737 }
738 #[cfg(any(feature = "full", feature = "derive"))]
739 fn visit_type_group(&mut self, i: &'ast TypeGroup) {
740 visit_type_group(self, i)
741 }
742 #[cfg(any(feature = "full", feature = "derive"))]
743 fn visit_type_impl_trait(&mut self, i: &'ast TypeImplTrait) {
744 visit_type_impl_trait(self, i)
745 }
746 #[cfg(any(feature = "full", feature = "derive"))]
747 fn visit_type_infer(&mut self, i: &'ast TypeInfer) {
748 visit_type_infer(self, i)
749 }
750 #[cfg(any(feature = "full", feature = "derive"))]
751 fn visit_type_macro(&mut self, i: &'ast TypeMacro) {
752 visit_type_macro(self, i)
753 }
754 #[cfg(any(feature = "full", feature = "derive"))]
755 fn visit_type_never(&mut self, i: &'ast TypeNever) {
756 visit_type_never(self, i)
757 }
758 #[cfg(any(feature = "full", feature = "derive"))]
759 fn visit_type_param(&mut self, i: &'ast TypeParam) {
760 visit_type_param(self, i)
761 }
762 #[cfg(any(feature = "full", feature = "derive"))]
763 fn visit_type_param_bound(&mut self, i: &'ast TypeParamBound) {
764 visit_type_param_bound(self, i)
765 }
766 #[cfg(any(feature = "full", feature = "derive"))]
767 fn visit_type_paren(&mut self, i: &'ast TypeParen) {
768 visit_type_paren(self, i)
769 }
770 #[cfg(any(feature = "full", feature = "derive"))]
771 fn visit_type_path(&mut self, i: &'ast TypePath) {
772 visit_type_path(self, i)
773 }
774 #[cfg(any(feature = "full", feature = "derive"))]
775 fn visit_type_ptr(&mut self, i: &'ast TypePtr) {
776 visit_type_ptr(self, i)
777 }
778 #[cfg(any(feature = "full", feature = "derive"))]
779 fn visit_type_reference(&mut self, i: &'ast TypeReference) {
780 visit_type_reference(self, i)
781 }
782 #[cfg(any(feature = "full", feature = "derive"))]
783 fn visit_type_slice(&mut self, i: &'ast TypeSlice) {
784 visit_type_slice(self, i)
785 }
786 #[cfg(any(feature = "full", feature = "derive"))]
787 fn visit_type_trait_object(&mut self, i: &'ast TypeTraitObject) {
788 visit_type_trait_object(self, i)
789 }
790 #[cfg(any(feature = "full", feature = "derive"))]
791 fn visit_type_tuple(&mut self, i: &'ast TypeTuple) {
792 visit_type_tuple(self, i)
793 }
794 #[cfg(any(feature = "full", feature = "derive"))]
795 fn visit_type_verbatim(&mut self, i: &'ast TypeVerbatim) {
796 visit_type_verbatim(self, i)
797 }
798 #[cfg(any(feature = "full", feature = "derive"))]
799 fn visit_un_op(&mut self, i: &'ast UnOp) {
800 visit_un_op(self, i)
801 }
802 #[cfg(feature = "full")]
803 fn visit_use_glob(&mut self, i: &'ast UseGlob) {
804 visit_use_glob(self, i)
805 }
806 #[cfg(feature = "full")]
807 fn visit_use_group(&mut self, i: &'ast UseGroup) {
808 visit_use_group(self, i)
809 }
810 #[cfg(feature = "full")]
811 fn visit_use_name(&mut self, i: &'ast UseName) {
812 visit_use_name(self, i)
813 }
814 #[cfg(feature = "full")]
815 fn visit_use_path(&mut self, i: &'ast UsePath) {
816 visit_use_path(self, i)
817 }
818 #[cfg(feature = "full")]
819 fn visit_use_rename(&mut self, i: &'ast UseRename) {
820 visit_use_rename(self, i)
821 }
822 #[cfg(feature = "full")]
823 fn visit_use_tree(&mut self, i: &'ast UseTree) {
824 visit_use_tree(self, i)
825 }
826 #[cfg(any(feature = "full", feature = "derive"))]
827 fn visit_variant(&mut self, i: &'ast Variant) {
828 visit_variant(self, i)
829 }
830 #[cfg(any(feature = "full", feature = "derive"))]
831 fn visit_vis_crate(&mut self, i: &'ast VisCrate) {
832 visit_vis_crate(self, i)
833 }
834 #[cfg(any(feature = "full", feature = "derive"))]
835 fn visit_vis_public(&mut self, i: &'ast VisPublic) {
836 visit_vis_public(self, i)
837 }
838 #[cfg(any(feature = "full", feature = "derive"))]
839 fn visit_vis_restricted(&mut self, i: &'ast VisRestricted) {
840 visit_vis_restricted(self, i)
841 }
842 #[cfg(any(feature = "full", feature = "derive"))]
843 fn visit_visibility(&mut self, i: &'ast Visibility) {
844 visit_visibility(self, i)
845 }
846 #[cfg(any(feature = "full", feature = "derive"))]
847 fn visit_where_clause(&mut self, i: &'ast WhereClause) {
848 visit_where_clause(self, i)
849 }
850 #[cfg(any(feature = "full", feature = "derive"))]
851 fn visit_where_predicate(&mut self, i: &'ast WherePredicate) {
852 visit_where_predicate(self, i)
853 }
Nika Layzell27726662017-10-24 23:16:35 -0400854}
David Tolnay8c81f622018-07-31 23:34:35 -0700855#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800856pub fn visit_abi<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Abi) {
David Tolnay7ac699c2018-08-24 14:00:58 -0400857 tokens_helper(_visitor, &_i.extern_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -0700858 if let Some(ref it) = _i.name {
859 _visitor.visit_lit_str(it)
860 };
Nika Layzell27726662017-10-24 23:16:35 -0400861}
David Tolnay8c81f622018-07-31 23:34:35 -0700862#[cfg(any(feature = "full", feature = "derive"))]
863pub fn visit_angle_bracketed_generic_arguments<'ast, V: Visit<'ast> + ?Sized>(
864 _visitor: &mut V,
865 _i: &'ast AngleBracketedGenericArguments,
866) {
867 if let Some(ref it) = _i.colon2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -0400868 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -0700869 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400870 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700871 for el in Punctuated::pairs(&_i.args) {
872 let it = el.value();
873 _visitor.visit_generic_argument(it)
874 }
David Tolnay7ac699c2018-08-24 14:00:58 -0400875 tokens_helper(_visitor, &_i.gt_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400876}
David Tolnay8c81f622018-07-31 23:34:35 -0700877#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800878pub fn visit_arg_captured<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ArgCaptured) {
David Tolnay8c81f622018-07-31 23:34:35 -0700879 _visitor.visit_pat(&_i.pat);
David Tolnay7ac699c2018-08-24 14:00:58 -0400880 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700881 _visitor.visit_type(&_i.ty);
Nika Layzell27726662017-10-24 23:16:35 -0400882}
David Tolnay8c81f622018-07-31 23:34:35 -0700883#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800884pub fn visit_arg_self<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ArgSelf) {
David Tolnay8c81f622018-07-31 23:34:35 -0700885 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -0400886 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -0700887 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400888 tokens_helper(_visitor, &_i.self_token.span);
Nika Layzell27726662017-10-24 23:16:35 -0400889}
David Tolnay8c81f622018-07-31 23:34:35 -0700890#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800891pub fn visit_arg_self_ref<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ArgSelfRef) {
David Tolnay7ac699c2018-08-24 14:00:58 -0400892 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700893 if let Some(ref it) = _i.lifetime {
894 _visitor.visit_lifetime(it)
895 };
896 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -0400897 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -0700898 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400899 tokens_helper(_visitor, &_i.self_token.span);
Nika Layzell27726662017-10-24 23:16:35 -0400900}
David Tolnay8c81f622018-07-31 23:34:35 -0700901#[cfg(any(feature = "full", feature = "derive"))]
902#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800903pub fn visit_arm<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Arm) {
David Tolnay8c81f622018-07-31 23:34:35 -0700904 for it in &_i.attrs {
905 _visitor.visit_attribute(it)
906 }
907 if let Some(ref it) = _i.leading_vert {
David Tolnay7ac699c2018-08-24 14:00:58 -0400908 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -0700909 };
910 for el in Punctuated::pairs(&_i.pats) {
911 let it = el.value();
912 _visitor.visit_pat(it)
913 }
914 if let Some(ref it) = _i.guard {
David Tolnay7ac699c2018-08-24 14:00:58 -0400915 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -0700916 _visitor.visit_expr(&*(it).1);
917 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400918 tokens_helper(_visitor, &_i.fat_arrow_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700919 _visitor.visit_expr(&*_i.body);
920 if let Some(ref it) = _i.comma {
David Tolnay7ac699c2018-08-24 14:00:58 -0400921 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -0700922 };
Nika Layzell27726662017-10-24 23:16:35 -0400923}
David Tolnay8c81f622018-07-31 23:34:35 -0700924#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800925pub fn visit_attr_style<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast AttrStyle) {
Nika Layzell27726662017-10-24 23:16:35 -0400926 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -0700927 AttrStyle::Outer => {}
928 AttrStyle::Inner(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400929 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400930 }
931 }
932}
David Tolnay8c81f622018-07-31 23:34:35 -0700933#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800934pub fn visit_attribute<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Attribute) {
David Tolnay7ac699c2018-08-24 14:00:58 -0400935 tokens_helper(_visitor, &_i.pound_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700936 _visitor.visit_attr_style(&_i.style);
David Tolnay7ac699c2018-08-24 14:00:58 -0400937 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -0700938 _visitor.visit_path(&_i.path);
David Tolnay6af48992018-08-01 11:16:28 -0700939 skip!(_i.tts);
Nika Layzell27726662017-10-24 23:16:35 -0400940}
David Tolnay8c81f622018-07-31 23:34:35 -0700941#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800942pub fn visit_bare_fn_arg<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast BareFnArg) {
David Tolnay8c81f622018-07-31 23:34:35 -0700943 if let Some(ref it) = _i.name {
944 _visitor.visit_bare_fn_arg_name(&(it).0);
David Tolnay7ac699c2018-08-24 14:00:58 -0400945 tokens_helper(_visitor, &(it).1.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700946 };
947 _visitor.visit_type(&_i.ty);
Nika Layzell27726662017-10-24 23:16:35 -0400948}
David Tolnay8c81f622018-07-31 23:34:35 -0700949#[cfg(any(feature = "full", feature = "derive"))]
950pub fn visit_bare_fn_arg_name<'ast, V: Visit<'ast> + ?Sized>(
951 _visitor: &mut V,
952 _i: &'ast BareFnArgName,
953) {
Nika Layzell27726662017-10-24 23:16:35 -0400954 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -0700955 BareFnArgName::Named(ref _binding_0) => {
Alex Crichtond261d092018-05-18 13:47:35 -0700956 _visitor.visit_ident(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -0400957 }
David Tolnay8c81f622018-07-31 23:34:35 -0700958 BareFnArgName::Wild(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400959 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400960 }
961 }
962}
David Tolnay8c81f622018-07-31 23:34:35 -0700963#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800964pub fn visit_bin_op<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast BinOp) {
Nika Layzell27726662017-10-24 23:16:35 -0400965 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -0700966 BinOp::Add(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400967 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400968 }
David Tolnay8c81f622018-07-31 23:34:35 -0700969 BinOp::Sub(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400970 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400971 }
David Tolnay8c81f622018-07-31 23:34:35 -0700972 BinOp::Mul(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400973 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400974 }
David Tolnay8c81f622018-07-31 23:34:35 -0700975 BinOp::Div(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400976 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400977 }
David Tolnay8c81f622018-07-31 23:34:35 -0700978 BinOp::Rem(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400979 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400980 }
David Tolnay8c81f622018-07-31 23:34:35 -0700981 BinOp::And(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400982 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400983 }
David Tolnay8c81f622018-07-31 23:34:35 -0700984 BinOp::Or(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400985 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400986 }
David Tolnay8c81f622018-07-31 23:34:35 -0700987 BinOp::BitXor(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400988 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400989 }
David Tolnay8c81f622018-07-31 23:34:35 -0700990 BinOp::BitAnd(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400991 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400992 }
David Tolnay8c81f622018-07-31 23:34:35 -0700993 BinOp::BitOr(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400994 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400995 }
David Tolnay8c81f622018-07-31 23:34:35 -0700996 BinOp::Shl(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400997 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400998 }
David Tolnay8c81f622018-07-31 23:34:35 -0700999 BinOp::Shr(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001000 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001001 }
David Tolnay8c81f622018-07-31 23:34:35 -07001002 BinOp::Eq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001003 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001004 }
David Tolnay8c81f622018-07-31 23:34:35 -07001005 BinOp::Lt(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001006 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001007 }
David Tolnay8c81f622018-07-31 23:34:35 -07001008 BinOp::Le(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001009 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001010 }
David Tolnay8c81f622018-07-31 23:34:35 -07001011 BinOp::Ne(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001012 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001013 }
David Tolnay8c81f622018-07-31 23:34:35 -07001014 BinOp::Ge(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001015 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001016 }
David Tolnay8c81f622018-07-31 23:34:35 -07001017 BinOp::Gt(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001018 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001019 }
David Tolnay8c81f622018-07-31 23:34:35 -07001020 BinOp::AddEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001021 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001022 }
David Tolnay8c81f622018-07-31 23:34:35 -07001023 BinOp::SubEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001024 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001025 }
David Tolnay8c81f622018-07-31 23:34:35 -07001026 BinOp::MulEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001027 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001028 }
David Tolnay8c81f622018-07-31 23:34:35 -07001029 BinOp::DivEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001030 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001031 }
David Tolnay8c81f622018-07-31 23:34:35 -07001032 BinOp::RemEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001033 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001034 }
David Tolnay8c81f622018-07-31 23:34:35 -07001035 BinOp::BitXorEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001036 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001037 }
David Tolnay8c81f622018-07-31 23:34:35 -07001038 BinOp::BitAndEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001039 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001040 }
David Tolnay8c81f622018-07-31 23:34:35 -07001041 BinOp::BitOrEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001042 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001043 }
David Tolnay8c81f622018-07-31 23:34:35 -07001044 BinOp::ShlEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001045 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001046 }
David Tolnay8c81f622018-07-31 23:34:35 -07001047 BinOp::ShrEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001048 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001049 }
1050 }
1051}
David Tolnay8c81f622018-07-31 23:34:35 -07001052#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001053pub fn visit_binding<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Binding) {
David Tolnay8c81f622018-07-31 23:34:35 -07001054 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001055 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001056 _visitor.visit_type(&_i.ty);
David Tolnay506e43a2017-12-29 11:34:36 -05001057}
David Tolnay8c81f622018-07-31 23:34:35 -07001058#[cfg(any(feature = "full", feature = "derive"))]
1059#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001060pub fn visit_block<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Block) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001061 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001062 for it in &_i.stmts {
1063 _visitor.visit_stmt(it)
1064 }
Nika Layzell27726662017-10-24 23:16:35 -04001065}
David Tolnay8c81f622018-07-31 23:34:35 -07001066#[cfg(any(feature = "full", feature = "derive"))]
1067pub fn visit_bound_lifetimes<'ast, V: Visit<'ast> + ?Sized>(
1068 _visitor: &mut V,
1069 _i: &'ast BoundLifetimes,
1070) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001071 tokens_helper(_visitor, &_i.for_token.span);
1072 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001073 for el in Punctuated::pairs(&_i.lifetimes) {
1074 let it = el.value();
1075 _visitor.visit_lifetime_def(it)
1076 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001077 tokens_helper(_visitor, &_i.gt_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001078}
David Tolnay8c81f622018-07-31 23:34:35 -07001079#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001080pub fn visit_const_param<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ConstParam) {
David Tolnay8c81f622018-07-31 23:34:35 -07001081 for it in &_i.attrs {
1082 _visitor.visit_attribute(it)
1083 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001084 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001085 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001086 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001087 _visitor.visit_type(&_i.ty);
1088 if let Some(ref it) = _i.eq_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001089 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001090 };
1091 if let Some(ref it) = _i.default {
1092 _visitor.visit_expr(it)
1093 };
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001094}
David Tolnay8c81f622018-07-31 23:34:35 -07001095#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001096pub fn visit_data<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Data) {
David Tolnaye3d41b72017-12-31 15:24:00 -05001097 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001098 Data::Struct(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05001099 _visitor.visit_data_struct(_binding_0);
1100 }
David Tolnay8c81f622018-07-31 23:34:35 -07001101 Data::Enum(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05001102 _visitor.visit_data_enum(_binding_0);
1103 }
David Tolnay8c81f622018-07-31 23:34:35 -07001104 Data::Union(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05001105 _visitor.visit_data_union(_binding_0);
1106 }
1107 }
1108}
David Tolnay8c81f622018-07-31 23:34:35 -07001109#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001110pub fn visit_data_enum<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataEnum) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001111 tokens_helper(_visitor, &_i.enum_token.span);
1112 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001113 for el in Punctuated::pairs(&_i.variants) {
1114 let it = el.value();
1115 _visitor.visit_variant(it)
1116 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001117}
David Tolnay8c81f622018-07-31 23:34:35 -07001118#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001119pub fn visit_data_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataStruct) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001120 tokens_helper(_visitor, &_i.struct_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001121 _visitor.visit_fields(&_i.fields);
1122 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001123 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001124 };
David Tolnaye3d41b72017-12-31 15:24:00 -05001125}
David Tolnay8c81f622018-07-31 23:34:35 -07001126#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001127pub fn visit_data_union<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataUnion) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001128 tokens_helper(_visitor, &_i.union_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001129 _visitor.visit_fields_named(&_i.fields);
David Tolnaye3d41b72017-12-31 15:24:00 -05001130}
David Tolnay8c81f622018-07-31 23:34:35 -07001131#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001132pub fn visit_derive_input<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DeriveInput) {
David Tolnay8c81f622018-07-31 23:34:35 -07001133 for it in &_i.attrs {
1134 _visitor.visit_attribute(it)
1135 }
1136 _visitor.visit_visibility(&_i.vis);
1137 _visitor.visit_ident(&_i.ident);
1138 _visitor.visit_generics(&_i.generics);
1139 _visitor.visit_data(&_i.data);
Nika Layzell27726662017-10-24 23:16:35 -04001140}
David Tolnay8c81f622018-07-31 23:34:35 -07001141#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001142pub fn visit_expr<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Expr) {
Nika Layzell27726662017-10-24 23:16:35 -04001143 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001144 Expr::Box(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001145 full!(_visitor.visit_expr_box(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001146 }
David Tolnay8c81f622018-07-31 23:34:35 -07001147 Expr::InPlace(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001148 full!(_visitor.visit_expr_in_place(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001149 }
David Tolnay8c81f622018-07-31 23:34:35 -07001150 Expr::Array(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001151 full!(_visitor.visit_expr_array(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001152 }
David Tolnay8c81f622018-07-31 23:34:35 -07001153 Expr::Call(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001154 _visitor.visit_expr_call(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001155 }
David Tolnay8c81f622018-07-31 23:34:35 -07001156 Expr::MethodCall(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001157 full!(_visitor.visit_expr_method_call(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001158 }
David Tolnay8c81f622018-07-31 23:34:35 -07001159 Expr::Tuple(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001160 full!(_visitor.visit_expr_tuple(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001161 }
David Tolnay8c81f622018-07-31 23:34:35 -07001162 Expr::Binary(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001163 _visitor.visit_expr_binary(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001164 }
David Tolnay8c81f622018-07-31 23:34:35 -07001165 Expr::Unary(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001166 _visitor.visit_expr_unary(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001167 }
David Tolnay8c81f622018-07-31 23:34:35 -07001168 Expr::Lit(ref _binding_0) => {
David Tolnay8c91b882017-12-28 23:04:32 -05001169 _visitor.visit_expr_lit(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001170 }
David Tolnay8c81f622018-07-31 23:34:35 -07001171 Expr::Cast(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001172 _visitor.visit_expr_cast(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001173 }
David Tolnay8c81f622018-07-31 23:34:35 -07001174 Expr::Type(ref _binding_0) => {
David Tolnay0cf94f22017-12-28 23:46:26 -05001175 full!(_visitor.visit_expr_type(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001176 }
David Tolnay8c81f622018-07-31 23:34:35 -07001177 Expr::If(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001178 full!(_visitor.visit_expr_if(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001179 }
David Tolnay8c81f622018-07-31 23:34:35 -07001180 Expr::IfLet(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001181 full!(_visitor.visit_expr_if_let(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001182 }
David Tolnay8c81f622018-07-31 23:34:35 -07001183 Expr::While(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001184 full!(_visitor.visit_expr_while(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001185 }
David Tolnay8c81f622018-07-31 23:34:35 -07001186 Expr::WhileLet(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001187 full!(_visitor.visit_expr_while_let(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001188 }
David Tolnay8c81f622018-07-31 23:34:35 -07001189 Expr::ForLoop(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001190 full!(_visitor.visit_expr_for_loop(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001191 }
David Tolnay8c81f622018-07-31 23:34:35 -07001192 Expr::Loop(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001193 full!(_visitor.visit_expr_loop(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001194 }
David Tolnay8c81f622018-07-31 23:34:35 -07001195 Expr::Match(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001196 full!(_visitor.visit_expr_match(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001197 }
David Tolnay8c81f622018-07-31 23:34:35 -07001198 Expr::Closure(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001199 full!(_visitor.visit_expr_closure(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001200 }
David Tolnay8c81f622018-07-31 23:34:35 -07001201 Expr::Unsafe(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001202 full!(_visitor.visit_expr_unsafe(_binding_0));
Nika Layzell640832a2017-12-04 13:37:09 -05001203 }
David Tolnay8c81f622018-07-31 23:34:35 -07001204 Expr::Block(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001205 full!(_visitor.visit_expr_block(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001206 }
David Tolnay8c81f622018-07-31 23:34:35 -07001207 Expr::Assign(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001208 full!(_visitor.visit_expr_assign(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001209 }
David Tolnay8c81f622018-07-31 23:34:35 -07001210 Expr::AssignOp(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001211 full!(_visitor.visit_expr_assign_op(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001212 }
David Tolnay8c81f622018-07-31 23:34:35 -07001213 Expr::Field(ref _binding_0) => {
David Tolnayd093fa92018-06-30 10:23:25 -07001214 _visitor.visit_expr_field(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001215 }
David Tolnay8c81f622018-07-31 23:34:35 -07001216 Expr::Index(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001217 _visitor.visit_expr_index(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001218 }
David Tolnay8c81f622018-07-31 23:34:35 -07001219 Expr::Range(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001220 full!(_visitor.visit_expr_range(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001221 }
David Tolnay8c81f622018-07-31 23:34:35 -07001222 Expr::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001223 _visitor.visit_expr_path(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001224 }
David Tolnay8c81f622018-07-31 23:34:35 -07001225 Expr::Reference(ref _binding_0) => {
David Tolnay00674ba2018-03-31 18:14:11 +02001226 full!(_visitor.visit_expr_reference(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001227 }
David Tolnay8c81f622018-07-31 23:34:35 -07001228 Expr::Break(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001229 full!(_visitor.visit_expr_break(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001230 }
David Tolnay8c81f622018-07-31 23:34:35 -07001231 Expr::Continue(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001232 full!(_visitor.visit_expr_continue(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001233 }
David Tolnay8c81f622018-07-31 23:34:35 -07001234 Expr::Return(ref _binding_0) => {
David Tolnayc246cd32017-12-28 23:14:32 -05001235 full!(_visitor.visit_expr_return(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001236 }
David Tolnay8c81f622018-07-31 23:34:35 -07001237 Expr::Macro(ref _binding_0) => {
David Tolnay8c91b882017-12-28 23:04:32 -05001238 full!(_visitor.visit_expr_macro(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001239 }
David Tolnay8c81f622018-07-31 23:34:35 -07001240 Expr::Struct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001241 full!(_visitor.visit_expr_struct(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001242 }
David Tolnay8c81f622018-07-31 23:34:35 -07001243 Expr::Repeat(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001244 full!(_visitor.visit_expr_repeat(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001245 }
David Tolnay8c81f622018-07-31 23:34:35 -07001246 Expr::Paren(ref _binding_0) => {
David Tolnay81ab4f62018-01-27 19:02:51 -08001247 _visitor.visit_expr_paren(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001248 }
David Tolnay8c81f622018-07-31 23:34:35 -07001249 Expr::Group(ref _binding_0) => {
David Tolnaye98775f2017-12-28 23:17:00 -05001250 full!(_visitor.visit_expr_group(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001251 }
David Tolnay8c81f622018-07-31 23:34:35 -07001252 Expr::Try(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001253 full!(_visitor.visit_expr_try(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001254 }
David Tolnay8c81f622018-07-31 23:34:35 -07001255 Expr::Catch(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001256 full!(_visitor.visit_expr_catch(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001257 }
David Tolnay8c81f622018-07-31 23:34:35 -07001258 Expr::Yield(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001259 full!(_visitor.visit_expr_yield(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001260 }
David Tolnay8c81f622018-07-31 23:34:35 -07001261 Expr::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05001262 _visitor.visit_expr_verbatim(_binding_0);
1263 }
Nika Layzell27726662017-10-24 23:16:35 -04001264 }
1265}
David Tolnay8c81f622018-07-31 23:34:35 -07001266#[cfg(feature = "full")]
1267#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001268pub fn visit_expr_array<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprArray) {
David Tolnay8c81f622018-07-31 23:34:35 -07001269 for it in &_i.attrs {
1270 _visitor.visit_attribute(it)
1271 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001272 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001273 for el in Punctuated::pairs(&_i.elems) {
1274 let it = el.value();
1275 _visitor.visit_expr(it)
David Tolnaye3d41b72017-12-31 15:24:00 -05001276 }
1277}
David Tolnay8c81f622018-07-31 23:34:35 -07001278#[cfg(feature = "full")]
1279#[cfg(any(feature = "full", feature = "derive"))]
1280pub fn visit_expr_assign<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprAssign) {
1281 for it in &_i.attrs {
1282 _visitor.visit_attribute(it)
1283 }
1284 _visitor.visit_expr(&*_i.left);
David Tolnay7ac699c2018-08-24 14:00:58 -04001285 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001286 _visitor.visit_expr(&*_i.right);
1287}
1288#[cfg(feature = "full")]
1289#[cfg(any(feature = "full", feature = "derive"))]
1290pub fn visit_expr_assign_op<'ast, V: Visit<'ast> + ?Sized>(
1291 _visitor: &mut V,
1292 _i: &'ast ExprAssignOp,
1293) {
1294 for it in &_i.attrs {
1295 _visitor.visit_attribute(it)
1296 }
1297 _visitor.visit_expr(&*_i.left);
1298 _visitor.visit_bin_op(&_i.op);
1299 _visitor.visit_expr(&*_i.right);
1300}
1301#[cfg(any(feature = "full", feature = "derive"))]
1302pub fn visit_expr_binary<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBinary) {
1303 for it in &_i.attrs {
1304 _visitor.visit_attribute(it)
1305 }
1306 _visitor.visit_expr(&*_i.left);
1307 _visitor.visit_bin_op(&_i.op);
1308 _visitor.visit_expr(&*_i.right);
1309}
1310#[cfg(feature = "full")]
1311#[cfg(any(feature = "full", feature = "derive"))]
1312pub fn visit_expr_block<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBlock) {
1313 for it in &_i.attrs {
1314 _visitor.visit_attribute(it)
1315 }
1316 _visitor.visit_block(&_i.block);
1317}
1318#[cfg(feature = "full")]
1319#[cfg(any(feature = "full", feature = "derive"))]
1320pub fn visit_expr_box<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBox) {
1321 for it in &_i.attrs {
1322 _visitor.visit_attribute(it)
1323 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001324 tokens_helper(_visitor, &_i.box_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001325 _visitor.visit_expr(&*_i.expr);
1326}
1327#[cfg(feature = "full")]
1328#[cfg(any(feature = "full", feature = "derive"))]
1329pub fn visit_expr_break<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBreak) {
1330 for it in &_i.attrs {
1331 _visitor.visit_attribute(it)
1332 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001333 tokens_helper(_visitor, &_i.break_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001334 if let Some(ref it) = _i.label {
1335 _visitor.visit_lifetime(it)
1336 };
1337 if let Some(ref it) = _i.expr {
1338 _visitor.visit_expr(&**it)
1339 };
1340}
1341#[cfg(any(feature = "full", feature = "derive"))]
1342pub fn visit_expr_call<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprCall) {
1343 for it in &_i.attrs {
1344 _visitor.visit_attribute(it)
1345 }
1346 _visitor.visit_expr(&*_i.func);
David Tolnay7ac699c2018-08-24 14:00:58 -04001347 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001348 for el in Punctuated::pairs(&_i.args) {
1349 let it = el.value();
1350 _visitor.visit_expr(it)
1351 }
1352}
1353#[cfg(any(feature = "full", feature = "derive"))]
1354pub fn visit_expr_cast<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprCast) {
1355 for it in &_i.attrs {
1356 _visitor.visit_attribute(it)
1357 }
1358 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001359 tokens_helper(_visitor, &_i.as_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001360 _visitor.visit_type(&*_i.ty);
1361}
1362#[cfg(feature = "full")]
1363#[cfg(any(feature = "full", feature = "derive"))]
1364pub fn visit_expr_catch<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprCatch) {
1365 for it in &_i.attrs {
1366 _visitor.visit_attribute(it)
1367 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001368 tokens_helper(_visitor, &_i.do_token.span);
1369 tokens_helper(_visitor, &_i.catch_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001370 _visitor.visit_block(&_i.block);
1371}
1372#[cfg(feature = "full")]
1373#[cfg(any(feature = "full", feature = "derive"))]
1374pub fn visit_expr_closure<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprClosure) {
1375 for it in &_i.attrs {
1376 _visitor.visit_attribute(it)
1377 }
1378 if let Some(ref it) = _i.movability {
David Tolnay7ac699c2018-08-24 14:00:58 -04001379 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001380 };
1381 if let Some(ref it) = _i.capture {
David Tolnay7ac699c2018-08-24 14:00:58 -04001382 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001383 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001384 tokens_helper(_visitor, &_i.or1_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001385 for el in Punctuated::pairs(&_i.inputs) {
1386 let it = el.value();
1387 _visitor.visit_fn_arg(it)
1388 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001389 tokens_helper(_visitor, &_i.or2_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001390 _visitor.visit_return_type(&_i.output);
1391 _visitor.visit_expr(&*_i.body);
1392}
1393#[cfg(feature = "full")]
1394#[cfg(any(feature = "full", feature = "derive"))]
1395pub fn visit_expr_continue<'ast, V: Visit<'ast> + ?Sized>(
1396 _visitor: &mut V,
1397 _i: &'ast ExprContinue,
1398) {
1399 for it in &_i.attrs {
1400 _visitor.visit_attribute(it)
1401 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001402 tokens_helper(_visitor, &_i.continue_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001403 if let Some(ref it) = _i.label {
1404 _visitor.visit_lifetime(it)
1405 };
1406}
1407#[cfg(any(feature = "full", feature = "derive"))]
1408pub fn visit_expr_field<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprField) {
1409 for it in &_i.attrs {
1410 _visitor.visit_attribute(it)
1411 }
1412 _visitor.visit_expr(&*_i.base);
David Tolnay7ac699c2018-08-24 14:00:58 -04001413 tokens_helper(_visitor, &_i.dot_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001414 _visitor.visit_member(&_i.member);
1415}
1416#[cfg(feature = "full")]
1417#[cfg(any(feature = "full", feature = "derive"))]
1418pub fn visit_expr_for_loop<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprForLoop) {
1419 for it in &_i.attrs {
1420 _visitor.visit_attribute(it)
1421 }
1422 if let Some(ref it) = _i.label {
1423 _visitor.visit_label(it)
1424 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001425 tokens_helper(_visitor, &_i.for_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001426 _visitor.visit_pat(&*_i.pat);
David Tolnay7ac699c2018-08-24 14:00:58 -04001427 tokens_helper(_visitor, &_i.in_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001428 _visitor.visit_expr(&*_i.expr);
1429 _visitor.visit_block(&_i.body);
1430}
1431#[cfg(feature = "full")]
1432#[cfg(any(feature = "full", feature = "derive"))]
1433pub fn visit_expr_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprGroup) {
1434 for it in &_i.attrs {
1435 _visitor.visit_attribute(it)
1436 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001437 tokens_helper(_visitor, &_i.group_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001438 _visitor.visit_expr(&*_i.expr);
1439}
1440#[cfg(feature = "full")]
1441#[cfg(any(feature = "full", feature = "derive"))]
1442pub fn visit_expr_if<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprIf) {
1443 for it in &_i.attrs {
1444 _visitor.visit_attribute(it)
1445 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001446 tokens_helper(_visitor, &_i.if_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001447 _visitor.visit_expr(&*_i.cond);
1448 _visitor.visit_block(&_i.then_branch);
1449 if let Some(ref it) = _i.else_branch {
David Tolnay7ac699c2018-08-24 14:00:58 -04001450 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001451 _visitor.visit_expr(&*(it).1);
1452 };
1453}
1454#[cfg(feature = "full")]
1455#[cfg(any(feature = "full", feature = "derive"))]
1456pub fn visit_expr_if_let<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprIfLet) {
1457 for it in &_i.attrs {
1458 _visitor.visit_attribute(it)
1459 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001460 tokens_helper(_visitor, &_i.if_token.span);
1461 tokens_helper(_visitor, &_i.let_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001462 for el in Punctuated::pairs(&_i.pats) {
1463 let it = el.value();
1464 _visitor.visit_pat(it)
1465 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001466 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001467 _visitor.visit_expr(&*_i.expr);
1468 _visitor.visit_block(&_i.then_branch);
1469 if let Some(ref it) = _i.else_branch {
David Tolnay7ac699c2018-08-24 14:00:58 -04001470 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001471 _visitor.visit_expr(&*(it).1);
1472 };
1473}
1474#[cfg(feature = "full")]
1475#[cfg(any(feature = "full", feature = "derive"))]
1476pub fn visit_expr_in_place<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprInPlace) {
1477 for it in &_i.attrs {
1478 _visitor.visit_attribute(it)
1479 }
1480 _visitor.visit_expr(&*_i.place);
David Tolnay7ac699c2018-08-24 14:00:58 -04001481 tokens_helper(_visitor, &_i.arrow_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001482 _visitor.visit_expr(&*_i.value);
1483}
1484#[cfg(any(feature = "full", feature = "derive"))]
1485pub fn visit_expr_index<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprIndex) {
1486 for it in &_i.attrs {
1487 _visitor.visit_attribute(it)
1488 }
1489 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001490 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001491 _visitor.visit_expr(&*_i.index);
1492}
1493#[cfg(any(feature = "full", feature = "derive"))]
1494pub fn visit_expr_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprLit) {
1495 for it in &_i.attrs {
1496 _visitor.visit_attribute(it)
1497 }
1498 _visitor.visit_lit(&_i.lit);
1499}
1500#[cfg(feature = "full")]
1501#[cfg(any(feature = "full", feature = "derive"))]
1502pub fn visit_expr_loop<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprLoop) {
1503 for it in &_i.attrs {
1504 _visitor.visit_attribute(it)
1505 }
1506 if let Some(ref it) = _i.label {
1507 _visitor.visit_label(it)
1508 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001509 tokens_helper(_visitor, &_i.loop_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001510 _visitor.visit_block(&_i.body);
1511}
1512#[cfg(feature = "full")]
1513#[cfg(any(feature = "full", feature = "derive"))]
1514pub fn visit_expr_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprMacro) {
1515 for it in &_i.attrs {
1516 _visitor.visit_attribute(it)
1517 }
1518 _visitor.visit_macro(&_i.mac);
1519}
1520#[cfg(feature = "full")]
1521#[cfg(any(feature = "full", feature = "derive"))]
1522pub fn visit_expr_match<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprMatch) {
1523 for it in &_i.attrs {
1524 _visitor.visit_attribute(it)
1525 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001526 tokens_helper(_visitor, &_i.match_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001527 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001528 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001529 for it in &_i.arms {
1530 _visitor.visit_arm(it)
1531 }
1532}
1533#[cfg(feature = "full")]
1534#[cfg(any(feature = "full", feature = "derive"))]
1535pub fn visit_expr_method_call<'ast, V: Visit<'ast> + ?Sized>(
1536 _visitor: &mut V,
1537 _i: &'ast ExprMethodCall,
1538) {
1539 for it in &_i.attrs {
1540 _visitor.visit_attribute(it)
1541 }
1542 _visitor.visit_expr(&*_i.receiver);
David Tolnay7ac699c2018-08-24 14:00:58 -04001543 tokens_helper(_visitor, &_i.dot_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001544 _visitor.visit_ident(&_i.method);
1545 if let Some(ref it) = _i.turbofish {
1546 _visitor.visit_method_turbofish(it)
1547 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001548 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001549 for el in Punctuated::pairs(&_i.args) {
1550 let it = el.value();
1551 _visitor.visit_expr(it)
1552 }
1553}
1554#[cfg(any(feature = "full", feature = "derive"))]
1555pub fn visit_expr_paren<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprParen) {
1556 for it in &_i.attrs {
1557 _visitor.visit_attribute(it)
1558 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001559 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001560 _visitor.visit_expr(&*_i.expr);
1561}
1562#[cfg(any(feature = "full", feature = "derive"))]
1563pub fn visit_expr_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprPath) {
1564 for it in &_i.attrs {
1565 _visitor.visit_attribute(it)
1566 }
1567 if let Some(ref it) = _i.qself {
1568 _visitor.visit_qself(it)
1569 };
1570 _visitor.visit_path(&_i.path);
1571}
1572#[cfg(feature = "full")]
1573#[cfg(any(feature = "full", feature = "derive"))]
1574pub fn visit_expr_range<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprRange) {
1575 for it in &_i.attrs {
1576 _visitor.visit_attribute(it)
1577 }
1578 if let Some(ref it) = _i.from {
1579 _visitor.visit_expr(&**it)
1580 };
1581 _visitor.visit_range_limits(&_i.limits);
1582 if let Some(ref it) = _i.to {
1583 _visitor.visit_expr(&**it)
1584 };
1585}
1586#[cfg(feature = "full")]
1587#[cfg(any(feature = "full", feature = "derive"))]
1588pub fn visit_expr_reference<'ast, V: Visit<'ast> + ?Sized>(
1589 _visitor: &mut V,
1590 _i: &'ast ExprReference,
1591) {
1592 for it in &_i.attrs {
1593 _visitor.visit_attribute(it)
1594 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001595 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001596 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04001597 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001598 };
1599 _visitor.visit_expr(&*_i.expr);
1600}
1601#[cfg(feature = "full")]
1602#[cfg(any(feature = "full", feature = "derive"))]
1603pub fn visit_expr_repeat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprRepeat) {
1604 for it in &_i.attrs {
1605 _visitor.visit_attribute(it)
1606 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001607 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001608 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001609 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001610 _visitor.visit_expr(&*_i.len);
1611}
1612#[cfg(feature = "full")]
1613#[cfg(any(feature = "full", feature = "derive"))]
1614pub fn visit_expr_return<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprReturn) {
1615 for it in &_i.attrs {
1616 _visitor.visit_attribute(it)
1617 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001618 tokens_helper(_visitor, &_i.return_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001619 if let Some(ref it) = _i.expr {
1620 _visitor.visit_expr(&**it)
1621 };
1622}
1623#[cfg(feature = "full")]
1624#[cfg(any(feature = "full", feature = "derive"))]
1625pub fn visit_expr_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprStruct) {
1626 for it in &_i.attrs {
1627 _visitor.visit_attribute(it)
1628 }
1629 _visitor.visit_path(&_i.path);
David Tolnay7ac699c2018-08-24 14:00:58 -04001630 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001631 for el in Punctuated::pairs(&_i.fields) {
1632 let it = el.value();
1633 _visitor.visit_field_value(it)
1634 }
1635 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001636 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001637 };
1638 if let Some(ref it) = _i.rest {
1639 _visitor.visit_expr(&**it)
1640 };
1641}
1642#[cfg(feature = "full")]
1643#[cfg(any(feature = "full", feature = "derive"))]
1644pub fn visit_expr_try<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprTry) {
1645 for it in &_i.attrs {
1646 _visitor.visit_attribute(it)
1647 }
1648 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001649 tokens_helper(_visitor, &_i.question_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001650}
1651#[cfg(feature = "full")]
1652#[cfg(any(feature = "full", feature = "derive"))]
1653pub fn visit_expr_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprTuple) {
1654 for it in &_i.attrs {
1655 _visitor.visit_attribute(it)
1656 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001657 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001658 for el in Punctuated::pairs(&_i.elems) {
1659 let it = el.value();
1660 _visitor.visit_expr(it)
1661 }
1662}
1663#[cfg(feature = "full")]
1664#[cfg(any(feature = "full", feature = "derive"))]
1665pub fn visit_expr_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprType) {
1666 for it in &_i.attrs {
1667 _visitor.visit_attribute(it)
1668 }
1669 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001670 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001671 _visitor.visit_type(&*_i.ty);
1672}
1673#[cfg(any(feature = "full", feature = "derive"))]
1674pub fn visit_expr_unary<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprUnary) {
1675 for it in &_i.attrs {
1676 _visitor.visit_attribute(it)
1677 }
1678 _visitor.visit_un_op(&_i.op);
1679 _visitor.visit_expr(&*_i.expr);
1680}
1681#[cfg(feature = "full")]
1682#[cfg(any(feature = "full", feature = "derive"))]
1683pub fn visit_expr_unsafe<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprUnsafe) {
1684 for it in &_i.attrs {
1685 _visitor.visit_attribute(it)
1686 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001687 tokens_helper(_visitor, &_i.unsafe_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001688 _visitor.visit_block(&_i.block);
1689}
1690#[cfg(any(feature = "full", feature = "derive"))]
1691pub fn visit_expr_verbatim<'ast, V: Visit<'ast> + ?Sized>(
1692 _visitor: &mut V,
1693 _i: &'ast ExprVerbatim,
1694) {
David Tolnay6af48992018-08-01 11:16:28 -07001695 skip!(_i.tts);
David Tolnay8c81f622018-07-31 23:34:35 -07001696}
1697#[cfg(feature = "full")]
1698#[cfg(any(feature = "full", feature = "derive"))]
1699pub fn visit_expr_while<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprWhile) {
1700 for it in &_i.attrs {
1701 _visitor.visit_attribute(it)
1702 }
1703 if let Some(ref it) = _i.label {
1704 _visitor.visit_label(it)
1705 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001706 tokens_helper(_visitor, &_i.while_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001707 _visitor.visit_expr(&*_i.cond);
1708 _visitor.visit_block(&_i.body);
1709}
1710#[cfg(feature = "full")]
1711#[cfg(any(feature = "full", feature = "derive"))]
1712pub fn visit_expr_while_let<'ast, V: Visit<'ast> + ?Sized>(
1713 _visitor: &mut V,
1714 _i: &'ast ExprWhileLet,
1715) {
1716 for it in &_i.attrs {
1717 _visitor.visit_attribute(it)
1718 }
1719 if let Some(ref it) = _i.label {
1720 _visitor.visit_label(it)
1721 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001722 tokens_helper(_visitor, &_i.while_token.span);
1723 tokens_helper(_visitor, &_i.let_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001724 for el in Punctuated::pairs(&_i.pats) {
1725 let it = el.value();
1726 _visitor.visit_pat(it)
1727 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001728 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001729 _visitor.visit_expr(&*_i.expr);
1730 _visitor.visit_block(&_i.body);
1731}
1732#[cfg(feature = "full")]
1733#[cfg(any(feature = "full", feature = "derive"))]
1734pub fn visit_expr_yield<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprYield) {
1735 for it in &_i.attrs {
1736 _visitor.visit_attribute(it)
1737 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001738 tokens_helper(_visitor, &_i.yield_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001739 if let Some(ref it) = _i.expr {
1740 _visitor.visit_expr(&**it)
1741 };
1742}
1743#[cfg(any(feature = "full", feature = "derive"))]
1744pub fn visit_field<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Field) {
1745 for it in &_i.attrs {
1746 _visitor.visit_attribute(it)
1747 }
1748 _visitor.visit_visibility(&_i.vis);
1749 if let Some(ref it) = _i.ident {
1750 _visitor.visit_ident(it)
1751 };
1752 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001753 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001754 };
1755 _visitor.visit_type(&_i.ty);
1756}
1757#[cfg(any(feature = "full", feature = "derive"))]
1758#[cfg(feature = "full")]
1759pub fn visit_field_pat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldPat) {
1760 for it in &_i.attrs {
1761 _visitor.visit_attribute(it)
1762 }
1763 _visitor.visit_member(&_i.member);
1764 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001765 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001766 };
1767 _visitor.visit_pat(&*_i.pat);
1768}
1769#[cfg(any(feature = "full", feature = "derive"))]
1770#[cfg(feature = "full")]
1771pub fn visit_field_value<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldValue) {
1772 for it in &_i.attrs {
1773 _visitor.visit_attribute(it)
1774 }
1775 _visitor.visit_member(&_i.member);
1776 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001777 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001778 };
1779 _visitor.visit_expr(&_i.expr);
1780}
1781#[cfg(any(feature = "full", feature = "derive"))]
1782pub fn visit_fields<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Fields) {
1783 match *_i {
1784 Fields::Named(ref _binding_0) => {
1785 _visitor.visit_fields_named(_binding_0);
1786 }
1787 Fields::Unnamed(ref _binding_0) => {
1788 _visitor.visit_fields_unnamed(_binding_0);
1789 }
1790 Fields::Unit => {}
1791 }
1792}
1793#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001794pub fn visit_fields_named<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldsNamed) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001795 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001796 for el in Punctuated::pairs(&_i.named) {
1797 let it = el.value();
1798 _visitor.visit_field(it)
1799 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001800}
David Tolnay8c81f622018-07-31 23:34:35 -07001801#[cfg(any(feature = "full", feature = "derive"))]
1802pub fn visit_fields_unnamed<'ast, V: Visit<'ast> + ?Sized>(
1803 _visitor: &mut V,
1804 _i: &'ast FieldsUnnamed,
1805) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001806 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001807 for el in Punctuated::pairs(&_i.unnamed) {
1808 let it = el.value();
1809 _visitor.visit_field(it)
1810 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001811}
David Tolnay8c81f622018-07-31 23:34:35 -07001812#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001813pub fn visit_file<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast File) {
David Tolnay6af48992018-08-01 11:16:28 -07001814 skip!(_i.shebang);
David Tolnay8c81f622018-07-31 23:34:35 -07001815 for it in &_i.attrs {
1816 _visitor.visit_attribute(it)
1817 }
1818 for it in &_i.items {
1819 _visitor.visit_item(it)
1820 }
Nika Layzell27726662017-10-24 23:16:35 -04001821}
David Tolnay8c81f622018-07-31 23:34:35 -07001822#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001823pub fn visit_fn_arg<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FnArg) {
Nika Layzell27726662017-10-24 23:16:35 -04001824 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001825 FnArg::SelfRef(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001826 _visitor.visit_arg_self_ref(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001827 }
David Tolnay8c81f622018-07-31 23:34:35 -07001828 FnArg::SelfValue(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001829 _visitor.visit_arg_self(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001830 }
David Tolnay8c81f622018-07-31 23:34:35 -07001831 FnArg::Captured(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001832 _visitor.visit_arg_captured(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001833 }
David Tolnay8c81f622018-07-31 23:34:35 -07001834 FnArg::Inferred(ref _binding_0) => {
David Tolnay80ed55f2017-12-27 22:54:40 -05001835 _visitor.visit_pat(_binding_0);
1836 }
David Tolnay8c81f622018-07-31 23:34:35 -07001837 FnArg::Ignored(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001838 _visitor.visit_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001839 }
1840 }
1841}
David Tolnay8c81f622018-07-31 23:34:35 -07001842#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001843pub fn visit_fn_decl<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FnDecl) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001844 tokens_helper(_visitor, &_i.fn_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001845 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04001846 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001847 for el in Punctuated::pairs(&_i.inputs) {
1848 let it = el.value();
1849 _visitor.visit_fn_arg(it)
1850 }
1851 if let Some(ref it) = _i.variadic {
David Tolnay7ac699c2018-08-24 14:00:58 -04001852 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001853 };
1854 _visitor.visit_return_type(&_i.output);
Nika Layzell27726662017-10-24 23:16:35 -04001855}
David Tolnay8c81f622018-07-31 23:34:35 -07001856#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001857pub fn visit_foreign_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ForeignItem) {
Nika Layzell27726662017-10-24 23:16:35 -04001858 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001859 ForeignItem::Fn(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001860 _visitor.visit_foreign_item_fn(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001861 }
David Tolnay8c81f622018-07-31 23:34:35 -07001862 ForeignItem::Static(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001863 _visitor.visit_foreign_item_static(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001864 }
David Tolnay8c81f622018-07-31 23:34:35 -07001865 ForeignItem::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001866 _visitor.visit_foreign_item_type(_binding_0);
David Tolnay199bcbb2017-11-12 10:33:52 -08001867 }
David Tolnay8c81f622018-07-31 23:34:35 -07001868 ForeignItem::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05001869 _visitor.visit_foreign_item_verbatim(_binding_0);
1870 }
Nika Layzell27726662017-10-24 23:16:35 -04001871 }
1872}
David Tolnay8c81f622018-07-31 23:34:35 -07001873#[cfg(feature = "full")]
1874pub fn visit_foreign_item_fn<'ast, V: Visit<'ast> + ?Sized>(
1875 _visitor: &mut V,
1876 _i: &'ast ForeignItemFn,
1877) {
1878 for it in &_i.attrs {
1879 _visitor.visit_attribute(it)
1880 }
1881 _visitor.visit_visibility(&_i.vis);
1882 _visitor.visit_ident(&_i.ident);
1883 _visitor.visit_fn_decl(&*_i.decl);
David Tolnay7ac699c2018-08-24 14:00:58 -04001884 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay8894f602017-11-11 12:11:04 -08001885}
David Tolnay8c81f622018-07-31 23:34:35 -07001886#[cfg(feature = "full")]
1887pub fn visit_foreign_item_static<'ast, V: Visit<'ast> + ?Sized>(
1888 _visitor: &mut V,
1889 _i: &'ast ForeignItemStatic,
1890) {
1891 for it in &_i.attrs {
1892 _visitor.visit_attribute(it)
1893 }
1894 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04001895 tokens_helper(_visitor, &_i.static_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001896 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04001897 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001898 };
1899 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001900 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001901 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04001902 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001903}
David Tolnay8c81f622018-07-31 23:34:35 -07001904#[cfg(feature = "full")]
1905pub fn visit_foreign_item_type<'ast, V: Visit<'ast> + ?Sized>(
1906 _visitor: &mut V,
1907 _i: &'ast ForeignItemType,
1908) {
1909 for it in &_i.attrs {
1910 _visitor.visit_attribute(it)
1911 }
1912 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04001913 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001914 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001915 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay199bcbb2017-11-12 10:33:52 -08001916}
David Tolnay8c81f622018-07-31 23:34:35 -07001917#[cfg(feature = "full")]
1918pub fn visit_foreign_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
1919 _visitor: &mut V,
1920 _i: &'ast ForeignItemVerbatim,
1921) {
David Tolnay6af48992018-08-01 11:16:28 -07001922 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05001923}
David Tolnay8c81f622018-07-31 23:34:35 -07001924#[cfg(any(feature = "full", feature = "derive"))]
1925pub fn visit_generic_argument<'ast, V: Visit<'ast> + ?Sized>(
1926 _visitor: &mut V,
1927 _i: &'ast GenericArgument,
1928) {
Nika Layzell357885a2017-12-04 15:47:07 -05001929 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001930 GenericArgument::Lifetime(ref _binding_0) => {
David Tolnay4ba63a02017-12-28 15:53:05 -05001931 _visitor.visit_lifetime(_binding_0);
Nika Layzell357885a2017-12-04 15:47:07 -05001932 }
David Tolnay8c81f622018-07-31 23:34:35 -07001933 GenericArgument::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001934 _visitor.visit_type(_binding_0);
Nika Layzell357885a2017-12-04 15:47:07 -05001935 }
David Tolnay8c81f622018-07-31 23:34:35 -07001936 GenericArgument::Binding(ref _binding_0) => {
David Tolnay506e43a2017-12-29 11:34:36 -05001937 _visitor.visit_binding(_binding_0);
Nika Layzell357885a2017-12-04 15:47:07 -05001938 }
David Tolnay8c81f622018-07-31 23:34:35 -07001939 GenericArgument::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001940 _visitor.visit_expr(_binding_0);
Nika Layzellc680e612017-12-04 19:07:20 -05001941 }
Nika Layzell357885a2017-12-04 15:47:07 -05001942 }
1943}
David Tolnay8c81f622018-07-31 23:34:35 -07001944#[cfg(any(feature = "full", feature = "derive"))]
1945#[cfg(feature = "full")]
1946pub fn visit_generic_method_argument<'ast, V: Visit<'ast> + ?Sized>(
1947 _visitor: &mut V,
1948 _i: &'ast GenericMethodArgument,
1949) {
David Tolnayd60cfec2017-12-29 00:21:38 -05001950 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001951 GenericMethodArgument::Type(ref _binding_0) => {
David Tolnayd60cfec2017-12-29 00:21:38 -05001952 _visitor.visit_type(_binding_0);
1953 }
David Tolnay8c81f622018-07-31 23:34:35 -07001954 GenericMethodArgument::Const(ref _binding_0) => {
David Tolnayd60cfec2017-12-29 00:21:38 -05001955 _visitor.visit_expr(_binding_0);
1956 }
1957 }
1958}
David Tolnay8c81f622018-07-31 23:34:35 -07001959#[cfg(any(feature = "full", feature = "derive"))]
1960pub fn visit_generic_param<'ast, V: Visit<'ast> + ?Sized>(
1961 _visitor: &mut V,
1962 _i: &'ast GenericParam,
1963) {
David Tolnayc2f1aba2017-11-12 20:29:22 -08001964 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001965 GenericParam::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001966 _visitor.visit_type_param(_binding_0);
David Tolnayc2f1aba2017-11-12 20:29:22 -08001967 }
David Tolnay8c81f622018-07-31 23:34:35 -07001968 GenericParam::Lifetime(ref _binding_0) => {
David Tolnay517f3692018-01-01 20:17:23 -08001969 _visitor.visit_lifetime_def(_binding_0);
1970 }
David Tolnay8c81f622018-07-31 23:34:35 -07001971 GenericParam::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001972 _visitor.visit_const_param(_binding_0);
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001973 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08001974 }
1975}
David Tolnay8c81f622018-07-31 23:34:35 -07001976#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001977pub fn visit_generics<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Generics) {
David Tolnay8c81f622018-07-31 23:34:35 -07001978 if let Some(ref it) = _i.lt_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001979 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001980 };
1981 for el in Punctuated::pairs(&_i.params) {
1982 let it = el.value();
1983 _visitor.visit_generic_param(it)
1984 }
1985 if let Some(ref it) = _i.gt_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001986 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001987 };
1988 if let Some(ref it) = _i.where_clause {
1989 _visitor.visit_where_clause(it)
1990 };
Nika Layzell27726662017-10-24 23:16:35 -04001991}
David Tolnay8c81f622018-07-31 23:34:35 -07001992pub fn visit_ident<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Ident) {}
1993#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001994pub fn visit_impl_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ImplItem) {
Nika Layzell27726662017-10-24 23:16:35 -04001995 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001996 ImplItem::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001997 _visitor.visit_impl_item_const(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001998 }
David Tolnay8c81f622018-07-31 23:34:35 -07001999 ImplItem::Method(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002000 _visitor.visit_impl_item_method(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002001 }
David Tolnay8c81f622018-07-31 23:34:35 -07002002 ImplItem::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002003 _visitor.visit_impl_item_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002004 }
David Tolnay8c81f622018-07-31 23:34:35 -07002005 ImplItem::Macro(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002006 _visitor.visit_impl_item_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002007 }
David Tolnay8c81f622018-07-31 23:34:35 -07002008 ImplItem::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002009 _visitor.visit_impl_item_verbatim(_binding_0);
2010 }
Nika Layzell27726662017-10-24 23:16:35 -04002011 }
2012}
David Tolnay8c81f622018-07-31 23:34:35 -07002013#[cfg(feature = "full")]
2014pub fn visit_impl_item_const<'ast, V: Visit<'ast> + ?Sized>(
2015 _visitor: &mut V,
2016 _i: &'ast ImplItemConst,
2017) {
2018 for it in &_i.attrs {
2019 _visitor.visit_attribute(it)
2020 }
2021 _visitor.visit_visibility(&_i.vis);
2022 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002023 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002024 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002025 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002026 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002027 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002028 _visitor.visit_type(&_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002029 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002030 _visitor.visit_expr(&_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04002031 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay857628c2017-11-11 12:25:31 -08002032}
David Tolnay8c81f622018-07-31 23:34:35 -07002033#[cfg(feature = "full")]
2034pub fn visit_impl_item_macro<'ast, V: Visit<'ast> + ?Sized>(
2035 _visitor: &mut V,
2036 _i: &'ast ImplItemMacro,
2037) {
2038 for it in &_i.attrs {
2039 _visitor.visit_attribute(it)
2040 }
2041 _visitor.visit_macro(&_i.mac);
2042 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002043 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002044 };
David Tolnay857628c2017-11-11 12:25:31 -08002045}
David Tolnay8c81f622018-07-31 23:34:35 -07002046#[cfg(feature = "full")]
2047pub fn visit_impl_item_method<'ast, V: Visit<'ast> + ?Sized>(
2048 _visitor: &mut V,
2049 _i: &'ast ImplItemMethod,
2050) {
2051 for it in &_i.attrs {
2052 _visitor.visit_attribute(it)
2053 }
2054 _visitor.visit_visibility(&_i.vis);
2055 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002056 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002057 };
2058 _visitor.visit_method_sig(&_i.sig);
2059 _visitor.visit_block(&_i.block);
Nika Layzell27726662017-10-24 23:16:35 -04002060}
David Tolnay8c81f622018-07-31 23:34:35 -07002061#[cfg(feature = "full")]
2062pub fn visit_impl_item_type<'ast, V: Visit<'ast> + ?Sized>(
2063 _visitor: &mut V,
2064 _i: &'ast ImplItemType,
2065) {
2066 for it in &_i.attrs {
2067 _visitor.visit_attribute(it)
2068 }
2069 _visitor.visit_visibility(&_i.vis);
2070 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002071 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002072 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002073 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002074 _visitor.visit_ident(&_i.ident);
2075 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04002076 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002077 _visitor.visit_type(&_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002078 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002079}
David Tolnay8c81f622018-07-31 23:34:35 -07002080#[cfg(feature = "full")]
2081pub fn visit_impl_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
2082 _visitor: &mut V,
2083 _i: &'ast ImplItemVerbatim,
2084) {
David Tolnay6af48992018-08-01 11:16:28 -07002085 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05002086}
David Tolnay8c81f622018-07-31 23:34:35 -07002087#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002088pub fn visit_index<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Index) {
David Tolnay6af48992018-08-01 11:16:28 -07002089 skip!(_i.index);
David Tolnay8c81f622018-07-31 23:34:35 -07002090 _visitor.visit_span(&_i.span);
David Tolnay85b69a42017-12-27 20:43:10 -05002091}
David Tolnay8c81f622018-07-31 23:34:35 -07002092#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002093pub fn visit_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Item) {
Nika Layzell27726662017-10-24 23:16:35 -04002094 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002095 Item::ExternCrate(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002096 _visitor.visit_item_extern_crate(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002097 }
David Tolnay8c81f622018-07-31 23:34:35 -07002098 Item::Use(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002099 _visitor.visit_item_use(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002100 }
David Tolnay8c81f622018-07-31 23:34:35 -07002101 Item::Static(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002102 _visitor.visit_item_static(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002103 }
David Tolnay8c81f622018-07-31 23:34:35 -07002104 Item::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002105 _visitor.visit_item_const(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002106 }
David Tolnay8c81f622018-07-31 23:34:35 -07002107 Item::Fn(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002108 _visitor.visit_item_fn(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002109 }
David Tolnay8c81f622018-07-31 23:34:35 -07002110 Item::Mod(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002111 _visitor.visit_item_mod(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002112 }
David Tolnay8c81f622018-07-31 23:34:35 -07002113 Item::ForeignMod(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002114 _visitor.visit_item_foreign_mod(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002115 }
David Tolnay8c81f622018-07-31 23:34:35 -07002116 Item::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002117 _visitor.visit_item_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002118 }
David Tolnay8c81f622018-07-31 23:34:35 -07002119 Item::Struct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002120 _visitor.visit_item_struct(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002121 }
David Tolnay8c81f622018-07-31 23:34:35 -07002122 Item::Enum(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05002123 _visitor.visit_item_enum(_binding_0);
2124 }
David Tolnay8c81f622018-07-31 23:34:35 -07002125 Item::Union(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002126 _visitor.visit_item_union(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002127 }
David Tolnay8c81f622018-07-31 23:34:35 -07002128 Item::Trait(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002129 _visitor.visit_item_trait(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002130 }
David Tolnay8c81f622018-07-31 23:34:35 -07002131 Item::Impl(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002132 _visitor.visit_item_impl(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002133 }
David Tolnay8c81f622018-07-31 23:34:35 -07002134 Item::Macro(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002135 _visitor.visit_item_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002136 }
David Tolnay8c81f622018-07-31 23:34:35 -07002137 Item::Macro2(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002138 _visitor.visit_item_macro2(_binding_0);
David Tolnay500d8322017-12-18 00:32:51 -08002139 }
David Tolnay8c81f622018-07-31 23:34:35 -07002140 Item::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002141 _visitor.visit_item_verbatim(_binding_0);
2142 }
Nika Layzell27726662017-10-24 23:16:35 -04002143 }
2144}
David Tolnay8c81f622018-07-31 23:34:35 -07002145#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002146pub fn visit_item_const<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemConst) {
David Tolnay8c81f622018-07-31 23:34:35 -07002147 for it in &_i.attrs {
2148 _visitor.visit_attribute(it)
2149 }
2150 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002151 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002152 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002153 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002154 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002155 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002156 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04002157 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnayc6b55bc2017-11-09 22:48:38 -08002158}
David Tolnay8c81f622018-07-31 23:34:35 -07002159#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002160pub fn visit_item_enum<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemEnum) {
David Tolnay8c81f622018-07-31 23:34:35 -07002161 for it in &_i.attrs {
2162 _visitor.visit_attribute(it)
2163 }
2164 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002165 tokens_helper(_visitor, &_i.enum_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002166 _visitor.visit_ident(&_i.ident);
2167 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04002168 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002169 for el in Punctuated::pairs(&_i.variants) {
2170 let it = el.value();
2171 _visitor.visit_variant(it)
2172 }
David Tolnayc6b55bc2017-11-09 22:48:38 -08002173}
David Tolnay8c81f622018-07-31 23:34:35 -07002174#[cfg(feature = "full")]
2175pub fn visit_item_extern_crate<'ast, V: Visit<'ast> + ?Sized>(
2176 _visitor: &mut V,
2177 _i: &'ast ItemExternCrate,
2178) {
2179 for it in &_i.attrs {
2180 _visitor.visit_attribute(it)
2181 }
2182 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002183 tokens_helper(_visitor, &_i.extern_token.span);
2184 tokens_helper(_visitor, &_i.crate_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002185 _visitor.visit_ident(&_i.ident);
2186 if let Some(ref it) = _i.rename {
David Tolnay7ac699c2018-08-24 14:00:58 -04002187 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002188 _visitor.visit_ident(&(it).1);
2189 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002190 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnayc6b55bc2017-11-09 22:48:38 -08002191}
David Tolnay8c81f622018-07-31 23:34:35 -07002192#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002193pub fn visit_item_fn<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemFn) {
David Tolnay8c81f622018-07-31 23:34:35 -07002194 for it in &_i.attrs {
2195 _visitor.visit_attribute(it)
2196 }
2197 _visitor.visit_visibility(&_i.vis);
2198 if let Some(ref it) = _i.constness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002199 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002200 };
2201 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002202 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002203 };
2204 if let Some(ref it) = _i.abi {
2205 _visitor.visit_abi(it)
2206 };
2207 _visitor.visit_ident(&_i.ident);
2208 _visitor.visit_fn_decl(&*_i.decl);
2209 _visitor.visit_block(&*_i.block);
David Tolnayc6b55bc2017-11-09 22:48:38 -08002210}
David Tolnay8c81f622018-07-31 23:34:35 -07002211#[cfg(feature = "full")]
2212pub fn visit_item_foreign_mod<'ast, V: Visit<'ast> + ?Sized>(
2213 _visitor: &mut V,
2214 _i: &'ast ItemForeignMod,
2215) {
2216 for it in &_i.attrs {
2217 _visitor.visit_attribute(it)
2218 }
2219 _visitor.visit_abi(&_i.abi);
David Tolnay7ac699c2018-08-24 14:00:58 -04002220 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002221 for it in &_i.items {
2222 _visitor.visit_foreign_item(it)
2223 }
David Tolnayc6b55bc2017-11-09 22:48:38 -08002224}
David Tolnay8c81f622018-07-31 23:34:35 -07002225#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002226pub fn visit_item_impl<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemImpl) {
David Tolnay8c81f622018-07-31 23:34:35 -07002227 for it in &_i.attrs {
2228 _visitor.visit_attribute(it)
2229 }
2230 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002231 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002232 };
2233 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002234 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002235 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002236 tokens_helper(_visitor, &_i.impl_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002237 _visitor.visit_generics(&_i.generics);
2238 if let Some(ref it) = _i.trait_ {
2239 if let Some(ref it) = (it).0 {
David Tolnay7ac699c2018-08-24 14:00:58 -04002240 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002241 };
2242 _visitor.visit_path(&(it).1);
David Tolnay7ac699c2018-08-24 14:00:58 -04002243 tokens_helper(_visitor, &(it).2.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002244 };
2245 _visitor.visit_type(&*_i.self_ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002246 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002247 for it in &_i.items {
2248 _visitor.visit_impl_item(it)
2249 }
David Tolnayc6b55bc2017-11-09 22:48:38 -08002250}
David Tolnay8c81f622018-07-31 23:34:35 -07002251#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002252pub fn visit_item_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemMacro) {
David Tolnay8c81f622018-07-31 23:34:35 -07002253 for it in &_i.attrs {
2254 _visitor.visit_attribute(it)
2255 }
2256 if let Some(ref it) = _i.ident {
2257 _visitor.visit_ident(it)
2258 };
2259 _visitor.visit_macro(&_i.mac);
2260 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002261 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002262 };
David Tolnayc6b55bc2017-11-09 22:48:38 -08002263}
David Tolnay8c81f622018-07-31 23:34:35 -07002264#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002265pub fn visit_item_macro2<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemMacro2) {
David Tolnay8c81f622018-07-31 23:34:35 -07002266 for it in &_i.attrs {
2267 _visitor.visit_attribute(it)
2268 }
2269 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002270 tokens_helper(_visitor, &_i.macro_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002271 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002272 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay6af48992018-08-01 11:16:28 -07002273 skip!(_i.args);
David Tolnay7ac699c2018-08-24 14:00:58 -04002274 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay6af48992018-08-01 11:16:28 -07002275 skip!(_i.body);
David Tolnay500d8322017-12-18 00:32:51 -08002276}
David Tolnay8c81f622018-07-31 23:34:35 -07002277#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002278pub fn visit_item_mod<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemMod) {
David Tolnay8c81f622018-07-31 23:34:35 -07002279 for it in &_i.attrs {
2280 _visitor.visit_attribute(it)
2281 }
2282 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002283 tokens_helper(_visitor, &_i.mod_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002284 _visitor.visit_ident(&_i.ident);
2285 if let Some(ref it) = _i.content {
David Tolnay7ac699c2018-08-24 14:00:58 -04002286 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002287 for it in &(it).1 {
2288 _visitor.visit_item(it)
2289 }
2290 };
2291 if let Some(ref it) = _i.semi {
David Tolnay7ac699c2018-08-24 14:00:58 -04002292 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002293 };
Nika Layzell27726662017-10-24 23:16:35 -04002294}
David Tolnay8c81f622018-07-31 23:34:35 -07002295#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002296pub fn visit_item_static<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemStatic) {
David Tolnay8c81f622018-07-31 23:34:35 -07002297 for it in &_i.attrs {
2298 _visitor.visit_attribute(it)
2299 }
2300 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002301 tokens_helper(_visitor, &_i.static_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002302 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04002303 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002304 };
2305 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002306 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002307 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002308 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002309 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04002310 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002311}
David Tolnay8c81f622018-07-31 23:34:35 -07002312#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002313pub fn visit_item_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemStruct) {
David Tolnay8c81f622018-07-31 23:34:35 -07002314 for it in &_i.attrs {
2315 _visitor.visit_attribute(it)
2316 }
2317 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002318 tokens_helper(_visitor, &_i.struct_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002319 _visitor.visit_ident(&_i.ident);
2320 _visitor.visit_generics(&_i.generics);
2321 _visitor.visit_fields(&_i.fields);
2322 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002323 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002324 };
Nika Layzell27726662017-10-24 23:16:35 -04002325}
David Tolnay8c81f622018-07-31 23:34:35 -07002326#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002327pub fn visit_item_trait<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemTrait) {
David Tolnay8c81f622018-07-31 23:34:35 -07002328 for it in &_i.attrs {
2329 _visitor.visit_attribute(it)
2330 }
2331 _visitor.visit_visibility(&_i.vis);
2332 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002333 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002334 };
2335 if let Some(ref it) = _i.auto_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002336 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002337 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002338 tokens_helper(_visitor, &_i.trait_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002339 _visitor.visit_ident(&_i.ident);
2340 _visitor.visit_generics(&_i.generics);
2341 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002342 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002343 };
2344 for el in Punctuated::pairs(&_i.supertraits) {
2345 let it = el.value();
2346 _visitor.visit_type_param_bound(it)
2347 }
David Tolnay7ac699c2018-08-24 14:00:58 -04002348 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002349 for it in &_i.items {
2350 _visitor.visit_trait_item(it)
2351 }
Nika Layzell27726662017-10-24 23:16:35 -04002352}
David Tolnay8c81f622018-07-31 23:34:35 -07002353#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002354pub fn visit_item_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemType) {
David Tolnay8c81f622018-07-31 23:34:35 -07002355 for it in &_i.attrs {
2356 _visitor.visit_attribute(it)
2357 }
2358 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002359 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002360 _visitor.visit_ident(&_i.ident);
2361 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04002362 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002363 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002364 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002365}
David Tolnay8c81f622018-07-31 23:34:35 -07002366#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002367pub fn visit_item_union<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemUnion) {
David Tolnay8c81f622018-07-31 23:34:35 -07002368 for it in &_i.attrs {
2369 _visitor.visit_attribute(it)
2370 }
2371 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002372 tokens_helper(_visitor, &_i.union_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002373 _visitor.visit_ident(&_i.ident);
2374 _visitor.visit_generics(&_i.generics);
2375 _visitor.visit_fields_named(&_i.fields);
Nika Layzell27726662017-10-24 23:16:35 -04002376}
David Tolnay8c81f622018-07-31 23:34:35 -07002377#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002378pub fn visit_item_use<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemUse) {
David Tolnay8c81f622018-07-31 23:34:35 -07002379 for it in &_i.attrs {
2380 _visitor.visit_attribute(it)
2381 }
2382 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002383 tokens_helper(_visitor, &_i.use_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002384 if let Some(ref it) = _i.leading_colon {
David Tolnay7ac699c2018-08-24 14:00:58 -04002385 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002386 };
2387 _visitor.visit_use_tree(&_i.tree);
David Tolnay7ac699c2018-08-24 14:00:58 -04002388 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002389}
David Tolnay8c81f622018-07-31 23:34:35 -07002390#[cfg(feature = "full")]
2391pub fn visit_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
2392 _visitor: &mut V,
2393 _i: &'ast ItemVerbatim,
2394) {
David Tolnay6af48992018-08-01 11:16:28 -07002395 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05002396}
David Tolnay8c81f622018-07-31 23:34:35 -07002397#[cfg(any(feature = "full", feature = "derive"))]
2398#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002399pub fn visit_label<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Label) {
David Tolnay8c81f622018-07-31 23:34:35 -07002400 _visitor.visit_lifetime(&_i.name);
David Tolnay7ac699c2018-08-24 14:00:58 -04002401 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnaybcd498f2017-12-29 12:02:33 -05002402}
David Tolnay8c81f622018-07-31 23:34:35 -07002403#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002404pub fn visit_lifetime<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Lifetime) {
David Tolnay6af48992018-08-01 11:16:28 -07002405 skip!(_i.apostrophe);
David Tolnay8c81f622018-07-31 23:34:35 -07002406 _visitor.visit_ident(&_i.ident);
David Tolnay4ba63a02017-12-28 15:53:05 -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_def<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LifetimeDef) {
David Tolnay8c81f622018-07-31 23:34:35 -07002410 for it in &_i.attrs {
2411 _visitor.visit_attribute(it)
2412 }
2413 _visitor.visit_lifetime(&_i.lifetime);
2414 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002415 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002416 };
2417 for el in Punctuated::pairs(&_i.bounds) {
2418 let it = el.value();
2419 _visitor.visit_lifetime(it)
2420 }
David Tolnay4ba63a02017-12-28 15:53:05 -05002421}
David Tolnay8c81f622018-07-31 23:34:35 -07002422#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002423pub fn visit_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Lit) {
David Tolnay360efd22018-01-04 23:35:26 -08002424 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002425 Lit::Str(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002426 _visitor.visit_lit_str(_binding_0);
2427 }
David Tolnay8c81f622018-07-31 23:34:35 -07002428 Lit::ByteStr(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002429 _visitor.visit_lit_byte_str(_binding_0);
2430 }
David Tolnay8c81f622018-07-31 23:34:35 -07002431 Lit::Byte(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002432 _visitor.visit_lit_byte(_binding_0);
2433 }
David Tolnay8c81f622018-07-31 23:34:35 -07002434 Lit::Char(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002435 _visitor.visit_lit_char(_binding_0);
2436 }
David Tolnay8c81f622018-07-31 23:34:35 -07002437 Lit::Int(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002438 _visitor.visit_lit_int(_binding_0);
2439 }
David Tolnay8c81f622018-07-31 23:34:35 -07002440 Lit::Float(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002441 _visitor.visit_lit_float(_binding_0);
2442 }
David Tolnay8c81f622018-07-31 23:34:35 -07002443 Lit::Bool(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002444 _visitor.visit_lit_bool(_binding_0);
2445 }
David Tolnay8c81f622018-07-31 23:34:35 -07002446 Lit::Verbatim(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002447 _visitor.visit_lit_verbatim(_binding_0);
2448 }
2449 }
2450}
David Tolnay8c81f622018-07-31 23:34:35 -07002451#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002452pub fn visit_lit_bool<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitBool) {
David Tolnay6af48992018-08-01 11:16:28 -07002453 skip!(_i.value);
David Tolnay8c81f622018-07-31 23:34:35 -07002454 _visitor.visit_span(&_i.span);
Nika Layzell27726662017-10-24 23:16:35 -04002455}
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_byte<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitByte) {
David Tolnay6af48992018-08-01 11:16:28 -07002458 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002459}
David Tolnay8c81f622018-07-31 23:34:35 -07002460#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002461pub fn visit_lit_byte_str<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitByteStr) {
David Tolnay6af48992018-08-01 11:16:28 -07002462 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002463}
David Tolnay8c81f622018-07-31 23:34:35 -07002464#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002465pub fn visit_lit_char<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitChar) {
David Tolnay6af48992018-08-01 11:16:28 -07002466 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002467}
David Tolnay8c81f622018-07-31 23:34:35 -07002468#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002469pub fn visit_lit_float<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitFloat) {
David Tolnay6af48992018-08-01 11:16:28 -07002470 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002471}
David Tolnay8c81f622018-07-31 23:34:35 -07002472#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002473pub fn visit_lit_int<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitInt) {
David Tolnay6af48992018-08-01 11:16:28 -07002474 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002475}
David Tolnay8c81f622018-07-31 23:34:35 -07002476#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002477pub fn visit_lit_str<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitStr) {
David Tolnay6af48992018-08-01 11:16:28 -07002478 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002479}
David Tolnay8c81f622018-07-31 23:34:35 -07002480#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002481pub fn visit_lit_verbatim<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitVerbatim) {
David Tolnay6af48992018-08-01 11:16:28 -07002482 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002483}
David Tolnay8c81f622018-07-31 23:34:35 -07002484#[cfg(any(feature = "full", feature = "derive"))]
2485#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002486pub fn visit_local<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Local) {
David Tolnay8c81f622018-07-31 23:34:35 -07002487 for it in &_i.attrs {
2488 _visitor.visit_attribute(it)
2489 }
David Tolnay7ac699c2018-08-24 14:00:58 -04002490 tokens_helper(_visitor, &_i.let_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002491 for el in Punctuated::pairs(&_i.pats) {
2492 let it = el.value();
2493 _visitor.visit_pat(it)
2494 }
2495 if let Some(ref it) = _i.ty {
David Tolnay7ac699c2018-08-24 14:00:58 -04002496 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002497 _visitor.visit_type(&*(it).1);
2498 };
2499 if let Some(ref it) = _i.init {
David Tolnay7ac699c2018-08-24 14:00:58 -04002500 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002501 _visitor.visit_expr(&*(it).1);
2502 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002503 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002504}
David Tolnay8c81f622018-07-31 23:34:35 -07002505#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002506pub fn visit_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Macro) {
David Tolnay8c81f622018-07-31 23:34:35 -07002507 _visitor.visit_path(&_i.path);
David Tolnay7ac699c2018-08-24 14:00:58 -04002508 tokens_helper(_visitor, &_i.bang_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002509 _visitor.visit_macro_delimiter(&_i.delimiter);
David Tolnay6af48992018-08-01 11:16:28 -07002510 skip!(_i.tts);
David Tolnayab919512017-12-30 23:31:51 -05002511}
David Tolnay8c81f622018-07-31 23:34:35 -07002512#[cfg(any(feature = "full", feature = "derive"))]
2513pub fn visit_macro_delimiter<'ast, V: Visit<'ast> + ?Sized>(
2514 _visitor: &mut V,
2515 _i: &'ast MacroDelimiter,
2516) {
David Tolnayab919512017-12-30 23:31:51 -05002517 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002518 MacroDelimiter::Paren(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002519 tokens_helper(_visitor, &_binding_0.span);
David Tolnayab919512017-12-30 23:31:51 -05002520 }
David Tolnay8c81f622018-07-31 23:34:35 -07002521 MacroDelimiter::Brace(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002522 tokens_helper(_visitor, &_binding_0.span);
David Tolnayab919512017-12-30 23:31:51 -05002523 }
David Tolnay8c81f622018-07-31 23:34:35 -07002524 MacroDelimiter::Bracket(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002525 tokens_helper(_visitor, &_binding_0.span);
David Tolnayab919512017-12-30 23:31:51 -05002526 }
2527 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002528}
David Tolnay8c81f622018-07-31 23:34:35 -07002529#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002530pub fn visit_member<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Member) {
David Tolnay85b69a42017-12-27 20:43:10 -05002531 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002532 Member::Named(ref _binding_0) => {
Alex Crichtond261d092018-05-18 13:47:35 -07002533 _visitor.visit_ident(_binding_0);
David Tolnay85b69a42017-12-27 20:43:10 -05002534 }
David Tolnay8c81f622018-07-31 23:34:35 -07002535 Member::Unnamed(ref _binding_0) => {
David Tolnay85b69a42017-12-27 20:43:10 -05002536 _visitor.visit_index(_binding_0);
2537 }
2538 }
2539}
David Tolnay8c81f622018-07-31 23:34:35 -07002540#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayaaadd782018-01-06 22:58:13 -08002541pub fn visit_meta<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Meta) {
Nika Layzell27726662017-10-24 23:16:35 -04002542 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002543 Meta::Word(ref _binding_0) => {
Alex Crichtond261d092018-05-18 13:47:35 -07002544 _visitor.visit_ident(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002545 }
David Tolnay8c81f622018-07-31 23:34:35 -07002546 Meta::List(ref _binding_0) => {
David Tolnayaaadd782018-01-06 22:58:13 -08002547 _visitor.visit_meta_list(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002548 }
David Tolnay8c81f622018-07-31 23:34:35 -07002549 Meta::NameValue(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002550 _visitor.visit_meta_name_value(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002551 }
2552 }
2553}
David Tolnay8c81f622018-07-31 23:34:35 -07002554#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayaaadd782018-01-06 22:58:13 -08002555pub fn visit_meta_list<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast MetaList) {
David Tolnay8c81f622018-07-31 23:34:35 -07002556 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002557 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002558 for el in Punctuated::pairs(&_i.nested) {
2559 let it = el.value();
2560 _visitor.visit_nested_meta(it)
2561 }
Nika Layzell27726662017-10-24 23:16:35 -04002562}
David Tolnay8c81f622018-07-31 23:34:35 -07002563#[cfg(any(feature = "full", feature = "derive"))]
2564pub fn visit_meta_name_value<'ast, V: Visit<'ast> + ?Sized>(
2565 _visitor: &mut V,
2566 _i: &'ast MetaNameValue,
2567) {
2568 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002569 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002570 _visitor.visit_lit(&_i.lit);
Nika Layzell27726662017-10-24 23:16:35 -04002571}
David Tolnay8c81f622018-07-31 23:34:35 -07002572#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002573pub fn visit_method_sig<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast MethodSig) {
David Tolnay8c81f622018-07-31 23:34:35 -07002574 if let Some(ref it) = _i.constness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002575 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002576 };
2577 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002578 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002579 };
2580 if let Some(ref it) = _i.abi {
2581 _visitor.visit_abi(it)
2582 };
2583 _visitor.visit_ident(&_i.ident);
2584 _visitor.visit_fn_decl(&_i.decl);
Nika Layzell27726662017-10-24 23:16:35 -04002585}
David Tolnay8c81f622018-07-31 23:34:35 -07002586#[cfg(any(feature = "full", feature = "derive"))]
2587#[cfg(feature = "full")]
2588pub fn visit_method_turbofish<'ast, V: Visit<'ast> + ?Sized>(
2589 _visitor: &mut V,
2590 _i: &'ast MethodTurbofish,
2591) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002592 tokens_helper(_visitor, &_i.colon2_token.spans);
2593 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002594 for el in Punctuated::pairs(&_i.args) {
2595 let it = el.value();
2596 _visitor.visit_generic_method_argument(it)
2597 }
David Tolnay7ac699c2018-08-24 14:00:58 -04002598 tokens_helper(_visitor, &_i.gt_token.spans);
David Tolnayd60cfec2017-12-29 00:21:38 -05002599}
David Tolnay8c81f622018-07-31 23:34:35 -07002600#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayaaadd782018-01-06 22:58:13 -08002601pub fn visit_nested_meta<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast NestedMeta) {
Nika Layzell27726662017-10-24 23:16:35 -04002602 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002603 NestedMeta::Meta(ref _binding_0) => {
David Tolnayaaadd782018-01-06 22:58:13 -08002604 _visitor.visit_meta(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002605 }
David Tolnay8c81f622018-07-31 23:34:35 -07002606 NestedMeta::Literal(ref _binding_0) => {
David Tolnay4ba63a02017-12-28 15:53:05 -05002607 _visitor.visit_lit(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002608 }
2609 }
2610}
David Tolnay8c81f622018-07-31 23:34:35 -07002611#[cfg(any(feature = "full", feature = "derive"))]
2612pub fn visit_parenthesized_generic_arguments<'ast, V: Visit<'ast> + ?Sized>(
2613 _visitor: &mut V,
2614 _i: &'ast ParenthesizedGenericArguments,
2615) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002616 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002617 for el in Punctuated::pairs(&_i.inputs) {
2618 let it = el.value();
2619 _visitor.visit_type(it)
2620 }
2621 _visitor.visit_return_type(&_i.output);
Nika Layzell27726662017-10-24 23:16:35 -04002622}
David Tolnay8c81f622018-07-31 23:34:35 -07002623#[cfg(any(feature = "full", feature = "derive"))]
2624#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002625pub fn visit_pat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Pat) {
Nika Layzell27726662017-10-24 23:16:35 -04002626 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002627 Pat::Wild(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002628 _visitor.visit_pat_wild(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002629 }
David Tolnay8c81f622018-07-31 23:34:35 -07002630 Pat::Ident(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002631 _visitor.visit_pat_ident(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002632 }
David Tolnay8c81f622018-07-31 23:34:35 -07002633 Pat::Struct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002634 _visitor.visit_pat_struct(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002635 }
David Tolnay8c81f622018-07-31 23:34:35 -07002636 Pat::TupleStruct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002637 _visitor.visit_pat_tuple_struct(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002638 }
David Tolnay8c81f622018-07-31 23:34:35 -07002639 Pat::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002640 _visitor.visit_pat_path(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002641 }
David Tolnay8c81f622018-07-31 23:34:35 -07002642 Pat::Tuple(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002643 _visitor.visit_pat_tuple(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002644 }
David Tolnay8c81f622018-07-31 23:34:35 -07002645 Pat::Box(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002646 _visitor.visit_pat_box(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002647 }
David Tolnay8c81f622018-07-31 23:34:35 -07002648 Pat::Ref(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002649 _visitor.visit_pat_ref(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002650 }
David Tolnay8c81f622018-07-31 23:34:35 -07002651 Pat::Lit(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002652 _visitor.visit_pat_lit(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002653 }
David Tolnay8c81f622018-07-31 23:34:35 -07002654 Pat::Range(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002655 _visitor.visit_pat_range(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002656 }
David Tolnay8c81f622018-07-31 23:34:35 -07002657 Pat::Slice(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002658 _visitor.visit_pat_slice(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002659 }
David Tolnay8c81f622018-07-31 23:34:35 -07002660 Pat::Macro(ref _binding_0) => {
David Tolnay323279a2017-12-29 11:26:32 -05002661 _visitor.visit_pat_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002662 }
David Tolnay8c81f622018-07-31 23:34:35 -07002663 Pat::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002664 _visitor.visit_pat_verbatim(_binding_0);
2665 }
Nika Layzell27726662017-10-24 23:16:35 -04002666 }
2667}
David Tolnay8c81f622018-07-31 23:34:35 -07002668#[cfg(any(feature = "full", feature = "derive"))]
2669#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002670pub fn visit_pat_box<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatBox) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002671 tokens_helper(_visitor, &_i.box_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002672 _visitor.visit_pat(&*_i.pat);
Nika Layzell27726662017-10-24 23:16:35 -04002673}
David Tolnay8c81f622018-07-31 23:34:35 -07002674#[cfg(any(feature = "full", feature = "derive"))]
2675#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002676pub fn visit_pat_ident<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatIdent) {
David Tolnay8c81f622018-07-31 23:34:35 -07002677 if let Some(ref it) = _i.by_ref {
David Tolnay7ac699c2018-08-24 14:00:58 -04002678 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002679 };
2680 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04002681 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002682 };
2683 _visitor.visit_ident(&_i.ident);
2684 if let Some(ref it) = _i.subpat {
David Tolnay7ac699c2018-08-24 14:00:58 -04002685 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002686 _visitor.visit_pat(&*(it).1);
2687 };
Nika Layzell27726662017-10-24 23:16:35 -04002688}
David Tolnay8c81f622018-07-31 23:34:35 -07002689#[cfg(any(feature = "full", feature = "derive"))]
2690#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002691pub fn visit_pat_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatLit) {
David Tolnay8c81f622018-07-31 23:34:35 -07002692 _visitor.visit_expr(&*_i.expr);
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_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatMacro) {
David Tolnay8c81f622018-07-31 23:34:35 -07002697 _visitor.visit_macro(&_i.mac);
David Tolnay323279a2017-12-29 11:26:32 -05002698}
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_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatPath) {
David Tolnay8c81f622018-07-31 23:34:35 -07002702 if let Some(ref it) = _i.qself {
2703 _visitor.visit_qself(it)
2704 };
2705 _visitor.visit_path(&_i.path);
Nika Layzell27726662017-10-24 23:16:35 -04002706}
David Tolnay8c81f622018-07-31 23:34:35 -07002707#[cfg(any(feature = "full", feature = "derive"))]
2708#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002709pub fn visit_pat_range<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatRange) {
David Tolnay8c81f622018-07-31 23:34:35 -07002710 _visitor.visit_expr(&*_i.lo);
2711 _visitor.visit_range_limits(&_i.limits);
2712 _visitor.visit_expr(&*_i.hi);
Nika Layzell27726662017-10-24 23:16:35 -04002713}
David Tolnay8c81f622018-07-31 23:34:35 -07002714#[cfg(any(feature = "full", feature = "derive"))]
2715#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002716pub fn visit_pat_ref<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatRef) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002717 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002718 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04002719 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002720 };
2721 _visitor.visit_pat(&*_i.pat);
Nika Layzell27726662017-10-24 23:16:35 -04002722}
David Tolnay8c81f622018-07-31 23:34:35 -07002723#[cfg(any(feature = "full", feature = "derive"))]
2724#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002725pub fn visit_pat_slice<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatSlice) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002726 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002727 for el in Punctuated::pairs(&_i.front) {
2728 let it = el.value();
2729 _visitor.visit_pat(it)
2730 }
2731 if let Some(ref it) = _i.middle {
2732 _visitor.visit_pat(&**it)
2733 };
2734 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002735 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002736 };
2737 if let Some(ref it) = _i.comma_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002738 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002739 };
2740 for el in Punctuated::pairs(&_i.back) {
2741 let it = el.value();
2742 _visitor.visit_pat(it)
2743 }
Nika Layzell27726662017-10-24 23:16:35 -04002744}
David Tolnay8c81f622018-07-31 23:34:35 -07002745#[cfg(any(feature = "full", feature = "derive"))]
2746#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002747pub fn visit_pat_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatStruct) {
David Tolnay8c81f622018-07-31 23:34:35 -07002748 _visitor.visit_path(&_i.path);
David Tolnay7ac699c2018-08-24 14:00:58 -04002749 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002750 for el in Punctuated::pairs(&_i.fields) {
2751 let it = el.value();
2752 _visitor.visit_field_pat(it)
2753 }
2754 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002755 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002756 };
Nika Layzell27726662017-10-24 23:16:35 -04002757}
David Tolnay8c81f622018-07-31 23:34:35 -07002758#[cfg(any(feature = "full", feature = "derive"))]
2759#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002760pub fn visit_pat_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatTuple) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002761 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002762 for el in Punctuated::pairs(&_i.front) {
2763 let it = el.value();
2764 _visitor.visit_pat(it)
2765 }
2766 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002767 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002768 };
2769 if let Some(ref it) = _i.comma_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002770 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002771 };
2772 for el in Punctuated::pairs(&_i.back) {
2773 let it = el.value();
2774 _visitor.visit_pat(it)
2775 }
Nika Layzell27726662017-10-24 23:16:35 -04002776}
David Tolnay8c81f622018-07-31 23:34:35 -07002777#[cfg(any(feature = "full", feature = "derive"))]
2778#[cfg(feature = "full")]
2779pub fn visit_pat_tuple_struct<'ast, V: Visit<'ast> + ?Sized>(
2780 _visitor: &mut V,
2781 _i: &'ast PatTupleStruct,
2782) {
2783 _visitor.visit_path(&_i.path);
2784 _visitor.visit_pat_tuple(&_i.pat);
Nika Layzell27726662017-10-24 23:16:35 -04002785}
David Tolnay8c81f622018-07-31 23:34:35 -07002786#[cfg(any(feature = "full", feature = "derive"))]
2787#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002788pub fn visit_pat_verbatim<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatVerbatim) {
David Tolnay6af48992018-08-01 11:16:28 -07002789 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05002790}
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_wild<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatWild) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002794 tokens_helper(_visitor, &_i.underscore_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002795}
David Tolnay8c81f622018-07-31 23:34:35 -07002796#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002797pub fn visit_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Path) {
David Tolnay8c81f622018-07-31 23:34:35 -07002798 if let Some(ref it) = _i.leading_colon {
David Tolnay7ac699c2018-08-24 14:00:58 -04002799 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002800 };
2801 for el in Punctuated::pairs(&_i.segments) {
2802 let it = el.value();
2803 _visitor.visit_path_segment(it)
2804 }
Nika Layzell27726662017-10-24 23:16:35 -04002805}
David Tolnay8c81f622018-07-31 23:34:35 -07002806#[cfg(any(feature = "full", feature = "derive"))]
2807pub fn visit_path_arguments<'ast, V: Visit<'ast> + ?Sized>(
2808 _visitor: &mut V,
2809 _i: &'ast PathArguments,
2810) {
Nika Layzellc08227a2017-12-04 16:30:17 -05002811 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002812 PathArguments::None => {}
2813 PathArguments::AngleBracketed(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002814 _visitor.visit_angle_bracketed_generic_arguments(_binding_0);
Nika Layzellc08227a2017-12-04 16:30:17 -05002815 }
David Tolnay8c81f622018-07-31 23:34:35 -07002816 PathArguments::Parenthesized(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002817 _visitor.visit_parenthesized_generic_arguments(_binding_0);
Nika Layzellc08227a2017-12-04 16:30:17 -05002818 }
2819 }
2820}
David Tolnay8c81f622018-07-31 23:34:35 -07002821#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002822pub fn visit_path_segment<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PathSegment) {
David Tolnay8c81f622018-07-31 23:34:35 -07002823 _visitor.visit_ident(&_i.ident);
2824 _visitor.visit_path_arguments(&_i.arguments);
Nika Layzell27726662017-10-24 23:16:35 -04002825}
David Tolnay8c81f622018-07-31 23:34:35 -07002826#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002827pub fn visit_predicate_eq<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PredicateEq) {
David Tolnay8c81f622018-07-31 23:34:35 -07002828 _visitor.visit_type(&_i.lhs_ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002829 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002830 _visitor.visit_type(&_i.rhs_ty);
David Tolnayd4add852018-01-01 20:13:24 -08002831}
David Tolnay8c81f622018-07-31 23:34:35 -07002832#[cfg(any(feature = "full", feature = "derive"))]
2833pub fn visit_predicate_lifetime<'ast, V: Visit<'ast> + ?Sized>(
2834 _visitor: &mut V,
2835 _i: &'ast PredicateLifetime,
2836) {
2837 _visitor.visit_lifetime(&_i.lifetime);
2838 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002839 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002840 };
2841 for el in Punctuated::pairs(&_i.bounds) {
2842 let it = el.value();
2843 _visitor.visit_lifetime(it)
2844 }
David Tolnayd4add852018-01-01 20:13:24 -08002845}
David Tolnay8c81f622018-07-31 23:34:35 -07002846#[cfg(any(feature = "full", feature = "derive"))]
2847pub fn visit_predicate_type<'ast, V: Visit<'ast> + ?Sized>(
2848 _visitor: &mut V,
2849 _i: &'ast PredicateType,
2850) {
2851 if let Some(ref it) = _i.lifetimes {
2852 _visitor.visit_bound_lifetimes(it)
2853 };
2854 _visitor.visit_type(&_i.bounded_ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002855 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002856 for el in Punctuated::pairs(&_i.bounds) {
2857 let it = el.value();
2858 _visitor.visit_type_param_bound(it)
2859 }
David Tolnayd4add852018-01-01 20:13:24 -08002860}
David Tolnay8c81f622018-07-31 23:34:35 -07002861#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002862pub fn visit_qself<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast QSelf) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002863 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002864 _visitor.visit_type(&*_i.ty);
David Tolnay6af48992018-08-01 11:16:28 -07002865 skip!(_i.position);
David Tolnay8c81f622018-07-31 23:34:35 -07002866 if let Some(ref it) = _i.as_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002867 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002868 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002869 tokens_helper(_visitor, &_i.gt_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002870}
David Tolnay8c81f622018-07-31 23:34:35 -07002871#[cfg(any(feature = "full", feature = "derive"))]
2872#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002873pub fn visit_range_limits<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast RangeLimits) {
Nika Layzell27726662017-10-24 23:16:35 -04002874 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002875 RangeLimits::HalfOpen(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002876 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002877 }
David Tolnay8c81f622018-07-31 23:34:35 -07002878 RangeLimits::Closed(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002879 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002880 }
2881 }
2882}
David Tolnay8c81f622018-07-31 23:34:35 -07002883#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002884pub fn visit_return_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ReturnType) {
David Tolnayf93b90d2017-11-11 19:21:26 -08002885 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002886 ReturnType::Default => {}
2887 ReturnType::Type(ref _binding_0, ref _binding_1) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002888 tokens_helper(_visitor, &_binding_0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002889 _visitor.visit_type(&**_binding_1);
David Tolnayf93b90d2017-11-11 19:21:26 -08002890 }
2891 }
2892}
David Tolnay8c81f622018-07-31 23:34:35 -07002893pub fn visit_span<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Span) {}
2894#[cfg(any(feature = "full", feature = "derive"))]
2895#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002896pub fn visit_stmt<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Stmt) {
Nika Layzell27726662017-10-24 23:16:35 -04002897 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002898 Stmt::Local(ref _binding_0) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08002899 _visitor.visit_local(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002900 }
David Tolnay8c81f622018-07-31 23:34:35 -07002901 Stmt::Item(ref _binding_0) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08002902 _visitor.visit_item(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002903 }
David Tolnay8c81f622018-07-31 23:34:35 -07002904 Stmt::Expr(ref _binding_0) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08002905 _visitor.visit_expr(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002906 }
David Tolnay8c81f622018-07-31 23:34:35 -07002907 Stmt::Semi(ref _binding_0, ref _binding_1) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08002908 _visitor.visit_expr(_binding_0);
David Tolnay7ac699c2018-08-24 14:00:58 -04002909 tokens_helper(_visitor, &_binding_1.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002910 }
Nika Layzell27726662017-10-24 23:16:35 -04002911 }
2912}
David Tolnay8c81f622018-07-31 23:34:35 -07002913#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002914pub fn visit_trait_bound<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TraitBound) {
David Tolnay8c81f622018-07-31 23:34:35 -07002915 if let Some(ref it) = _i.paren_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002916 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002917 };
2918 _visitor.visit_trait_bound_modifier(&_i.modifier);
2919 if let Some(ref it) = _i.lifetimes {
2920 _visitor.visit_bound_lifetimes(it)
2921 };
2922 _visitor.visit_path(&_i.path);
David Tolnay40fb8ce2018-01-02 10:53:46 -08002923}
David Tolnay8c81f622018-07-31 23:34:35 -07002924#[cfg(any(feature = "full", feature = "derive"))]
2925pub fn visit_trait_bound_modifier<'ast, V: Visit<'ast> + ?Sized>(
2926 _visitor: &mut V,
2927 _i: &'ast TraitBoundModifier,
2928) {
Nika Layzell27726662017-10-24 23:16:35 -04002929 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002930 TraitBoundModifier::None => {}
2931 TraitBoundModifier::Maybe(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002932 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002933 }
2934 }
2935}
David Tolnay8c81f622018-07-31 23:34:35 -07002936#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002937pub fn visit_trait_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TraitItem) {
Nika Layzell27726662017-10-24 23:16:35 -04002938 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002939 TraitItem::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002940 _visitor.visit_trait_item_const(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002941 }
David Tolnay8c81f622018-07-31 23:34:35 -07002942 TraitItem::Method(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002943 _visitor.visit_trait_item_method(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002944 }
David Tolnay8c81f622018-07-31 23:34:35 -07002945 TraitItem::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002946 _visitor.visit_trait_item_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002947 }
David Tolnay8c81f622018-07-31 23:34:35 -07002948 TraitItem::Macro(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002949 _visitor.visit_trait_item_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002950 }
David Tolnay8c81f622018-07-31 23:34:35 -07002951 TraitItem::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002952 _visitor.visit_trait_item_verbatim(_binding_0);
2953 }
Nika Layzell27726662017-10-24 23:16:35 -04002954 }
2955}
David Tolnay8c81f622018-07-31 23:34:35 -07002956#[cfg(feature = "full")]
2957pub fn visit_trait_item_const<'ast, V: Visit<'ast> + ?Sized>(
2958 _visitor: &mut V,
2959 _i: &'ast TraitItemConst,
2960) {
2961 for it in &_i.attrs {
2962 _visitor.visit_attribute(it)
2963 }
David Tolnay7ac699c2018-08-24 14:00:58 -04002964 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002965 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002966 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002967 _visitor.visit_type(&_i.ty);
2968 if let Some(ref it) = _i.default {
David Tolnay7ac699c2018-08-24 14:00:58 -04002969 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002970 _visitor.visit_expr(&(it).1);
2971 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002972 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnayda705bd2017-11-10 21:58:05 -08002973}
David Tolnay8c81f622018-07-31 23:34:35 -07002974#[cfg(feature = "full")]
2975pub fn visit_trait_item_macro<'ast, V: Visit<'ast> + ?Sized>(
2976 _visitor: &mut V,
2977 _i: &'ast TraitItemMacro,
2978) {
2979 for it in &_i.attrs {
2980 _visitor.visit_attribute(it)
2981 }
2982 _visitor.visit_macro(&_i.mac);
2983 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002984 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002985 };
David Tolnayda705bd2017-11-10 21:58:05 -08002986}
David Tolnay8c81f622018-07-31 23:34:35 -07002987#[cfg(feature = "full")]
2988pub fn visit_trait_item_method<'ast, V: Visit<'ast> + ?Sized>(
2989 _visitor: &mut V,
2990 _i: &'ast TraitItemMethod,
2991) {
2992 for it in &_i.attrs {
2993 _visitor.visit_attribute(it)
2994 }
2995 _visitor.visit_method_sig(&_i.sig);
2996 if let Some(ref it) = _i.default {
2997 _visitor.visit_block(it)
2998 };
2999 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003000 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003001 };
Nika Layzell27726662017-10-24 23:16:35 -04003002}
David Tolnay8c81f622018-07-31 23:34:35 -07003003#[cfg(feature = "full")]
3004pub fn visit_trait_item_type<'ast, V: Visit<'ast> + ?Sized>(
3005 _visitor: &mut V,
3006 _i: &'ast TraitItemType,
3007) {
3008 for it in &_i.attrs {
3009 _visitor.visit_attribute(it)
3010 }
David Tolnay7ac699c2018-08-24 14:00:58 -04003011 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003012 _visitor.visit_ident(&_i.ident);
3013 _visitor.visit_generics(&_i.generics);
3014 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003015 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003016 };
3017 for el in Punctuated::pairs(&_i.bounds) {
3018 let it = el.value();
3019 _visitor.visit_type_param_bound(it)
3020 }
3021 if let Some(ref it) = _i.default {
David Tolnay7ac699c2018-08-24 14:00:58 -04003022 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003023 _visitor.visit_type(&(it).1);
3024 };
David Tolnay7ac699c2018-08-24 14:00:58 -04003025 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003026}
David Tolnay8c81f622018-07-31 23:34:35 -07003027#[cfg(feature = "full")]
3028pub fn visit_trait_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
3029 _visitor: &mut V,
3030 _i: &'ast TraitItemVerbatim,
3031) {
David Tolnay6af48992018-08-01 11:16:28 -07003032 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05003033}
David Tolnay8c81f622018-07-31 23:34:35 -07003034#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003035pub fn visit_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Type) {
Nika Layzell27726662017-10-24 23:16:35 -04003036 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003037 Type::Slice(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003038 _visitor.visit_type_slice(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003039 }
David Tolnay8c81f622018-07-31 23:34:35 -07003040 Type::Array(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003041 _visitor.visit_type_array(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003042 }
David Tolnay8c81f622018-07-31 23:34:35 -07003043 Type::Ptr(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003044 _visitor.visit_type_ptr(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003045 }
David Tolnay8c81f622018-07-31 23:34:35 -07003046 Type::Reference(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003047 _visitor.visit_type_reference(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003048 }
David Tolnay8c81f622018-07-31 23:34:35 -07003049 Type::BareFn(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003050 _visitor.visit_type_bare_fn(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003051 }
David Tolnay8c81f622018-07-31 23:34:35 -07003052 Type::Never(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003053 _visitor.visit_type_never(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003054 }
David Tolnay8c81f622018-07-31 23:34:35 -07003055 Type::Tuple(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003056 _visitor.visit_type_tuple(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003057 }
David Tolnay8c81f622018-07-31 23:34:35 -07003058 Type::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003059 _visitor.visit_type_path(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003060 }
David Tolnay8c81f622018-07-31 23:34:35 -07003061 Type::TraitObject(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003062 _visitor.visit_type_trait_object(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003063 }
David Tolnay8c81f622018-07-31 23:34:35 -07003064 Type::ImplTrait(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003065 _visitor.visit_type_impl_trait(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003066 }
David Tolnay8c81f622018-07-31 23:34:35 -07003067 Type::Paren(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003068 _visitor.visit_type_paren(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003069 }
David Tolnay8c81f622018-07-31 23:34:35 -07003070 Type::Group(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003071 _visitor.visit_type_group(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003072 }
David Tolnay8c81f622018-07-31 23:34:35 -07003073 Type::Infer(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003074 _visitor.visit_type_infer(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003075 }
David Tolnay8c81f622018-07-31 23:34:35 -07003076 Type::Macro(ref _binding_0) => {
David Tolnay323279a2017-12-29 11:26:32 -05003077 _visitor.visit_type_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003078 }
David Tolnay8c81f622018-07-31 23:34:35 -07003079 Type::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05003080 _visitor.visit_type_verbatim(_binding_0);
3081 }
Nika Layzell27726662017-10-24 23:16:35 -04003082 }
3083}
David Tolnay8c81f622018-07-31 23:34:35 -07003084#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003085pub fn visit_type_array<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeArray) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003086 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003087 _visitor.visit_type(&*_i.elem);
David Tolnay7ac699c2018-08-24 14:00:58 -04003088 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003089 _visitor.visit_expr(&_i.len);
Nika Layzell27726662017-10-24 23:16:35 -04003090}
David Tolnay8c81f622018-07-31 23:34:35 -07003091#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003092pub fn visit_type_bare_fn<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeBareFn) {
David Tolnay8c81f622018-07-31 23:34:35 -07003093 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04003094 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003095 };
3096 if let Some(ref it) = _i.abi {
3097 _visitor.visit_abi(it)
3098 };
David Tolnay7ac699c2018-08-24 14:00:58 -04003099 tokens_helper(_visitor, &_i.fn_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003100 if let Some(ref it) = _i.lifetimes {
3101 _visitor.visit_bound_lifetimes(it)
3102 };
David Tolnay7ac699c2018-08-24 14:00:58 -04003103 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003104 for el in Punctuated::pairs(&_i.inputs) {
3105 let it = el.value();
3106 _visitor.visit_bare_fn_arg(it)
3107 }
3108 if let Some(ref it) = _i.variadic {
David Tolnay7ac699c2018-08-24 14:00:58 -04003109 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003110 };
3111 _visitor.visit_return_type(&_i.output);
Nika Layzell27726662017-10-24 23:16:35 -04003112}
David Tolnay8c81f622018-07-31 23:34:35 -07003113#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003114pub fn visit_type_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeGroup) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003115 tokens_helper(_visitor, &_i.group_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003116 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003117}
David Tolnay8c81f622018-07-31 23:34:35 -07003118#[cfg(any(feature = "full", feature = "derive"))]
3119pub fn visit_type_impl_trait<'ast, V: Visit<'ast> + ?Sized>(
3120 _visitor: &mut V,
3121 _i: &'ast TypeImplTrait,
3122) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003123 tokens_helper(_visitor, &_i.impl_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003124 for el in Punctuated::pairs(&_i.bounds) {
3125 let it = el.value();
3126 _visitor.visit_type_param_bound(it)
3127 }
Nika Layzell27726662017-10-24 23:16:35 -04003128}
David Tolnay8c81f622018-07-31 23:34:35 -07003129#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003130pub fn visit_type_infer<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeInfer) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003131 tokens_helper(_visitor, &_i.underscore_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003132}
David Tolnay8c81f622018-07-31 23:34:35 -07003133#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003134pub fn visit_type_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeMacro) {
David Tolnay8c81f622018-07-31 23:34:35 -07003135 _visitor.visit_macro(&_i.mac);
David Tolnay323279a2017-12-29 11:26:32 -05003136}
David Tolnay8c81f622018-07-31 23:34:35 -07003137#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003138pub fn visit_type_never<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeNever) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003139 tokens_helper(_visitor, &_i.bang_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003140}
David Tolnay8c81f622018-07-31 23:34:35 -07003141#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003142pub fn visit_type_param<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeParam) {
David Tolnay8c81f622018-07-31 23:34:35 -07003143 for it in &_i.attrs {
3144 _visitor.visit_attribute(it)
3145 }
3146 _visitor.visit_ident(&_i.ident);
3147 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003148 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003149 };
3150 for el in Punctuated::pairs(&_i.bounds) {
3151 let it = el.value();
3152 _visitor.visit_type_param_bound(it)
3153 }
3154 if let Some(ref it) = _i.eq_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003155 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003156 };
3157 if let Some(ref it) = _i.default {
3158 _visitor.visit_type(it)
3159 };
Nika Layzell27726662017-10-24 23:16:35 -04003160}
David Tolnay8c81f622018-07-31 23:34:35 -07003161#[cfg(any(feature = "full", feature = "derive"))]
3162pub fn visit_type_param_bound<'ast, V: Visit<'ast> + ?Sized>(
3163 _visitor: &mut V,
3164 _i: &'ast TypeParamBound,
3165) {
Nika Layzell27726662017-10-24 23:16:35 -04003166 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003167 TypeParamBound::Trait(ref _binding_0) => {
David Tolnay40fb8ce2018-01-02 10:53:46 -08003168 _visitor.visit_trait_bound(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003169 }
David Tolnay8c81f622018-07-31 23:34:35 -07003170 TypeParamBound::Lifetime(ref _binding_0) => {
David Tolnay4ba63a02017-12-28 15:53:05 -05003171 _visitor.visit_lifetime(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003172 }
3173 }
3174}
David Tolnay8c81f622018-07-31 23:34:35 -07003175#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003176pub fn visit_type_paren<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeParen) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003177 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003178 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003179}
David Tolnay8c81f622018-07-31 23:34:35 -07003180#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003181pub fn visit_type_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypePath) {
David Tolnay8c81f622018-07-31 23:34:35 -07003182 if let Some(ref it) = _i.qself {
3183 _visitor.visit_qself(it)
3184 };
3185 _visitor.visit_path(&_i.path);
Nika Layzell27726662017-10-24 23:16:35 -04003186}
David Tolnay8c81f622018-07-31 23:34:35 -07003187#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003188pub fn visit_type_ptr<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypePtr) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003189 tokens_helper(_visitor, &_i.star_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003190 if let Some(ref it) = _i.const_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003191 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003192 };
3193 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04003194 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003195 };
3196 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003197}
David Tolnay8c81f622018-07-31 23:34:35 -07003198#[cfg(any(feature = "full", feature = "derive"))]
3199pub fn visit_type_reference<'ast, V: Visit<'ast> + ?Sized>(
3200 _visitor: &mut V,
3201 _i: &'ast TypeReference,
3202) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003203 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003204 if let Some(ref it) = _i.lifetime {
3205 _visitor.visit_lifetime(it)
3206 };
3207 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04003208 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003209 };
3210 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003211}
David Tolnay8c81f622018-07-31 23:34:35 -07003212#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003213pub fn visit_type_slice<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeSlice) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003214 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003215 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003216}
David Tolnay8c81f622018-07-31 23:34:35 -07003217#[cfg(any(feature = "full", feature = "derive"))]
3218pub fn visit_type_trait_object<'ast, V: Visit<'ast> + ?Sized>(
3219 _visitor: &mut V,
3220 _i: &'ast TypeTraitObject,
3221) {
3222 if let Some(ref it) = _i.dyn_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003223 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003224 };
3225 for el in Punctuated::pairs(&_i.bounds) {
3226 let it = el.value();
3227 _visitor.visit_type_param_bound(it)
3228 }
Nika Layzell27726662017-10-24 23:16:35 -04003229}
David Tolnay8c81f622018-07-31 23:34:35 -07003230#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003231pub fn visit_type_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeTuple) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003232 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003233 for el in Punctuated::pairs(&_i.elems) {
3234 let it = el.value();
3235 _visitor.visit_type(it)
3236 }
Nika Layzell27726662017-10-24 23:16:35 -04003237}
David Tolnay8c81f622018-07-31 23:34:35 -07003238#[cfg(any(feature = "full", feature = "derive"))]
3239pub fn visit_type_verbatim<'ast, V: Visit<'ast> + ?Sized>(
3240 _visitor: &mut V,
3241 _i: &'ast TypeVerbatim,
3242) {
David Tolnay6af48992018-08-01 11:16:28 -07003243 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05003244}
David Tolnay8c81f622018-07-31 23:34:35 -07003245#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003246pub fn visit_un_op<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UnOp) {
Nika Layzell27726662017-10-24 23:16:35 -04003247 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003248 UnOp::Deref(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003249 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003250 }
David Tolnay8c81f622018-07-31 23:34:35 -07003251 UnOp::Not(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003252 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003253 }
David Tolnay8c81f622018-07-31 23:34:35 -07003254 UnOp::Neg(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003255 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003256 }
3257 }
3258}
David Tolnay8c81f622018-07-31 23:34:35 -07003259#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003260pub fn visit_use_glob<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseGlob) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003261 tokens_helper(_visitor, &_i.star_token.spans);
David Tolnay5f332a92017-12-26 00:42:45 -05003262}
David Tolnay8c81f622018-07-31 23:34:35 -07003263#[cfg(feature = "full")]
David Tolnayd97a7d22018-03-31 19:17:01 +02003264pub fn visit_use_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseGroup) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003265 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003266 for el in Punctuated::pairs(&_i.items) {
3267 let it = el.value();
3268 _visitor.visit_use_tree(it)
3269 }
David Tolnay5f332a92017-12-26 00:42:45 -05003270}
David Tolnay8c81f622018-07-31 23:34:35 -07003271#[cfg(feature = "full")]
David Tolnayd97a7d22018-03-31 19:17:01 +02003272pub fn visit_use_name<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseName) {
David Tolnay8c81f622018-07-31 23:34:35 -07003273 _visitor.visit_ident(&_i.ident);
David Tolnayd97a7d22018-03-31 19:17:01 +02003274}
David Tolnay8c81f622018-07-31 23:34:35 -07003275#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003276pub fn visit_use_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UsePath) {
David Tolnay8c81f622018-07-31 23:34:35 -07003277 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04003278 tokens_helper(_visitor, &_i.colon2_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003279 _visitor.visit_use_tree(&*_i.tree);
David Tolnayd97a7d22018-03-31 19:17:01 +02003280}
David Tolnay8c81f622018-07-31 23:34:35 -07003281#[cfg(feature = "full")]
David Tolnayd97a7d22018-03-31 19:17:01 +02003282pub fn visit_use_rename<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseRename) {
David Tolnay8c81f622018-07-31 23:34:35 -07003283 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04003284 tokens_helper(_visitor, &_i.as_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003285 _visitor.visit_ident(&_i.rename);
David Tolnay5f332a92017-12-26 00:42:45 -05003286}
David Tolnay8c81f622018-07-31 23:34:35 -07003287#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003288pub fn visit_use_tree<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseTree) {
David Tolnay5f332a92017-12-26 00:42:45 -05003289 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003290 UseTree::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003291 _visitor.visit_use_path(_binding_0);
David Tolnay5f332a92017-12-26 00:42:45 -05003292 }
David Tolnay8c81f622018-07-31 23:34:35 -07003293 UseTree::Name(ref _binding_0) => {
David Tolnayd97a7d22018-03-31 19:17:01 +02003294 _visitor.visit_use_name(_binding_0);
3295 }
David Tolnay8c81f622018-07-31 23:34:35 -07003296 UseTree::Rename(ref _binding_0) => {
David Tolnayd97a7d22018-03-31 19:17:01 +02003297 _visitor.visit_use_rename(_binding_0);
3298 }
David Tolnay8c81f622018-07-31 23:34:35 -07003299 UseTree::Glob(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003300 _visitor.visit_use_glob(_binding_0);
David Tolnay5f332a92017-12-26 00:42:45 -05003301 }
David Tolnay8c81f622018-07-31 23:34:35 -07003302 UseTree::Group(ref _binding_0) => {
David Tolnayd97a7d22018-03-31 19:17:01 +02003303 _visitor.visit_use_group(_binding_0);
David Tolnay5f332a92017-12-26 00:42:45 -05003304 }
3305 }
3306}
David Tolnay8c81f622018-07-31 23:34:35 -07003307#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003308pub fn visit_variant<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Variant) {
David Tolnay8c81f622018-07-31 23:34:35 -07003309 for it in &_i.attrs {
3310 _visitor.visit_attribute(it)
3311 }
3312 _visitor.visit_ident(&_i.ident);
3313 _visitor.visit_fields(&_i.fields);
3314 if let Some(ref it) = _i.discriminant {
David Tolnay7ac699c2018-08-24 14:00:58 -04003315 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003316 _visitor.visit_expr(&(it).1);
3317 };
Nika Layzell27726662017-10-24 23:16:35 -04003318}
David Tolnay8c81f622018-07-31 23:34:35 -07003319#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003320pub fn visit_vis_crate<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast VisCrate) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003321 tokens_helper(_visitor, &_i.crate_token.span);
Nika Layzell27726662017-10-24 23:16:35 -04003322}
David Tolnay8c81f622018-07-31 23:34:35 -07003323#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003324pub fn visit_vis_public<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast VisPublic) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003325 tokens_helper(_visitor, &_i.pub_token.span);
Nika Layzell27726662017-10-24 23:16:35 -04003326}
David Tolnay8c81f622018-07-31 23:34:35 -07003327#[cfg(any(feature = "full", feature = "derive"))]
3328pub fn visit_vis_restricted<'ast, V: Visit<'ast> + ?Sized>(
3329 _visitor: &mut V,
3330 _i: &'ast VisRestricted,
3331) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003332 tokens_helper(_visitor, &_i.pub_token.span);
3333 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003334 if let Some(ref it) = _i.in_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003335 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003336 };
3337 _visitor.visit_path(&*_i.path);
Nika Layzell27726662017-10-24 23:16:35 -04003338}
David Tolnay8c81f622018-07-31 23:34:35 -07003339#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003340pub fn visit_visibility<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Visibility) {
Nika Layzell27726662017-10-24 23:16:35 -04003341 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003342 Visibility::Public(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003343 _visitor.visit_vis_public(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003344 }
David Tolnay8c81f622018-07-31 23:34:35 -07003345 Visibility::Crate(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003346 _visitor.visit_vis_crate(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003347 }
David Tolnay8c81f622018-07-31 23:34:35 -07003348 Visibility::Restricted(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003349 _visitor.visit_vis_restricted(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003350 }
David Tolnay8c81f622018-07-31 23:34:35 -07003351 Visibility::Inherited => {}
Nika Layzell27726662017-10-24 23:16:35 -04003352 }
3353}
David Tolnay8c81f622018-07-31 23:34:35 -07003354#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003355pub fn visit_where_clause<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast WhereClause) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003356 tokens_helper(_visitor, &_i.where_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003357 for el in Punctuated::pairs(&_i.predicates) {
3358 let it = el.value();
3359 _visitor.visit_where_predicate(it)
3360 }
Nika Layzell27726662017-10-24 23:16:35 -04003361}
David Tolnay8c81f622018-07-31 23:34:35 -07003362#[cfg(any(feature = "full", feature = "derive"))]
3363pub fn visit_where_predicate<'ast, V: Visit<'ast> + ?Sized>(
3364 _visitor: &mut V,
3365 _i: &'ast WherePredicate,
3366) {
Nika Layzell27726662017-10-24 23:16:35 -04003367 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003368 WherePredicate::Type(ref _binding_0) => {
David Tolnayd4add852018-01-01 20:13:24 -08003369 _visitor.visit_predicate_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003370 }
David Tolnay8c81f622018-07-31 23:34:35 -07003371 WherePredicate::Lifetime(ref _binding_0) => {
David Tolnayd4add852018-01-01 20:13:24 -08003372 _visitor.visit_predicate_lifetime(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003373 }
David Tolnay8c81f622018-07-31 23:34:35 -07003374 WherePredicate::Eq(ref _binding_0) => {
David Tolnayd4add852018-01-01 20:13:24 -08003375 _visitor.visit_predicate_eq(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003376 }
3377 }
3378}