blob: 7ef88fd934d8cb508da364dd94f68eff3bdeb49c [file] [log] [blame]
Nika Layzell27726662017-10-24 23:16:35 -04001// THIS FILE IS AUTOMATICALLY GENERATED; DO NOT EDIT
2
David Tolnayf0d63bf2017-12-26 12:29:47 -05003#![cfg_attr(feature = "cargo-clippy", allow(match_same_arms))]
David Tolnay0a0d78c2018-01-05 15:24:01 -08004#[cfg(any(feature = "full", feature = "derive"))]
David Tolnaycc0f0372017-12-28 19:11:04 -05005use gen::helper::visit::*;
David Tolnay8c81f622018-07-31 23:34:35 -07006use proc_macro2::Span;
7#[cfg(any(feature = "full", feature = "derive"))]
8use punctuated::Punctuated;
9use *;
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040010#[cfg(feature = "full")]
11macro_rules! full {
David Tolnay280202f2018-08-02 00:29:54 -070012 ($e:expr) => {
David Tolnay8c81f622018-07-31 23:34:35 -070013 $e
14 };
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040015}
David Tolnay0a0d78c2018-01-05 15:24:01 -080016#[cfg(all(feature = "derive", not(feature = "full")))]
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040017macro_rules! full {
David Tolnay280202f2018-08-02 00:29:54 -070018 ($e:expr) => {
David Tolnay8c81f622018-07-31 23:34:35 -070019 unreachable!()
20 };
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040021}
David Tolnay6af48992018-08-01 11:16:28 -070022#[cfg(any(feature = "full", feature = "derive"))]
23macro_rules! skip {
David Tolnay280202f2018-08-02 00:29:54 -070024 ($($tt:tt)*) => {};
David Tolnay6af48992018-08-01 11:16:28 -070025}
26#[doc = r" Syntax tree traversal to walk a shared borrow of a syntax tree."]
27#[doc = r""]
28#[doc = r" See the [module documentation] for details."]
29#[doc = r""]
30#[doc = r" [module documentation]: index.html"]
31#[doc = r""]
32#[doc = r#" *This trait is available if Syn is built with the `"visit"` feature.*"#]
David Tolnay4b4c4b62018-01-06 13:48:05 -080033pub trait Visit<'ast> {
David Tolnay8c81f622018-07-31 23:34:35 -070034 #[cfg(any(feature = "full", feature = "derive"))]
35 fn visit_abi(&mut self, i: &'ast Abi) {
36 visit_abi(self, i)
37 }
38 #[cfg(any(feature = "full", feature = "derive"))]
39 fn visit_angle_bracketed_generic_arguments(&mut self, i: &'ast AngleBracketedGenericArguments) {
40 visit_angle_bracketed_generic_arguments(self, i)
41 }
42 #[cfg(feature = "full")]
43 fn visit_arg_captured(&mut self, i: &'ast ArgCaptured) {
44 visit_arg_captured(self, i)
45 }
46 #[cfg(feature = "full")]
47 fn visit_arg_self(&mut self, i: &'ast ArgSelf) {
48 visit_arg_self(self, i)
49 }
50 #[cfg(feature = "full")]
51 fn visit_arg_self_ref(&mut self, i: &'ast ArgSelfRef) {
52 visit_arg_self_ref(self, i)
53 }
54 #[cfg(any(feature = "full", feature = "derive"))]
55 #[cfg(feature = "full")]
56 fn visit_arm(&mut self, i: &'ast Arm) {
57 visit_arm(self, i)
58 }
59 #[cfg(any(feature = "full", feature = "derive"))]
60 fn visit_attr_style(&mut self, i: &'ast AttrStyle) {
61 visit_attr_style(self, i)
62 }
63 #[cfg(any(feature = "full", feature = "derive"))]
64 fn visit_attribute(&mut self, i: &'ast Attribute) {
65 visit_attribute(self, i)
66 }
67 #[cfg(any(feature = "full", feature = "derive"))]
68 fn visit_bare_fn_arg(&mut self, i: &'ast BareFnArg) {
69 visit_bare_fn_arg(self, i)
70 }
71 #[cfg(any(feature = "full", feature = "derive"))]
72 fn visit_bare_fn_arg_name(&mut self, i: &'ast BareFnArgName) {
73 visit_bare_fn_arg_name(self, i)
74 }
75 #[cfg(any(feature = "full", feature = "derive"))]
76 fn visit_bin_op(&mut self, i: &'ast BinOp) {
77 visit_bin_op(self, i)
78 }
79 #[cfg(any(feature = "full", feature = "derive"))]
80 fn visit_binding(&mut self, i: &'ast Binding) {
81 visit_binding(self, i)
82 }
83 #[cfg(any(feature = "full", feature = "derive"))]
84 #[cfg(feature = "full")]
85 fn visit_block(&mut self, i: &'ast Block) {
86 visit_block(self, i)
87 }
88 #[cfg(any(feature = "full", feature = "derive"))]
89 fn visit_bound_lifetimes(&mut self, i: &'ast BoundLifetimes) {
90 visit_bound_lifetimes(self, i)
91 }
92 #[cfg(any(feature = "full", feature = "derive"))]
93 fn visit_const_param(&mut self, i: &'ast ConstParam) {
94 visit_const_param(self, i)
95 }
96 #[cfg(feature = "derive")]
97 fn visit_data(&mut self, i: &'ast Data) {
98 visit_data(self, i)
99 }
100 #[cfg(feature = "derive")]
101 fn visit_data_enum(&mut self, i: &'ast DataEnum) {
102 visit_data_enum(self, i)
103 }
104 #[cfg(feature = "derive")]
105 fn visit_data_struct(&mut self, i: &'ast DataStruct) {
106 visit_data_struct(self, i)
107 }
108 #[cfg(feature = "derive")]
109 fn visit_data_union(&mut self, i: &'ast DataUnion) {
110 visit_data_union(self, i)
111 }
112 #[cfg(feature = "derive")]
113 fn visit_derive_input(&mut self, i: &'ast DeriveInput) {
114 visit_derive_input(self, i)
115 }
116 #[cfg(any(feature = "full", feature = "derive"))]
117 fn visit_expr(&mut self, i: &'ast Expr) {
118 visit_expr(self, i)
119 }
120 #[cfg(feature = "full")]
121 #[cfg(any(feature = "full", feature = "derive"))]
122 fn visit_expr_array(&mut self, i: &'ast ExprArray) {
123 visit_expr_array(self, i)
124 }
125 #[cfg(feature = "full")]
126 #[cfg(any(feature = "full", feature = "derive"))]
127 fn visit_expr_assign(&mut self, i: &'ast ExprAssign) {
128 visit_expr_assign(self, i)
129 }
130 #[cfg(feature = "full")]
131 #[cfg(any(feature = "full", feature = "derive"))]
132 fn visit_expr_assign_op(&mut self, i: &'ast ExprAssignOp) {
133 visit_expr_assign_op(self, i)
134 }
David Tolnay02a9c6f2018-08-24 18:58:45 -0400135 #[cfg(feature = "full")]
136 #[cfg(any(feature = "full", feature = "derive"))]
137 fn visit_expr_async(&mut self, i: &'ast ExprAsync) {
138 visit_expr_async(self, i)
139 }
David Tolnay8c81f622018-07-31 23:34:35 -0700140 #[cfg(any(feature = "full", feature = "derive"))]
141 fn visit_expr_binary(&mut self, i: &'ast ExprBinary) {
142 visit_expr_binary(self, i)
143 }
144 #[cfg(feature = "full")]
145 #[cfg(any(feature = "full", feature = "derive"))]
146 fn visit_expr_block(&mut self, i: &'ast ExprBlock) {
147 visit_expr_block(self, i)
148 }
149 #[cfg(feature = "full")]
150 #[cfg(any(feature = "full", feature = "derive"))]
151 fn visit_expr_box(&mut self, i: &'ast ExprBox) {
152 visit_expr_box(self, i)
153 }
154 #[cfg(feature = "full")]
155 #[cfg(any(feature = "full", feature = "derive"))]
156 fn visit_expr_break(&mut self, i: &'ast ExprBreak) {
157 visit_expr_break(self, i)
158 }
159 #[cfg(any(feature = "full", feature = "derive"))]
160 fn visit_expr_call(&mut self, i: &'ast ExprCall) {
161 visit_expr_call(self, i)
162 }
163 #[cfg(any(feature = "full", feature = "derive"))]
164 fn visit_expr_cast(&mut self, i: &'ast ExprCast) {
165 visit_expr_cast(self, i)
166 }
167 #[cfg(feature = "full")]
168 #[cfg(any(feature = "full", feature = "derive"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700169 fn visit_expr_closure(&mut self, i: &'ast ExprClosure) {
170 visit_expr_closure(self, i)
171 }
172 #[cfg(feature = "full")]
173 #[cfg(any(feature = "full", feature = "derive"))]
174 fn visit_expr_continue(&mut self, i: &'ast ExprContinue) {
175 visit_expr_continue(self, i)
176 }
177 #[cfg(any(feature = "full", feature = "derive"))]
178 fn visit_expr_field(&mut self, i: &'ast ExprField) {
179 visit_expr_field(self, i)
180 }
181 #[cfg(feature = "full")]
182 #[cfg(any(feature = "full", feature = "derive"))]
183 fn visit_expr_for_loop(&mut self, i: &'ast ExprForLoop) {
184 visit_expr_for_loop(self, i)
185 }
186 #[cfg(feature = "full")]
187 #[cfg(any(feature = "full", feature = "derive"))]
188 fn visit_expr_group(&mut self, i: &'ast ExprGroup) {
189 visit_expr_group(self, i)
190 }
191 #[cfg(feature = "full")]
192 #[cfg(any(feature = "full", feature = "derive"))]
193 fn visit_expr_if(&mut self, i: &'ast ExprIf) {
194 visit_expr_if(self, i)
195 }
196 #[cfg(feature = "full")]
197 #[cfg(any(feature = "full", feature = "derive"))]
198 fn visit_expr_if_let(&mut self, i: &'ast ExprIfLet) {
199 visit_expr_if_let(self, i)
200 }
201 #[cfg(feature = "full")]
202 #[cfg(any(feature = "full", feature = "derive"))]
203 fn visit_expr_in_place(&mut self, i: &'ast ExprInPlace) {
204 visit_expr_in_place(self, i)
205 }
206 #[cfg(any(feature = "full", feature = "derive"))]
207 fn visit_expr_index(&mut self, i: &'ast ExprIndex) {
208 visit_expr_index(self, i)
209 }
210 #[cfg(any(feature = "full", feature = "derive"))]
211 fn visit_expr_lit(&mut self, i: &'ast ExprLit) {
212 visit_expr_lit(self, i)
213 }
214 #[cfg(feature = "full")]
215 #[cfg(any(feature = "full", feature = "derive"))]
216 fn visit_expr_loop(&mut self, i: &'ast ExprLoop) {
217 visit_expr_loop(self, i)
218 }
219 #[cfg(feature = "full")]
220 #[cfg(any(feature = "full", feature = "derive"))]
221 fn visit_expr_macro(&mut self, i: &'ast ExprMacro) {
222 visit_expr_macro(self, i)
223 }
224 #[cfg(feature = "full")]
225 #[cfg(any(feature = "full", feature = "derive"))]
226 fn visit_expr_match(&mut self, i: &'ast ExprMatch) {
227 visit_expr_match(self, i)
228 }
229 #[cfg(feature = "full")]
230 #[cfg(any(feature = "full", feature = "derive"))]
231 fn visit_expr_method_call(&mut self, i: &'ast ExprMethodCall) {
232 visit_expr_method_call(self, i)
233 }
234 #[cfg(any(feature = "full", feature = "derive"))]
235 fn visit_expr_paren(&mut self, i: &'ast ExprParen) {
236 visit_expr_paren(self, i)
237 }
238 #[cfg(any(feature = "full", feature = "derive"))]
239 fn visit_expr_path(&mut self, i: &'ast ExprPath) {
240 visit_expr_path(self, i)
241 }
242 #[cfg(feature = "full")]
243 #[cfg(any(feature = "full", feature = "derive"))]
244 fn visit_expr_range(&mut self, i: &'ast ExprRange) {
245 visit_expr_range(self, i)
246 }
247 #[cfg(feature = "full")]
248 #[cfg(any(feature = "full", feature = "derive"))]
249 fn visit_expr_reference(&mut self, i: &'ast ExprReference) {
250 visit_expr_reference(self, i)
251 }
252 #[cfg(feature = "full")]
253 #[cfg(any(feature = "full", feature = "derive"))]
254 fn visit_expr_repeat(&mut self, i: &'ast ExprRepeat) {
255 visit_expr_repeat(self, i)
256 }
257 #[cfg(feature = "full")]
258 #[cfg(any(feature = "full", feature = "derive"))]
259 fn visit_expr_return(&mut self, i: &'ast ExprReturn) {
260 visit_expr_return(self, i)
261 }
262 #[cfg(feature = "full")]
263 #[cfg(any(feature = "full", feature = "derive"))]
264 fn visit_expr_struct(&mut self, i: &'ast ExprStruct) {
265 visit_expr_struct(self, i)
266 }
267 #[cfg(feature = "full")]
268 #[cfg(any(feature = "full", feature = "derive"))]
269 fn visit_expr_try(&mut self, i: &'ast ExprTry) {
270 visit_expr_try(self, i)
271 }
272 #[cfg(feature = "full")]
273 #[cfg(any(feature = "full", feature = "derive"))]
David Tolnayfb2dd4b2018-08-24 16:45:34 -0400274 fn visit_expr_try_block(&mut self, i: &'ast ExprTryBlock) {
275 visit_expr_try_block(self, i)
276 }
277 #[cfg(feature = "full")]
278 #[cfg(any(feature = "full", feature = "derive"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700279 fn visit_expr_tuple(&mut self, i: &'ast ExprTuple) {
280 visit_expr_tuple(self, i)
281 }
282 #[cfg(feature = "full")]
283 #[cfg(any(feature = "full", feature = "derive"))]
284 fn visit_expr_type(&mut self, i: &'ast ExprType) {
285 visit_expr_type(self, i)
286 }
287 #[cfg(any(feature = "full", feature = "derive"))]
288 fn visit_expr_unary(&mut self, i: &'ast ExprUnary) {
289 visit_expr_unary(self, i)
290 }
291 #[cfg(feature = "full")]
292 #[cfg(any(feature = "full", feature = "derive"))]
293 fn visit_expr_unsafe(&mut self, i: &'ast ExprUnsafe) {
294 visit_expr_unsafe(self, i)
295 }
296 #[cfg(any(feature = "full", feature = "derive"))]
297 fn visit_expr_verbatim(&mut self, i: &'ast ExprVerbatim) {
298 visit_expr_verbatim(self, i)
299 }
300 #[cfg(feature = "full")]
301 #[cfg(any(feature = "full", feature = "derive"))]
302 fn visit_expr_while(&mut self, i: &'ast ExprWhile) {
303 visit_expr_while(self, i)
304 }
305 #[cfg(feature = "full")]
306 #[cfg(any(feature = "full", feature = "derive"))]
307 fn visit_expr_while_let(&mut self, i: &'ast ExprWhileLet) {
308 visit_expr_while_let(self, i)
309 }
310 #[cfg(feature = "full")]
311 #[cfg(any(feature = "full", feature = "derive"))]
312 fn visit_expr_yield(&mut self, i: &'ast ExprYield) {
313 visit_expr_yield(self, i)
314 }
315 #[cfg(any(feature = "full", feature = "derive"))]
316 fn visit_field(&mut self, i: &'ast Field) {
317 visit_field(self, i)
318 }
319 #[cfg(any(feature = "full", feature = "derive"))]
320 #[cfg(feature = "full")]
321 fn visit_field_pat(&mut self, i: &'ast FieldPat) {
322 visit_field_pat(self, i)
323 }
324 #[cfg(any(feature = "full", feature = "derive"))]
325 #[cfg(feature = "full")]
326 fn visit_field_value(&mut self, i: &'ast FieldValue) {
327 visit_field_value(self, i)
328 }
329 #[cfg(any(feature = "full", feature = "derive"))]
330 fn visit_fields(&mut self, i: &'ast Fields) {
331 visit_fields(self, i)
332 }
333 #[cfg(any(feature = "full", feature = "derive"))]
334 fn visit_fields_named(&mut self, i: &'ast FieldsNamed) {
335 visit_fields_named(self, i)
336 }
337 #[cfg(any(feature = "full", feature = "derive"))]
338 fn visit_fields_unnamed(&mut self, i: &'ast FieldsUnnamed) {
339 visit_fields_unnamed(self, i)
340 }
341 #[cfg(feature = "full")]
342 fn visit_file(&mut self, i: &'ast File) {
343 visit_file(self, i)
344 }
345 #[cfg(feature = "full")]
346 fn visit_fn_arg(&mut self, i: &'ast FnArg) {
347 visit_fn_arg(self, i)
348 }
349 #[cfg(feature = "full")]
350 fn visit_fn_decl(&mut self, i: &'ast FnDecl) {
351 visit_fn_decl(self, i)
352 }
353 #[cfg(feature = "full")]
354 fn visit_foreign_item(&mut self, i: &'ast ForeignItem) {
355 visit_foreign_item(self, i)
356 }
357 #[cfg(feature = "full")]
358 fn visit_foreign_item_fn(&mut self, i: &'ast ForeignItemFn) {
359 visit_foreign_item_fn(self, i)
360 }
361 #[cfg(feature = "full")]
David Tolnay435c1782018-08-24 16:15:44 -0400362 fn visit_foreign_item_macro(&mut self, i: &'ast ForeignItemMacro) {
363 visit_foreign_item_macro(self, i)
364 }
365 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700366 fn visit_foreign_item_static(&mut self, i: &'ast ForeignItemStatic) {
367 visit_foreign_item_static(self, i)
368 }
369 #[cfg(feature = "full")]
370 fn visit_foreign_item_type(&mut self, i: &'ast ForeignItemType) {
371 visit_foreign_item_type(self, i)
372 }
373 #[cfg(feature = "full")]
374 fn visit_foreign_item_verbatim(&mut self, i: &'ast ForeignItemVerbatim) {
375 visit_foreign_item_verbatim(self, i)
376 }
377 #[cfg(any(feature = "full", feature = "derive"))]
378 fn visit_generic_argument(&mut self, i: &'ast GenericArgument) {
379 visit_generic_argument(self, i)
380 }
381 #[cfg(any(feature = "full", feature = "derive"))]
382 #[cfg(feature = "full")]
383 fn visit_generic_method_argument(&mut self, i: &'ast GenericMethodArgument) {
384 visit_generic_method_argument(self, i)
385 }
386 #[cfg(any(feature = "full", feature = "derive"))]
387 fn visit_generic_param(&mut self, i: &'ast GenericParam) {
388 visit_generic_param(self, i)
389 }
390 #[cfg(any(feature = "full", feature = "derive"))]
391 fn visit_generics(&mut self, i: &'ast Generics) {
392 visit_generics(self, i)
393 }
David Tolnay8c81f622018-07-31 23:34:35 -0700394 fn visit_ident(&mut self, i: &'ast Ident) {
395 visit_ident(self, i)
396 }
397 #[cfg(feature = "full")]
398 fn visit_impl_item(&mut self, i: &'ast ImplItem) {
399 visit_impl_item(self, i)
400 }
401 #[cfg(feature = "full")]
402 fn visit_impl_item_const(&mut self, i: &'ast ImplItemConst) {
403 visit_impl_item_const(self, i)
404 }
405 #[cfg(feature = "full")]
David Tolnaybb82ef02018-08-24 20:15:45 -0400406 fn visit_impl_item_existential(&mut self, i: &'ast ImplItemExistential) {
407 visit_impl_item_existential(self, i)
408 }
409 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700410 fn visit_impl_item_macro(&mut self, i: &'ast ImplItemMacro) {
411 visit_impl_item_macro(self, i)
412 }
413 #[cfg(feature = "full")]
414 fn visit_impl_item_method(&mut self, i: &'ast ImplItemMethod) {
415 visit_impl_item_method(self, i)
416 }
417 #[cfg(feature = "full")]
418 fn visit_impl_item_type(&mut self, i: &'ast ImplItemType) {
419 visit_impl_item_type(self, i)
420 }
421 #[cfg(feature = "full")]
422 fn visit_impl_item_verbatim(&mut self, i: &'ast ImplItemVerbatim) {
423 visit_impl_item_verbatim(self, i)
424 }
425 #[cfg(any(feature = "full", feature = "derive"))]
426 fn visit_index(&mut self, i: &'ast Index) {
427 visit_index(self, i)
428 }
429 #[cfg(feature = "full")]
430 fn visit_item(&mut self, i: &'ast Item) {
431 visit_item(self, i)
432 }
433 #[cfg(feature = "full")]
434 fn visit_item_const(&mut self, i: &'ast ItemConst) {
435 visit_item_const(self, i)
436 }
437 #[cfg(feature = "full")]
438 fn visit_item_enum(&mut self, i: &'ast ItemEnum) {
439 visit_item_enum(self, i)
440 }
441 #[cfg(feature = "full")]
David Tolnaybb82ef02018-08-24 20:15:45 -0400442 fn visit_item_existential(&mut self, i: &'ast ItemExistential) {
443 visit_item_existential(self, i)
444 }
445 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700446 fn visit_item_extern_crate(&mut self, i: &'ast ItemExternCrate) {
447 visit_item_extern_crate(self, i)
448 }
449 #[cfg(feature = "full")]
450 fn visit_item_fn(&mut self, i: &'ast ItemFn) {
451 visit_item_fn(self, i)
452 }
453 #[cfg(feature = "full")]
454 fn visit_item_foreign_mod(&mut self, i: &'ast ItemForeignMod) {
455 visit_item_foreign_mod(self, i)
456 }
457 #[cfg(feature = "full")]
458 fn visit_item_impl(&mut self, i: &'ast ItemImpl) {
459 visit_item_impl(self, i)
460 }
461 #[cfg(feature = "full")]
462 fn visit_item_macro(&mut self, i: &'ast ItemMacro) {
463 visit_item_macro(self, i)
464 }
465 #[cfg(feature = "full")]
466 fn visit_item_macro2(&mut self, i: &'ast ItemMacro2) {
467 visit_item_macro2(self, i)
468 }
469 #[cfg(feature = "full")]
470 fn visit_item_mod(&mut self, i: &'ast ItemMod) {
471 visit_item_mod(self, i)
472 }
473 #[cfg(feature = "full")]
474 fn visit_item_static(&mut self, i: &'ast ItemStatic) {
475 visit_item_static(self, i)
476 }
477 #[cfg(feature = "full")]
478 fn visit_item_struct(&mut self, i: &'ast ItemStruct) {
479 visit_item_struct(self, i)
480 }
481 #[cfg(feature = "full")]
482 fn visit_item_trait(&mut self, i: &'ast ItemTrait) {
483 visit_item_trait(self, i)
484 }
485 #[cfg(feature = "full")]
David Tolnayc6b04dd2018-08-30 23:22:51 -0700486 fn visit_item_trait_alias(&mut self, i: &'ast ItemTraitAlias) {
487 visit_item_trait_alias(self, i)
488 }
489 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700490 fn visit_item_type(&mut self, i: &'ast ItemType) {
491 visit_item_type(self, i)
492 }
493 #[cfg(feature = "full")]
494 fn visit_item_union(&mut self, i: &'ast ItemUnion) {
495 visit_item_union(self, i)
496 }
497 #[cfg(feature = "full")]
498 fn visit_item_use(&mut self, i: &'ast ItemUse) {
499 visit_item_use(self, i)
500 }
501 #[cfg(feature = "full")]
502 fn visit_item_verbatim(&mut self, i: &'ast ItemVerbatim) {
503 visit_item_verbatim(self, i)
504 }
505 #[cfg(any(feature = "full", feature = "derive"))]
506 #[cfg(feature = "full")]
507 fn visit_label(&mut self, i: &'ast Label) {
508 visit_label(self, i)
509 }
David Tolnay8c81f622018-07-31 23:34:35 -0700510 fn visit_lifetime(&mut self, i: &'ast Lifetime) {
511 visit_lifetime(self, i)
512 }
513 #[cfg(any(feature = "full", feature = "derive"))]
514 fn visit_lifetime_def(&mut self, i: &'ast LifetimeDef) {
515 visit_lifetime_def(self, i)
516 }
517 #[cfg(any(feature = "full", feature = "derive"))]
518 fn visit_lit(&mut self, i: &'ast Lit) {
519 visit_lit(self, i)
520 }
521 #[cfg(any(feature = "full", feature = "derive"))]
522 fn visit_lit_bool(&mut self, i: &'ast LitBool) {
523 visit_lit_bool(self, i)
524 }
525 #[cfg(any(feature = "full", feature = "derive"))]
526 fn visit_lit_byte(&mut self, i: &'ast LitByte) {
527 visit_lit_byte(self, i)
528 }
529 #[cfg(any(feature = "full", feature = "derive"))]
530 fn visit_lit_byte_str(&mut self, i: &'ast LitByteStr) {
531 visit_lit_byte_str(self, i)
532 }
533 #[cfg(any(feature = "full", feature = "derive"))]
534 fn visit_lit_char(&mut self, i: &'ast LitChar) {
535 visit_lit_char(self, i)
536 }
537 #[cfg(any(feature = "full", feature = "derive"))]
538 fn visit_lit_float(&mut self, i: &'ast LitFloat) {
539 visit_lit_float(self, i)
540 }
541 #[cfg(any(feature = "full", feature = "derive"))]
542 fn visit_lit_int(&mut self, i: &'ast LitInt) {
543 visit_lit_int(self, i)
544 }
545 #[cfg(any(feature = "full", feature = "derive"))]
546 fn visit_lit_str(&mut self, i: &'ast LitStr) {
547 visit_lit_str(self, i)
548 }
549 #[cfg(any(feature = "full", feature = "derive"))]
550 fn visit_lit_verbatim(&mut self, i: &'ast LitVerbatim) {
551 visit_lit_verbatim(self, i)
552 }
553 #[cfg(any(feature = "full", feature = "derive"))]
554 #[cfg(feature = "full")]
555 fn visit_local(&mut self, i: &'ast Local) {
556 visit_local(self, i)
557 }
558 #[cfg(any(feature = "full", feature = "derive"))]
559 fn visit_macro(&mut self, i: &'ast Macro) {
560 visit_macro(self, i)
561 }
562 #[cfg(any(feature = "full", feature = "derive"))]
563 fn visit_macro_delimiter(&mut self, i: &'ast MacroDelimiter) {
564 visit_macro_delimiter(self, i)
565 }
566 #[cfg(any(feature = "full", feature = "derive"))]
567 fn visit_member(&mut self, i: &'ast Member) {
568 visit_member(self, i)
569 }
570 #[cfg(any(feature = "full", feature = "derive"))]
571 fn visit_meta(&mut self, i: &'ast Meta) {
572 visit_meta(self, i)
573 }
574 #[cfg(any(feature = "full", feature = "derive"))]
575 fn visit_meta_list(&mut self, i: &'ast MetaList) {
576 visit_meta_list(self, i)
577 }
578 #[cfg(any(feature = "full", feature = "derive"))]
579 fn visit_meta_name_value(&mut self, i: &'ast MetaNameValue) {
580 visit_meta_name_value(self, i)
581 }
582 #[cfg(feature = "full")]
583 fn visit_method_sig(&mut self, i: &'ast MethodSig) {
584 visit_method_sig(self, i)
585 }
586 #[cfg(any(feature = "full", feature = "derive"))]
587 #[cfg(feature = "full")]
588 fn visit_method_turbofish(&mut self, i: &'ast MethodTurbofish) {
589 visit_method_turbofish(self, i)
590 }
591 #[cfg(any(feature = "full", feature = "derive"))]
592 fn visit_nested_meta(&mut self, i: &'ast NestedMeta) {
593 visit_nested_meta(self, i)
594 }
595 #[cfg(any(feature = "full", feature = "derive"))]
596 fn visit_parenthesized_generic_arguments(&mut self, i: &'ast ParenthesizedGenericArguments) {
597 visit_parenthesized_generic_arguments(self, i)
598 }
599 #[cfg(any(feature = "full", feature = "derive"))]
600 #[cfg(feature = "full")]
601 fn visit_pat(&mut self, i: &'ast Pat) {
602 visit_pat(self, i)
603 }
604 #[cfg(any(feature = "full", feature = "derive"))]
605 #[cfg(feature = "full")]
606 fn visit_pat_box(&mut self, i: &'ast PatBox) {
607 visit_pat_box(self, i)
608 }
609 #[cfg(any(feature = "full", feature = "derive"))]
610 #[cfg(feature = "full")]
611 fn visit_pat_ident(&mut self, i: &'ast PatIdent) {
612 visit_pat_ident(self, i)
613 }
614 #[cfg(any(feature = "full", feature = "derive"))]
615 #[cfg(feature = "full")]
616 fn visit_pat_lit(&mut self, i: &'ast PatLit) {
617 visit_pat_lit(self, i)
618 }
619 #[cfg(any(feature = "full", feature = "derive"))]
620 #[cfg(feature = "full")]
621 fn visit_pat_macro(&mut self, i: &'ast PatMacro) {
622 visit_pat_macro(self, i)
623 }
624 #[cfg(any(feature = "full", feature = "derive"))]
625 #[cfg(feature = "full")]
626 fn visit_pat_path(&mut self, i: &'ast PatPath) {
627 visit_pat_path(self, i)
628 }
629 #[cfg(any(feature = "full", feature = "derive"))]
630 #[cfg(feature = "full")]
631 fn visit_pat_range(&mut self, i: &'ast PatRange) {
632 visit_pat_range(self, i)
633 }
634 #[cfg(any(feature = "full", feature = "derive"))]
635 #[cfg(feature = "full")]
636 fn visit_pat_ref(&mut self, i: &'ast PatRef) {
637 visit_pat_ref(self, i)
638 }
639 #[cfg(any(feature = "full", feature = "derive"))]
640 #[cfg(feature = "full")]
641 fn visit_pat_slice(&mut self, i: &'ast PatSlice) {
642 visit_pat_slice(self, i)
643 }
644 #[cfg(any(feature = "full", feature = "derive"))]
645 #[cfg(feature = "full")]
646 fn visit_pat_struct(&mut self, i: &'ast PatStruct) {
647 visit_pat_struct(self, i)
648 }
649 #[cfg(any(feature = "full", feature = "derive"))]
650 #[cfg(feature = "full")]
651 fn visit_pat_tuple(&mut self, i: &'ast PatTuple) {
652 visit_pat_tuple(self, i)
653 }
654 #[cfg(any(feature = "full", feature = "derive"))]
655 #[cfg(feature = "full")]
656 fn visit_pat_tuple_struct(&mut self, i: &'ast PatTupleStruct) {
657 visit_pat_tuple_struct(self, i)
658 }
659 #[cfg(any(feature = "full", feature = "derive"))]
660 #[cfg(feature = "full")]
661 fn visit_pat_verbatim(&mut self, i: &'ast PatVerbatim) {
662 visit_pat_verbatim(self, i)
663 }
664 #[cfg(any(feature = "full", feature = "derive"))]
665 #[cfg(feature = "full")]
666 fn visit_pat_wild(&mut self, i: &'ast PatWild) {
667 visit_pat_wild(self, i)
668 }
669 #[cfg(any(feature = "full", feature = "derive"))]
670 fn visit_path(&mut self, i: &'ast Path) {
671 visit_path(self, i)
672 }
673 #[cfg(any(feature = "full", feature = "derive"))]
674 fn visit_path_arguments(&mut self, i: &'ast PathArguments) {
675 visit_path_arguments(self, i)
676 }
677 #[cfg(any(feature = "full", feature = "derive"))]
678 fn visit_path_segment(&mut self, i: &'ast PathSegment) {
679 visit_path_segment(self, i)
680 }
681 #[cfg(any(feature = "full", feature = "derive"))]
682 fn visit_predicate_eq(&mut self, i: &'ast PredicateEq) {
683 visit_predicate_eq(self, i)
684 }
685 #[cfg(any(feature = "full", feature = "derive"))]
686 fn visit_predicate_lifetime(&mut self, i: &'ast PredicateLifetime) {
687 visit_predicate_lifetime(self, i)
688 }
689 #[cfg(any(feature = "full", feature = "derive"))]
690 fn visit_predicate_type(&mut self, i: &'ast PredicateType) {
691 visit_predicate_type(self, i)
692 }
693 #[cfg(any(feature = "full", feature = "derive"))]
694 fn visit_qself(&mut self, i: &'ast QSelf) {
695 visit_qself(self, i)
696 }
697 #[cfg(any(feature = "full", feature = "derive"))]
698 #[cfg(feature = "full")]
699 fn visit_range_limits(&mut self, i: &'ast RangeLimits) {
700 visit_range_limits(self, i)
701 }
702 #[cfg(any(feature = "full", feature = "derive"))]
703 fn visit_return_type(&mut self, i: &'ast ReturnType) {
704 visit_return_type(self, i)
705 }
David Tolnay8c81f622018-07-31 23:34:35 -0700706 fn visit_span(&mut self, i: &'ast Span) {
707 visit_span(self, i)
708 }
709 #[cfg(any(feature = "full", feature = "derive"))]
710 #[cfg(feature = "full")]
711 fn visit_stmt(&mut self, i: &'ast Stmt) {
712 visit_stmt(self, i)
713 }
714 #[cfg(any(feature = "full", feature = "derive"))]
715 fn visit_trait_bound(&mut self, i: &'ast TraitBound) {
716 visit_trait_bound(self, i)
717 }
718 #[cfg(any(feature = "full", feature = "derive"))]
719 fn visit_trait_bound_modifier(&mut self, i: &'ast TraitBoundModifier) {
720 visit_trait_bound_modifier(self, i)
721 }
722 #[cfg(feature = "full")]
723 fn visit_trait_item(&mut self, i: &'ast TraitItem) {
724 visit_trait_item(self, i)
725 }
726 #[cfg(feature = "full")]
727 fn visit_trait_item_const(&mut self, i: &'ast TraitItemConst) {
728 visit_trait_item_const(self, i)
729 }
730 #[cfg(feature = "full")]
731 fn visit_trait_item_macro(&mut self, i: &'ast TraitItemMacro) {
732 visit_trait_item_macro(self, i)
733 }
734 #[cfg(feature = "full")]
735 fn visit_trait_item_method(&mut self, i: &'ast TraitItemMethod) {
736 visit_trait_item_method(self, i)
737 }
738 #[cfg(feature = "full")]
739 fn visit_trait_item_type(&mut self, i: &'ast TraitItemType) {
740 visit_trait_item_type(self, i)
741 }
742 #[cfg(feature = "full")]
743 fn visit_trait_item_verbatim(&mut self, i: &'ast TraitItemVerbatim) {
744 visit_trait_item_verbatim(self, i)
745 }
746 #[cfg(any(feature = "full", feature = "derive"))]
747 fn visit_type(&mut self, i: &'ast Type) {
748 visit_type(self, i)
749 }
750 #[cfg(any(feature = "full", feature = "derive"))]
751 fn visit_type_array(&mut self, i: &'ast TypeArray) {
752 visit_type_array(self, i)
753 }
754 #[cfg(any(feature = "full", feature = "derive"))]
755 fn visit_type_bare_fn(&mut self, i: &'ast TypeBareFn) {
756 visit_type_bare_fn(self, i)
757 }
758 #[cfg(any(feature = "full", feature = "derive"))]
759 fn visit_type_group(&mut self, i: &'ast TypeGroup) {
760 visit_type_group(self, i)
761 }
762 #[cfg(any(feature = "full", feature = "derive"))]
763 fn visit_type_impl_trait(&mut self, i: &'ast TypeImplTrait) {
764 visit_type_impl_trait(self, i)
765 }
766 #[cfg(any(feature = "full", feature = "derive"))]
767 fn visit_type_infer(&mut self, i: &'ast TypeInfer) {
768 visit_type_infer(self, i)
769 }
770 #[cfg(any(feature = "full", feature = "derive"))]
771 fn visit_type_macro(&mut self, i: &'ast TypeMacro) {
772 visit_type_macro(self, i)
773 }
774 #[cfg(any(feature = "full", feature = "derive"))]
775 fn visit_type_never(&mut self, i: &'ast TypeNever) {
776 visit_type_never(self, i)
777 }
778 #[cfg(any(feature = "full", feature = "derive"))]
779 fn visit_type_param(&mut self, i: &'ast TypeParam) {
780 visit_type_param(self, i)
781 }
782 #[cfg(any(feature = "full", feature = "derive"))]
783 fn visit_type_param_bound(&mut self, i: &'ast TypeParamBound) {
784 visit_type_param_bound(self, i)
785 }
786 #[cfg(any(feature = "full", feature = "derive"))]
787 fn visit_type_paren(&mut self, i: &'ast TypeParen) {
788 visit_type_paren(self, i)
789 }
790 #[cfg(any(feature = "full", feature = "derive"))]
791 fn visit_type_path(&mut self, i: &'ast TypePath) {
792 visit_type_path(self, i)
793 }
794 #[cfg(any(feature = "full", feature = "derive"))]
795 fn visit_type_ptr(&mut self, i: &'ast TypePtr) {
796 visit_type_ptr(self, i)
797 }
798 #[cfg(any(feature = "full", feature = "derive"))]
799 fn visit_type_reference(&mut self, i: &'ast TypeReference) {
800 visit_type_reference(self, i)
801 }
802 #[cfg(any(feature = "full", feature = "derive"))]
803 fn visit_type_slice(&mut self, i: &'ast TypeSlice) {
804 visit_type_slice(self, i)
805 }
806 #[cfg(any(feature = "full", feature = "derive"))]
807 fn visit_type_trait_object(&mut self, i: &'ast TypeTraitObject) {
808 visit_type_trait_object(self, i)
809 }
810 #[cfg(any(feature = "full", feature = "derive"))]
811 fn visit_type_tuple(&mut self, i: &'ast TypeTuple) {
812 visit_type_tuple(self, i)
813 }
814 #[cfg(any(feature = "full", feature = "derive"))]
815 fn visit_type_verbatim(&mut self, i: &'ast TypeVerbatim) {
816 visit_type_verbatim(self, i)
817 }
818 #[cfg(any(feature = "full", feature = "derive"))]
819 fn visit_un_op(&mut self, i: &'ast UnOp) {
820 visit_un_op(self, i)
821 }
822 #[cfg(feature = "full")]
823 fn visit_use_glob(&mut self, i: &'ast UseGlob) {
824 visit_use_glob(self, i)
825 }
826 #[cfg(feature = "full")]
827 fn visit_use_group(&mut self, i: &'ast UseGroup) {
828 visit_use_group(self, i)
829 }
830 #[cfg(feature = "full")]
831 fn visit_use_name(&mut self, i: &'ast UseName) {
832 visit_use_name(self, i)
833 }
834 #[cfg(feature = "full")]
835 fn visit_use_path(&mut self, i: &'ast UsePath) {
836 visit_use_path(self, i)
837 }
838 #[cfg(feature = "full")]
839 fn visit_use_rename(&mut self, i: &'ast UseRename) {
840 visit_use_rename(self, i)
841 }
842 #[cfg(feature = "full")]
843 fn visit_use_tree(&mut self, i: &'ast UseTree) {
844 visit_use_tree(self, i)
845 }
846 #[cfg(any(feature = "full", feature = "derive"))]
847 fn visit_variant(&mut self, i: &'ast Variant) {
848 visit_variant(self, i)
849 }
850 #[cfg(any(feature = "full", feature = "derive"))]
851 fn visit_vis_crate(&mut self, i: &'ast VisCrate) {
852 visit_vis_crate(self, i)
853 }
854 #[cfg(any(feature = "full", feature = "derive"))]
855 fn visit_vis_public(&mut self, i: &'ast VisPublic) {
856 visit_vis_public(self, i)
857 }
858 #[cfg(any(feature = "full", feature = "derive"))]
859 fn visit_vis_restricted(&mut self, i: &'ast VisRestricted) {
860 visit_vis_restricted(self, i)
861 }
862 #[cfg(any(feature = "full", feature = "derive"))]
863 fn visit_visibility(&mut self, i: &'ast Visibility) {
864 visit_visibility(self, i)
865 }
866 #[cfg(any(feature = "full", feature = "derive"))]
867 fn visit_where_clause(&mut self, i: &'ast WhereClause) {
868 visit_where_clause(self, i)
869 }
870 #[cfg(any(feature = "full", feature = "derive"))]
871 fn visit_where_predicate(&mut self, i: &'ast WherePredicate) {
872 visit_where_predicate(self, i)
873 }
Nika Layzell27726662017-10-24 23:16:35 -0400874}
David Tolnay8c81f622018-07-31 23:34:35 -0700875#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800876pub fn visit_abi<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Abi) {
David Tolnay7ac699c2018-08-24 14:00:58 -0400877 tokens_helper(_visitor, &_i.extern_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -0700878 if let Some(ref it) = _i.name {
879 _visitor.visit_lit_str(it)
880 };
Nika Layzell27726662017-10-24 23:16:35 -0400881}
David Tolnay8c81f622018-07-31 23:34:35 -0700882#[cfg(any(feature = "full", feature = "derive"))]
883pub fn visit_angle_bracketed_generic_arguments<'ast, V: Visit<'ast> + ?Sized>(
884 _visitor: &mut V,
885 _i: &'ast AngleBracketedGenericArguments,
886) {
887 if let Some(ref it) = _i.colon2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -0400888 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -0700889 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400890 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700891 for el in Punctuated::pairs(&_i.args) {
892 let it = el.value();
893 _visitor.visit_generic_argument(it)
894 }
David Tolnay7ac699c2018-08-24 14:00:58 -0400895 tokens_helper(_visitor, &_i.gt_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400896}
David Tolnay8c81f622018-07-31 23:34:35 -0700897#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800898pub fn visit_arg_captured<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ArgCaptured) {
David Tolnay8c81f622018-07-31 23:34:35 -0700899 _visitor.visit_pat(&_i.pat);
David Tolnay7ac699c2018-08-24 14:00:58 -0400900 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700901 _visitor.visit_type(&_i.ty);
Nika Layzell27726662017-10-24 23:16:35 -0400902}
David Tolnay8c81f622018-07-31 23:34:35 -0700903#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800904pub fn visit_arg_self<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ArgSelf) {
David Tolnay8c81f622018-07-31 23:34:35 -0700905 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -0400906 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -0700907 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400908 tokens_helper(_visitor, &_i.self_token.span);
Nika Layzell27726662017-10-24 23:16:35 -0400909}
David Tolnay8c81f622018-07-31 23:34:35 -0700910#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800911pub fn visit_arg_self_ref<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ArgSelfRef) {
David Tolnay7ac699c2018-08-24 14:00:58 -0400912 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700913 if let Some(ref it) = _i.lifetime {
914 _visitor.visit_lifetime(it)
915 };
916 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -0400917 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -0700918 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400919 tokens_helper(_visitor, &_i.self_token.span);
Nika Layzell27726662017-10-24 23:16:35 -0400920}
David Tolnay8c81f622018-07-31 23:34:35 -0700921#[cfg(any(feature = "full", feature = "derive"))]
922#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800923pub fn visit_arm<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Arm) {
David Tolnay8c81f622018-07-31 23:34:35 -0700924 for it in &_i.attrs {
925 _visitor.visit_attribute(it)
926 }
927 if let Some(ref it) = _i.leading_vert {
David Tolnay7ac699c2018-08-24 14:00:58 -0400928 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -0700929 };
930 for el in Punctuated::pairs(&_i.pats) {
931 let it = el.value();
932 _visitor.visit_pat(it)
933 }
934 if let Some(ref it) = _i.guard {
David Tolnay7ac699c2018-08-24 14:00:58 -0400935 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -0700936 _visitor.visit_expr(&*(it).1);
937 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400938 tokens_helper(_visitor, &_i.fat_arrow_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700939 _visitor.visit_expr(&*_i.body);
940 if let Some(ref it) = _i.comma {
David Tolnay7ac699c2018-08-24 14:00:58 -0400941 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -0700942 };
Nika Layzell27726662017-10-24 23:16:35 -0400943}
David Tolnay8c81f622018-07-31 23:34:35 -0700944#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800945pub fn visit_attr_style<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast AttrStyle) {
Nika Layzell27726662017-10-24 23:16:35 -0400946 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -0700947 AttrStyle::Outer => {}
948 AttrStyle::Inner(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400949 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400950 }
951 }
952}
David Tolnay8c81f622018-07-31 23:34:35 -0700953#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800954pub fn visit_attribute<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Attribute) {
David Tolnay7ac699c2018-08-24 14:00:58 -0400955 tokens_helper(_visitor, &_i.pound_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700956 _visitor.visit_attr_style(&_i.style);
David Tolnay7ac699c2018-08-24 14:00:58 -0400957 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -0700958 _visitor.visit_path(&_i.path);
David Tolnay6af48992018-08-01 11:16:28 -0700959 skip!(_i.tts);
Nika Layzell27726662017-10-24 23:16:35 -0400960}
David Tolnay8c81f622018-07-31 23:34:35 -0700961#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800962pub fn visit_bare_fn_arg<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast BareFnArg) {
David Tolnay8c81f622018-07-31 23:34:35 -0700963 if let Some(ref it) = _i.name {
964 _visitor.visit_bare_fn_arg_name(&(it).0);
David Tolnay7ac699c2018-08-24 14:00:58 -0400965 tokens_helper(_visitor, &(it).1.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700966 };
967 _visitor.visit_type(&_i.ty);
Nika Layzell27726662017-10-24 23:16:35 -0400968}
David Tolnay8c81f622018-07-31 23:34:35 -0700969#[cfg(any(feature = "full", feature = "derive"))]
970pub fn visit_bare_fn_arg_name<'ast, V: Visit<'ast> + ?Sized>(
971 _visitor: &mut V,
972 _i: &'ast BareFnArgName,
973) {
Nika Layzell27726662017-10-24 23:16:35 -0400974 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -0700975 BareFnArgName::Named(ref _binding_0) => {
Alex Crichtond261d092018-05-18 13:47:35 -0700976 _visitor.visit_ident(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -0400977 }
David Tolnay8c81f622018-07-31 23:34:35 -0700978 BareFnArgName::Wild(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 }
981 }
982}
David Tolnay8c81f622018-07-31 23:34:35 -0700983#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800984pub fn visit_bin_op<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast BinOp) {
Nika Layzell27726662017-10-24 23:16:35 -0400985 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -0700986 BinOp::Add(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400987 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400988 }
David Tolnay8c81f622018-07-31 23:34:35 -0700989 BinOp::Sub(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400990 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400991 }
David Tolnay8c81f622018-07-31 23:34:35 -0700992 BinOp::Mul(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400993 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400994 }
David Tolnay8c81f622018-07-31 23:34:35 -0700995 BinOp::Div(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400996 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400997 }
David Tolnay8c81f622018-07-31 23:34:35 -0700998 BinOp::Rem(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400999 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001000 }
David Tolnay8c81f622018-07-31 23:34:35 -07001001 BinOp::And(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001002 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001003 }
David Tolnay8c81f622018-07-31 23:34:35 -07001004 BinOp::Or(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001005 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001006 }
David Tolnay8c81f622018-07-31 23:34:35 -07001007 BinOp::BitXor(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001008 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001009 }
David Tolnay8c81f622018-07-31 23:34:35 -07001010 BinOp::BitAnd(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001011 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001012 }
David Tolnay8c81f622018-07-31 23:34:35 -07001013 BinOp::BitOr(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001014 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001015 }
David Tolnay8c81f622018-07-31 23:34:35 -07001016 BinOp::Shl(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001017 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001018 }
David Tolnay8c81f622018-07-31 23:34:35 -07001019 BinOp::Shr(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001020 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001021 }
David Tolnay8c81f622018-07-31 23:34:35 -07001022 BinOp::Eq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001023 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001024 }
David Tolnay8c81f622018-07-31 23:34:35 -07001025 BinOp::Lt(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001026 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001027 }
David Tolnay8c81f622018-07-31 23:34:35 -07001028 BinOp::Le(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001029 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001030 }
David Tolnay8c81f622018-07-31 23:34:35 -07001031 BinOp::Ne(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001032 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001033 }
David Tolnay8c81f622018-07-31 23:34:35 -07001034 BinOp::Ge(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001035 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001036 }
David Tolnay8c81f622018-07-31 23:34:35 -07001037 BinOp::Gt(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001038 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001039 }
David Tolnay8c81f622018-07-31 23:34:35 -07001040 BinOp::AddEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001041 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001042 }
David Tolnay8c81f622018-07-31 23:34:35 -07001043 BinOp::SubEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001044 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001045 }
David Tolnay8c81f622018-07-31 23:34:35 -07001046 BinOp::MulEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001047 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001048 }
David Tolnay8c81f622018-07-31 23:34:35 -07001049 BinOp::DivEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001050 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001051 }
David Tolnay8c81f622018-07-31 23:34:35 -07001052 BinOp::RemEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001053 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001054 }
David Tolnay8c81f622018-07-31 23:34:35 -07001055 BinOp::BitXorEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001056 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001057 }
David Tolnay8c81f622018-07-31 23:34:35 -07001058 BinOp::BitAndEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001059 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001060 }
David Tolnay8c81f622018-07-31 23:34:35 -07001061 BinOp::BitOrEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001062 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001063 }
David Tolnay8c81f622018-07-31 23:34:35 -07001064 BinOp::ShlEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001065 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001066 }
David Tolnay8c81f622018-07-31 23:34:35 -07001067 BinOp::ShrEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001068 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001069 }
1070 }
1071}
David Tolnay8c81f622018-07-31 23:34:35 -07001072#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001073pub fn visit_binding<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Binding) {
David Tolnay8c81f622018-07-31 23:34:35 -07001074 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001075 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001076 _visitor.visit_type(&_i.ty);
David Tolnay506e43a2017-12-29 11:34:36 -05001077}
David Tolnay8c81f622018-07-31 23:34:35 -07001078#[cfg(any(feature = "full", feature = "derive"))]
1079#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001080pub fn visit_block<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Block) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001081 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001082 for it in &_i.stmts {
1083 _visitor.visit_stmt(it)
1084 }
Nika Layzell27726662017-10-24 23:16:35 -04001085}
David Tolnay8c81f622018-07-31 23:34:35 -07001086#[cfg(any(feature = "full", feature = "derive"))]
1087pub fn visit_bound_lifetimes<'ast, V: Visit<'ast> + ?Sized>(
1088 _visitor: &mut V,
1089 _i: &'ast BoundLifetimes,
1090) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001091 tokens_helper(_visitor, &_i.for_token.span);
1092 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001093 for el in Punctuated::pairs(&_i.lifetimes) {
1094 let it = el.value();
1095 _visitor.visit_lifetime_def(it)
1096 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001097 tokens_helper(_visitor, &_i.gt_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001098}
David Tolnay8c81f622018-07-31 23:34:35 -07001099#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001100pub fn visit_const_param<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ConstParam) {
David Tolnay8c81f622018-07-31 23:34:35 -07001101 for it in &_i.attrs {
1102 _visitor.visit_attribute(it)
1103 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001104 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001105 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001106 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001107 _visitor.visit_type(&_i.ty);
1108 if let Some(ref it) = _i.eq_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001109 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001110 };
1111 if let Some(ref it) = _i.default {
1112 _visitor.visit_expr(it)
1113 };
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001114}
David Tolnay8c81f622018-07-31 23:34:35 -07001115#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001116pub fn visit_data<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Data) {
David Tolnaye3d41b72017-12-31 15:24:00 -05001117 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001118 Data::Struct(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05001119 _visitor.visit_data_struct(_binding_0);
1120 }
David Tolnay8c81f622018-07-31 23:34:35 -07001121 Data::Enum(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05001122 _visitor.visit_data_enum(_binding_0);
1123 }
David Tolnay8c81f622018-07-31 23:34:35 -07001124 Data::Union(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05001125 _visitor.visit_data_union(_binding_0);
1126 }
1127 }
1128}
David Tolnay8c81f622018-07-31 23:34:35 -07001129#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001130pub fn visit_data_enum<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataEnum) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001131 tokens_helper(_visitor, &_i.enum_token.span);
1132 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001133 for el in Punctuated::pairs(&_i.variants) {
1134 let it = el.value();
1135 _visitor.visit_variant(it)
1136 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001137}
David Tolnay8c81f622018-07-31 23:34:35 -07001138#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001139pub fn visit_data_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataStruct) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001140 tokens_helper(_visitor, &_i.struct_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001141 _visitor.visit_fields(&_i.fields);
1142 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001143 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001144 };
David Tolnaye3d41b72017-12-31 15:24:00 -05001145}
David Tolnay8c81f622018-07-31 23:34:35 -07001146#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001147pub fn visit_data_union<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataUnion) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001148 tokens_helper(_visitor, &_i.union_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001149 _visitor.visit_fields_named(&_i.fields);
David Tolnaye3d41b72017-12-31 15:24:00 -05001150}
David Tolnay8c81f622018-07-31 23:34:35 -07001151#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001152pub fn visit_derive_input<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DeriveInput) {
David Tolnay8c81f622018-07-31 23:34:35 -07001153 for it in &_i.attrs {
1154 _visitor.visit_attribute(it)
1155 }
1156 _visitor.visit_visibility(&_i.vis);
1157 _visitor.visit_ident(&_i.ident);
1158 _visitor.visit_generics(&_i.generics);
1159 _visitor.visit_data(&_i.data);
Nika Layzell27726662017-10-24 23:16:35 -04001160}
David Tolnay8c81f622018-07-31 23:34:35 -07001161#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001162pub fn visit_expr<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Expr) {
Nika Layzell27726662017-10-24 23:16:35 -04001163 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001164 Expr::Box(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001165 full!(_visitor.visit_expr_box(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001166 }
David Tolnay8c81f622018-07-31 23:34:35 -07001167 Expr::InPlace(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001168 full!(_visitor.visit_expr_in_place(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001169 }
David Tolnay8c81f622018-07-31 23:34:35 -07001170 Expr::Array(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001171 full!(_visitor.visit_expr_array(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001172 }
David Tolnay8c81f622018-07-31 23:34:35 -07001173 Expr::Call(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001174 _visitor.visit_expr_call(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001175 }
David Tolnay8c81f622018-07-31 23:34:35 -07001176 Expr::MethodCall(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001177 full!(_visitor.visit_expr_method_call(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001178 }
David Tolnay8c81f622018-07-31 23:34:35 -07001179 Expr::Tuple(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001180 full!(_visitor.visit_expr_tuple(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001181 }
David Tolnay8c81f622018-07-31 23:34:35 -07001182 Expr::Binary(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001183 _visitor.visit_expr_binary(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001184 }
David Tolnay8c81f622018-07-31 23:34:35 -07001185 Expr::Unary(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001186 _visitor.visit_expr_unary(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001187 }
David Tolnay8c81f622018-07-31 23:34:35 -07001188 Expr::Lit(ref _binding_0) => {
David Tolnay8c91b882017-12-28 23:04:32 -05001189 _visitor.visit_expr_lit(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001190 }
David Tolnay8c81f622018-07-31 23:34:35 -07001191 Expr::Cast(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001192 _visitor.visit_expr_cast(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001193 }
David Tolnay8c81f622018-07-31 23:34:35 -07001194 Expr::Type(ref _binding_0) => {
David Tolnay0cf94f22017-12-28 23:46:26 -05001195 full!(_visitor.visit_expr_type(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001196 }
David Tolnay8c81f622018-07-31 23:34:35 -07001197 Expr::If(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001198 full!(_visitor.visit_expr_if(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001199 }
David Tolnay8c81f622018-07-31 23:34:35 -07001200 Expr::IfLet(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001201 full!(_visitor.visit_expr_if_let(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001202 }
David Tolnay8c81f622018-07-31 23:34:35 -07001203 Expr::While(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001204 full!(_visitor.visit_expr_while(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001205 }
David Tolnay8c81f622018-07-31 23:34:35 -07001206 Expr::WhileLet(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001207 full!(_visitor.visit_expr_while_let(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001208 }
David Tolnay8c81f622018-07-31 23:34:35 -07001209 Expr::ForLoop(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001210 full!(_visitor.visit_expr_for_loop(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001211 }
David Tolnay8c81f622018-07-31 23:34:35 -07001212 Expr::Loop(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001213 full!(_visitor.visit_expr_loop(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001214 }
David Tolnay8c81f622018-07-31 23:34:35 -07001215 Expr::Match(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001216 full!(_visitor.visit_expr_match(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001217 }
David Tolnay8c81f622018-07-31 23:34:35 -07001218 Expr::Closure(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001219 full!(_visitor.visit_expr_closure(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001220 }
David Tolnay8c81f622018-07-31 23:34:35 -07001221 Expr::Unsafe(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001222 full!(_visitor.visit_expr_unsafe(_binding_0));
Nika Layzell640832a2017-12-04 13:37:09 -05001223 }
David Tolnay8c81f622018-07-31 23:34:35 -07001224 Expr::Block(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001225 full!(_visitor.visit_expr_block(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001226 }
David Tolnay8c81f622018-07-31 23:34:35 -07001227 Expr::Assign(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001228 full!(_visitor.visit_expr_assign(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001229 }
David Tolnay8c81f622018-07-31 23:34:35 -07001230 Expr::AssignOp(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001231 full!(_visitor.visit_expr_assign_op(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001232 }
David Tolnay8c81f622018-07-31 23:34:35 -07001233 Expr::Field(ref _binding_0) => {
David Tolnayd093fa92018-06-30 10:23:25 -07001234 _visitor.visit_expr_field(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001235 }
David Tolnay8c81f622018-07-31 23:34:35 -07001236 Expr::Index(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001237 _visitor.visit_expr_index(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001238 }
David Tolnay8c81f622018-07-31 23:34:35 -07001239 Expr::Range(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001240 full!(_visitor.visit_expr_range(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001241 }
David Tolnay8c81f622018-07-31 23:34:35 -07001242 Expr::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001243 _visitor.visit_expr_path(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001244 }
David Tolnay8c81f622018-07-31 23:34:35 -07001245 Expr::Reference(ref _binding_0) => {
David Tolnay00674ba2018-03-31 18:14:11 +02001246 full!(_visitor.visit_expr_reference(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001247 }
David Tolnay8c81f622018-07-31 23:34:35 -07001248 Expr::Break(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001249 full!(_visitor.visit_expr_break(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001250 }
David Tolnay8c81f622018-07-31 23:34:35 -07001251 Expr::Continue(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001252 full!(_visitor.visit_expr_continue(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001253 }
David Tolnay8c81f622018-07-31 23:34:35 -07001254 Expr::Return(ref _binding_0) => {
David Tolnayc246cd32017-12-28 23:14:32 -05001255 full!(_visitor.visit_expr_return(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001256 }
David Tolnay8c81f622018-07-31 23:34:35 -07001257 Expr::Macro(ref _binding_0) => {
David Tolnay8c91b882017-12-28 23:04:32 -05001258 full!(_visitor.visit_expr_macro(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001259 }
David Tolnay8c81f622018-07-31 23:34:35 -07001260 Expr::Struct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001261 full!(_visitor.visit_expr_struct(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001262 }
David Tolnay8c81f622018-07-31 23:34:35 -07001263 Expr::Repeat(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001264 full!(_visitor.visit_expr_repeat(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001265 }
David Tolnay8c81f622018-07-31 23:34:35 -07001266 Expr::Paren(ref _binding_0) => {
David Tolnay81ab4f62018-01-27 19:02:51 -08001267 _visitor.visit_expr_paren(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001268 }
David Tolnay8c81f622018-07-31 23:34:35 -07001269 Expr::Group(ref _binding_0) => {
David Tolnaye98775f2017-12-28 23:17:00 -05001270 full!(_visitor.visit_expr_group(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001271 }
David Tolnay8c81f622018-07-31 23:34:35 -07001272 Expr::Try(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001273 full!(_visitor.visit_expr_try(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001274 }
David Tolnay02a9c6f2018-08-24 18:58:45 -04001275 Expr::Async(ref _binding_0) => {
1276 full!(_visitor.visit_expr_async(_binding_0));
1277 }
David Tolnayfb2dd4b2018-08-24 16:45:34 -04001278 Expr::TryBlock(ref _binding_0) => {
1279 full!(_visitor.visit_expr_try_block(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001280 }
David Tolnay8c81f622018-07-31 23:34:35 -07001281 Expr::Yield(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001282 full!(_visitor.visit_expr_yield(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001283 }
David Tolnay8c81f622018-07-31 23:34:35 -07001284 Expr::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05001285 _visitor.visit_expr_verbatim(_binding_0);
1286 }
Nika Layzell27726662017-10-24 23:16:35 -04001287 }
1288}
David Tolnay8c81f622018-07-31 23:34:35 -07001289#[cfg(feature = "full")]
1290#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001291pub fn visit_expr_array<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprArray) {
David Tolnay8c81f622018-07-31 23:34:35 -07001292 for it in &_i.attrs {
1293 _visitor.visit_attribute(it)
1294 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001295 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001296 for el in Punctuated::pairs(&_i.elems) {
1297 let it = el.value();
1298 _visitor.visit_expr(it)
David Tolnaye3d41b72017-12-31 15:24:00 -05001299 }
1300}
David Tolnay8c81f622018-07-31 23:34:35 -07001301#[cfg(feature = "full")]
1302#[cfg(any(feature = "full", feature = "derive"))]
1303pub fn visit_expr_assign<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprAssign) {
1304 for it in &_i.attrs {
1305 _visitor.visit_attribute(it)
1306 }
1307 _visitor.visit_expr(&*_i.left);
David Tolnay7ac699c2018-08-24 14:00:58 -04001308 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001309 _visitor.visit_expr(&*_i.right);
1310}
1311#[cfg(feature = "full")]
1312#[cfg(any(feature = "full", feature = "derive"))]
1313pub fn visit_expr_assign_op<'ast, V: Visit<'ast> + ?Sized>(
1314 _visitor: &mut V,
1315 _i: &'ast ExprAssignOp,
1316) {
1317 for it in &_i.attrs {
1318 _visitor.visit_attribute(it)
1319 }
1320 _visitor.visit_expr(&*_i.left);
1321 _visitor.visit_bin_op(&_i.op);
1322 _visitor.visit_expr(&*_i.right);
1323}
David Tolnay02a9c6f2018-08-24 18:58:45 -04001324#[cfg(feature = "full")]
1325#[cfg(any(feature = "full", feature = "derive"))]
1326pub fn visit_expr_async<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprAsync) {
1327 for it in &_i.attrs {
1328 _visitor.visit_attribute(it)
1329 }
1330 tokens_helper(_visitor, &_i.async_token.span);
1331 if let Some(ref it) = _i.capture {
1332 tokens_helper(_visitor, &it.span)
1333 };
1334 _visitor.visit_block(&_i.block);
1335}
David Tolnay8c81f622018-07-31 23:34:35 -07001336#[cfg(any(feature = "full", feature = "derive"))]
1337pub fn visit_expr_binary<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBinary) {
1338 for it in &_i.attrs {
1339 _visitor.visit_attribute(it)
1340 }
1341 _visitor.visit_expr(&*_i.left);
1342 _visitor.visit_bin_op(&_i.op);
1343 _visitor.visit_expr(&*_i.right);
1344}
1345#[cfg(feature = "full")]
1346#[cfg(any(feature = "full", feature = "derive"))]
1347pub fn visit_expr_block<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBlock) {
1348 for it in &_i.attrs {
1349 _visitor.visit_attribute(it)
1350 }
David Tolnay1d8e9962018-08-24 19:04:20 -04001351 if let Some(ref it) = _i.label {
1352 _visitor.visit_label(it)
1353 };
David Tolnay8c81f622018-07-31 23:34:35 -07001354 _visitor.visit_block(&_i.block);
1355}
1356#[cfg(feature = "full")]
1357#[cfg(any(feature = "full", feature = "derive"))]
1358pub fn visit_expr_box<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBox) {
1359 for it in &_i.attrs {
1360 _visitor.visit_attribute(it)
1361 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001362 tokens_helper(_visitor, &_i.box_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001363 _visitor.visit_expr(&*_i.expr);
1364}
1365#[cfg(feature = "full")]
1366#[cfg(any(feature = "full", feature = "derive"))]
1367pub fn visit_expr_break<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBreak) {
1368 for it in &_i.attrs {
1369 _visitor.visit_attribute(it)
1370 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001371 tokens_helper(_visitor, &_i.break_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001372 if let Some(ref it) = _i.label {
1373 _visitor.visit_lifetime(it)
1374 };
1375 if let Some(ref it) = _i.expr {
1376 _visitor.visit_expr(&**it)
1377 };
1378}
1379#[cfg(any(feature = "full", feature = "derive"))]
1380pub fn visit_expr_call<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprCall) {
1381 for it in &_i.attrs {
1382 _visitor.visit_attribute(it)
1383 }
1384 _visitor.visit_expr(&*_i.func);
David Tolnay7ac699c2018-08-24 14:00:58 -04001385 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001386 for el in Punctuated::pairs(&_i.args) {
1387 let it = el.value();
1388 _visitor.visit_expr(it)
1389 }
1390}
1391#[cfg(any(feature = "full", feature = "derive"))]
1392pub fn visit_expr_cast<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprCast) {
1393 for it in &_i.attrs {
1394 _visitor.visit_attribute(it)
1395 }
1396 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001397 tokens_helper(_visitor, &_i.as_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001398 _visitor.visit_type(&*_i.ty);
1399}
1400#[cfg(feature = "full")]
1401#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001402pub fn visit_expr_closure<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprClosure) {
1403 for it in &_i.attrs {
1404 _visitor.visit_attribute(it)
1405 }
Yusuke Sasaki4e5d9662018-07-21 02:49:47 +09001406 if let Some(ref it) = _i.asyncness {
1407 tokens_helper(_visitor, &it.span)
1408 };
David Tolnay8c81f622018-07-31 23:34:35 -07001409 if let Some(ref it) = _i.movability {
David Tolnay7ac699c2018-08-24 14:00:58 -04001410 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001411 };
1412 if let Some(ref it) = _i.capture {
David Tolnay7ac699c2018-08-24 14:00:58 -04001413 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001414 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001415 tokens_helper(_visitor, &_i.or1_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001416 for el in Punctuated::pairs(&_i.inputs) {
1417 let it = el.value();
1418 _visitor.visit_fn_arg(it)
1419 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001420 tokens_helper(_visitor, &_i.or2_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001421 _visitor.visit_return_type(&_i.output);
1422 _visitor.visit_expr(&*_i.body);
1423}
1424#[cfg(feature = "full")]
1425#[cfg(any(feature = "full", feature = "derive"))]
1426pub fn visit_expr_continue<'ast, V: Visit<'ast> + ?Sized>(
1427 _visitor: &mut V,
1428 _i: &'ast ExprContinue,
1429) {
1430 for it in &_i.attrs {
1431 _visitor.visit_attribute(it)
1432 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001433 tokens_helper(_visitor, &_i.continue_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001434 if let Some(ref it) = _i.label {
1435 _visitor.visit_lifetime(it)
1436 };
1437}
1438#[cfg(any(feature = "full", feature = "derive"))]
1439pub fn visit_expr_field<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprField) {
1440 for it in &_i.attrs {
1441 _visitor.visit_attribute(it)
1442 }
1443 _visitor.visit_expr(&*_i.base);
David Tolnay7ac699c2018-08-24 14:00:58 -04001444 tokens_helper(_visitor, &_i.dot_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001445 _visitor.visit_member(&_i.member);
1446}
1447#[cfg(feature = "full")]
1448#[cfg(any(feature = "full", feature = "derive"))]
1449pub fn visit_expr_for_loop<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprForLoop) {
1450 for it in &_i.attrs {
1451 _visitor.visit_attribute(it)
1452 }
1453 if let Some(ref it) = _i.label {
1454 _visitor.visit_label(it)
1455 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001456 tokens_helper(_visitor, &_i.for_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001457 _visitor.visit_pat(&*_i.pat);
David Tolnay7ac699c2018-08-24 14:00:58 -04001458 tokens_helper(_visitor, &_i.in_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001459 _visitor.visit_expr(&*_i.expr);
1460 _visitor.visit_block(&_i.body);
1461}
1462#[cfg(feature = "full")]
1463#[cfg(any(feature = "full", feature = "derive"))]
1464pub fn visit_expr_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprGroup) {
1465 for it in &_i.attrs {
1466 _visitor.visit_attribute(it)
1467 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001468 tokens_helper(_visitor, &_i.group_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001469 _visitor.visit_expr(&*_i.expr);
1470}
1471#[cfg(feature = "full")]
1472#[cfg(any(feature = "full", feature = "derive"))]
1473pub fn visit_expr_if<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprIf) {
1474 for it in &_i.attrs {
1475 _visitor.visit_attribute(it)
1476 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001477 tokens_helper(_visitor, &_i.if_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001478 _visitor.visit_expr(&*_i.cond);
1479 _visitor.visit_block(&_i.then_branch);
1480 if let Some(ref it) = _i.else_branch {
David Tolnay7ac699c2018-08-24 14:00:58 -04001481 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001482 _visitor.visit_expr(&*(it).1);
1483 };
1484}
1485#[cfg(feature = "full")]
1486#[cfg(any(feature = "full", feature = "derive"))]
1487pub fn visit_expr_if_let<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprIfLet) {
1488 for it in &_i.attrs {
1489 _visitor.visit_attribute(it)
1490 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001491 tokens_helper(_visitor, &_i.if_token.span);
1492 tokens_helper(_visitor, &_i.let_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001493 for el in Punctuated::pairs(&_i.pats) {
1494 let it = el.value();
1495 _visitor.visit_pat(it)
1496 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001497 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001498 _visitor.visit_expr(&*_i.expr);
1499 _visitor.visit_block(&_i.then_branch);
1500 if let Some(ref it) = _i.else_branch {
David Tolnay7ac699c2018-08-24 14:00:58 -04001501 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001502 _visitor.visit_expr(&*(it).1);
1503 };
1504}
1505#[cfg(feature = "full")]
1506#[cfg(any(feature = "full", feature = "derive"))]
1507pub fn visit_expr_in_place<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprInPlace) {
1508 for it in &_i.attrs {
1509 _visitor.visit_attribute(it)
1510 }
1511 _visitor.visit_expr(&*_i.place);
David Tolnay7ac699c2018-08-24 14:00:58 -04001512 tokens_helper(_visitor, &_i.arrow_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001513 _visitor.visit_expr(&*_i.value);
1514}
1515#[cfg(any(feature = "full", feature = "derive"))]
1516pub fn visit_expr_index<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprIndex) {
1517 for it in &_i.attrs {
1518 _visitor.visit_attribute(it)
1519 }
1520 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001521 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001522 _visitor.visit_expr(&*_i.index);
1523}
1524#[cfg(any(feature = "full", feature = "derive"))]
1525pub fn visit_expr_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprLit) {
1526 for it in &_i.attrs {
1527 _visitor.visit_attribute(it)
1528 }
1529 _visitor.visit_lit(&_i.lit);
1530}
1531#[cfg(feature = "full")]
1532#[cfg(any(feature = "full", feature = "derive"))]
1533pub fn visit_expr_loop<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprLoop) {
1534 for it in &_i.attrs {
1535 _visitor.visit_attribute(it)
1536 }
1537 if let Some(ref it) = _i.label {
1538 _visitor.visit_label(it)
1539 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001540 tokens_helper(_visitor, &_i.loop_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001541 _visitor.visit_block(&_i.body);
1542}
1543#[cfg(feature = "full")]
1544#[cfg(any(feature = "full", feature = "derive"))]
1545pub fn visit_expr_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprMacro) {
1546 for it in &_i.attrs {
1547 _visitor.visit_attribute(it)
1548 }
1549 _visitor.visit_macro(&_i.mac);
1550}
1551#[cfg(feature = "full")]
1552#[cfg(any(feature = "full", feature = "derive"))]
1553pub fn visit_expr_match<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprMatch) {
1554 for it in &_i.attrs {
1555 _visitor.visit_attribute(it)
1556 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001557 tokens_helper(_visitor, &_i.match_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001558 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001559 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001560 for it in &_i.arms {
1561 _visitor.visit_arm(it)
1562 }
1563}
1564#[cfg(feature = "full")]
1565#[cfg(any(feature = "full", feature = "derive"))]
1566pub fn visit_expr_method_call<'ast, V: Visit<'ast> + ?Sized>(
1567 _visitor: &mut V,
1568 _i: &'ast ExprMethodCall,
1569) {
1570 for it in &_i.attrs {
1571 _visitor.visit_attribute(it)
1572 }
1573 _visitor.visit_expr(&*_i.receiver);
David Tolnay7ac699c2018-08-24 14:00:58 -04001574 tokens_helper(_visitor, &_i.dot_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001575 _visitor.visit_ident(&_i.method);
1576 if let Some(ref it) = _i.turbofish {
1577 _visitor.visit_method_turbofish(it)
1578 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001579 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001580 for el in Punctuated::pairs(&_i.args) {
1581 let it = el.value();
1582 _visitor.visit_expr(it)
1583 }
1584}
1585#[cfg(any(feature = "full", feature = "derive"))]
1586pub fn visit_expr_paren<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprParen) {
1587 for it in &_i.attrs {
1588 _visitor.visit_attribute(it)
1589 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001590 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001591 _visitor.visit_expr(&*_i.expr);
1592}
1593#[cfg(any(feature = "full", feature = "derive"))]
1594pub fn visit_expr_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprPath) {
1595 for it in &_i.attrs {
1596 _visitor.visit_attribute(it)
1597 }
1598 if let Some(ref it) = _i.qself {
1599 _visitor.visit_qself(it)
1600 };
1601 _visitor.visit_path(&_i.path);
1602}
1603#[cfg(feature = "full")]
1604#[cfg(any(feature = "full", feature = "derive"))]
1605pub fn visit_expr_range<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprRange) {
1606 for it in &_i.attrs {
1607 _visitor.visit_attribute(it)
1608 }
1609 if let Some(ref it) = _i.from {
1610 _visitor.visit_expr(&**it)
1611 };
1612 _visitor.visit_range_limits(&_i.limits);
1613 if let Some(ref it) = _i.to {
1614 _visitor.visit_expr(&**it)
1615 };
1616}
1617#[cfg(feature = "full")]
1618#[cfg(any(feature = "full", feature = "derive"))]
1619pub fn visit_expr_reference<'ast, V: Visit<'ast> + ?Sized>(
1620 _visitor: &mut V,
1621 _i: &'ast ExprReference,
1622) {
1623 for it in &_i.attrs {
1624 _visitor.visit_attribute(it)
1625 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001626 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001627 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04001628 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001629 };
1630 _visitor.visit_expr(&*_i.expr);
1631}
1632#[cfg(feature = "full")]
1633#[cfg(any(feature = "full", feature = "derive"))]
1634pub fn visit_expr_repeat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprRepeat) {
1635 for it in &_i.attrs {
1636 _visitor.visit_attribute(it)
1637 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001638 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001639 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001640 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001641 _visitor.visit_expr(&*_i.len);
1642}
1643#[cfg(feature = "full")]
1644#[cfg(any(feature = "full", feature = "derive"))]
1645pub fn visit_expr_return<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprReturn) {
1646 for it in &_i.attrs {
1647 _visitor.visit_attribute(it)
1648 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001649 tokens_helper(_visitor, &_i.return_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001650 if let Some(ref it) = _i.expr {
1651 _visitor.visit_expr(&**it)
1652 };
1653}
1654#[cfg(feature = "full")]
1655#[cfg(any(feature = "full", feature = "derive"))]
1656pub fn visit_expr_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprStruct) {
1657 for it in &_i.attrs {
1658 _visitor.visit_attribute(it)
1659 }
1660 _visitor.visit_path(&_i.path);
David Tolnay7ac699c2018-08-24 14:00:58 -04001661 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001662 for el in Punctuated::pairs(&_i.fields) {
1663 let it = el.value();
1664 _visitor.visit_field_value(it)
1665 }
1666 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001667 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001668 };
1669 if let Some(ref it) = _i.rest {
1670 _visitor.visit_expr(&**it)
1671 };
1672}
1673#[cfg(feature = "full")]
1674#[cfg(any(feature = "full", feature = "derive"))]
1675pub fn visit_expr_try<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprTry) {
1676 for it in &_i.attrs {
1677 _visitor.visit_attribute(it)
1678 }
1679 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001680 tokens_helper(_visitor, &_i.question_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001681}
1682#[cfg(feature = "full")]
1683#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayfb2dd4b2018-08-24 16:45:34 -04001684pub fn visit_expr_try_block<'ast, V: Visit<'ast> + ?Sized>(
1685 _visitor: &mut V,
1686 _i: &'ast ExprTryBlock,
1687) {
1688 for it in &_i.attrs {
1689 _visitor.visit_attribute(it)
1690 }
1691 tokens_helper(_visitor, &_i.try_token.span);
1692 _visitor.visit_block(&_i.block);
1693}
1694#[cfg(feature = "full")]
1695#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001696pub fn visit_expr_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprTuple) {
1697 for it in &_i.attrs {
1698 _visitor.visit_attribute(it)
1699 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001700 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001701 for el in Punctuated::pairs(&_i.elems) {
1702 let it = el.value();
1703 _visitor.visit_expr(it)
1704 }
1705}
1706#[cfg(feature = "full")]
1707#[cfg(any(feature = "full", feature = "derive"))]
1708pub fn visit_expr_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprType) {
1709 for it in &_i.attrs {
1710 _visitor.visit_attribute(it)
1711 }
1712 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001713 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001714 _visitor.visit_type(&*_i.ty);
1715}
1716#[cfg(any(feature = "full", feature = "derive"))]
1717pub fn visit_expr_unary<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprUnary) {
1718 for it in &_i.attrs {
1719 _visitor.visit_attribute(it)
1720 }
1721 _visitor.visit_un_op(&_i.op);
1722 _visitor.visit_expr(&*_i.expr);
1723}
1724#[cfg(feature = "full")]
1725#[cfg(any(feature = "full", feature = "derive"))]
1726pub fn visit_expr_unsafe<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprUnsafe) {
1727 for it in &_i.attrs {
1728 _visitor.visit_attribute(it)
1729 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001730 tokens_helper(_visitor, &_i.unsafe_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001731 _visitor.visit_block(&_i.block);
1732}
1733#[cfg(any(feature = "full", feature = "derive"))]
1734pub fn visit_expr_verbatim<'ast, V: Visit<'ast> + ?Sized>(
1735 _visitor: &mut V,
1736 _i: &'ast ExprVerbatim,
1737) {
David Tolnay6af48992018-08-01 11:16:28 -07001738 skip!(_i.tts);
David Tolnay8c81f622018-07-31 23:34:35 -07001739}
1740#[cfg(feature = "full")]
1741#[cfg(any(feature = "full", feature = "derive"))]
1742pub fn visit_expr_while<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprWhile) {
1743 for it in &_i.attrs {
1744 _visitor.visit_attribute(it)
1745 }
1746 if let Some(ref it) = _i.label {
1747 _visitor.visit_label(it)
1748 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001749 tokens_helper(_visitor, &_i.while_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001750 _visitor.visit_expr(&*_i.cond);
1751 _visitor.visit_block(&_i.body);
1752}
1753#[cfg(feature = "full")]
1754#[cfg(any(feature = "full", feature = "derive"))]
1755pub fn visit_expr_while_let<'ast, V: Visit<'ast> + ?Sized>(
1756 _visitor: &mut V,
1757 _i: &'ast ExprWhileLet,
1758) {
1759 for it in &_i.attrs {
1760 _visitor.visit_attribute(it)
1761 }
1762 if let Some(ref it) = _i.label {
1763 _visitor.visit_label(it)
1764 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001765 tokens_helper(_visitor, &_i.while_token.span);
1766 tokens_helper(_visitor, &_i.let_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001767 for el in Punctuated::pairs(&_i.pats) {
1768 let it = el.value();
1769 _visitor.visit_pat(it)
1770 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001771 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001772 _visitor.visit_expr(&*_i.expr);
1773 _visitor.visit_block(&_i.body);
1774}
1775#[cfg(feature = "full")]
1776#[cfg(any(feature = "full", feature = "derive"))]
1777pub fn visit_expr_yield<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprYield) {
1778 for it in &_i.attrs {
1779 _visitor.visit_attribute(it)
1780 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001781 tokens_helper(_visitor, &_i.yield_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001782 if let Some(ref it) = _i.expr {
1783 _visitor.visit_expr(&**it)
1784 };
1785}
1786#[cfg(any(feature = "full", feature = "derive"))]
1787pub fn visit_field<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Field) {
1788 for it in &_i.attrs {
1789 _visitor.visit_attribute(it)
1790 }
1791 _visitor.visit_visibility(&_i.vis);
1792 if let Some(ref it) = _i.ident {
1793 _visitor.visit_ident(it)
1794 };
1795 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001796 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001797 };
1798 _visitor.visit_type(&_i.ty);
1799}
1800#[cfg(any(feature = "full", feature = "derive"))]
1801#[cfg(feature = "full")]
1802pub fn visit_field_pat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldPat) {
1803 for it in &_i.attrs {
1804 _visitor.visit_attribute(it)
1805 }
1806 _visitor.visit_member(&_i.member);
1807 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001808 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001809 };
1810 _visitor.visit_pat(&*_i.pat);
1811}
1812#[cfg(any(feature = "full", feature = "derive"))]
1813#[cfg(feature = "full")]
1814pub fn visit_field_value<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldValue) {
1815 for it in &_i.attrs {
1816 _visitor.visit_attribute(it)
1817 }
1818 _visitor.visit_member(&_i.member);
1819 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001820 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001821 };
1822 _visitor.visit_expr(&_i.expr);
1823}
1824#[cfg(any(feature = "full", feature = "derive"))]
1825pub fn visit_fields<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Fields) {
1826 match *_i {
1827 Fields::Named(ref _binding_0) => {
1828 _visitor.visit_fields_named(_binding_0);
1829 }
1830 Fields::Unnamed(ref _binding_0) => {
1831 _visitor.visit_fields_unnamed(_binding_0);
1832 }
1833 Fields::Unit => {}
1834 }
1835}
1836#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001837pub fn visit_fields_named<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldsNamed) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001838 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001839 for el in Punctuated::pairs(&_i.named) {
1840 let it = el.value();
1841 _visitor.visit_field(it)
1842 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001843}
David Tolnay8c81f622018-07-31 23:34:35 -07001844#[cfg(any(feature = "full", feature = "derive"))]
1845pub fn visit_fields_unnamed<'ast, V: Visit<'ast> + ?Sized>(
1846 _visitor: &mut V,
1847 _i: &'ast FieldsUnnamed,
1848) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001849 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001850 for el in Punctuated::pairs(&_i.unnamed) {
1851 let it = el.value();
1852 _visitor.visit_field(it)
1853 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001854}
David Tolnay8c81f622018-07-31 23:34:35 -07001855#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001856pub fn visit_file<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast File) {
David Tolnay6af48992018-08-01 11:16:28 -07001857 skip!(_i.shebang);
David Tolnay8c81f622018-07-31 23:34:35 -07001858 for it in &_i.attrs {
1859 _visitor.visit_attribute(it)
1860 }
1861 for it in &_i.items {
1862 _visitor.visit_item(it)
1863 }
Nika Layzell27726662017-10-24 23:16:35 -04001864}
David Tolnay8c81f622018-07-31 23:34:35 -07001865#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001866pub fn visit_fn_arg<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FnArg) {
Nika Layzell27726662017-10-24 23:16:35 -04001867 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001868 FnArg::SelfRef(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001869 _visitor.visit_arg_self_ref(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001870 }
David Tolnay8c81f622018-07-31 23:34:35 -07001871 FnArg::SelfValue(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001872 _visitor.visit_arg_self(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001873 }
David Tolnay8c81f622018-07-31 23:34:35 -07001874 FnArg::Captured(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001875 _visitor.visit_arg_captured(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001876 }
David Tolnay8c81f622018-07-31 23:34:35 -07001877 FnArg::Inferred(ref _binding_0) => {
David Tolnay80ed55f2017-12-27 22:54:40 -05001878 _visitor.visit_pat(_binding_0);
1879 }
David Tolnay8c81f622018-07-31 23:34:35 -07001880 FnArg::Ignored(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001881 _visitor.visit_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001882 }
1883 }
1884}
David Tolnay8c81f622018-07-31 23:34:35 -07001885#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001886pub fn visit_fn_decl<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FnDecl) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001887 tokens_helper(_visitor, &_i.fn_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001888 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04001889 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001890 for el in Punctuated::pairs(&_i.inputs) {
1891 let it = el.value();
1892 _visitor.visit_fn_arg(it)
1893 }
1894 if let Some(ref it) = _i.variadic {
David Tolnay7ac699c2018-08-24 14:00:58 -04001895 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001896 };
1897 _visitor.visit_return_type(&_i.output);
Nika Layzell27726662017-10-24 23:16:35 -04001898}
David Tolnay8c81f622018-07-31 23:34:35 -07001899#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001900pub fn visit_foreign_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ForeignItem) {
Nika Layzell27726662017-10-24 23:16:35 -04001901 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001902 ForeignItem::Fn(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001903 _visitor.visit_foreign_item_fn(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001904 }
David Tolnay8c81f622018-07-31 23:34:35 -07001905 ForeignItem::Static(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001906 _visitor.visit_foreign_item_static(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001907 }
David Tolnay8c81f622018-07-31 23:34:35 -07001908 ForeignItem::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001909 _visitor.visit_foreign_item_type(_binding_0);
David Tolnay199bcbb2017-11-12 10:33:52 -08001910 }
David Tolnay435c1782018-08-24 16:15:44 -04001911 ForeignItem::Macro(ref _binding_0) => {
1912 _visitor.visit_foreign_item_macro(_binding_0);
1913 }
David Tolnay8c81f622018-07-31 23:34:35 -07001914 ForeignItem::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05001915 _visitor.visit_foreign_item_verbatim(_binding_0);
1916 }
Nika Layzell27726662017-10-24 23:16:35 -04001917 }
1918}
David Tolnay8c81f622018-07-31 23:34:35 -07001919#[cfg(feature = "full")]
1920pub fn visit_foreign_item_fn<'ast, V: Visit<'ast> + ?Sized>(
1921 _visitor: &mut V,
1922 _i: &'ast ForeignItemFn,
1923) {
1924 for it in &_i.attrs {
1925 _visitor.visit_attribute(it)
1926 }
1927 _visitor.visit_visibility(&_i.vis);
1928 _visitor.visit_ident(&_i.ident);
1929 _visitor.visit_fn_decl(&*_i.decl);
David Tolnay7ac699c2018-08-24 14:00:58 -04001930 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay8894f602017-11-11 12:11:04 -08001931}
David Tolnay8c81f622018-07-31 23:34:35 -07001932#[cfg(feature = "full")]
David Tolnay435c1782018-08-24 16:15:44 -04001933pub fn visit_foreign_item_macro<'ast, V: Visit<'ast> + ?Sized>(
1934 _visitor: &mut V,
1935 _i: &'ast ForeignItemMacro,
1936) {
1937 for it in &_i.attrs {
1938 _visitor.visit_attribute(it)
1939 }
1940 _visitor.visit_macro(&_i.mac);
1941 if let Some(ref it) = _i.semi_token {
1942 tokens_helper(_visitor, &it.spans)
1943 };
1944}
1945#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001946pub fn visit_foreign_item_static<'ast, V: Visit<'ast> + ?Sized>(
1947 _visitor: &mut V,
1948 _i: &'ast ForeignItemStatic,
1949) {
1950 for it in &_i.attrs {
1951 _visitor.visit_attribute(it)
1952 }
1953 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04001954 tokens_helper(_visitor, &_i.static_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001955 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04001956 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001957 };
1958 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001959 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001960 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04001961 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001962}
David Tolnay8c81f622018-07-31 23:34:35 -07001963#[cfg(feature = "full")]
1964pub fn visit_foreign_item_type<'ast, V: Visit<'ast> + ?Sized>(
1965 _visitor: &mut V,
1966 _i: &'ast ForeignItemType,
1967) {
1968 for it in &_i.attrs {
1969 _visitor.visit_attribute(it)
1970 }
1971 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04001972 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001973 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001974 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay199bcbb2017-11-12 10:33:52 -08001975}
David Tolnay8c81f622018-07-31 23:34:35 -07001976#[cfg(feature = "full")]
1977pub fn visit_foreign_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
1978 _visitor: &mut V,
1979 _i: &'ast ForeignItemVerbatim,
1980) {
David Tolnay6af48992018-08-01 11:16:28 -07001981 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05001982}
David Tolnay8c81f622018-07-31 23:34:35 -07001983#[cfg(any(feature = "full", feature = "derive"))]
1984pub fn visit_generic_argument<'ast, V: Visit<'ast> + ?Sized>(
1985 _visitor: &mut V,
1986 _i: &'ast GenericArgument,
1987) {
Nika Layzell357885a2017-12-04 15:47:07 -05001988 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001989 GenericArgument::Lifetime(ref _binding_0) => {
David Tolnay4ba63a02017-12-28 15:53:05 -05001990 _visitor.visit_lifetime(_binding_0);
Nika Layzell357885a2017-12-04 15:47:07 -05001991 }
David Tolnay8c81f622018-07-31 23:34:35 -07001992 GenericArgument::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001993 _visitor.visit_type(_binding_0);
Nika Layzell357885a2017-12-04 15:47:07 -05001994 }
David Tolnay8c81f622018-07-31 23:34:35 -07001995 GenericArgument::Binding(ref _binding_0) => {
David Tolnay506e43a2017-12-29 11:34:36 -05001996 _visitor.visit_binding(_binding_0);
Nika Layzell357885a2017-12-04 15:47:07 -05001997 }
David Tolnay8c81f622018-07-31 23:34:35 -07001998 GenericArgument::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001999 _visitor.visit_expr(_binding_0);
Nika Layzellc680e612017-12-04 19:07:20 -05002000 }
Nika Layzell357885a2017-12-04 15:47:07 -05002001 }
2002}
David Tolnay8c81f622018-07-31 23:34:35 -07002003#[cfg(any(feature = "full", feature = "derive"))]
2004#[cfg(feature = "full")]
2005pub fn visit_generic_method_argument<'ast, V: Visit<'ast> + ?Sized>(
2006 _visitor: &mut V,
2007 _i: &'ast GenericMethodArgument,
2008) {
David Tolnayd60cfec2017-12-29 00:21:38 -05002009 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002010 GenericMethodArgument::Type(ref _binding_0) => {
David Tolnayd60cfec2017-12-29 00:21:38 -05002011 _visitor.visit_type(_binding_0);
2012 }
David Tolnay8c81f622018-07-31 23:34:35 -07002013 GenericMethodArgument::Const(ref _binding_0) => {
David Tolnayd60cfec2017-12-29 00:21:38 -05002014 _visitor.visit_expr(_binding_0);
2015 }
2016 }
2017}
David Tolnay8c81f622018-07-31 23:34:35 -07002018#[cfg(any(feature = "full", feature = "derive"))]
2019pub fn visit_generic_param<'ast, V: Visit<'ast> + ?Sized>(
2020 _visitor: &mut V,
2021 _i: &'ast GenericParam,
2022) {
David Tolnayc2f1aba2017-11-12 20:29:22 -08002023 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002024 GenericParam::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002025 _visitor.visit_type_param(_binding_0);
David Tolnayc2f1aba2017-11-12 20:29:22 -08002026 }
David Tolnay8c81f622018-07-31 23:34:35 -07002027 GenericParam::Lifetime(ref _binding_0) => {
David Tolnay517f3692018-01-01 20:17:23 -08002028 _visitor.visit_lifetime_def(_binding_0);
2029 }
David Tolnay8c81f622018-07-31 23:34:35 -07002030 GenericParam::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002031 _visitor.visit_const_param(_binding_0);
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05002032 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08002033 }
2034}
David Tolnay8c81f622018-07-31 23:34:35 -07002035#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002036pub fn visit_generics<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Generics) {
David Tolnay8c81f622018-07-31 23:34:35 -07002037 if let Some(ref it) = _i.lt_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002038 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002039 };
2040 for el in Punctuated::pairs(&_i.params) {
2041 let it = el.value();
2042 _visitor.visit_generic_param(it)
2043 }
2044 if let Some(ref it) = _i.gt_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002045 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002046 };
2047 if let Some(ref it) = _i.where_clause {
2048 _visitor.visit_where_clause(it)
2049 };
Nika Layzell27726662017-10-24 23:16:35 -04002050}
David Tolnay8c81f622018-07-31 23:34:35 -07002051pub fn visit_ident<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Ident) {}
2052#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002053pub fn visit_impl_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ImplItem) {
Nika Layzell27726662017-10-24 23:16:35 -04002054 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002055 ImplItem::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002056 _visitor.visit_impl_item_const(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002057 }
David Tolnay8c81f622018-07-31 23:34:35 -07002058 ImplItem::Method(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002059 _visitor.visit_impl_item_method(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002060 }
David Tolnay8c81f622018-07-31 23:34:35 -07002061 ImplItem::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002062 _visitor.visit_impl_item_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002063 }
David Tolnaybb82ef02018-08-24 20:15:45 -04002064 ImplItem::Existential(ref _binding_0) => {
2065 _visitor.visit_impl_item_existential(_binding_0);
2066 }
David Tolnay8c81f622018-07-31 23:34:35 -07002067 ImplItem::Macro(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002068 _visitor.visit_impl_item_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002069 }
David Tolnay8c81f622018-07-31 23:34:35 -07002070 ImplItem::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002071 _visitor.visit_impl_item_verbatim(_binding_0);
2072 }
Nika Layzell27726662017-10-24 23:16:35 -04002073 }
2074}
David Tolnay8c81f622018-07-31 23:34:35 -07002075#[cfg(feature = "full")]
2076pub fn visit_impl_item_const<'ast, V: Visit<'ast> + ?Sized>(
2077 _visitor: &mut V,
2078 _i: &'ast ImplItemConst,
2079) {
2080 for it in &_i.attrs {
2081 _visitor.visit_attribute(it)
2082 }
2083 _visitor.visit_visibility(&_i.vis);
2084 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002085 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002086 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002087 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002088 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002089 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002090 _visitor.visit_type(&_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002091 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002092 _visitor.visit_expr(&_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04002093 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay857628c2017-11-11 12:25:31 -08002094}
David Tolnay8c81f622018-07-31 23:34:35 -07002095#[cfg(feature = "full")]
David Tolnaybb82ef02018-08-24 20:15:45 -04002096pub fn visit_impl_item_existential<'ast, V: Visit<'ast> + ?Sized>(
2097 _visitor: &mut V,
2098 _i: &'ast ImplItemExistential,
2099) {
2100 for it in &_i.attrs {
2101 _visitor.visit_attribute(it)
2102 }
2103 tokens_helper(_visitor, &_i.existential_token.span);
2104 tokens_helper(_visitor, &_i.type_token.span);
2105 _visitor.visit_ident(&_i.ident);
2106 _visitor.visit_generics(&_i.generics);
2107 if let Some(ref it) = _i.colon_token {
2108 tokens_helper(_visitor, &it.spans)
2109 };
2110 for el in Punctuated::pairs(&_i.bounds) {
2111 let it = el.value();
2112 _visitor.visit_type_param_bound(it)
2113 }
2114 tokens_helper(_visitor, &_i.semi_token.spans);
2115}
2116#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07002117pub fn visit_impl_item_macro<'ast, V: Visit<'ast> + ?Sized>(
2118 _visitor: &mut V,
2119 _i: &'ast ImplItemMacro,
2120) {
2121 for it in &_i.attrs {
2122 _visitor.visit_attribute(it)
2123 }
2124 _visitor.visit_macro(&_i.mac);
2125 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002126 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002127 };
David Tolnay857628c2017-11-11 12:25:31 -08002128}
David Tolnay8c81f622018-07-31 23:34:35 -07002129#[cfg(feature = "full")]
2130pub fn visit_impl_item_method<'ast, V: Visit<'ast> + ?Sized>(
2131 _visitor: &mut V,
2132 _i: &'ast ImplItemMethod,
2133) {
2134 for it in &_i.attrs {
2135 _visitor.visit_attribute(it)
2136 }
2137 _visitor.visit_visibility(&_i.vis);
2138 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002139 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002140 };
2141 _visitor.visit_method_sig(&_i.sig);
2142 _visitor.visit_block(&_i.block);
Nika Layzell27726662017-10-24 23:16:35 -04002143}
David Tolnay8c81f622018-07-31 23:34:35 -07002144#[cfg(feature = "full")]
2145pub fn visit_impl_item_type<'ast, V: Visit<'ast> + ?Sized>(
2146 _visitor: &mut V,
2147 _i: &'ast ImplItemType,
2148) {
2149 for it in &_i.attrs {
2150 _visitor.visit_attribute(it)
2151 }
2152 _visitor.visit_visibility(&_i.vis);
2153 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002154 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002155 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002156 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002157 _visitor.visit_ident(&_i.ident);
2158 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04002159 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002160 _visitor.visit_type(&_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002161 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002162}
David Tolnay8c81f622018-07-31 23:34:35 -07002163#[cfg(feature = "full")]
2164pub fn visit_impl_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
2165 _visitor: &mut V,
2166 _i: &'ast ImplItemVerbatim,
2167) {
David Tolnay6af48992018-08-01 11:16:28 -07002168 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05002169}
David Tolnay8c81f622018-07-31 23:34:35 -07002170#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002171pub fn visit_index<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Index) {
David Tolnay6af48992018-08-01 11:16:28 -07002172 skip!(_i.index);
David Tolnay8c81f622018-07-31 23:34:35 -07002173 _visitor.visit_span(&_i.span);
David Tolnay85b69a42017-12-27 20:43:10 -05002174}
David Tolnay8c81f622018-07-31 23:34:35 -07002175#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002176pub fn visit_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Item) {
Nika Layzell27726662017-10-24 23:16:35 -04002177 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002178 Item::ExternCrate(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002179 _visitor.visit_item_extern_crate(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002180 }
David Tolnay8c81f622018-07-31 23:34:35 -07002181 Item::Use(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002182 _visitor.visit_item_use(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002183 }
David Tolnay8c81f622018-07-31 23:34:35 -07002184 Item::Static(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002185 _visitor.visit_item_static(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002186 }
David Tolnay8c81f622018-07-31 23:34:35 -07002187 Item::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002188 _visitor.visit_item_const(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002189 }
David Tolnay8c81f622018-07-31 23:34:35 -07002190 Item::Fn(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002191 _visitor.visit_item_fn(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002192 }
David Tolnay8c81f622018-07-31 23:34:35 -07002193 Item::Mod(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002194 _visitor.visit_item_mod(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002195 }
David Tolnay8c81f622018-07-31 23:34:35 -07002196 Item::ForeignMod(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002197 _visitor.visit_item_foreign_mod(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002198 }
David Tolnay8c81f622018-07-31 23:34:35 -07002199 Item::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002200 _visitor.visit_item_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002201 }
David Tolnaybb82ef02018-08-24 20:15:45 -04002202 Item::Existential(ref _binding_0) => {
2203 _visitor.visit_item_existential(_binding_0);
2204 }
David Tolnay8c81f622018-07-31 23:34:35 -07002205 Item::Struct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002206 _visitor.visit_item_struct(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002207 }
David Tolnay8c81f622018-07-31 23:34:35 -07002208 Item::Enum(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05002209 _visitor.visit_item_enum(_binding_0);
2210 }
David Tolnay8c81f622018-07-31 23:34:35 -07002211 Item::Union(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002212 _visitor.visit_item_union(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002213 }
David Tolnay8c81f622018-07-31 23:34:35 -07002214 Item::Trait(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002215 _visitor.visit_item_trait(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002216 }
David Tolnayc6b04dd2018-08-30 23:22:51 -07002217 Item::TraitAlias(ref _binding_0) => {
2218 _visitor.visit_item_trait_alias(_binding_0);
2219 }
David Tolnay8c81f622018-07-31 23:34:35 -07002220 Item::Impl(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002221 _visitor.visit_item_impl(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002222 }
David Tolnay8c81f622018-07-31 23:34:35 -07002223 Item::Macro(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002224 _visitor.visit_item_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002225 }
David Tolnay8c81f622018-07-31 23:34:35 -07002226 Item::Macro2(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002227 _visitor.visit_item_macro2(_binding_0);
David Tolnay500d8322017-12-18 00:32:51 -08002228 }
David Tolnay8c81f622018-07-31 23:34:35 -07002229 Item::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002230 _visitor.visit_item_verbatim(_binding_0);
2231 }
Nika Layzell27726662017-10-24 23:16:35 -04002232 }
2233}
David Tolnay8c81f622018-07-31 23:34:35 -07002234#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002235pub fn visit_item_const<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemConst) {
David Tolnay8c81f622018-07-31 23:34:35 -07002236 for it in &_i.attrs {
2237 _visitor.visit_attribute(it)
2238 }
2239 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002240 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002241 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002242 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002243 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002244 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002245 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04002246 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnayc6b55bc2017-11-09 22:48:38 -08002247}
David Tolnay8c81f622018-07-31 23:34:35 -07002248#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002249pub fn visit_item_enum<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemEnum) {
David Tolnay8c81f622018-07-31 23:34:35 -07002250 for it in &_i.attrs {
2251 _visitor.visit_attribute(it)
2252 }
2253 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002254 tokens_helper(_visitor, &_i.enum_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002255 _visitor.visit_ident(&_i.ident);
2256 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04002257 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002258 for el in Punctuated::pairs(&_i.variants) {
2259 let it = el.value();
2260 _visitor.visit_variant(it)
2261 }
David Tolnayc6b55bc2017-11-09 22:48:38 -08002262}
David Tolnay8c81f622018-07-31 23:34:35 -07002263#[cfg(feature = "full")]
David Tolnaybb82ef02018-08-24 20:15:45 -04002264pub fn visit_item_existential<'ast, V: Visit<'ast> + ?Sized>(
2265 _visitor: &mut V,
2266 _i: &'ast ItemExistential,
2267) {
2268 for it in &_i.attrs {
2269 _visitor.visit_attribute(it)
2270 }
2271 _visitor.visit_visibility(&_i.vis);
2272 tokens_helper(_visitor, &_i.existential_token.span);
2273 tokens_helper(_visitor, &_i.type_token.span);
2274 _visitor.visit_ident(&_i.ident);
2275 _visitor.visit_generics(&_i.generics);
2276 if let Some(ref it) = _i.colon_token {
2277 tokens_helper(_visitor, &it.spans)
2278 };
2279 for el in Punctuated::pairs(&_i.bounds) {
2280 let it = el.value();
2281 _visitor.visit_type_param_bound(it)
2282 }
2283 tokens_helper(_visitor, &_i.semi_token.spans);
2284}
2285#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07002286pub fn visit_item_extern_crate<'ast, V: Visit<'ast> + ?Sized>(
2287 _visitor: &mut V,
2288 _i: &'ast ItemExternCrate,
2289) {
2290 for it in &_i.attrs {
2291 _visitor.visit_attribute(it)
2292 }
2293 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002294 tokens_helper(_visitor, &_i.extern_token.span);
2295 tokens_helper(_visitor, &_i.crate_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002296 _visitor.visit_ident(&_i.ident);
2297 if let Some(ref it) = _i.rename {
David Tolnay7ac699c2018-08-24 14:00:58 -04002298 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002299 _visitor.visit_ident(&(it).1);
2300 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002301 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnayc6b55bc2017-11-09 22:48:38 -08002302}
David Tolnay8c81f622018-07-31 23:34:35 -07002303#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002304pub fn visit_item_fn<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemFn) {
David Tolnay8c81f622018-07-31 23:34:35 -07002305 for it in &_i.attrs {
2306 _visitor.visit_attribute(it)
2307 }
2308 _visitor.visit_visibility(&_i.vis);
2309 if let Some(ref it) = _i.constness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002310 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002311 };
2312 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002313 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002314 };
Yusuke Sasakif00a3ef2018-07-20 22:08:42 +09002315 if let Some(ref it) = _i.asyncness {
2316 tokens_helper(_visitor, &it.span)
2317 };
David Tolnay8c81f622018-07-31 23:34:35 -07002318 if let Some(ref it) = _i.abi {
2319 _visitor.visit_abi(it)
2320 };
2321 _visitor.visit_ident(&_i.ident);
2322 _visitor.visit_fn_decl(&*_i.decl);
2323 _visitor.visit_block(&*_i.block);
David Tolnayc6b55bc2017-11-09 22:48:38 -08002324}
David Tolnay8c81f622018-07-31 23:34:35 -07002325#[cfg(feature = "full")]
2326pub fn visit_item_foreign_mod<'ast, V: Visit<'ast> + ?Sized>(
2327 _visitor: &mut V,
2328 _i: &'ast ItemForeignMod,
2329) {
2330 for it in &_i.attrs {
2331 _visitor.visit_attribute(it)
2332 }
2333 _visitor.visit_abi(&_i.abi);
David Tolnay7ac699c2018-08-24 14:00:58 -04002334 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002335 for it in &_i.items {
2336 _visitor.visit_foreign_item(it)
2337 }
David Tolnayc6b55bc2017-11-09 22:48:38 -08002338}
David Tolnay8c81f622018-07-31 23:34:35 -07002339#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002340pub fn visit_item_impl<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemImpl) {
David Tolnay8c81f622018-07-31 23:34:35 -07002341 for it in &_i.attrs {
2342 _visitor.visit_attribute(it)
2343 }
2344 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002345 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002346 };
2347 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002348 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002349 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002350 tokens_helper(_visitor, &_i.impl_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002351 _visitor.visit_generics(&_i.generics);
2352 if let Some(ref it) = _i.trait_ {
2353 if let Some(ref it) = (it).0 {
David Tolnay7ac699c2018-08-24 14:00:58 -04002354 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002355 };
2356 _visitor.visit_path(&(it).1);
David Tolnay7ac699c2018-08-24 14:00:58 -04002357 tokens_helper(_visitor, &(it).2.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002358 };
2359 _visitor.visit_type(&*_i.self_ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002360 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002361 for it in &_i.items {
2362 _visitor.visit_impl_item(it)
2363 }
David Tolnayc6b55bc2017-11-09 22:48:38 -08002364}
David Tolnay8c81f622018-07-31 23:34:35 -07002365#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002366pub fn visit_item_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemMacro) {
David Tolnay8c81f622018-07-31 23:34:35 -07002367 for it in &_i.attrs {
2368 _visitor.visit_attribute(it)
2369 }
2370 if let Some(ref it) = _i.ident {
2371 _visitor.visit_ident(it)
2372 };
2373 _visitor.visit_macro(&_i.mac);
2374 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002375 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002376 };
David Tolnayc6b55bc2017-11-09 22:48:38 -08002377}
David Tolnay8c81f622018-07-31 23:34:35 -07002378#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002379pub fn visit_item_macro2<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemMacro2) {
David Tolnay8c81f622018-07-31 23:34:35 -07002380 for it in &_i.attrs {
2381 _visitor.visit_attribute(it)
2382 }
2383 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002384 tokens_helper(_visitor, &_i.macro_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002385 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002386 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay6af48992018-08-01 11:16:28 -07002387 skip!(_i.args);
David Tolnay7ac699c2018-08-24 14:00:58 -04002388 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay6af48992018-08-01 11:16:28 -07002389 skip!(_i.body);
David Tolnay500d8322017-12-18 00:32:51 -08002390}
David Tolnay8c81f622018-07-31 23:34:35 -07002391#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002392pub fn visit_item_mod<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemMod) {
David Tolnay8c81f622018-07-31 23:34:35 -07002393 for it in &_i.attrs {
2394 _visitor.visit_attribute(it)
2395 }
2396 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002397 tokens_helper(_visitor, &_i.mod_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002398 _visitor.visit_ident(&_i.ident);
2399 if let Some(ref it) = _i.content {
David Tolnay7ac699c2018-08-24 14:00:58 -04002400 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002401 for it in &(it).1 {
2402 _visitor.visit_item(it)
2403 }
2404 };
2405 if let Some(ref it) = _i.semi {
David Tolnay7ac699c2018-08-24 14:00:58 -04002406 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002407 };
Nika Layzell27726662017-10-24 23:16:35 -04002408}
David Tolnay8c81f622018-07-31 23:34:35 -07002409#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002410pub fn visit_item_static<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemStatic) {
David Tolnay8c81f622018-07-31 23:34:35 -07002411 for it in &_i.attrs {
2412 _visitor.visit_attribute(it)
2413 }
2414 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002415 tokens_helper(_visitor, &_i.static_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002416 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04002417 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002418 };
2419 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002420 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002421 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002422 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002423 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04002424 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002425}
David Tolnay8c81f622018-07-31 23:34:35 -07002426#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002427pub fn visit_item_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemStruct) {
David Tolnay8c81f622018-07-31 23:34:35 -07002428 for it in &_i.attrs {
2429 _visitor.visit_attribute(it)
2430 }
2431 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002432 tokens_helper(_visitor, &_i.struct_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002433 _visitor.visit_ident(&_i.ident);
2434 _visitor.visit_generics(&_i.generics);
2435 _visitor.visit_fields(&_i.fields);
2436 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002437 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002438 };
Nika Layzell27726662017-10-24 23:16:35 -04002439}
David Tolnay8c81f622018-07-31 23:34:35 -07002440#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002441pub fn visit_item_trait<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemTrait) {
David Tolnay8c81f622018-07-31 23:34:35 -07002442 for it in &_i.attrs {
2443 _visitor.visit_attribute(it)
2444 }
2445 _visitor.visit_visibility(&_i.vis);
2446 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002447 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002448 };
2449 if let Some(ref it) = _i.auto_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002450 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002451 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002452 tokens_helper(_visitor, &_i.trait_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002453 _visitor.visit_ident(&_i.ident);
2454 _visitor.visit_generics(&_i.generics);
2455 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002456 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002457 };
2458 for el in Punctuated::pairs(&_i.supertraits) {
2459 let it = el.value();
2460 _visitor.visit_type_param_bound(it)
2461 }
David Tolnay7ac699c2018-08-24 14:00:58 -04002462 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002463 for it in &_i.items {
2464 _visitor.visit_trait_item(it)
2465 }
Nika Layzell27726662017-10-24 23:16:35 -04002466}
David Tolnay8c81f622018-07-31 23:34:35 -07002467#[cfg(feature = "full")]
David Tolnayc6b04dd2018-08-30 23:22:51 -07002468pub fn visit_item_trait_alias<'ast, V: Visit<'ast> + ?Sized>(
2469 _visitor: &mut V,
2470 _i: &'ast ItemTraitAlias,
2471) {
2472 for it in &_i.attrs {
2473 _visitor.visit_attribute(it)
2474 }
2475 _visitor.visit_visibility(&_i.vis);
2476 tokens_helper(_visitor, &_i.trait_token.span);
2477 _visitor.visit_ident(&_i.ident);
2478 _visitor.visit_generics(&_i.generics);
2479 tokens_helper(_visitor, &_i.eq_token.spans);
2480 for el in Punctuated::pairs(&_i.bounds) {
2481 let it = el.value();
2482 _visitor.visit_type_param_bound(it)
2483 }
2484 tokens_helper(_visitor, &_i.semi_token.spans);
2485}
2486#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002487pub fn visit_item_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemType) {
David Tolnay8c81f622018-07-31 23:34:35 -07002488 for it in &_i.attrs {
2489 _visitor.visit_attribute(it)
2490 }
2491 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002492 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002493 _visitor.visit_ident(&_i.ident);
2494 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04002495 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002496 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002497 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002498}
David Tolnay8c81f622018-07-31 23:34:35 -07002499#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002500pub fn visit_item_union<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemUnion) {
David Tolnay8c81f622018-07-31 23:34:35 -07002501 for it in &_i.attrs {
2502 _visitor.visit_attribute(it)
2503 }
2504 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002505 tokens_helper(_visitor, &_i.union_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002506 _visitor.visit_ident(&_i.ident);
2507 _visitor.visit_generics(&_i.generics);
2508 _visitor.visit_fields_named(&_i.fields);
Nika Layzell27726662017-10-24 23:16:35 -04002509}
David Tolnay8c81f622018-07-31 23:34:35 -07002510#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002511pub fn visit_item_use<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemUse) {
David Tolnay8c81f622018-07-31 23:34:35 -07002512 for it in &_i.attrs {
2513 _visitor.visit_attribute(it)
2514 }
2515 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002516 tokens_helper(_visitor, &_i.use_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002517 if let Some(ref it) = _i.leading_colon {
David Tolnay7ac699c2018-08-24 14:00:58 -04002518 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002519 };
2520 _visitor.visit_use_tree(&_i.tree);
David Tolnay7ac699c2018-08-24 14:00:58 -04002521 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002522}
David Tolnay8c81f622018-07-31 23:34:35 -07002523#[cfg(feature = "full")]
2524pub fn visit_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
2525 _visitor: &mut V,
2526 _i: &'ast ItemVerbatim,
2527) {
David Tolnay6af48992018-08-01 11:16:28 -07002528 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05002529}
David Tolnay8c81f622018-07-31 23:34:35 -07002530#[cfg(any(feature = "full", feature = "derive"))]
2531#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002532pub fn visit_label<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Label) {
David Tolnay8c81f622018-07-31 23:34:35 -07002533 _visitor.visit_lifetime(&_i.name);
David Tolnay7ac699c2018-08-24 14:00:58 -04002534 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnaybcd498f2017-12-29 12:02:33 -05002535}
David Tolnay4b4c4b62018-01-06 13:48:05 -08002536pub fn visit_lifetime<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Lifetime) {
David Tolnay17f63892018-08-31 10:36:32 -07002537 _visitor.visit_span(&_i.apostrophe);
David Tolnay8c81f622018-07-31 23:34:35 -07002538 _visitor.visit_ident(&_i.ident);
David Tolnay4ba63a02017-12-28 15:53:05 -05002539}
David Tolnay8c81f622018-07-31 23:34:35 -07002540#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002541pub fn visit_lifetime_def<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LifetimeDef) {
David Tolnay8c81f622018-07-31 23:34:35 -07002542 for it in &_i.attrs {
2543 _visitor.visit_attribute(it)
2544 }
2545 _visitor.visit_lifetime(&_i.lifetime);
2546 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002547 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002548 };
2549 for el in Punctuated::pairs(&_i.bounds) {
2550 let it = el.value();
2551 _visitor.visit_lifetime(it)
2552 }
David Tolnay4ba63a02017-12-28 15:53:05 -05002553}
David Tolnay8c81f622018-07-31 23:34:35 -07002554#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002555pub fn visit_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Lit) {
David Tolnay360efd22018-01-04 23:35:26 -08002556 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002557 Lit::Str(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002558 _visitor.visit_lit_str(_binding_0);
2559 }
David Tolnay8c81f622018-07-31 23:34:35 -07002560 Lit::ByteStr(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002561 _visitor.visit_lit_byte_str(_binding_0);
2562 }
David Tolnay8c81f622018-07-31 23:34:35 -07002563 Lit::Byte(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002564 _visitor.visit_lit_byte(_binding_0);
2565 }
David Tolnay8c81f622018-07-31 23:34:35 -07002566 Lit::Char(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002567 _visitor.visit_lit_char(_binding_0);
2568 }
David Tolnay8c81f622018-07-31 23:34:35 -07002569 Lit::Int(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002570 _visitor.visit_lit_int(_binding_0);
2571 }
David Tolnay8c81f622018-07-31 23:34:35 -07002572 Lit::Float(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002573 _visitor.visit_lit_float(_binding_0);
2574 }
David Tolnay8c81f622018-07-31 23:34:35 -07002575 Lit::Bool(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002576 _visitor.visit_lit_bool(_binding_0);
2577 }
David Tolnay8c81f622018-07-31 23:34:35 -07002578 Lit::Verbatim(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002579 _visitor.visit_lit_verbatim(_binding_0);
2580 }
2581 }
2582}
David Tolnay8c81f622018-07-31 23:34:35 -07002583#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002584pub fn visit_lit_bool<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitBool) {
David Tolnay6af48992018-08-01 11:16:28 -07002585 skip!(_i.value);
David Tolnay8c81f622018-07-31 23:34:35 -07002586 _visitor.visit_span(&_i.span);
Nika Layzell27726662017-10-24 23:16:35 -04002587}
David Tolnay8c81f622018-07-31 23:34:35 -07002588#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002589pub fn visit_lit_byte<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitByte) {
David Tolnay6af48992018-08-01 11:16:28 -07002590 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002591}
David Tolnay8c81f622018-07-31 23:34:35 -07002592#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002593pub fn visit_lit_byte_str<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitByteStr) {
David Tolnay6af48992018-08-01 11:16:28 -07002594 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002595}
David Tolnay8c81f622018-07-31 23:34:35 -07002596#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002597pub fn visit_lit_char<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitChar) {
David Tolnay6af48992018-08-01 11:16:28 -07002598 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002599}
David Tolnay8c81f622018-07-31 23:34:35 -07002600#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002601pub fn visit_lit_float<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitFloat) {
David Tolnay6af48992018-08-01 11:16:28 -07002602 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002603}
David Tolnay8c81f622018-07-31 23:34:35 -07002604#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002605pub fn visit_lit_int<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitInt) {
David Tolnay6af48992018-08-01 11:16:28 -07002606 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002607}
David Tolnay8c81f622018-07-31 23:34:35 -07002608#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002609pub fn visit_lit_str<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitStr) {
David Tolnay6af48992018-08-01 11:16:28 -07002610 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002611}
David Tolnay8c81f622018-07-31 23:34:35 -07002612#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002613pub fn visit_lit_verbatim<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitVerbatim) {
David Tolnay6af48992018-08-01 11:16:28 -07002614 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002615}
David Tolnay8c81f622018-07-31 23:34:35 -07002616#[cfg(any(feature = "full", feature = "derive"))]
2617#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002618pub fn visit_local<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Local) {
David Tolnay8c81f622018-07-31 23:34:35 -07002619 for it in &_i.attrs {
2620 _visitor.visit_attribute(it)
2621 }
David Tolnay7ac699c2018-08-24 14:00:58 -04002622 tokens_helper(_visitor, &_i.let_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002623 for el in Punctuated::pairs(&_i.pats) {
2624 let it = el.value();
2625 _visitor.visit_pat(it)
2626 }
2627 if let Some(ref it) = _i.ty {
David Tolnay7ac699c2018-08-24 14:00:58 -04002628 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002629 _visitor.visit_type(&*(it).1);
2630 };
2631 if let Some(ref it) = _i.init {
David Tolnay7ac699c2018-08-24 14:00:58 -04002632 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002633 _visitor.visit_expr(&*(it).1);
2634 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002635 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002636}
David Tolnay8c81f622018-07-31 23:34:35 -07002637#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002638pub fn visit_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Macro) {
David Tolnay8c81f622018-07-31 23:34:35 -07002639 _visitor.visit_path(&_i.path);
David Tolnay7ac699c2018-08-24 14:00:58 -04002640 tokens_helper(_visitor, &_i.bang_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002641 _visitor.visit_macro_delimiter(&_i.delimiter);
David Tolnay6af48992018-08-01 11:16:28 -07002642 skip!(_i.tts);
David Tolnayab919512017-12-30 23:31:51 -05002643}
David Tolnay8c81f622018-07-31 23:34:35 -07002644#[cfg(any(feature = "full", feature = "derive"))]
2645pub fn visit_macro_delimiter<'ast, V: Visit<'ast> + ?Sized>(
2646 _visitor: &mut V,
2647 _i: &'ast MacroDelimiter,
2648) {
David Tolnayab919512017-12-30 23:31:51 -05002649 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002650 MacroDelimiter::Paren(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002651 tokens_helper(_visitor, &_binding_0.span);
David Tolnayab919512017-12-30 23:31:51 -05002652 }
David Tolnay8c81f622018-07-31 23:34:35 -07002653 MacroDelimiter::Brace(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002654 tokens_helper(_visitor, &_binding_0.span);
David Tolnayab919512017-12-30 23:31:51 -05002655 }
David Tolnay8c81f622018-07-31 23:34:35 -07002656 MacroDelimiter::Bracket(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002657 tokens_helper(_visitor, &_binding_0.span);
David Tolnayab919512017-12-30 23:31:51 -05002658 }
2659 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002660}
David Tolnay8c81f622018-07-31 23:34:35 -07002661#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002662pub fn visit_member<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Member) {
David Tolnay85b69a42017-12-27 20:43:10 -05002663 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002664 Member::Named(ref _binding_0) => {
Alex Crichtond261d092018-05-18 13:47:35 -07002665 _visitor.visit_ident(_binding_0);
David Tolnay85b69a42017-12-27 20:43:10 -05002666 }
David Tolnay8c81f622018-07-31 23:34:35 -07002667 Member::Unnamed(ref _binding_0) => {
David Tolnay85b69a42017-12-27 20:43:10 -05002668 _visitor.visit_index(_binding_0);
2669 }
2670 }
2671}
David Tolnay8c81f622018-07-31 23:34:35 -07002672#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayaaadd782018-01-06 22:58:13 -08002673pub fn visit_meta<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Meta) {
Nika Layzell27726662017-10-24 23:16:35 -04002674 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002675 Meta::Word(ref _binding_0) => {
Alex Crichtond261d092018-05-18 13:47:35 -07002676 _visitor.visit_ident(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002677 }
David Tolnay8c81f622018-07-31 23:34:35 -07002678 Meta::List(ref _binding_0) => {
David Tolnayaaadd782018-01-06 22:58:13 -08002679 _visitor.visit_meta_list(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002680 }
David Tolnay8c81f622018-07-31 23:34:35 -07002681 Meta::NameValue(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002682 _visitor.visit_meta_name_value(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002683 }
2684 }
2685}
David Tolnay8c81f622018-07-31 23:34:35 -07002686#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayaaadd782018-01-06 22:58:13 -08002687pub fn visit_meta_list<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast MetaList) {
David Tolnay8c81f622018-07-31 23:34:35 -07002688 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002689 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002690 for el in Punctuated::pairs(&_i.nested) {
2691 let it = el.value();
2692 _visitor.visit_nested_meta(it)
2693 }
Nika Layzell27726662017-10-24 23:16:35 -04002694}
David Tolnay8c81f622018-07-31 23:34:35 -07002695#[cfg(any(feature = "full", feature = "derive"))]
2696pub fn visit_meta_name_value<'ast, V: Visit<'ast> + ?Sized>(
2697 _visitor: &mut V,
2698 _i: &'ast MetaNameValue,
2699) {
2700 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002701 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002702 _visitor.visit_lit(&_i.lit);
Nika Layzell27726662017-10-24 23:16:35 -04002703}
David Tolnay8c81f622018-07-31 23:34:35 -07002704#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002705pub fn visit_method_sig<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast MethodSig) {
David Tolnay8c81f622018-07-31 23:34:35 -07002706 if let Some(ref it) = _i.constness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002707 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002708 };
2709 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002710 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002711 };
Yusuke Sasakif00a3ef2018-07-20 22:08:42 +09002712 if let Some(ref it) = _i.asyncness {
2713 tokens_helper(_visitor, &it.span)
2714 };
David Tolnay8c81f622018-07-31 23:34:35 -07002715 if let Some(ref it) = _i.abi {
2716 _visitor.visit_abi(it)
2717 };
2718 _visitor.visit_ident(&_i.ident);
2719 _visitor.visit_fn_decl(&_i.decl);
Nika Layzell27726662017-10-24 23:16:35 -04002720}
David Tolnay8c81f622018-07-31 23:34:35 -07002721#[cfg(any(feature = "full", feature = "derive"))]
2722#[cfg(feature = "full")]
2723pub fn visit_method_turbofish<'ast, V: Visit<'ast> + ?Sized>(
2724 _visitor: &mut V,
2725 _i: &'ast MethodTurbofish,
2726) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002727 tokens_helper(_visitor, &_i.colon2_token.spans);
2728 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002729 for el in Punctuated::pairs(&_i.args) {
2730 let it = el.value();
2731 _visitor.visit_generic_method_argument(it)
2732 }
David Tolnay7ac699c2018-08-24 14:00:58 -04002733 tokens_helper(_visitor, &_i.gt_token.spans);
David Tolnayd60cfec2017-12-29 00:21:38 -05002734}
David Tolnay8c81f622018-07-31 23:34:35 -07002735#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayaaadd782018-01-06 22:58:13 -08002736pub fn visit_nested_meta<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast NestedMeta) {
Nika Layzell27726662017-10-24 23:16:35 -04002737 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002738 NestedMeta::Meta(ref _binding_0) => {
David Tolnayaaadd782018-01-06 22:58:13 -08002739 _visitor.visit_meta(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002740 }
David Tolnay8c81f622018-07-31 23:34:35 -07002741 NestedMeta::Literal(ref _binding_0) => {
David Tolnay4ba63a02017-12-28 15:53:05 -05002742 _visitor.visit_lit(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002743 }
2744 }
2745}
David Tolnay8c81f622018-07-31 23:34:35 -07002746#[cfg(any(feature = "full", feature = "derive"))]
2747pub fn visit_parenthesized_generic_arguments<'ast, V: Visit<'ast> + ?Sized>(
2748 _visitor: &mut V,
2749 _i: &'ast ParenthesizedGenericArguments,
2750) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002751 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002752 for el in Punctuated::pairs(&_i.inputs) {
2753 let it = el.value();
2754 _visitor.visit_type(it)
2755 }
2756 _visitor.visit_return_type(&_i.output);
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<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Pat) {
Nika Layzell27726662017-10-24 23:16:35 -04002761 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002762 Pat::Wild(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002763 _visitor.visit_pat_wild(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002764 }
David Tolnay8c81f622018-07-31 23:34:35 -07002765 Pat::Ident(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002766 _visitor.visit_pat_ident(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002767 }
David Tolnay8c81f622018-07-31 23:34:35 -07002768 Pat::Struct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002769 _visitor.visit_pat_struct(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002770 }
David Tolnay8c81f622018-07-31 23:34:35 -07002771 Pat::TupleStruct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002772 _visitor.visit_pat_tuple_struct(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002773 }
David Tolnay8c81f622018-07-31 23:34:35 -07002774 Pat::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002775 _visitor.visit_pat_path(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002776 }
David Tolnay8c81f622018-07-31 23:34:35 -07002777 Pat::Tuple(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002778 _visitor.visit_pat_tuple(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002779 }
David Tolnay8c81f622018-07-31 23:34:35 -07002780 Pat::Box(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002781 _visitor.visit_pat_box(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002782 }
David Tolnay8c81f622018-07-31 23:34:35 -07002783 Pat::Ref(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002784 _visitor.visit_pat_ref(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002785 }
David Tolnay8c81f622018-07-31 23:34:35 -07002786 Pat::Lit(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002787 _visitor.visit_pat_lit(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002788 }
David Tolnay8c81f622018-07-31 23:34:35 -07002789 Pat::Range(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002790 _visitor.visit_pat_range(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002791 }
David Tolnay8c81f622018-07-31 23:34:35 -07002792 Pat::Slice(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002793 _visitor.visit_pat_slice(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002794 }
David Tolnay8c81f622018-07-31 23:34:35 -07002795 Pat::Macro(ref _binding_0) => {
David Tolnay323279a2017-12-29 11:26:32 -05002796 _visitor.visit_pat_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002797 }
David Tolnay8c81f622018-07-31 23:34:35 -07002798 Pat::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002799 _visitor.visit_pat_verbatim(_binding_0);
2800 }
Nika Layzell27726662017-10-24 23:16:35 -04002801 }
2802}
David Tolnay8c81f622018-07-31 23:34:35 -07002803#[cfg(any(feature = "full", feature = "derive"))]
2804#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002805pub fn visit_pat_box<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatBox) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002806 tokens_helper(_visitor, &_i.box_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002807 _visitor.visit_pat(&*_i.pat);
Nika Layzell27726662017-10-24 23:16:35 -04002808}
David Tolnay8c81f622018-07-31 23:34:35 -07002809#[cfg(any(feature = "full", feature = "derive"))]
2810#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002811pub fn visit_pat_ident<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatIdent) {
David Tolnay8c81f622018-07-31 23:34:35 -07002812 if let Some(ref it) = _i.by_ref {
David Tolnay7ac699c2018-08-24 14:00:58 -04002813 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002814 };
2815 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04002816 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002817 };
2818 _visitor.visit_ident(&_i.ident);
2819 if let Some(ref it) = _i.subpat {
David Tolnay7ac699c2018-08-24 14:00:58 -04002820 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002821 _visitor.visit_pat(&*(it).1);
2822 };
Nika Layzell27726662017-10-24 23:16:35 -04002823}
David Tolnay8c81f622018-07-31 23:34:35 -07002824#[cfg(any(feature = "full", feature = "derive"))]
2825#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002826pub fn visit_pat_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatLit) {
David Tolnay8c81f622018-07-31 23:34:35 -07002827 _visitor.visit_expr(&*_i.expr);
Nika Layzell27726662017-10-24 23:16:35 -04002828}
David Tolnay8c81f622018-07-31 23:34:35 -07002829#[cfg(any(feature = "full", feature = "derive"))]
2830#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002831pub fn visit_pat_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatMacro) {
David Tolnay8c81f622018-07-31 23:34:35 -07002832 _visitor.visit_macro(&_i.mac);
David Tolnay323279a2017-12-29 11:26:32 -05002833}
David Tolnay8c81f622018-07-31 23:34:35 -07002834#[cfg(any(feature = "full", feature = "derive"))]
2835#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002836pub fn visit_pat_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatPath) {
David Tolnay8c81f622018-07-31 23:34:35 -07002837 if let Some(ref it) = _i.qself {
2838 _visitor.visit_qself(it)
2839 };
2840 _visitor.visit_path(&_i.path);
Nika Layzell27726662017-10-24 23:16:35 -04002841}
David Tolnay8c81f622018-07-31 23:34:35 -07002842#[cfg(any(feature = "full", feature = "derive"))]
2843#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002844pub fn visit_pat_range<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatRange) {
David Tolnay8c81f622018-07-31 23:34:35 -07002845 _visitor.visit_expr(&*_i.lo);
2846 _visitor.visit_range_limits(&_i.limits);
2847 _visitor.visit_expr(&*_i.hi);
Nika Layzell27726662017-10-24 23:16:35 -04002848}
David Tolnay8c81f622018-07-31 23:34:35 -07002849#[cfg(any(feature = "full", feature = "derive"))]
2850#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002851pub fn visit_pat_ref<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatRef) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002852 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002853 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04002854 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002855 };
2856 _visitor.visit_pat(&*_i.pat);
Nika Layzell27726662017-10-24 23:16:35 -04002857}
David Tolnay8c81f622018-07-31 23:34:35 -07002858#[cfg(any(feature = "full", feature = "derive"))]
2859#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002860pub fn visit_pat_slice<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatSlice) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002861 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002862 for el in Punctuated::pairs(&_i.front) {
2863 let it = el.value();
2864 _visitor.visit_pat(it)
2865 }
2866 if let Some(ref it) = _i.middle {
2867 _visitor.visit_pat(&**it)
2868 };
2869 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002870 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002871 };
2872 if let Some(ref it) = _i.comma_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002873 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002874 };
2875 for el in Punctuated::pairs(&_i.back) {
2876 let it = el.value();
2877 _visitor.visit_pat(it)
2878 }
Nika Layzell27726662017-10-24 23:16:35 -04002879}
David Tolnay8c81f622018-07-31 23:34:35 -07002880#[cfg(any(feature = "full", feature = "derive"))]
2881#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002882pub fn visit_pat_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatStruct) {
David Tolnay8c81f622018-07-31 23:34:35 -07002883 _visitor.visit_path(&_i.path);
David Tolnay7ac699c2018-08-24 14:00:58 -04002884 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002885 for el in Punctuated::pairs(&_i.fields) {
2886 let it = el.value();
2887 _visitor.visit_field_pat(it)
2888 }
2889 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002890 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002891 };
Nika Layzell27726662017-10-24 23:16:35 -04002892}
David Tolnay8c81f622018-07-31 23:34:35 -07002893#[cfg(any(feature = "full", feature = "derive"))]
2894#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002895pub fn visit_pat_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatTuple) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002896 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002897 for el in Punctuated::pairs(&_i.front) {
2898 let it = el.value();
2899 _visitor.visit_pat(it)
2900 }
2901 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002902 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002903 };
2904 if let Some(ref it) = _i.comma_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002905 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002906 };
2907 for el in Punctuated::pairs(&_i.back) {
2908 let it = el.value();
2909 _visitor.visit_pat(it)
2910 }
Nika Layzell27726662017-10-24 23:16:35 -04002911}
David Tolnay8c81f622018-07-31 23:34:35 -07002912#[cfg(any(feature = "full", feature = "derive"))]
2913#[cfg(feature = "full")]
2914pub fn visit_pat_tuple_struct<'ast, V: Visit<'ast> + ?Sized>(
2915 _visitor: &mut V,
2916 _i: &'ast PatTupleStruct,
2917) {
2918 _visitor.visit_path(&_i.path);
2919 _visitor.visit_pat_tuple(&_i.pat);
Nika Layzell27726662017-10-24 23:16:35 -04002920}
David Tolnay8c81f622018-07-31 23:34:35 -07002921#[cfg(any(feature = "full", feature = "derive"))]
2922#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002923pub fn visit_pat_verbatim<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatVerbatim) {
David Tolnay6af48992018-08-01 11:16:28 -07002924 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05002925}
David Tolnay8c81f622018-07-31 23:34:35 -07002926#[cfg(any(feature = "full", feature = "derive"))]
2927#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002928pub fn visit_pat_wild<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatWild) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002929 tokens_helper(_visitor, &_i.underscore_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002930}
David Tolnay8c81f622018-07-31 23:34:35 -07002931#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002932pub fn visit_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Path) {
David Tolnay8c81f622018-07-31 23:34:35 -07002933 if let Some(ref it) = _i.leading_colon {
David Tolnay7ac699c2018-08-24 14:00:58 -04002934 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002935 };
2936 for el in Punctuated::pairs(&_i.segments) {
2937 let it = el.value();
2938 _visitor.visit_path_segment(it)
2939 }
Nika Layzell27726662017-10-24 23:16:35 -04002940}
David Tolnay8c81f622018-07-31 23:34:35 -07002941#[cfg(any(feature = "full", feature = "derive"))]
2942pub fn visit_path_arguments<'ast, V: Visit<'ast> + ?Sized>(
2943 _visitor: &mut V,
2944 _i: &'ast PathArguments,
2945) {
Nika Layzellc08227a2017-12-04 16:30:17 -05002946 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002947 PathArguments::None => {}
2948 PathArguments::AngleBracketed(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002949 _visitor.visit_angle_bracketed_generic_arguments(_binding_0);
Nika Layzellc08227a2017-12-04 16:30:17 -05002950 }
David Tolnay8c81f622018-07-31 23:34:35 -07002951 PathArguments::Parenthesized(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002952 _visitor.visit_parenthesized_generic_arguments(_binding_0);
Nika Layzellc08227a2017-12-04 16:30:17 -05002953 }
2954 }
2955}
David Tolnay8c81f622018-07-31 23:34:35 -07002956#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002957pub fn visit_path_segment<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PathSegment) {
David Tolnay8c81f622018-07-31 23:34:35 -07002958 _visitor.visit_ident(&_i.ident);
2959 _visitor.visit_path_arguments(&_i.arguments);
Nika Layzell27726662017-10-24 23:16:35 -04002960}
David Tolnay8c81f622018-07-31 23:34:35 -07002961#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002962pub fn visit_predicate_eq<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PredicateEq) {
David Tolnay8c81f622018-07-31 23:34:35 -07002963 _visitor.visit_type(&_i.lhs_ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002964 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002965 _visitor.visit_type(&_i.rhs_ty);
David Tolnayd4add852018-01-01 20:13:24 -08002966}
David Tolnay8c81f622018-07-31 23:34:35 -07002967#[cfg(any(feature = "full", feature = "derive"))]
2968pub fn visit_predicate_lifetime<'ast, V: Visit<'ast> + ?Sized>(
2969 _visitor: &mut V,
2970 _i: &'ast PredicateLifetime,
2971) {
2972 _visitor.visit_lifetime(&_i.lifetime);
David Tolnay1b8e2852018-08-26 08:25:18 -04002973 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002974 for el in Punctuated::pairs(&_i.bounds) {
2975 let it = el.value();
2976 _visitor.visit_lifetime(it)
2977 }
David Tolnayd4add852018-01-01 20:13:24 -08002978}
David Tolnay8c81f622018-07-31 23:34:35 -07002979#[cfg(any(feature = "full", feature = "derive"))]
2980pub fn visit_predicate_type<'ast, V: Visit<'ast> + ?Sized>(
2981 _visitor: &mut V,
2982 _i: &'ast PredicateType,
2983) {
2984 if let Some(ref it) = _i.lifetimes {
2985 _visitor.visit_bound_lifetimes(it)
2986 };
2987 _visitor.visit_type(&_i.bounded_ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002988 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002989 for el in Punctuated::pairs(&_i.bounds) {
2990 let it = el.value();
2991 _visitor.visit_type_param_bound(it)
2992 }
David Tolnayd4add852018-01-01 20:13:24 -08002993}
David Tolnay8c81f622018-07-31 23:34:35 -07002994#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002995pub fn visit_qself<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast QSelf) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002996 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002997 _visitor.visit_type(&*_i.ty);
David Tolnay6af48992018-08-01 11:16:28 -07002998 skip!(_i.position);
David Tolnay8c81f622018-07-31 23:34:35 -07002999 if let Some(ref it) = _i.as_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003000 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003001 };
David Tolnay7ac699c2018-08-24 14:00:58 -04003002 tokens_helper(_visitor, &_i.gt_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003003}
David Tolnay8c81f622018-07-31 23:34:35 -07003004#[cfg(any(feature = "full", feature = "derive"))]
3005#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003006pub fn visit_range_limits<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast RangeLimits) {
Nika Layzell27726662017-10-24 23:16:35 -04003007 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003008 RangeLimits::HalfOpen(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003009 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003010 }
David Tolnay8c81f622018-07-31 23:34:35 -07003011 RangeLimits::Closed(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003012 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003013 }
3014 }
3015}
David Tolnay8c81f622018-07-31 23:34:35 -07003016#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003017pub fn visit_return_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ReturnType) {
David Tolnayf93b90d2017-11-11 19:21:26 -08003018 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003019 ReturnType::Default => {}
3020 ReturnType::Type(ref _binding_0, ref _binding_1) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003021 tokens_helper(_visitor, &_binding_0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003022 _visitor.visit_type(&**_binding_1);
David Tolnayf93b90d2017-11-11 19:21:26 -08003023 }
3024 }
3025}
David Tolnay8c81f622018-07-31 23:34:35 -07003026pub fn visit_span<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Span) {}
3027#[cfg(any(feature = "full", feature = "derive"))]
3028#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003029pub fn visit_stmt<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Stmt) {
Nika Layzell27726662017-10-24 23:16:35 -04003030 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003031 Stmt::Local(ref _binding_0) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08003032 _visitor.visit_local(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003033 }
David Tolnay8c81f622018-07-31 23:34:35 -07003034 Stmt::Item(ref _binding_0) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08003035 _visitor.visit_item(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003036 }
David Tolnay8c81f622018-07-31 23:34:35 -07003037 Stmt::Expr(ref _binding_0) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08003038 _visitor.visit_expr(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003039 }
David Tolnay8c81f622018-07-31 23:34:35 -07003040 Stmt::Semi(ref _binding_0, ref _binding_1) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08003041 _visitor.visit_expr(_binding_0);
David Tolnay7ac699c2018-08-24 14:00:58 -04003042 tokens_helper(_visitor, &_binding_1.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003043 }
Nika Layzell27726662017-10-24 23:16:35 -04003044 }
3045}
David Tolnay8c81f622018-07-31 23:34:35 -07003046#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003047pub fn visit_trait_bound<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TraitBound) {
David Tolnay8c81f622018-07-31 23:34:35 -07003048 if let Some(ref it) = _i.paren_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003049 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003050 };
3051 _visitor.visit_trait_bound_modifier(&_i.modifier);
3052 if let Some(ref it) = _i.lifetimes {
3053 _visitor.visit_bound_lifetimes(it)
3054 };
3055 _visitor.visit_path(&_i.path);
David Tolnay40fb8ce2018-01-02 10:53:46 -08003056}
David Tolnay8c81f622018-07-31 23:34:35 -07003057#[cfg(any(feature = "full", feature = "derive"))]
3058pub fn visit_trait_bound_modifier<'ast, V: Visit<'ast> + ?Sized>(
3059 _visitor: &mut V,
3060 _i: &'ast TraitBoundModifier,
3061) {
Nika Layzell27726662017-10-24 23:16:35 -04003062 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003063 TraitBoundModifier::None => {}
3064 TraitBoundModifier::Maybe(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003065 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003066 }
3067 }
3068}
David Tolnay8c81f622018-07-31 23:34:35 -07003069#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003070pub fn visit_trait_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TraitItem) {
Nika Layzell27726662017-10-24 23:16:35 -04003071 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003072 TraitItem::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003073 _visitor.visit_trait_item_const(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003074 }
David Tolnay8c81f622018-07-31 23:34:35 -07003075 TraitItem::Method(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003076 _visitor.visit_trait_item_method(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003077 }
David Tolnay8c81f622018-07-31 23:34:35 -07003078 TraitItem::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003079 _visitor.visit_trait_item_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003080 }
David Tolnay8c81f622018-07-31 23:34:35 -07003081 TraitItem::Macro(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003082 _visitor.visit_trait_item_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003083 }
David Tolnay8c81f622018-07-31 23:34:35 -07003084 TraitItem::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05003085 _visitor.visit_trait_item_verbatim(_binding_0);
3086 }
Nika Layzell27726662017-10-24 23:16:35 -04003087 }
3088}
David Tolnay8c81f622018-07-31 23:34:35 -07003089#[cfg(feature = "full")]
3090pub fn visit_trait_item_const<'ast, V: Visit<'ast> + ?Sized>(
3091 _visitor: &mut V,
3092 _i: &'ast TraitItemConst,
3093) {
3094 for it in &_i.attrs {
3095 _visitor.visit_attribute(it)
3096 }
David Tolnay7ac699c2018-08-24 14:00:58 -04003097 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003098 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04003099 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003100 _visitor.visit_type(&_i.ty);
3101 if let Some(ref it) = _i.default {
David Tolnay7ac699c2018-08-24 14:00:58 -04003102 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003103 _visitor.visit_expr(&(it).1);
3104 };
David Tolnay7ac699c2018-08-24 14:00:58 -04003105 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnayda705bd2017-11-10 21:58:05 -08003106}
David Tolnay8c81f622018-07-31 23:34:35 -07003107#[cfg(feature = "full")]
3108pub fn visit_trait_item_macro<'ast, V: Visit<'ast> + ?Sized>(
3109 _visitor: &mut V,
3110 _i: &'ast TraitItemMacro,
3111) {
3112 for it in &_i.attrs {
3113 _visitor.visit_attribute(it)
3114 }
3115 _visitor.visit_macro(&_i.mac);
3116 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003117 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003118 };
David Tolnayda705bd2017-11-10 21:58:05 -08003119}
David Tolnay8c81f622018-07-31 23:34:35 -07003120#[cfg(feature = "full")]
3121pub fn visit_trait_item_method<'ast, V: Visit<'ast> + ?Sized>(
3122 _visitor: &mut V,
3123 _i: &'ast TraitItemMethod,
3124) {
3125 for it in &_i.attrs {
3126 _visitor.visit_attribute(it)
3127 }
3128 _visitor.visit_method_sig(&_i.sig);
3129 if let Some(ref it) = _i.default {
3130 _visitor.visit_block(it)
3131 };
3132 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003133 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003134 };
Nika Layzell27726662017-10-24 23:16:35 -04003135}
David Tolnay8c81f622018-07-31 23:34:35 -07003136#[cfg(feature = "full")]
3137pub fn visit_trait_item_type<'ast, V: Visit<'ast> + ?Sized>(
3138 _visitor: &mut V,
3139 _i: &'ast TraitItemType,
3140) {
3141 for it in &_i.attrs {
3142 _visitor.visit_attribute(it)
3143 }
David Tolnay7ac699c2018-08-24 14:00:58 -04003144 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003145 _visitor.visit_ident(&_i.ident);
3146 _visitor.visit_generics(&_i.generics);
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.default {
David Tolnay7ac699c2018-08-24 14:00:58 -04003155 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003156 _visitor.visit_type(&(it).1);
3157 };
David Tolnay7ac699c2018-08-24 14:00:58 -04003158 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003159}
David Tolnay8c81f622018-07-31 23:34:35 -07003160#[cfg(feature = "full")]
3161pub fn visit_trait_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
3162 _visitor: &mut V,
3163 _i: &'ast TraitItemVerbatim,
3164) {
David Tolnay6af48992018-08-01 11:16:28 -07003165 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05003166}
David Tolnay8c81f622018-07-31 23:34:35 -07003167#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003168pub fn visit_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Type) {
Nika Layzell27726662017-10-24 23:16:35 -04003169 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003170 Type::Slice(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003171 _visitor.visit_type_slice(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003172 }
David Tolnay8c81f622018-07-31 23:34:35 -07003173 Type::Array(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003174 _visitor.visit_type_array(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003175 }
David Tolnay8c81f622018-07-31 23:34:35 -07003176 Type::Ptr(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003177 _visitor.visit_type_ptr(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003178 }
David Tolnay8c81f622018-07-31 23:34:35 -07003179 Type::Reference(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003180 _visitor.visit_type_reference(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003181 }
David Tolnay8c81f622018-07-31 23:34:35 -07003182 Type::BareFn(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003183 _visitor.visit_type_bare_fn(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003184 }
David Tolnay8c81f622018-07-31 23:34:35 -07003185 Type::Never(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003186 _visitor.visit_type_never(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003187 }
David Tolnay8c81f622018-07-31 23:34:35 -07003188 Type::Tuple(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003189 _visitor.visit_type_tuple(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003190 }
David Tolnay8c81f622018-07-31 23:34:35 -07003191 Type::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003192 _visitor.visit_type_path(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003193 }
David Tolnay8c81f622018-07-31 23:34:35 -07003194 Type::TraitObject(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003195 _visitor.visit_type_trait_object(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003196 }
David Tolnay8c81f622018-07-31 23:34:35 -07003197 Type::ImplTrait(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003198 _visitor.visit_type_impl_trait(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003199 }
David Tolnay8c81f622018-07-31 23:34:35 -07003200 Type::Paren(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003201 _visitor.visit_type_paren(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003202 }
David Tolnay8c81f622018-07-31 23:34:35 -07003203 Type::Group(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003204 _visitor.visit_type_group(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003205 }
David Tolnay8c81f622018-07-31 23:34:35 -07003206 Type::Infer(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003207 _visitor.visit_type_infer(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003208 }
David Tolnay8c81f622018-07-31 23:34:35 -07003209 Type::Macro(ref _binding_0) => {
David Tolnay323279a2017-12-29 11:26:32 -05003210 _visitor.visit_type_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003211 }
David Tolnay8c81f622018-07-31 23:34:35 -07003212 Type::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05003213 _visitor.visit_type_verbatim(_binding_0);
3214 }
Nika Layzell27726662017-10-24 23:16:35 -04003215 }
3216}
David Tolnay8c81f622018-07-31 23:34:35 -07003217#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003218pub fn visit_type_array<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeArray) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003219 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003220 _visitor.visit_type(&*_i.elem);
David Tolnay7ac699c2018-08-24 14:00:58 -04003221 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003222 _visitor.visit_expr(&_i.len);
Nika Layzell27726662017-10-24 23:16:35 -04003223}
David Tolnay8c81f622018-07-31 23:34:35 -07003224#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003225pub fn visit_type_bare_fn<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeBareFn) {
David Tolnay3779bb72018-08-26 18:46:07 -07003226 if let Some(ref it) = _i.lifetimes {
3227 _visitor.visit_bound_lifetimes(it)
3228 };
David Tolnay8c81f622018-07-31 23:34:35 -07003229 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04003230 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003231 };
3232 if let Some(ref it) = _i.abi {
3233 _visitor.visit_abi(it)
3234 };
David Tolnay7ac699c2018-08-24 14:00:58 -04003235 tokens_helper(_visitor, &_i.fn_token.span);
David Tolnay7ac699c2018-08-24 14:00:58 -04003236 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003237 for el in Punctuated::pairs(&_i.inputs) {
3238 let it = el.value();
3239 _visitor.visit_bare_fn_arg(it)
3240 }
3241 if let Some(ref it) = _i.variadic {
David Tolnay7ac699c2018-08-24 14:00:58 -04003242 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003243 };
3244 _visitor.visit_return_type(&_i.output);
Nika Layzell27726662017-10-24 23:16:35 -04003245}
David Tolnay8c81f622018-07-31 23:34:35 -07003246#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003247pub fn visit_type_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeGroup) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003248 tokens_helper(_visitor, &_i.group_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003249 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003250}
David Tolnay8c81f622018-07-31 23:34:35 -07003251#[cfg(any(feature = "full", feature = "derive"))]
3252pub fn visit_type_impl_trait<'ast, V: Visit<'ast> + ?Sized>(
3253 _visitor: &mut V,
3254 _i: &'ast TypeImplTrait,
3255) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003256 tokens_helper(_visitor, &_i.impl_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003257 for el in Punctuated::pairs(&_i.bounds) {
3258 let it = el.value();
3259 _visitor.visit_type_param_bound(it)
3260 }
Nika Layzell27726662017-10-24 23:16:35 -04003261}
David Tolnay8c81f622018-07-31 23:34:35 -07003262#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003263pub fn visit_type_infer<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeInfer) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003264 tokens_helper(_visitor, &_i.underscore_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003265}
David Tolnay8c81f622018-07-31 23:34:35 -07003266#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003267pub fn visit_type_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeMacro) {
David Tolnay8c81f622018-07-31 23:34:35 -07003268 _visitor.visit_macro(&_i.mac);
David Tolnay323279a2017-12-29 11:26:32 -05003269}
David Tolnay8c81f622018-07-31 23:34:35 -07003270#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003271pub fn visit_type_never<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeNever) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003272 tokens_helper(_visitor, &_i.bang_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003273}
David Tolnay8c81f622018-07-31 23:34:35 -07003274#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003275pub fn visit_type_param<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeParam) {
David Tolnay8c81f622018-07-31 23:34:35 -07003276 for it in &_i.attrs {
3277 _visitor.visit_attribute(it)
3278 }
3279 _visitor.visit_ident(&_i.ident);
3280 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003281 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003282 };
3283 for el in Punctuated::pairs(&_i.bounds) {
3284 let it = el.value();
3285 _visitor.visit_type_param_bound(it)
3286 }
3287 if let Some(ref it) = _i.eq_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003288 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003289 };
3290 if let Some(ref it) = _i.default {
3291 _visitor.visit_type(it)
3292 };
Nika Layzell27726662017-10-24 23:16:35 -04003293}
David Tolnay8c81f622018-07-31 23:34:35 -07003294#[cfg(any(feature = "full", feature = "derive"))]
3295pub fn visit_type_param_bound<'ast, V: Visit<'ast> + ?Sized>(
3296 _visitor: &mut V,
3297 _i: &'ast TypeParamBound,
3298) {
Nika Layzell27726662017-10-24 23:16:35 -04003299 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003300 TypeParamBound::Trait(ref _binding_0) => {
David Tolnay40fb8ce2018-01-02 10:53:46 -08003301 _visitor.visit_trait_bound(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003302 }
David Tolnay8c81f622018-07-31 23:34:35 -07003303 TypeParamBound::Lifetime(ref _binding_0) => {
David Tolnay4ba63a02017-12-28 15:53:05 -05003304 _visitor.visit_lifetime(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003305 }
3306 }
3307}
David Tolnay8c81f622018-07-31 23:34:35 -07003308#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003309pub fn visit_type_paren<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeParen) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003310 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003311 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003312}
David Tolnay8c81f622018-07-31 23:34:35 -07003313#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003314pub fn visit_type_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypePath) {
David Tolnay8c81f622018-07-31 23:34:35 -07003315 if let Some(ref it) = _i.qself {
3316 _visitor.visit_qself(it)
3317 };
3318 _visitor.visit_path(&_i.path);
Nika Layzell27726662017-10-24 23:16:35 -04003319}
David Tolnay8c81f622018-07-31 23:34:35 -07003320#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003321pub fn visit_type_ptr<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypePtr) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003322 tokens_helper(_visitor, &_i.star_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003323 if let Some(ref it) = _i.const_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003324 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003325 };
3326 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04003327 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003328 };
3329 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003330}
David Tolnay8c81f622018-07-31 23:34:35 -07003331#[cfg(any(feature = "full", feature = "derive"))]
3332pub fn visit_type_reference<'ast, V: Visit<'ast> + ?Sized>(
3333 _visitor: &mut V,
3334 _i: &'ast TypeReference,
3335) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003336 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003337 if let Some(ref it) = _i.lifetime {
3338 _visitor.visit_lifetime(it)
3339 };
3340 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04003341 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003342 };
3343 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003344}
David Tolnay8c81f622018-07-31 23:34:35 -07003345#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003346pub fn visit_type_slice<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeSlice) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003347 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003348 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003349}
David Tolnay8c81f622018-07-31 23:34:35 -07003350#[cfg(any(feature = "full", feature = "derive"))]
3351pub fn visit_type_trait_object<'ast, V: Visit<'ast> + ?Sized>(
3352 _visitor: &mut V,
3353 _i: &'ast TypeTraitObject,
3354) {
3355 if let Some(ref it) = _i.dyn_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003356 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003357 };
3358 for el in Punctuated::pairs(&_i.bounds) {
3359 let it = el.value();
3360 _visitor.visit_type_param_bound(it)
3361 }
Nika Layzell27726662017-10-24 23:16:35 -04003362}
David Tolnay8c81f622018-07-31 23:34:35 -07003363#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003364pub fn visit_type_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeTuple) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003365 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003366 for el in Punctuated::pairs(&_i.elems) {
3367 let it = el.value();
3368 _visitor.visit_type(it)
3369 }
Nika Layzell27726662017-10-24 23:16:35 -04003370}
David Tolnay8c81f622018-07-31 23:34:35 -07003371#[cfg(any(feature = "full", feature = "derive"))]
3372pub fn visit_type_verbatim<'ast, V: Visit<'ast> + ?Sized>(
3373 _visitor: &mut V,
3374 _i: &'ast TypeVerbatim,
3375) {
David Tolnay6af48992018-08-01 11:16:28 -07003376 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05003377}
David Tolnay8c81f622018-07-31 23:34:35 -07003378#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003379pub fn visit_un_op<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UnOp) {
Nika Layzell27726662017-10-24 23:16:35 -04003380 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003381 UnOp::Deref(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003382 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003383 }
David Tolnay8c81f622018-07-31 23:34:35 -07003384 UnOp::Not(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003385 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003386 }
David Tolnay8c81f622018-07-31 23:34:35 -07003387 UnOp::Neg(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003388 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003389 }
3390 }
3391}
David Tolnay8c81f622018-07-31 23:34:35 -07003392#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003393pub fn visit_use_glob<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseGlob) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003394 tokens_helper(_visitor, &_i.star_token.spans);
David Tolnay5f332a92017-12-26 00:42:45 -05003395}
David Tolnay8c81f622018-07-31 23:34:35 -07003396#[cfg(feature = "full")]
David Tolnayd97a7d22018-03-31 19:17:01 +02003397pub fn visit_use_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseGroup) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003398 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003399 for el in Punctuated::pairs(&_i.items) {
3400 let it = el.value();
3401 _visitor.visit_use_tree(it)
3402 }
David Tolnay5f332a92017-12-26 00:42:45 -05003403}
David Tolnay8c81f622018-07-31 23:34:35 -07003404#[cfg(feature = "full")]
David Tolnayd97a7d22018-03-31 19:17:01 +02003405pub fn visit_use_name<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseName) {
David Tolnay8c81f622018-07-31 23:34:35 -07003406 _visitor.visit_ident(&_i.ident);
David Tolnayd97a7d22018-03-31 19:17:01 +02003407}
David Tolnay8c81f622018-07-31 23:34:35 -07003408#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003409pub fn visit_use_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UsePath) {
David Tolnay8c81f622018-07-31 23:34:35 -07003410 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04003411 tokens_helper(_visitor, &_i.colon2_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003412 _visitor.visit_use_tree(&*_i.tree);
David Tolnayd97a7d22018-03-31 19:17:01 +02003413}
David Tolnay8c81f622018-07-31 23:34:35 -07003414#[cfg(feature = "full")]
David Tolnayd97a7d22018-03-31 19:17:01 +02003415pub fn visit_use_rename<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseRename) {
David Tolnay8c81f622018-07-31 23:34:35 -07003416 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04003417 tokens_helper(_visitor, &_i.as_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003418 _visitor.visit_ident(&_i.rename);
David Tolnay5f332a92017-12-26 00:42:45 -05003419}
David Tolnay8c81f622018-07-31 23:34:35 -07003420#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003421pub fn visit_use_tree<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseTree) {
David Tolnay5f332a92017-12-26 00:42:45 -05003422 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003423 UseTree::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003424 _visitor.visit_use_path(_binding_0);
David Tolnay5f332a92017-12-26 00:42:45 -05003425 }
David Tolnay8c81f622018-07-31 23:34:35 -07003426 UseTree::Name(ref _binding_0) => {
David Tolnayd97a7d22018-03-31 19:17:01 +02003427 _visitor.visit_use_name(_binding_0);
3428 }
David Tolnay8c81f622018-07-31 23:34:35 -07003429 UseTree::Rename(ref _binding_0) => {
David Tolnayd97a7d22018-03-31 19:17:01 +02003430 _visitor.visit_use_rename(_binding_0);
3431 }
David Tolnay8c81f622018-07-31 23:34:35 -07003432 UseTree::Glob(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003433 _visitor.visit_use_glob(_binding_0);
David Tolnay5f332a92017-12-26 00:42:45 -05003434 }
David Tolnay8c81f622018-07-31 23:34:35 -07003435 UseTree::Group(ref _binding_0) => {
David Tolnayd97a7d22018-03-31 19:17:01 +02003436 _visitor.visit_use_group(_binding_0);
David Tolnay5f332a92017-12-26 00:42:45 -05003437 }
3438 }
3439}
David Tolnay8c81f622018-07-31 23:34:35 -07003440#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003441pub fn visit_variant<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Variant) {
David Tolnay8c81f622018-07-31 23:34:35 -07003442 for it in &_i.attrs {
3443 _visitor.visit_attribute(it)
3444 }
3445 _visitor.visit_ident(&_i.ident);
3446 _visitor.visit_fields(&_i.fields);
3447 if let Some(ref it) = _i.discriminant {
David Tolnay7ac699c2018-08-24 14:00:58 -04003448 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003449 _visitor.visit_expr(&(it).1);
3450 };
Nika Layzell27726662017-10-24 23:16:35 -04003451}
David Tolnay8c81f622018-07-31 23:34:35 -07003452#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003453pub fn visit_vis_crate<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast VisCrate) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003454 tokens_helper(_visitor, &_i.crate_token.span);
Nika Layzell27726662017-10-24 23:16:35 -04003455}
David Tolnay8c81f622018-07-31 23:34:35 -07003456#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003457pub fn visit_vis_public<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast VisPublic) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003458 tokens_helper(_visitor, &_i.pub_token.span);
Nika Layzell27726662017-10-24 23:16:35 -04003459}
David Tolnay8c81f622018-07-31 23:34:35 -07003460#[cfg(any(feature = "full", feature = "derive"))]
3461pub fn visit_vis_restricted<'ast, V: Visit<'ast> + ?Sized>(
3462 _visitor: &mut V,
3463 _i: &'ast VisRestricted,
3464) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003465 tokens_helper(_visitor, &_i.pub_token.span);
3466 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003467 if let Some(ref it) = _i.in_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003468 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003469 };
3470 _visitor.visit_path(&*_i.path);
Nika Layzell27726662017-10-24 23:16:35 -04003471}
David Tolnay8c81f622018-07-31 23:34:35 -07003472#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003473pub fn visit_visibility<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Visibility) {
Nika Layzell27726662017-10-24 23:16:35 -04003474 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003475 Visibility::Public(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003476 _visitor.visit_vis_public(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003477 }
David Tolnay8c81f622018-07-31 23:34:35 -07003478 Visibility::Crate(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003479 _visitor.visit_vis_crate(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003480 }
David Tolnay8c81f622018-07-31 23:34:35 -07003481 Visibility::Restricted(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003482 _visitor.visit_vis_restricted(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003483 }
David Tolnay8c81f622018-07-31 23:34:35 -07003484 Visibility::Inherited => {}
Nika Layzell27726662017-10-24 23:16:35 -04003485 }
3486}
David Tolnay8c81f622018-07-31 23:34:35 -07003487#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003488pub fn visit_where_clause<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast WhereClause) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003489 tokens_helper(_visitor, &_i.where_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003490 for el in Punctuated::pairs(&_i.predicates) {
3491 let it = el.value();
3492 _visitor.visit_where_predicate(it)
3493 }
Nika Layzell27726662017-10-24 23:16:35 -04003494}
David Tolnay8c81f622018-07-31 23:34:35 -07003495#[cfg(any(feature = "full", feature = "derive"))]
3496pub fn visit_where_predicate<'ast, V: Visit<'ast> + ?Sized>(
3497 _visitor: &mut V,
3498 _i: &'ast WherePredicate,
3499) {
Nika Layzell27726662017-10-24 23:16:35 -04003500 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003501 WherePredicate::Type(ref _binding_0) => {
David Tolnayd4add852018-01-01 20:13:24 -08003502 _visitor.visit_predicate_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003503 }
David Tolnay8c81f622018-07-31 23:34:35 -07003504 WherePredicate::Lifetime(ref _binding_0) => {
David Tolnayd4add852018-01-01 20:13:24 -08003505 _visitor.visit_predicate_lifetime(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003506 }
David Tolnay8c81f622018-07-31 23:34:35 -07003507 WherePredicate::Eq(ref _binding_0) => {
David Tolnayd4add852018-01-01 20:13:24 -08003508 _visitor.visit_predicate_eq(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003509 }
3510 }
3511}