blob: 502e0f2e1b82f10aecb18c477c2f5e6d40d5ee9c [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 }
510 #[cfg(any(feature = "full", feature = "derive"))]
511 fn visit_lifetime(&mut self, i: &'ast Lifetime) {
512 visit_lifetime(self, i)
513 }
514 #[cfg(any(feature = "full", feature = "derive"))]
515 fn visit_lifetime_def(&mut self, i: &'ast LifetimeDef) {
516 visit_lifetime_def(self, i)
517 }
518 #[cfg(any(feature = "full", feature = "derive"))]
519 fn visit_lit(&mut self, i: &'ast Lit) {
520 visit_lit(self, i)
521 }
522 #[cfg(any(feature = "full", feature = "derive"))]
523 fn visit_lit_bool(&mut self, i: &'ast LitBool) {
524 visit_lit_bool(self, i)
525 }
526 #[cfg(any(feature = "full", feature = "derive"))]
527 fn visit_lit_byte(&mut self, i: &'ast LitByte) {
528 visit_lit_byte(self, i)
529 }
530 #[cfg(any(feature = "full", feature = "derive"))]
531 fn visit_lit_byte_str(&mut self, i: &'ast LitByteStr) {
532 visit_lit_byte_str(self, i)
533 }
534 #[cfg(any(feature = "full", feature = "derive"))]
535 fn visit_lit_char(&mut self, i: &'ast LitChar) {
536 visit_lit_char(self, i)
537 }
538 #[cfg(any(feature = "full", feature = "derive"))]
539 fn visit_lit_float(&mut self, i: &'ast LitFloat) {
540 visit_lit_float(self, i)
541 }
542 #[cfg(any(feature = "full", feature = "derive"))]
543 fn visit_lit_int(&mut self, i: &'ast LitInt) {
544 visit_lit_int(self, i)
545 }
546 #[cfg(any(feature = "full", feature = "derive"))]
547 fn visit_lit_str(&mut self, i: &'ast LitStr) {
548 visit_lit_str(self, i)
549 }
550 #[cfg(any(feature = "full", feature = "derive"))]
551 fn visit_lit_verbatim(&mut self, i: &'ast LitVerbatim) {
552 visit_lit_verbatim(self, i)
553 }
554 #[cfg(any(feature = "full", feature = "derive"))]
555 #[cfg(feature = "full")]
556 fn visit_local(&mut self, i: &'ast Local) {
557 visit_local(self, i)
558 }
559 #[cfg(any(feature = "full", feature = "derive"))]
560 fn visit_macro(&mut self, i: &'ast Macro) {
561 visit_macro(self, i)
562 }
563 #[cfg(any(feature = "full", feature = "derive"))]
564 fn visit_macro_delimiter(&mut self, i: &'ast MacroDelimiter) {
565 visit_macro_delimiter(self, i)
566 }
567 #[cfg(any(feature = "full", feature = "derive"))]
568 fn visit_member(&mut self, i: &'ast Member) {
569 visit_member(self, i)
570 }
571 #[cfg(any(feature = "full", feature = "derive"))]
572 fn visit_meta(&mut self, i: &'ast Meta) {
573 visit_meta(self, i)
574 }
575 #[cfg(any(feature = "full", feature = "derive"))]
576 fn visit_meta_list(&mut self, i: &'ast MetaList) {
577 visit_meta_list(self, i)
578 }
579 #[cfg(any(feature = "full", feature = "derive"))]
580 fn visit_meta_name_value(&mut self, i: &'ast MetaNameValue) {
581 visit_meta_name_value(self, i)
582 }
583 #[cfg(feature = "full")]
584 fn visit_method_sig(&mut self, i: &'ast MethodSig) {
585 visit_method_sig(self, i)
586 }
587 #[cfg(any(feature = "full", feature = "derive"))]
588 #[cfg(feature = "full")]
589 fn visit_method_turbofish(&mut self, i: &'ast MethodTurbofish) {
590 visit_method_turbofish(self, i)
591 }
592 #[cfg(any(feature = "full", feature = "derive"))]
593 fn visit_nested_meta(&mut self, i: &'ast NestedMeta) {
594 visit_nested_meta(self, i)
595 }
596 #[cfg(any(feature = "full", feature = "derive"))]
597 fn visit_parenthesized_generic_arguments(&mut self, i: &'ast ParenthesizedGenericArguments) {
598 visit_parenthesized_generic_arguments(self, i)
599 }
600 #[cfg(any(feature = "full", feature = "derive"))]
601 #[cfg(feature = "full")]
602 fn visit_pat(&mut self, i: &'ast Pat) {
603 visit_pat(self, i)
604 }
605 #[cfg(any(feature = "full", feature = "derive"))]
606 #[cfg(feature = "full")]
607 fn visit_pat_box(&mut self, i: &'ast PatBox) {
608 visit_pat_box(self, i)
609 }
610 #[cfg(any(feature = "full", feature = "derive"))]
611 #[cfg(feature = "full")]
612 fn visit_pat_ident(&mut self, i: &'ast PatIdent) {
613 visit_pat_ident(self, i)
614 }
615 #[cfg(any(feature = "full", feature = "derive"))]
616 #[cfg(feature = "full")]
617 fn visit_pat_lit(&mut self, i: &'ast PatLit) {
618 visit_pat_lit(self, i)
619 }
620 #[cfg(any(feature = "full", feature = "derive"))]
621 #[cfg(feature = "full")]
622 fn visit_pat_macro(&mut self, i: &'ast PatMacro) {
623 visit_pat_macro(self, i)
624 }
625 #[cfg(any(feature = "full", feature = "derive"))]
626 #[cfg(feature = "full")]
627 fn visit_pat_path(&mut self, i: &'ast PatPath) {
628 visit_pat_path(self, i)
629 }
630 #[cfg(any(feature = "full", feature = "derive"))]
631 #[cfg(feature = "full")]
632 fn visit_pat_range(&mut self, i: &'ast PatRange) {
633 visit_pat_range(self, i)
634 }
635 #[cfg(any(feature = "full", feature = "derive"))]
636 #[cfg(feature = "full")]
637 fn visit_pat_ref(&mut self, i: &'ast PatRef) {
638 visit_pat_ref(self, i)
639 }
640 #[cfg(any(feature = "full", feature = "derive"))]
641 #[cfg(feature = "full")]
642 fn visit_pat_slice(&mut self, i: &'ast PatSlice) {
643 visit_pat_slice(self, i)
644 }
645 #[cfg(any(feature = "full", feature = "derive"))]
646 #[cfg(feature = "full")]
647 fn visit_pat_struct(&mut self, i: &'ast PatStruct) {
648 visit_pat_struct(self, i)
649 }
650 #[cfg(any(feature = "full", feature = "derive"))]
651 #[cfg(feature = "full")]
652 fn visit_pat_tuple(&mut self, i: &'ast PatTuple) {
653 visit_pat_tuple(self, i)
654 }
655 #[cfg(any(feature = "full", feature = "derive"))]
656 #[cfg(feature = "full")]
657 fn visit_pat_tuple_struct(&mut self, i: &'ast PatTupleStruct) {
658 visit_pat_tuple_struct(self, i)
659 }
660 #[cfg(any(feature = "full", feature = "derive"))]
661 #[cfg(feature = "full")]
662 fn visit_pat_verbatim(&mut self, i: &'ast PatVerbatim) {
663 visit_pat_verbatim(self, i)
664 }
665 #[cfg(any(feature = "full", feature = "derive"))]
666 #[cfg(feature = "full")]
667 fn visit_pat_wild(&mut self, i: &'ast PatWild) {
668 visit_pat_wild(self, i)
669 }
670 #[cfg(any(feature = "full", feature = "derive"))]
671 fn visit_path(&mut self, i: &'ast Path) {
672 visit_path(self, i)
673 }
674 #[cfg(any(feature = "full", feature = "derive"))]
675 fn visit_path_arguments(&mut self, i: &'ast PathArguments) {
676 visit_path_arguments(self, i)
677 }
678 #[cfg(any(feature = "full", feature = "derive"))]
679 fn visit_path_segment(&mut self, i: &'ast PathSegment) {
680 visit_path_segment(self, i)
681 }
682 #[cfg(any(feature = "full", feature = "derive"))]
683 fn visit_predicate_eq(&mut self, i: &'ast PredicateEq) {
684 visit_predicate_eq(self, i)
685 }
686 #[cfg(any(feature = "full", feature = "derive"))]
687 fn visit_predicate_lifetime(&mut self, i: &'ast PredicateLifetime) {
688 visit_predicate_lifetime(self, i)
689 }
690 #[cfg(any(feature = "full", feature = "derive"))]
691 fn visit_predicate_type(&mut self, i: &'ast PredicateType) {
692 visit_predicate_type(self, i)
693 }
694 #[cfg(any(feature = "full", feature = "derive"))]
695 fn visit_qself(&mut self, i: &'ast QSelf) {
696 visit_qself(self, i)
697 }
698 #[cfg(any(feature = "full", feature = "derive"))]
699 #[cfg(feature = "full")]
700 fn visit_range_limits(&mut self, i: &'ast RangeLimits) {
701 visit_range_limits(self, i)
702 }
703 #[cfg(any(feature = "full", feature = "derive"))]
704 fn visit_return_type(&mut self, i: &'ast ReturnType) {
705 visit_return_type(self, i)
706 }
David Tolnay8c81f622018-07-31 23:34:35 -0700707 fn visit_span(&mut self, i: &'ast Span) {
708 visit_span(self, i)
709 }
710 #[cfg(any(feature = "full", feature = "derive"))]
711 #[cfg(feature = "full")]
712 fn visit_stmt(&mut self, i: &'ast Stmt) {
713 visit_stmt(self, i)
714 }
715 #[cfg(any(feature = "full", feature = "derive"))]
716 fn visit_trait_bound(&mut self, i: &'ast TraitBound) {
717 visit_trait_bound(self, i)
718 }
719 #[cfg(any(feature = "full", feature = "derive"))]
720 fn visit_trait_bound_modifier(&mut self, i: &'ast TraitBoundModifier) {
721 visit_trait_bound_modifier(self, i)
722 }
723 #[cfg(feature = "full")]
724 fn visit_trait_item(&mut self, i: &'ast TraitItem) {
725 visit_trait_item(self, i)
726 }
727 #[cfg(feature = "full")]
728 fn visit_trait_item_const(&mut self, i: &'ast TraitItemConst) {
729 visit_trait_item_const(self, i)
730 }
731 #[cfg(feature = "full")]
732 fn visit_trait_item_macro(&mut self, i: &'ast TraitItemMacro) {
733 visit_trait_item_macro(self, i)
734 }
735 #[cfg(feature = "full")]
736 fn visit_trait_item_method(&mut self, i: &'ast TraitItemMethod) {
737 visit_trait_item_method(self, i)
738 }
739 #[cfg(feature = "full")]
740 fn visit_trait_item_type(&mut self, i: &'ast TraitItemType) {
741 visit_trait_item_type(self, i)
742 }
743 #[cfg(feature = "full")]
744 fn visit_trait_item_verbatim(&mut self, i: &'ast TraitItemVerbatim) {
745 visit_trait_item_verbatim(self, i)
746 }
747 #[cfg(any(feature = "full", feature = "derive"))]
748 fn visit_type(&mut self, i: &'ast Type) {
749 visit_type(self, i)
750 }
751 #[cfg(any(feature = "full", feature = "derive"))]
752 fn visit_type_array(&mut self, i: &'ast TypeArray) {
753 visit_type_array(self, i)
754 }
755 #[cfg(any(feature = "full", feature = "derive"))]
756 fn visit_type_bare_fn(&mut self, i: &'ast TypeBareFn) {
757 visit_type_bare_fn(self, i)
758 }
759 #[cfg(any(feature = "full", feature = "derive"))]
760 fn visit_type_group(&mut self, i: &'ast TypeGroup) {
761 visit_type_group(self, i)
762 }
763 #[cfg(any(feature = "full", feature = "derive"))]
764 fn visit_type_impl_trait(&mut self, i: &'ast TypeImplTrait) {
765 visit_type_impl_trait(self, i)
766 }
767 #[cfg(any(feature = "full", feature = "derive"))]
768 fn visit_type_infer(&mut self, i: &'ast TypeInfer) {
769 visit_type_infer(self, i)
770 }
771 #[cfg(any(feature = "full", feature = "derive"))]
772 fn visit_type_macro(&mut self, i: &'ast TypeMacro) {
773 visit_type_macro(self, i)
774 }
775 #[cfg(any(feature = "full", feature = "derive"))]
776 fn visit_type_never(&mut self, i: &'ast TypeNever) {
777 visit_type_never(self, i)
778 }
779 #[cfg(any(feature = "full", feature = "derive"))]
780 fn visit_type_param(&mut self, i: &'ast TypeParam) {
781 visit_type_param(self, i)
782 }
783 #[cfg(any(feature = "full", feature = "derive"))]
784 fn visit_type_param_bound(&mut self, i: &'ast TypeParamBound) {
785 visit_type_param_bound(self, i)
786 }
787 #[cfg(any(feature = "full", feature = "derive"))]
788 fn visit_type_paren(&mut self, i: &'ast TypeParen) {
789 visit_type_paren(self, i)
790 }
791 #[cfg(any(feature = "full", feature = "derive"))]
792 fn visit_type_path(&mut self, i: &'ast TypePath) {
793 visit_type_path(self, i)
794 }
795 #[cfg(any(feature = "full", feature = "derive"))]
796 fn visit_type_ptr(&mut self, i: &'ast TypePtr) {
797 visit_type_ptr(self, i)
798 }
799 #[cfg(any(feature = "full", feature = "derive"))]
800 fn visit_type_reference(&mut self, i: &'ast TypeReference) {
801 visit_type_reference(self, i)
802 }
803 #[cfg(any(feature = "full", feature = "derive"))]
804 fn visit_type_slice(&mut self, i: &'ast TypeSlice) {
805 visit_type_slice(self, i)
806 }
807 #[cfg(any(feature = "full", feature = "derive"))]
808 fn visit_type_trait_object(&mut self, i: &'ast TypeTraitObject) {
809 visit_type_trait_object(self, i)
810 }
811 #[cfg(any(feature = "full", feature = "derive"))]
812 fn visit_type_tuple(&mut self, i: &'ast TypeTuple) {
813 visit_type_tuple(self, i)
814 }
815 #[cfg(any(feature = "full", feature = "derive"))]
816 fn visit_type_verbatim(&mut self, i: &'ast TypeVerbatim) {
817 visit_type_verbatim(self, i)
818 }
819 #[cfg(any(feature = "full", feature = "derive"))]
820 fn visit_un_op(&mut self, i: &'ast UnOp) {
821 visit_un_op(self, i)
822 }
823 #[cfg(feature = "full")]
824 fn visit_use_glob(&mut self, i: &'ast UseGlob) {
825 visit_use_glob(self, i)
826 }
827 #[cfg(feature = "full")]
828 fn visit_use_group(&mut self, i: &'ast UseGroup) {
829 visit_use_group(self, i)
830 }
831 #[cfg(feature = "full")]
832 fn visit_use_name(&mut self, i: &'ast UseName) {
833 visit_use_name(self, i)
834 }
835 #[cfg(feature = "full")]
836 fn visit_use_path(&mut self, i: &'ast UsePath) {
837 visit_use_path(self, i)
838 }
839 #[cfg(feature = "full")]
840 fn visit_use_rename(&mut self, i: &'ast UseRename) {
841 visit_use_rename(self, i)
842 }
843 #[cfg(feature = "full")]
844 fn visit_use_tree(&mut self, i: &'ast UseTree) {
845 visit_use_tree(self, i)
846 }
847 #[cfg(any(feature = "full", feature = "derive"))]
848 fn visit_variant(&mut self, i: &'ast Variant) {
849 visit_variant(self, i)
850 }
851 #[cfg(any(feature = "full", feature = "derive"))]
852 fn visit_vis_crate(&mut self, i: &'ast VisCrate) {
853 visit_vis_crate(self, i)
854 }
855 #[cfg(any(feature = "full", feature = "derive"))]
856 fn visit_vis_public(&mut self, i: &'ast VisPublic) {
857 visit_vis_public(self, i)
858 }
859 #[cfg(any(feature = "full", feature = "derive"))]
860 fn visit_vis_restricted(&mut self, i: &'ast VisRestricted) {
861 visit_vis_restricted(self, i)
862 }
863 #[cfg(any(feature = "full", feature = "derive"))]
864 fn visit_visibility(&mut self, i: &'ast Visibility) {
865 visit_visibility(self, i)
866 }
867 #[cfg(any(feature = "full", feature = "derive"))]
868 fn visit_where_clause(&mut self, i: &'ast WhereClause) {
869 visit_where_clause(self, i)
870 }
871 #[cfg(any(feature = "full", feature = "derive"))]
872 fn visit_where_predicate(&mut self, i: &'ast WherePredicate) {
873 visit_where_predicate(self, i)
874 }
Nika Layzell27726662017-10-24 23:16:35 -0400875}
David Tolnay8c81f622018-07-31 23:34:35 -0700876#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800877pub fn visit_abi<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Abi) {
David Tolnay7ac699c2018-08-24 14:00:58 -0400878 tokens_helper(_visitor, &_i.extern_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -0700879 if let Some(ref it) = _i.name {
880 _visitor.visit_lit_str(it)
881 };
Nika Layzell27726662017-10-24 23:16:35 -0400882}
David Tolnay8c81f622018-07-31 23:34:35 -0700883#[cfg(any(feature = "full", feature = "derive"))]
884pub fn visit_angle_bracketed_generic_arguments<'ast, V: Visit<'ast> + ?Sized>(
885 _visitor: &mut V,
886 _i: &'ast AngleBracketedGenericArguments,
887) {
888 if let Some(ref it) = _i.colon2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -0400889 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -0700890 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400891 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700892 for el in Punctuated::pairs(&_i.args) {
893 let it = el.value();
894 _visitor.visit_generic_argument(it)
895 }
David Tolnay7ac699c2018-08-24 14:00:58 -0400896 tokens_helper(_visitor, &_i.gt_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400897}
David Tolnay8c81f622018-07-31 23:34:35 -0700898#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800899pub fn visit_arg_captured<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ArgCaptured) {
David Tolnay8c81f622018-07-31 23:34:35 -0700900 _visitor.visit_pat(&_i.pat);
David Tolnay7ac699c2018-08-24 14:00:58 -0400901 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700902 _visitor.visit_type(&_i.ty);
Nika Layzell27726662017-10-24 23:16:35 -0400903}
David Tolnay8c81f622018-07-31 23:34:35 -0700904#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800905pub fn visit_arg_self<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ArgSelf) {
David Tolnay8c81f622018-07-31 23:34:35 -0700906 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -0400907 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -0700908 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400909 tokens_helper(_visitor, &_i.self_token.span);
Nika Layzell27726662017-10-24 23:16:35 -0400910}
David Tolnay8c81f622018-07-31 23:34:35 -0700911#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800912pub fn visit_arg_self_ref<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ArgSelfRef) {
David Tolnay7ac699c2018-08-24 14:00:58 -0400913 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700914 if let Some(ref it) = _i.lifetime {
915 _visitor.visit_lifetime(it)
916 };
917 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -0400918 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -0700919 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400920 tokens_helper(_visitor, &_i.self_token.span);
Nika Layzell27726662017-10-24 23:16:35 -0400921}
David Tolnay8c81f622018-07-31 23:34:35 -0700922#[cfg(any(feature = "full", feature = "derive"))]
923#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800924pub fn visit_arm<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Arm) {
David Tolnay8c81f622018-07-31 23:34:35 -0700925 for it in &_i.attrs {
926 _visitor.visit_attribute(it)
927 }
928 if let Some(ref it) = _i.leading_vert {
David Tolnay7ac699c2018-08-24 14:00:58 -0400929 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -0700930 };
931 for el in Punctuated::pairs(&_i.pats) {
932 let it = el.value();
933 _visitor.visit_pat(it)
934 }
935 if let Some(ref it) = _i.guard {
David Tolnay7ac699c2018-08-24 14:00:58 -0400936 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -0700937 _visitor.visit_expr(&*(it).1);
938 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400939 tokens_helper(_visitor, &_i.fat_arrow_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700940 _visitor.visit_expr(&*_i.body);
941 if let Some(ref it) = _i.comma {
David Tolnay7ac699c2018-08-24 14:00:58 -0400942 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -0700943 };
Nika Layzell27726662017-10-24 23:16:35 -0400944}
David Tolnay8c81f622018-07-31 23:34:35 -0700945#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800946pub fn visit_attr_style<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast AttrStyle) {
Nika Layzell27726662017-10-24 23:16:35 -0400947 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -0700948 AttrStyle::Outer => {}
949 AttrStyle::Inner(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400950 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400951 }
952 }
953}
David Tolnay8c81f622018-07-31 23:34:35 -0700954#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800955pub fn visit_attribute<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Attribute) {
David Tolnay7ac699c2018-08-24 14:00:58 -0400956 tokens_helper(_visitor, &_i.pound_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700957 _visitor.visit_attr_style(&_i.style);
David Tolnay7ac699c2018-08-24 14:00:58 -0400958 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -0700959 _visitor.visit_path(&_i.path);
David Tolnay6af48992018-08-01 11:16:28 -0700960 skip!(_i.tts);
Nika Layzell27726662017-10-24 23:16:35 -0400961}
David Tolnay8c81f622018-07-31 23:34:35 -0700962#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800963pub fn visit_bare_fn_arg<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast BareFnArg) {
David Tolnay8c81f622018-07-31 23:34:35 -0700964 if let Some(ref it) = _i.name {
965 _visitor.visit_bare_fn_arg_name(&(it).0);
David Tolnay7ac699c2018-08-24 14:00:58 -0400966 tokens_helper(_visitor, &(it).1.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700967 };
968 _visitor.visit_type(&_i.ty);
Nika Layzell27726662017-10-24 23:16:35 -0400969}
David Tolnay8c81f622018-07-31 23:34:35 -0700970#[cfg(any(feature = "full", feature = "derive"))]
971pub fn visit_bare_fn_arg_name<'ast, V: Visit<'ast> + ?Sized>(
972 _visitor: &mut V,
973 _i: &'ast BareFnArgName,
974) {
Nika Layzell27726662017-10-24 23:16:35 -0400975 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -0700976 BareFnArgName::Named(ref _binding_0) => {
Alex Crichtond261d092018-05-18 13:47:35 -0700977 _visitor.visit_ident(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -0400978 }
David Tolnay8c81f622018-07-31 23:34:35 -0700979 BareFnArgName::Wild(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400980 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400981 }
982 }
983}
David Tolnay8c81f622018-07-31 23:34:35 -0700984#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800985pub fn visit_bin_op<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast BinOp) {
Nika Layzell27726662017-10-24 23:16:35 -0400986 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -0700987 BinOp::Add(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400988 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400989 }
David Tolnay8c81f622018-07-31 23:34:35 -0700990 BinOp::Sub(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400991 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400992 }
David Tolnay8c81f622018-07-31 23:34:35 -0700993 BinOp::Mul(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400994 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400995 }
David Tolnay8c81f622018-07-31 23:34:35 -0700996 BinOp::Div(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400997 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400998 }
David Tolnay8c81f622018-07-31 23:34:35 -0700999 BinOp::Rem(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001000 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001001 }
David Tolnay8c81f622018-07-31 23:34:35 -07001002 BinOp::And(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001003 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001004 }
David Tolnay8c81f622018-07-31 23:34:35 -07001005 BinOp::Or(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001006 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001007 }
David Tolnay8c81f622018-07-31 23:34:35 -07001008 BinOp::BitXor(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001009 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001010 }
David Tolnay8c81f622018-07-31 23:34:35 -07001011 BinOp::BitAnd(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001012 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001013 }
David Tolnay8c81f622018-07-31 23:34:35 -07001014 BinOp::BitOr(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001015 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001016 }
David Tolnay8c81f622018-07-31 23:34:35 -07001017 BinOp::Shl(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001018 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001019 }
David Tolnay8c81f622018-07-31 23:34:35 -07001020 BinOp::Shr(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001021 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001022 }
David Tolnay8c81f622018-07-31 23:34:35 -07001023 BinOp::Eq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001024 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001025 }
David Tolnay8c81f622018-07-31 23:34:35 -07001026 BinOp::Lt(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001027 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001028 }
David Tolnay8c81f622018-07-31 23:34:35 -07001029 BinOp::Le(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001030 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001031 }
David Tolnay8c81f622018-07-31 23:34:35 -07001032 BinOp::Ne(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001033 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001034 }
David Tolnay8c81f622018-07-31 23:34:35 -07001035 BinOp::Ge(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001036 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001037 }
David Tolnay8c81f622018-07-31 23:34:35 -07001038 BinOp::Gt(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001039 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001040 }
David Tolnay8c81f622018-07-31 23:34:35 -07001041 BinOp::AddEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001042 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001043 }
David Tolnay8c81f622018-07-31 23:34:35 -07001044 BinOp::SubEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001045 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001046 }
David Tolnay8c81f622018-07-31 23:34:35 -07001047 BinOp::MulEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001048 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001049 }
David Tolnay8c81f622018-07-31 23:34:35 -07001050 BinOp::DivEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001051 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001052 }
David Tolnay8c81f622018-07-31 23:34:35 -07001053 BinOp::RemEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001054 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001055 }
David Tolnay8c81f622018-07-31 23:34:35 -07001056 BinOp::BitXorEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001057 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001058 }
David Tolnay8c81f622018-07-31 23:34:35 -07001059 BinOp::BitAndEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001060 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001061 }
David Tolnay8c81f622018-07-31 23:34:35 -07001062 BinOp::BitOrEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001063 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001064 }
David Tolnay8c81f622018-07-31 23:34:35 -07001065 BinOp::ShlEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001066 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001067 }
David Tolnay8c81f622018-07-31 23:34:35 -07001068 BinOp::ShrEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001069 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001070 }
1071 }
1072}
David Tolnay8c81f622018-07-31 23:34:35 -07001073#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001074pub fn visit_binding<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Binding) {
David Tolnay8c81f622018-07-31 23:34:35 -07001075 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001076 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001077 _visitor.visit_type(&_i.ty);
David Tolnay506e43a2017-12-29 11:34:36 -05001078}
David Tolnay8c81f622018-07-31 23:34:35 -07001079#[cfg(any(feature = "full", feature = "derive"))]
1080#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001081pub fn visit_block<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Block) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001082 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001083 for it in &_i.stmts {
1084 _visitor.visit_stmt(it)
1085 }
Nika Layzell27726662017-10-24 23:16:35 -04001086}
David Tolnay8c81f622018-07-31 23:34:35 -07001087#[cfg(any(feature = "full", feature = "derive"))]
1088pub fn visit_bound_lifetimes<'ast, V: Visit<'ast> + ?Sized>(
1089 _visitor: &mut V,
1090 _i: &'ast BoundLifetimes,
1091) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001092 tokens_helper(_visitor, &_i.for_token.span);
1093 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001094 for el in Punctuated::pairs(&_i.lifetimes) {
1095 let it = el.value();
1096 _visitor.visit_lifetime_def(it)
1097 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001098 tokens_helper(_visitor, &_i.gt_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001099}
David Tolnay8c81f622018-07-31 23:34:35 -07001100#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001101pub fn visit_const_param<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ConstParam) {
David Tolnay8c81f622018-07-31 23:34:35 -07001102 for it in &_i.attrs {
1103 _visitor.visit_attribute(it)
1104 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001105 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001106 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001107 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001108 _visitor.visit_type(&_i.ty);
1109 if let Some(ref it) = _i.eq_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001110 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001111 };
1112 if let Some(ref it) = _i.default {
1113 _visitor.visit_expr(it)
1114 };
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001115}
David Tolnay8c81f622018-07-31 23:34:35 -07001116#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001117pub fn visit_data<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Data) {
David Tolnaye3d41b72017-12-31 15:24:00 -05001118 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001119 Data::Struct(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05001120 _visitor.visit_data_struct(_binding_0);
1121 }
David Tolnay8c81f622018-07-31 23:34:35 -07001122 Data::Enum(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05001123 _visitor.visit_data_enum(_binding_0);
1124 }
David Tolnay8c81f622018-07-31 23:34:35 -07001125 Data::Union(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05001126 _visitor.visit_data_union(_binding_0);
1127 }
1128 }
1129}
David Tolnay8c81f622018-07-31 23:34:35 -07001130#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001131pub fn visit_data_enum<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataEnum) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001132 tokens_helper(_visitor, &_i.enum_token.span);
1133 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001134 for el in Punctuated::pairs(&_i.variants) {
1135 let it = el.value();
1136 _visitor.visit_variant(it)
1137 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001138}
David Tolnay8c81f622018-07-31 23:34:35 -07001139#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001140pub fn visit_data_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataStruct) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001141 tokens_helper(_visitor, &_i.struct_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001142 _visitor.visit_fields(&_i.fields);
1143 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001144 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001145 };
David Tolnaye3d41b72017-12-31 15:24:00 -05001146}
David Tolnay8c81f622018-07-31 23:34:35 -07001147#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001148pub fn visit_data_union<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataUnion) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001149 tokens_helper(_visitor, &_i.union_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001150 _visitor.visit_fields_named(&_i.fields);
David Tolnaye3d41b72017-12-31 15:24:00 -05001151}
David Tolnay8c81f622018-07-31 23:34:35 -07001152#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001153pub fn visit_derive_input<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DeriveInput) {
David Tolnay8c81f622018-07-31 23:34:35 -07001154 for it in &_i.attrs {
1155 _visitor.visit_attribute(it)
1156 }
1157 _visitor.visit_visibility(&_i.vis);
1158 _visitor.visit_ident(&_i.ident);
1159 _visitor.visit_generics(&_i.generics);
1160 _visitor.visit_data(&_i.data);
Nika Layzell27726662017-10-24 23:16:35 -04001161}
David Tolnay8c81f622018-07-31 23:34:35 -07001162#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001163pub fn visit_expr<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Expr) {
Nika Layzell27726662017-10-24 23:16:35 -04001164 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001165 Expr::Box(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001166 full!(_visitor.visit_expr_box(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001167 }
David Tolnay8c81f622018-07-31 23:34:35 -07001168 Expr::InPlace(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001169 full!(_visitor.visit_expr_in_place(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001170 }
David Tolnay8c81f622018-07-31 23:34:35 -07001171 Expr::Array(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001172 full!(_visitor.visit_expr_array(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001173 }
David Tolnay8c81f622018-07-31 23:34:35 -07001174 Expr::Call(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001175 _visitor.visit_expr_call(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001176 }
David Tolnay8c81f622018-07-31 23:34:35 -07001177 Expr::MethodCall(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001178 full!(_visitor.visit_expr_method_call(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001179 }
David Tolnay8c81f622018-07-31 23:34:35 -07001180 Expr::Tuple(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001181 full!(_visitor.visit_expr_tuple(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001182 }
David Tolnay8c81f622018-07-31 23:34:35 -07001183 Expr::Binary(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001184 _visitor.visit_expr_binary(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001185 }
David Tolnay8c81f622018-07-31 23:34:35 -07001186 Expr::Unary(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001187 _visitor.visit_expr_unary(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001188 }
David Tolnay8c81f622018-07-31 23:34:35 -07001189 Expr::Lit(ref _binding_0) => {
David Tolnay8c91b882017-12-28 23:04:32 -05001190 _visitor.visit_expr_lit(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001191 }
David Tolnay8c81f622018-07-31 23:34:35 -07001192 Expr::Cast(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001193 _visitor.visit_expr_cast(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001194 }
David Tolnay8c81f622018-07-31 23:34:35 -07001195 Expr::Type(ref _binding_0) => {
David Tolnay0cf94f22017-12-28 23:46:26 -05001196 full!(_visitor.visit_expr_type(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001197 }
David Tolnay8c81f622018-07-31 23:34:35 -07001198 Expr::If(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001199 full!(_visitor.visit_expr_if(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001200 }
David Tolnay8c81f622018-07-31 23:34:35 -07001201 Expr::IfLet(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001202 full!(_visitor.visit_expr_if_let(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001203 }
David Tolnay8c81f622018-07-31 23:34:35 -07001204 Expr::While(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001205 full!(_visitor.visit_expr_while(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001206 }
David Tolnay8c81f622018-07-31 23:34:35 -07001207 Expr::WhileLet(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001208 full!(_visitor.visit_expr_while_let(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001209 }
David Tolnay8c81f622018-07-31 23:34:35 -07001210 Expr::ForLoop(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001211 full!(_visitor.visit_expr_for_loop(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001212 }
David Tolnay8c81f622018-07-31 23:34:35 -07001213 Expr::Loop(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001214 full!(_visitor.visit_expr_loop(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001215 }
David Tolnay8c81f622018-07-31 23:34:35 -07001216 Expr::Match(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001217 full!(_visitor.visit_expr_match(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001218 }
David Tolnay8c81f622018-07-31 23:34:35 -07001219 Expr::Closure(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001220 full!(_visitor.visit_expr_closure(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001221 }
David Tolnay8c81f622018-07-31 23:34:35 -07001222 Expr::Unsafe(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001223 full!(_visitor.visit_expr_unsafe(_binding_0));
Nika Layzell640832a2017-12-04 13:37:09 -05001224 }
David Tolnay8c81f622018-07-31 23:34:35 -07001225 Expr::Block(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001226 full!(_visitor.visit_expr_block(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001227 }
David Tolnay8c81f622018-07-31 23:34:35 -07001228 Expr::Assign(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001229 full!(_visitor.visit_expr_assign(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001230 }
David Tolnay8c81f622018-07-31 23:34:35 -07001231 Expr::AssignOp(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001232 full!(_visitor.visit_expr_assign_op(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001233 }
David Tolnay8c81f622018-07-31 23:34:35 -07001234 Expr::Field(ref _binding_0) => {
David Tolnayd093fa92018-06-30 10:23:25 -07001235 _visitor.visit_expr_field(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001236 }
David Tolnay8c81f622018-07-31 23:34:35 -07001237 Expr::Index(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001238 _visitor.visit_expr_index(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001239 }
David Tolnay8c81f622018-07-31 23:34:35 -07001240 Expr::Range(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001241 full!(_visitor.visit_expr_range(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001242 }
David Tolnay8c81f622018-07-31 23:34:35 -07001243 Expr::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001244 _visitor.visit_expr_path(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001245 }
David Tolnay8c81f622018-07-31 23:34:35 -07001246 Expr::Reference(ref _binding_0) => {
David Tolnay00674ba2018-03-31 18:14:11 +02001247 full!(_visitor.visit_expr_reference(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001248 }
David Tolnay8c81f622018-07-31 23:34:35 -07001249 Expr::Break(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001250 full!(_visitor.visit_expr_break(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001251 }
David Tolnay8c81f622018-07-31 23:34:35 -07001252 Expr::Continue(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001253 full!(_visitor.visit_expr_continue(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001254 }
David Tolnay8c81f622018-07-31 23:34:35 -07001255 Expr::Return(ref _binding_0) => {
David Tolnayc246cd32017-12-28 23:14:32 -05001256 full!(_visitor.visit_expr_return(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001257 }
David Tolnay8c81f622018-07-31 23:34:35 -07001258 Expr::Macro(ref _binding_0) => {
David Tolnay8c91b882017-12-28 23:04:32 -05001259 full!(_visitor.visit_expr_macro(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001260 }
David Tolnay8c81f622018-07-31 23:34:35 -07001261 Expr::Struct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001262 full!(_visitor.visit_expr_struct(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001263 }
David Tolnay8c81f622018-07-31 23:34:35 -07001264 Expr::Repeat(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001265 full!(_visitor.visit_expr_repeat(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001266 }
David Tolnay8c81f622018-07-31 23:34:35 -07001267 Expr::Paren(ref _binding_0) => {
David Tolnay81ab4f62018-01-27 19:02:51 -08001268 _visitor.visit_expr_paren(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001269 }
David Tolnay8c81f622018-07-31 23:34:35 -07001270 Expr::Group(ref _binding_0) => {
David Tolnaye98775f2017-12-28 23:17:00 -05001271 full!(_visitor.visit_expr_group(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001272 }
David Tolnay8c81f622018-07-31 23:34:35 -07001273 Expr::Try(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001274 full!(_visitor.visit_expr_try(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001275 }
David Tolnay02a9c6f2018-08-24 18:58:45 -04001276 Expr::Async(ref _binding_0) => {
1277 full!(_visitor.visit_expr_async(_binding_0));
1278 }
David Tolnayfb2dd4b2018-08-24 16:45:34 -04001279 Expr::TryBlock(ref _binding_0) => {
1280 full!(_visitor.visit_expr_try_block(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001281 }
David Tolnay8c81f622018-07-31 23:34:35 -07001282 Expr::Yield(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001283 full!(_visitor.visit_expr_yield(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001284 }
David Tolnay8c81f622018-07-31 23:34:35 -07001285 Expr::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05001286 _visitor.visit_expr_verbatim(_binding_0);
1287 }
Nika Layzell27726662017-10-24 23:16:35 -04001288 }
1289}
David Tolnay8c81f622018-07-31 23:34:35 -07001290#[cfg(feature = "full")]
1291#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001292pub fn visit_expr_array<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprArray) {
David Tolnay8c81f622018-07-31 23:34:35 -07001293 for it in &_i.attrs {
1294 _visitor.visit_attribute(it)
1295 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001296 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001297 for el in Punctuated::pairs(&_i.elems) {
1298 let it = el.value();
1299 _visitor.visit_expr(it)
David Tolnaye3d41b72017-12-31 15:24:00 -05001300 }
1301}
David Tolnay8c81f622018-07-31 23:34:35 -07001302#[cfg(feature = "full")]
1303#[cfg(any(feature = "full", feature = "derive"))]
1304pub fn visit_expr_assign<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprAssign) {
1305 for it in &_i.attrs {
1306 _visitor.visit_attribute(it)
1307 }
1308 _visitor.visit_expr(&*_i.left);
David Tolnay7ac699c2018-08-24 14:00:58 -04001309 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001310 _visitor.visit_expr(&*_i.right);
1311}
1312#[cfg(feature = "full")]
1313#[cfg(any(feature = "full", feature = "derive"))]
1314pub fn visit_expr_assign_op<'ast, V: Visit<'ast> + ?Sized>(
1315 _visitor: &mut V,
1316 _i: &'ast ExprAssignOp,
1317) {
1318 for it in &_i.attrs {
1319 _visitor.visit_attribute(it)
1320 }
1321 _visitor.visit_expr(&*_i.left);
1322 _visitor.visit_bin_op(&_i.op);
1323 _visitor.visit_expr(&*_i.right);
1324}
David Tolnay02a9c6f2018-08-24 18:58:45 -04001325#[cfg(feature = "full")]
1326#[cfg(any(feature = "full", feature = "derive"))]
1327pub fn visit_expr_async<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprAsync) {
1328 for it in &_i.attrs {
1329 _visitor.visit_attribute(it)
1330 }
1331 tokens_helper(_visitor, &_i.async_token.span);
1332 if let Some(ref it) = _i.capture {
1333 tokens_helper(_visitor, &it.span)
1334 };
1335 _visitor.visit_block(&_i.block);
1336}
David Tolnay8c81f622018-07-31 23:34:35 -07001337#[cfg(any(feature = "full", feature = "derive"))]
1338pub fn visit_expr_binary<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBinary) {
1339 for it in &_i.attrs {
1340 _visitor.visit_attribute(it)
1341 }
1342 _visitor.visit_expr(&*_i.left);
1343 _visitor.visit_bin_op(&_i.op);
1344 _visitor.visit_expr(&*_i.right);
1345}
1346#[cfg(feature = "full")]
1347#[cfg(any(feature = "full", feature = "derive"))]
1348pub fn visit_expr_block<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBlock) {
1349 for it in &_i.attrs {
1350 _visitor.visit_attribute(it)
1351 }
David Tolnay1d8e9962018-08-24 19:04:20 -04001352 if let Some(ref it) = _i.label {
1353 _visitor.visit_label(it)
1354 };
David Tolnay8c81f622018-07-31 23:34:35 -07001355 _visitor.visit_block(&_i.block);
1356}
1357#[cfg(feature = "full")]
1358#[cfg(any(feature = "full", feature = "derive"))]
1359pub fn visit_expr_box<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBox) {
1360 for it in &_i.attrs {
1361 _visitor.visit_attribute(it)
1362 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001363 tokens_helper(_visitor, &_i.box_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001364 _visitor.visit_expr(&*_i.expr);
1365}
1366#[cfg(feature = "full")]
1367#[cfg(any(feature = "full", feature = "derive"))]
1368pub fn visit_expr_break<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBreak) {
1369 for it in &_i.attrs {
1370 _visitor.visit_attribute(it)
1371 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001372 tokens_helper(_visitor, &_i.break_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001373 if let Some(ref it) = _i.label {
1374 _visitor.visit_lifetime(it)
1375 };
1376 if let Some(ref it) = _i.expr {
1377 _visitor.visit_expr(&**it)
1378 };
1379}
1380#[cfg(any(feature = "full", feature = "derive"))]
1381pub fn visit_expr_call<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprCall) {
1382 for it in &_i.attrs {
1383 _visitor.visit_attribute(it)
1384 }
1385 _visitor.visit_expr(&*_i.func);
David Tolnay7ac699c2018-08-24 14:00:58 -04001386 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001387 for el in Punctuated::pairs(&_i.args) {
1388 let it = el.value();
1389 _visitor.visit_expr(it)
1390 }
1391}
1392#[cfg(any(feature = "full", feature = "derive"))]
1393pub fn visit_expr_cast<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprCast) {
1394 for it in &_i.attrs {
1395 _visitor.visit_attribute(it)
1396 }
1397 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001398 tokens_helper(_visitor, &_i.as_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001399 _visitor.visit_type(&*_i.ty);
1400}
1401#[cfg(feature = "full")]
1402#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001403pub fn visit_expr_closure<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprClosure) {
1404 for it in &_i.attrs {
1405 _visitor.visit_attribute(it)
1406 }
Yusuke Sasaki4e5d9662018-07-21 02:49:47 +09001407 if let Some(ref it) = _i.asyncness {
1408 tokens_helper(_visitor, &it.span)
1409 };
David Tolnay8c81f622018-07-31 23:34:35 -07001410 if let Some(ref it) = _i.movability {
David Tolnay7ac699c2018-08-24 14:00:58 -04001411 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001412 };
1413 if let Some(ref it) = _i.capture {
David Tolnay7ac699c2018-08-24 14:00:58 -04001414 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001415 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001416 tokens_helper(_visitor, &_i.or1_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001417 for el in Punctuated::pairs(&_i.inputs) {
1418 let it = el.value();
1419 _visitor.visit_fn_arg(it)
1420 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001421 tokens_helper(_visitor, &_i.or2_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001422 _visitor.visit_return_type(&_i.output);
1423 _visitor.visit_expr(&*_i.body);
1424}
1425#[cfg(feature = "full")]
1426#[cfg(any(feature = "full", feature = "derive"))]
1427pub fn visit_expr_continue<'ast, V: Visit<'ast> + ?Sized>(
1428 _visitor: &mut V,
1429 _i: &'ast ExprContinue,
1430) {
1431 for it in &_i.attrs {
1432 _visitor.visit_attribute(it)
1433 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001434 tokens_helper(_visitor, &_i.continue_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001435 if let Some(ref it) = _i.label {
1436 _visitor.visit_lifetime(it)
1437 };
1438}
1439#[cfg(any(feature = "full", feature = "derive"))]
1440pub fn visit_expr_field<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprField) {
1441 for it in &_i.attrs {
1442 _visitor.visit_attribute(it)
1443 }
1444 _visitor.visit_expr(&*_i.base);
David Tolnay7ac699c2018-08-24 14:00:58 -04001445 tokens_helper(_visitor, &_i.dot_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001446 _visitor.visit_member(&_i.member);
1447}
1448#[cfg(feature = "full")]
1449#[cfg(any(feature = "full", feature = "derive"))]
1450pub fn visit_expr_for_loop<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprForLoop) {
1451 for it in &_i.attrs {
1452 _visitor.visit_attribute(it)
1453 }
1454 if let Some(ref it) = _i.label {
1455 _visitor.visit_label(it)
1456 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001457 tokens_helper(_visitor, &_i.for_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001458 _visitor.visit_pat(&*_i.pat);
David Tolnay7ac699c2018-08-24 14:00:58 -04001459 tokens_helper(_visitor, &_i.in_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001460 _visitor.visit_expr(&*_i.expr);
1461 _visitor.visit_block(&_i.body);
1462}
1463#[cfg(feature = "full")]
1464#[cfg(any(feature = "full", feature = "derive"))]
1465pub fn visit_expr_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprGroup) {
1466 for it in &_i.attrs {
1467 _visitor.visit_attribute(it)
1468 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001469 tokens_helper(_visitor, &_i.group_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001470 _visitor.visit_expr(&*_i.expr);
1471}
1472#[cfg(feature = "full")]
1473#[cfg(any(feature = "full", feature = "derive"))]
1474pub fn visit_expr_if<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprIf) {
1475 for it in &_i.attrs {
1476 _visitor.visit_attribute(it)
1477 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001478 tokens_helper(_visitor, &_i.if_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001479 _visitor.visit_expr(&*_i.cond);
1480 _visitor.visit_block(&_i.then_branch);
1481 if let Some(ref it) = _i.else_branch {
David Tolnay7ac699c2018-08-24 14:00:58 -04001482 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001483 _visitor.visit_expr(&*(it).1);
1484 };
1485}
1486#[cfg(feature = "full")]
1487#[cfg(any(feature = "full", feature = "derive"))]
1488pub fn visit_expr_if_let<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprIfLet) {
1489 for it in &_i.attrs {
1490 _visitor.visit_attribute(it)
1491 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001492 tokens_helper(_visitor, &_i.if_token.span);
1493 tokens_helper(_visitor, &_i.let_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001494 for el in Punctuated::pairs(&_i.pats) {
1495 let it = el.value();
1496 _visitor.visit_pat(it)
1497 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001498 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001499 _visitor.visit_expr(&*_i.expr);
1500 _visitor.visit_block(&_i.then_branch);
1501 if let Some(ref it) = _i.else_branch {
David Tolnay7ac699c2018-08-24 14:00:58 -04001502 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001503 _visitor.visit_expr(&*(it).1);
1504 };
1505}
1506#[cfg(feature = "full")]
1507#[cfg(any(feature = "full", feature = "derive"))]
1508pub fn visit_expr_in_place<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprInPlace) {
1509 for it in &_i.attrs {
1510 _visitor.visit_attribute(it)
1511 }
1512 _visitor.visit_expr(&*_i.place);
David Tolnay7ac699c2018-08-24 14:00:58 -04001513 tokens_helper(_visitor, &_i.arrow_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001514 _visitor.visit_expr(&*_i.value);
1515}
1516#[cfg(any(feature = "full", feature = "derive"))]
1517pub fn visit_expr_index<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprIndex) {
1518 for it in &_i.attrs {
1519 _visitor.visit_attribute(it)
1520 }
1521 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001522 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001523 _visitor.visit_expr(&*_i.index);
1524}
1525#[cfg(any(feature = "full", feature = "derive"))]
1526pub fn visit_expr_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprLit) {
1527 for it in &_i.attrs {
1528 _visitor.visit_attribute(it)
1529 }
1530 _visitor.visit_lit(&_i.lit);
1531}
1532#[cfg(feature = "full")]
1533#[cfg(any(feature = "full", feature = "derive"))]
1534pub fn visit_expr_loop<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprLoop) {
1535 for it in &_i.attrs {
1536 _visitor.visit_attribute(it)
1537 }
1538 if let Some(ref it) = _i.label {
1539 _visitor.visit_label(it)
1540 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001541 tokens_helper(_visitor, &_i.loop_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001542 _visitor.visit_block(&_i.body);
1543}
1544#[cfg(feature = "full")]
1545#[cfg(any(feature = "full", feature = "derive"))]
1546pub fn visit_expr_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprMacro) {
1547 for it in &_i.attrs {
1548 _visitor.visit_attribute(it)
1549 }
1550 _visitor.visit_macro(&_i.mac);
1551}
1552#[cfg(feature = "full")]
1553#[cfg(any(feature = "full", feature = "derive"))]
1554pub fn visit_expr_match<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprMatch) {
1555 for it in &_i.attrs {
1556 _visitor.visit_attribute(it)
1557 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001558 tokens_helper(_visitor, &_i.match_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001559 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001560 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001561 for it in &_i.arms {
1562 _visitor.visit_arm(it)
1563 }
1564}
1565#[cfg(feature = "full")]
1566#[cfg(any(feature = "full", feature = "derive"))]
1567pub fn visit_expr_method_call<'ast, V: Visit<'ast> + ?Sized>(
1568 _visitor: &mut V,
1569 _i: &'ast ExprMethodCall,
1570) {
1571 for it in &_i.attrs {
1572 _visitor.visit_attribute(it)
1573 }
1574 _visitor.visit_expr(&*_i.receiver);
David Tolnay7ac699c2018-08-24 14:00:58 -04001575 tokens_helper(_visitor, &_i.dot_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001576 _visitor.visit_ident(&_i.method);
1577 if let Some(ref it) = _i.turbofish {
1578 _visitor.visit_method_turbofish(it)
1579 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001580 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001581 for el in Punctuated::pairs(&_i.args) {
1582 let it = el.value();
1583 _visitor.visit_expr(it)
1584 }
1585}
1586#[cfg(any(feature = "full", feature = "derive"))]
1587pub fn visit_expr_paren<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprParen) {
1588 for it in &_i.attrs {
1589 _visitor.visit_attribute(it)
1590 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001591 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001592 _visitor.visit_expr(&*_i.expr);
1593}
1594#[cfg(any(feature = "full", feature = "derive"))]
1595pub fn visit_expr_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprPath) {
1596 for it in &_i.attrs {
1597 _visitor.visit_attribute(it)
1598 }
1599 if let Some(ref it) = _i.qself {
1600 _visitor.visit_qself(it)
1601 };
1602 _visitor.visit_path(&_i.path);
1603}
1604#[cfg(feature = "full")]
1605#[cfg(any(feature = "full", feature = "derive"))]
1606pub fn visit_expr_range<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprRange) {
1607 for it in &_i.attrs {
1608 _visitor.visit_attribute(it)
1609 }
1610 if let Some(ref it) = _i.from {
1611 _visitor.visit_expr(&**it)
1612 };
1613 _visitor.visit_range_limits(&_i.limits);
1614 if let Some(ref it) = _i.to {
1615 _visitor.visit_expr(&**it)
1616 };
1617}
1618#[cfg(feature = "full")]
1619#[cfg(any(feature = "full", feature = "derive"))]
1620pub fn visit_expr_reference<'ast, V: Visit<'ast> + ?Sized>(
1621 _visitor: &mut V,
1622 _i: &'ast ExprReference,
1623) {
1624 for it in &_i.attrs {
1625 _visitor.visit_attribute(it)
1626 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001627 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001628 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04001629 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001630 };
1631 _visitor.visit_expr(&*_i.expr);
1632}
1633#[cfg(feature = "full")]
1634#[cfg(any(feature = "full", feature = "derive"))]
1635pub fn visit_expr_repeat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprRepeat) {
1636 for it in &_i.attrs {
1637 _visitor.visit_attribute(it)
1638 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001639 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001640 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001641 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001642 _visitor.visit_expr(&*_i.len);
1643}
1644#[cfg(feature = "full")]
1645#[cfg(any(feature = "full", feature = "derive"))]
1646pub fn visit_expr_return<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprReturn) {
1647 for it in &_i.attrs {
1648 _visitor.visit_attribute(it)
1649 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001650 tokens_helper(_visitor, &_i.return_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001651 if let Some(ref it) = _i.expr {
1652 _visitor.visit_expr(&**it)
1653 };
1654}
1655#[cfg(feature = "full")]
1656#[cfg(any(feature = "full", feature = "derive"))]
1657pub fn visit_expr_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprStruct) {
1658 for it in &_i.attrs {
1659 _visitor.visit_attribute(it)
1660 }
1661 _visitor.visit_path(&_i.path);
David Tolnay7ac699c2018-08-24 14:00:58 -04001662 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001663 for el in Punctuated::pairs(&_i.fields) {
1664 let it = el.value();
1665 _visitor.visit_field_value(it)
1666 }
1667 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001668 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001669 };
1670 if let Some(ref it) = _i.rest {
1671 _visitor.visit_expr(&**it)
1672 };
1673}
1674#[cfg(feature = "full")]
1675#[cfg(any(feature = "full", feature = "derive"))]
1676pub fn visit_expr_try<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprTry) {
1677 for it in &_i.attrs {
1678 _visitor.visit_attribute(it)
1679 }
1680 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001681 tokens_helper(_visitor, &_i.question_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001682}
1683#[cfg(feature = "full")]
1684#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayfb2dd4b2018-08-24 16:45:34 -04001685pub fn visit_expr_try_block<'ast, V: Visit<'ast> + ?Sized>(
1686 _visitor: &mut V,
1687 _i: &'ast ExprTryBlock,
1688) {
1689 for it in &_i.attrs {
1690 _visitor.visit_attribute(it)
1691 }
1692 tokens_helper(_visitor, &_i.try_token.span);
1693 _visitor.visit_block(&_i.block);
1694}
1695#[cfg(feature = "full")]
1696#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001697pub fn visit_expr_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprTuple) {
1698 for it in &_i.attrs {
1699 _visitor.visit_attribute(it)
1700 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001701 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001702 for el in Punctuated::pairs(&_i.elems) {
1703 let it = el.value();
1704 _visitor.visit_expr(it)
1705 }
1706}
1707#[cfg(feature = "full")]
1708#[cfg(any(feature = "full", feature = "derive"))]
1709pub fn visit_expr_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprType) {
1710 for it in &_i.attrs {
1711 _visitor.visit_attribute(it)
1712 }
1713 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001714 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001715 _visitor.visit_type(&*_i.ty);
1716}
1717#[cfg(any(feature = "full", feature = "derive"))]
1718pub fn visit_expr_unary<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprUnary) {
1719 for it in &_i.attrs {
1720 _visitor.visit_attribute(it)
1721 }
1722 _visitor.visit_un_op(&_i.op);
1723 _visitor.visit_expr(&*_i.expr);
1724}
1725#[cfg(feature = "full")]
1726#[cfg(any(feature = "full", feature = "derive"))]
1727pub fn visit_expr_unsafe<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprUnsafe) {
1728 for it in &_i.attrs {
1729 _visitor.visit_attribute(it)
1730 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001731 tokens_helper(_visitor, &_i.unsafe_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001732 _visitor.visit_block(&_i.block);
1733}
1734#[cfg(any(feature = "full", feature = "derive"))]
1735pub fn visit_expr_verbatim<'ast, V: Visit<'ast> + ?Sized>(
1736 _visitor: &mut V,
1737 _i: &'ast ExprVerbatim,
1738) {
David Tolnay6af48992018-08-01 11:16:28 -07001739 skip!(_i.tts);
David Tolnay8c81f622018-07-31 23:34:35 -07001740}
1741#[cfg(feature = "full")]
1742#[cfg(any(feature = "full", feature = "derive"))]
1743pub fn visit_expr_while<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprWhile) {
1744 for it in &_i.attrs {
1745 _visitor.visit_attribute(it)
1746 }
1747 if let Some(ref it) = _i.label {
1748 _visitor.visit_label(it)
1749 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001750 tokens_helper(_visitor, &_i.while_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001751 _visitor.visit_expr(&*_i.cond);
1752 _visitor.visit_block(&_i.body);
1753}
1754#[cfg(feature = "full")]
1755#[cfg(any(feature = "full", feature = "derive"))]
1756pub fn visit_expr_while_let<'ast, V: Visit<'ast> + ?Sized>(
1757 _visitor: &mut V,
1758 _i: &'ast ExprWhileLet,
1759) {
1760 for it in &_i.attrs {
1761 _visitor.visit_attribute(it)
1762 }
1763 if let Some(ref it) = _i.label {
1764 _visitor.visit_label(it)
1765 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001766 tokens_helper(_visitor, &_i.while_token.span);
1767 tokens_helper(_visitor, &_i.let_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001768 for el in Punctuated::pairs(&_i.pats) {
1769 let it = el.value();
1770 _visitor.visit_pat(it)
1771 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001772 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001773 _visitor.visit_expr(&*_i.expr);
1774 _visitor.visit_block(&_i.body);
1775}
1776#[cfg(feature = "full")]
1777#[cfg(any(feature = "full", feature = "derive"))]
1778pub fn visit_expr_yield<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprYield) {
1779 for it in &_i.attrs {
1780 _visitor.visit_attribute(it)
1781 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001782 tokens_helper(_visitor, &_i.yield_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001783 if let Some(ref it) = _i.expr {
1784 _visitor.visit_expr(&**it)
1785 };
1786}
1787#[cfg(any(feature = "full", feature = "derive"))]
1788pub fn visit_field<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Field) {
1789 for it in &_i.attrs {
1790 _visitor.visit_attribute(it)
1791 }
1792 _visitor.visit_visibility(&_i.vis);
1793 if let Some(ref it) = _i.ident {
1794 _visitor.visit_ident(it)
1795 };
1796 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001797 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001798 };
1799 _visitor.visit_type(&_i.ty);
1800}
1801#[cfg(any(feature = "full", feature = "derive"))]
1802#[cfg(feature = "full")]
1803pub fn visit_field_pat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldPat) {
1804 for it in &_i.attrs {
1805 _visitor.visit_attribute(it)
1806 }
1807 _visitor.visit_member(&_i.member);
1808 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001809 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001810 };
1811 _visitor.visit_pat(&*_i.pat);
1812}
1813#[cfg(any(feature = "full", feature = "derive"))]
1814#[cfg(feature = "full")]
1815pub fn visit_field_value<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldValue) {
1816 for it in &_i.attrs {
1817 _visitor.visit_attribute(it)
1818 }
1819 _visitor.visit_member(&_i.member);
1820 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001821 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001822 };
1823 _visitor.visit_expr(&_i.expr);
1824}
1825#[cfg(any(feature = "full", feature = "derive"))]
1826pub fn visit_fields<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Fields) {
1827 match *_i {
1828 Fields::Named(ref _binding_0) => {
1829 _visitor.visit_fields_named(_binding_0);
1830 }
1831 Fields::Unnamed(ref _binding_0) => {
1832 _visitor.visit_fields_unnamed(_binding_0);
1833 }
1834 Fields::Unit => {}
1835 }
1836}
1837#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001838pub fn visit_fields_named<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldsNamed) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001839 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001840 for el in Punctuated::pairs(&_i.named) {
1841 let it = el.value();
1842 _visitor.visit_field(it)
1843 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001844}
David Tolnay8c81f622018-07-31 23:34:35 -07001845#[cfg(any(feature = "full", feature = "derive"))]
1846pub fn visit_fields_unnamed<'ast, V: Visit<'ast> + ?Sized>(
1847 _visitor: &mut V,
1848 _i: &'ast FieldsUnnamed,
1849) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001850 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001851 for el in Punctuated::pairs(&_i.unnamed) {
1852 let it = el.value();
1853 _visitor.visit_field(it)
1854 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001855}
David Tolnay8c81f622018-07-31 23:34:35 -07001856#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001857pub fn visit_file<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast File) {
David Tolnay6af48992018-08-01 11:16:28 -07001858 skip!(_i.shebang);
David Tolnay8c81f622018-07-31 23:34:35 -07001859 for it in &_i.attrs {
1860 _visitor.visit_attribute(it)
1861 }
1862 for it in &_i.items {
1863 _visitor.visit_item(it)
1864 }
Nika Layzell27726662017-10-24 23:16:35 -04001865}
David Tolnay8c81f622018-07-31 23:34:35 -07001866#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001867pub fn visit_fn_arg<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FnArg) {
Nika Layzell27726662017-10-24 23:16:35 -04001868 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001869 FnArg::SelfRef(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001870 _visitor.visit_arg_self_ref(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001871 }
David Tolnay8c81f622018-07-31 23:34:35 -07001872 FnArg::SelfValue(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001873 _visitor.visit_arg_self(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001874 }
David Tolnay8c81f622018-07-31 23:34:35 -07001875 FnArg::Captured(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001876 _visitor.visit_arg_captured(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001877 }
David Tolnay8c81f622018-07-31 23:34:35 -07001878 FnArg::Inferred(ref _binding_0) => {
David Tolnay80ed55f2017-12-27 22:54:40 -05001879 _visitor.visit_pat(_binding_0);
1880 }
David Tolnay8c81f622018-07-31 23:34:35 -07001881 FnArg::Ignored(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001882 _visitor.visit_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001883 }
1884 }
1885}
David Tolnay8c81f622018-07-31 23:34:35 -07001886#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001887pub fn visit_fn_decl<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FnDecl) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001888 tokens_helper(_visitor, &_i.fn_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001889 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04001890 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001891 for el in Punctuated::pairs(&_i.inputs) {
1892 let it = el.value();
1893 _visitor.visit_fn_arg(it)
1894 }
1895 if let Some(ref it) = _i.variadic {
David Tolnay7ac699c2018-08-24 14:00:58 -04001896 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001897 };
1898 _visitor.visit_return_type(&_i.output);
Nika Layzell27726662017-10-24 23:16:35 -04001899}
David Tolnay8c81f622018-07-31 23:34:35 -07001900#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001901pub fn visit_foreign_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ForeignItem) {
Nika Layzell27726662017-10-24 23:16:35 -04001902 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001903 ForeignItem::Fn(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001904 _visitor.visit_foreign_item_fn(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001905 }
David Tolnay8c81f622018-07-31 23:34:35 -07001906 ForeignItem::Static(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001907 _visitor.visit_foreign_item_static(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001908 }
David Tolnay8c81f622018-07-31 23:34:35 -07001909 ForeignItem::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001910 _visitor.visit_foreign_item_type(_binding_0);
David Tolnay199bcbb2017-11-12 10:33:52 -08001911 }
David Tolnay435c1782018-08-24 16:15:44 -04001912 ForeignItem::Macro(ref _binding_0) => {
1913 _visitor.visit_foreign_item_macro(_binding_0);
1914 }
David Tolnay8c81f622018-07-31 23:34:35 -07001915 ForeignItem::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05001916 _visitor.visit_foreign_item_verbatim(_binding_0);
1917 }
Nika Layzell27726662017-10-24 23:16:35 -04001918 }
1919}
David Tolnay8c81f622018-07-31 23:34:35 -07001920#[cfg(feature = "full")]
1921pub fn visit_foreign_item_fn<'ast, V: Visit<'ast> + ?Sized>(
1922 _visitor: &mut V,
1923 _i: &'ast ForeignItemFn,
1924) {
1925 for it in &_i.attrs {
1926 _visitor.visit_attribute(it)
1927 }
1928 _visitor.visit_visibility(&_i.vis);
1929 _visitor.visit_ident(&_i.ident);
1930 _visitor.visit_fn_decl(&*_i.decl);
David Tolnay7ac699c2018-08-24 14:00:58 -04001931 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay8894f602017-11-11 12:11:04 -08001932}
David Tolnay8c81f622018-07-31 23:34:35 -07001933#[cfg(feature = "full")]
David Tolnay435c1782018-08-24 16:15:44 -04001934pub fn visit_foreign_item_macro<'ast, V: Visit<'ast> + ?Sized>(
1935 _visitor: &mut V,
1936 _i: &'ast ForeignItemMacro,
1937) {
1938 for it in &_i.attrs {
1939 _visitor.visit_attribute(it)
1940 }
1941 _visitor.visit_macro(&_i.mac);
1942 if let Some(ref it) = _i.semi_token {
1943 tokens_helper(_visitor, &it.spans)
1944 };
1945}
1946#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001947pub fn visit_foreign_item_static<'ast, V: Visit<'ast> + ?Sized>(
1948 _visitor: &mut V,
1949 _i: &'ast ForeignItemStatic,
1950) {
1951 for it in &_i.attrs {
1952 _visitor.visit_attribute(it)
1953 }
1954 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04001955 tokens_helper(_visitor, &_i.static_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001956 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04001957 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001958 };
1959 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001960 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001961 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04001962 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001963}
David Tolnay8c81f622018-07-31 23:34:35 -07001964#[cfg(feature = "full")]
1965pub fn visit_foreign_item_type<'ast, V: Visit<'ast> + ?Sized>(
1966 _visitor: &mut V,
1967 _i: &'ast ForeignItemType,
1968) {
1969 for it in &_i.attrs {
1970 _visitor.visit_attribute(it)
1971 }
1972 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04001973 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001974 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001975 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay199bcbb2017-11-12 10:33:52 -08001976}
David Tolnay8c81f622018-07-31 23:34:35 -07001977#[cfg(feature = "full")]
1978pub fn visit_foreign_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
1979 _visitor: &mut V,
1980 _i: &'ast ForeignItemVerbatim,
1981) {
David Tolnay6af48992018-08-01 11:16:28 -07001982 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05001983}
David Tolnay8c81f622018-07-31 23:34:35 -07001984#[cfg(any(feature = "full", feature = "derive"))]
1985pub fn visit_generic_argument<'ast, V: Visit<'ast> + ?Sized>(
1986 _visitor: &mut V,
1987 _i: &'ast GenericArgument,
1988) {
Nika Layzell357885a2017-12-04 15:47:07 -05001989 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001990 GenericArgument::Lifetime(ref _binding_0) => {
David Tolnay4ba63a02017-12-28 15:53:05 -05001991 _visitor.visit_lifetime(_binding_0);
Nika Layzell357885a2017-12-04 15:47:07 -05001992 }
David Tolnay8c81f622018-07-31 23:34:35 -07001993 GenericArgument::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001994 _visitor.visit_type(_binding_0);
Nika Layzell357885a2017-12-04 15:47:07 -05001995 }
David Tolnay8c81f622018-07-31 23:34:35 -07001996 GenericArgument::Binding(ref _binding_0) => {
David Tolnay506e43a2017-12-29 11:34:36 -05001997 _visitor.visit_binding(_binding_0);
Nika Layzell357885a2017-12-04 15:47:07 -05001998 }
David Tolnay8c81f622018-07-31 23:34:35 -07001999 GenericArgument::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002000 _visitor.visit_expr(_binding_0);
Nika Layzellc680e612017-12-04 19:07:20 -05002001 }
Nika Layzell357885a2017-12-04 15:47:07 -05002002 }
2003}
David Tolnay8c81f622018-07-31 23:34:35 -07002004#[cfg(any(feature = "full", feature = "derive"))]
2005#[cfg(feature = "full")]
2006pub fn visit_generic_method_argument<'ast, V: Visit<'ast> + ?Sized>(
2007 _visitor: &mut V,
2008 _i: &'ast GenericMethodArgument,
2009) {
David Tolnayd60cfec2017-12-29 00:21:38 -05002010 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002011 GenericMethodArgument::Type(ref _binding_0) => {
David Tolnayd60cfec2017-12-29 00:21:38 -05002012 _visitor.visit_type(_binding_0);
2013 }
David Tolnay8c81f622018-07-31 23:34:35 -07002014 GenericMethodArgument::Const(ref _binding_0) => {
David Tolnayd60cfec2017-12-29 00:21:38 -05002015 _visitor.visit_expr(_binding_0);
2016 }
2017 }
2018}
David Tolnay8c81f622018-07-31 23:34:35 -07002019#[cfg(any(feature = "full", feature = "derive"))]
2020pub fn visit_generic_param<'ast, V: Visit<'ast> + ?Sized>(
2021 _visitor: &mut V,
2022 _i: &'ast GenericParam,
2023) {
David Tolnayc2f1aba2017-11-12 20:29:22 -08002024 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002025 GenericParam::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002026 _visitor.visit_type_param(_binding_0);
David Tolnayc2f1aba2017-11-12 20:29:22 -08002027 }
David Tolnay8c81f622018-07-31 23:34:35 -07002028 GenericParam::Lifetime(ref _binding_0) => {
David Tolnay517f3692018-01-01 20:17:23 -08002029 _visitor.visit_lifetime_def(_binding_0);
2030 }
David Tolnay8c81f622018-07-31 23:34:35 -07002031 GenericParam::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002032 _visitor.visit_const_param(_binding_0);
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05002033 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08002034 }
2035}
David Tolnay8c81f622018-07-31 23:34:35 -07002036#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002037pub fn visit_generics<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Generics) {
David Tolnay8c81f622018-07-31 23:34:35 -07002038 if let Some(ref it) = _i.lt_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002039 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002040 };
2041 for el in Punctuated::pairs(&_i.params) {
2042 let it = el.value();
2043 _visitor.visit_generic_param(it)
2044 }
2045 if let Some(ref it) = _i.gt_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002046 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002047 };
2048 if let Some(ref it) = _i.where_clause {
2049 _visitor.visit_where_clause(it)
2050 };
Nika Layzell27726662017-10-24 23:16:35 -04002051}
David Tolnay8c81f622018-07-31 23:34:35 -07002052pub fn visit_ident<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Ident) {}
2053#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002054pub fn visit_impl_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ImplItem) {
Nika Layzell27726662017-10-24 23:16:35 -04002055 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002056 ImplItem::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002057 _visitor.visit_impl_item_const(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002058 }
David Tolnay8c81f622018-07-31 23:34:35 -07002059 ImplItem::Method(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002060 _visitor.visit_impl_item_method(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002061 }
David Tolnay8c81f622018-07-31 23:34:35 -07002062 ImplItem::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002063 _visitor.visit_impl_item_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002064 }
David Tolnaybb82ef02018-08-24 20:15:45 -04002065 ImplItem::Existential(ref _binding_0) => {
2066 _visitor.visit_impl_item_existential(_binding_0);
2067 }
David Tolnay8c81f622018-07-31 23:34:35 -07002068 ImplItem::Macro(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002069 _visitor.visit_impl_item_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002070 }
David Tolnay8c81f622018-07-31 23:34:35 -07002071 ImplItem::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002072 _visitor.visit_impl_item_verbatim(_binding_0);
2073 }
Nika Layzell27726662017-10-24 23:16:35 -04002074 }
2075}
David Tolnay8c81f622018-07-31 23:34:35 -07002076#[cfg(feature = "full")]
2077pub fn visit_impl_item_const<'ast, V: Visit<'ast> + ?Sized>(
2078 _visitor: &mut V,
2079 _i: &'ast ImplItemConst,
2080) {
2081 for it in &_i.attrs {
2082 _visitor.visit_attribute(it)
2083 }
2084 _visitor.visit_visibility(&_i.vis);
2085 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002086 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002087 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002088 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002089 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002090 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002091 _visitor.visit_type(&_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002092 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002093 _visitor.visit_expr(&_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04002094 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay857628c2017-11-11 12:25:31 -08002095}
David Tolnay8c81f622018-07-31 23:34:35 -07002096#[cfg(feature = "full")]
David Tolnaybb82ef02018-08-24 20:15:45 -04002097pub fn visit_impl_item_existential<'ast, V: Visit<'ast> + ?Sized>(
2098 _visitor: &mut V,
2099 _i: &'ast ImplItemExistential,
2100) {
2101 for it in &_i.attrs {
2102 _visitor.visit_attribute(it)
2103 }
2104 tokens_helper(_visitor, &_i.existential_token.span);
2105 tokens_helper(_visitor, &_i.type_token.span);
2106 _visitor.visit_ident(&_i.ident);
2107 _visitor.visit_generics(&_i.generics);
2108 if let Some(ref it) = _i.colon_token {
2109 tokens_helper(_visitor, &it.spans)
2110 };
2111 for el in Punctuated::pairs(&_i.bounds) {
2112 let it = el.value();
2113 _visitor.visit_type_param_bound(it)
2114 }
2115 tokens_helper(_visitor, &_i.semi_token.spans);
2116}
2117#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07002118pub fn visit_impl_item_macro<'ast, V: Visit<'ast> + ?Sized>(
2119 _visitor: &mut V,
2120 _i: &'ast ImplItemMacro,
2121) {
2122 for it in &_i.attrs {
2123 _visitor.visit_attribute(it)
2124 }
2125 _visitor.visit_macro(&_i.mac);
2126 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002127 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002128 };
David Tolnay857628c2017-11-11 12:25:31 -08002129}
David Tolnay8c81f622018-07-31 23:34:35 -07002130#[cfg(feature = "full")]
2131pub fn visit_impl_item_method<'ast, V: Visit<'ast> + ?Sized>(
2132 _visitor: &mut V,
2133 _i: &'ast ImplItemMethod,
2134) {
2135 for it in &_i.attrs {
2136 _visitor.visit_attribute(it)
2137 }
2138 _visitor.visit_visibility(&_i.vis);
2139 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002140 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002141 };
2142 _visitor.visit_method_sig(&_i.sig);
2143 _visitor.visit_block(&_i.block);
Nika Layzell27726662017-10-24 23:16:35 -04002144}
David Tolnay8c81f622018-07-31 23:34:35 -07002145#[cfg(feature = "full")]
2146pub fn visit_impl_item_type<'ast, V: Visit<'ast> + ?Sized>(
2147 _visitor: &mut V,
2148 _i: &'ast ImplItemType,
2149) {
2150 for it in &_i.attrs {
2151 _visitor.visit_attribute(it)
2152 }
2153 _visitor.visit_visibility(&_i.vis);
2154 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002155 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002156 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002157 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002158 _visitor.visit_ident(&_i.ident);
2159 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04002160 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002161 _visitor.visit_type(&_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002162 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002163}
David Tolnay8c81f622018-07-31 23:34:35 -07002164#[cfg(feature = "full")]
2165pub fn visit_impl_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
2166 _visitor: &mut V,
2167 _i: &'ast ImplItemVerbatim,
2168) {
David Tolnay6af48992018-08-01 11:16:28 -07002169 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05002170}
David Tolnay8c81f622018-07-31 23:34:35 -07002171#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002172pub fn visit_index<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Index) {
David Tolnay6af48992018-08-01 11:16:28 -07002173 skip!(_i.index);
David Tolnay8c81f622018-07-31 23:34:35 -07002174 _visitor.visit_span(&_i.span);
David Tolnay85b69a42017-12-27 20:43:10 -05002175}
David Tolnay8c81f622018-07-31 23:34:35 -07002176#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002177pub fn visit_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Item) {
Nika Layzell27726662017-10-24 23:16:35 -04002178 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002179 Item::ExternCrate(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002180 _visitor.visit_item_extern_crate(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002181 }
David Tolnay8c81f622018-07-31 23:34:35 -07002182 Item::Use(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002183 _visitor.visit_item_use(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002184 }
David Tolnay8c81f622018-07-31 23:34:35 -07002185 Item::Static(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002186 _visitor.visit_item_static(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002187 }
David Tolnay8c81f622018-07-31 23:34:35 -07002188 Item::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002189 _visitor.visit_item_const(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002190 }
David Tolnay8c81f622018-07-31 23:34:35 -07002191 Item::Fn(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002192 _visitor.visit_item_fn(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002193 }
David Tolnay8c81f622018-07-31 23:34:35 -07002194 Item::Mod(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002195 _visitor.visit_item_mod(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002196 }
David Tolnay8c81f622018-07-31 23:34:35 -07002197 Item::ForeignMod(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002198 _visitor.visit_item_foreign_mod(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002199 }
David Tolnay8c81f622018-07-31 23:34:35 -07002200 Item::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002201 _visitor.visit_item_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002202 }
David Tolnaybb82ef02018-08-24 20:15:45 -04002203 Item::Existential(ref _binding_0) => {
2204 _visitor.visit_item_existential(_binding_0);
2205 }
David Tolnay8c81f622018-07-31 23:34:35 -07002206 Item::Struct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002207 _visitor.visit_item_struct(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002208 }
David Tolnay8c81f622018-07-31 23:34:35 -07002209 Item::Enum(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05002210 _visitor.visit_item_enum(_binding_0);
2211 }
David Tolnay8c81f622018-07-31 23:34:35 -07002212 Item::Union(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002213 _visitor.visit_item_union(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002214 }
David Tolnay8c81f622018-07-31 23:34:35 -07002215 Item::Trait(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002216 _visitor.visit_item_trait(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002217 }
David Tolnayc6b04dd2018-08-30 23:22:51 -07002218 Item::TraitAlias(ref _binding_0) => {
2219 _visitor.visit_item_trait_alias(_binding_0);
2220 }
David Tolnay8c81f622018-07-31 23:34:35 -07002221 Item::Impl(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002222 _visitor.visit_item_impl(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002223 }
David Tolnay8c81f622018-07-31 23:34:35 -07002224 Item::Macro(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002225 _visitor.visit_item_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002226 }
David Tolnay8c81f622018-07-31 23:34:35 -07002227 Item::Macro2(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002228 _visitor.visit_item_macro2(_binding_0);
David Tolnay500d8322017-12-18 00:32:51 -08002229 }
David Tolnay8c81f622018-07-31 23:34:35 -07002230 Item::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002231 _visitor.visit_item_verbatim(_binding_0);
2232 }
Nika Layzell27726662017-10-24 23:16:35 -04002233 }
2234}
David Tolnay8c81f622018-07-31 23:34:35 -07002235#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002236pub fn visit_item_const<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemConst) {
David Tolnay8c81f622018-07-31 23:34:35 -07002237 for it in &_i.attrs {
2238 _visitor.visit_attribute(it)
2239 }
2240 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002241 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002242 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002243 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002244 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002245 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002246 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04002247 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnayc6b55bc2017-11-09 22:48:38 -08002248}
David Tolnay8c81f622018-07-31 23:34:35 -07002249#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002250pub fn visit_item_enum<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemEnum) {
David Tolnay8c81f622018-07-31 23:34:35 -07002251 for it in &_i.attrs {
2252 _visitor.visit_attribute(it)
2253 }
2254 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002255 tokens_helper(_visitor, &_i.enum_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002256 _visitor.visit_ident(&_i.ident);
2257 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04002258 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002259 for el in Punctuated::pairs(&_i.variants) {
2260 let it = el.value();
2261 _visitor.visit_variant(it)
2262 }
David Tolnayc6b55bc2017-11-09 22:48:38 -08002263}
David Tolnay8c81f622018-07-31 23:34:35 -07002264#[cfg(feature = "full")]
David Tolnaybb82ef02018-08-24 20:15:45 -04002265pub fn visit_item_existential<'ast, V: Visit<'ast> + ?Sized>(
2266 _visitor: &mut V,
2267 _i: &'ast ItemExistential,
2268) {
2269 for it in &_i.attrs {
2270 _visitor.visit_attribute(it)
2271 }
2272 _visitor.visit_visibility(&_i.vis);
2273 tokens_helper(_visitor, &_i.existential_token.span);
2274 tokens_helper(_visitor, &_i.type_token.span);
2275 _visitor.visit_ident(&_i.ident);
2276 _visitor.visit_generics(&_i.generics);
2277 if let Some(ref it) = _i.colon_token {
2278 tokens_helper(_visitor, &it.spans)
2279 };
2280 for el in Punctuated::pairs(&_i.bounds) {
2281 let it = el.value();
2282 _visitor.visit_type_param_bound(it)
2283 }
2284 tokens_helper(_visitor, &_i.semi_token.spans);
2285}
2286#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07002287pub fn visit_item_extern_crate<'ast, V: Visit<'ast> + ?Sized>(
2288 _visitor: &mut V,
2289 _i: &'ast ItemExternCrate,
2290) {
2291 for it in &_i.attrs {
2292 _visitor.visit_attribute(it)
2293 }
2294 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002295 tokens_helper(_visitor, &_i.extern_token.span);
2296 tokens_helper(_visitor, &_i.crate_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002297 _visitor.visit_ident(&_i.ident);
2298 if let Some(ref it) = _i.rename {
David Tolnay7ac699c2018-08-24 14:00:58 -04002299 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002300 _visitor.visit_ident(&(it).1);
2301 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002302 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnayc6b55bc2017-11-09 22:48:38 -08002303}
David Tolnay8c81f622018-07-31 23:34:35 -07002304#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002305pub fn visit_item_fn<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemFn) {
David Tolnay8c81f622018-07-31 23:34:35 -07002306 for it in &_i.attrs {
2307 _visitor.visit_attribute(it)
2308 }
2309 _visitor.visit_visibility(&_i.vis);
2310 if let Some(ref it) = _i.constness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002311 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002312 };
2313 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002314 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002315 };
Yusuke Sasakif00a3ef2018-07-20 22:08:42 +09002316 if let Some(ref it) = _i.asyncness {
2317 tokens_helper(_visitor, &it.span)
2318 };
David Tolnay8c81f622018-07-31 23:34:35 -07002319 if let Some(ref it) = _i.abi {
2320 _visitor.visit_abi(it)
2321 };
2322 _visitor.visit_ident(&_i.ident);
2323 _visitor.visit_fn_decl(&*_i.decl);
2324 _visitor.visit_block(&*_i.block);
David Tolnayc6b55bc2017-11-09 22:48:38 -08002325}
David Tolnay8c81f622018-07-31 23:34:35 -07002326#[cfg(feature = "full")]
2327pub fn visit_item_foreign_mod<'ast, V: Visit<'ast> + ?Sized>(
2328 _visitor: &mut V,
2329 _i: &'ast ItemForeignMod,
2330) {
2331 for it in &_i.attrs {
2332 _visitor.visit_attribute(it)
2333 }
2334 _visitor.visit_abi(&_i.abi);
David Tolnay7ac699c2018-08-24 14:00:58 -04002335 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002336 for it in &_i.items {
2337 _visitor.visit_foreign_item(it)
2338 }
David Tolnayc6b55bc2017-11-09 22:48:38 -08002339}
David Tolnay8c81f622018-07-31 23:34:35 -07002340#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002341pub fn visit_item_impl<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemImpl) {
David Tolnay8c81f622018-07-31 23:34:35 -07002342 for it in &_i.attrs {
2343 _visitor.visit_attribute(it)
2344 }
2345 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002346 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002347 };
2348 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002349 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002350 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002351 tokens_helper(_visitor, &_i.impl_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002352 _visitor.visit_generics(&_i.generics);
2353 if let Some(ref it) = _i.trait_ {
2354 if let Some(ref it) = (it).0 {
David Tolnay7ac699c2018-08-24 14:00:58 -04002355 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002356 };
2357 _visitor.visit_path(&(it).1);
David Tolnay7ac699c2018-08-24 14:00:58 -04002358 tokens_helper(_visitor, &(it).2.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002359 };
2360 _visitor.visit_type(&*_i.self_ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002361 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002362 for it in &_i.items {
2363 _visitor.visit_impl_item(it)
2364 }
David Tolnayc6b55bc2017-11-09 22:48:38 -08002365}
David Tolnay8c81f622018-07-31 23:34:35 -07002366#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002367pub fn visit_item_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemMacro) {
David Tolnay8c81f622018-07-31 23:34:35 -07002368 for it in &_i.attrs {
2369 _visitor.visit_attribute(it)
2370 }
2371 if let Some(ref it) = _i.ident {
2372 _visitor.visit_ident(it)
2373 };
2374 _visitor.visit_macro(&_i.mac);
2375 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002376 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002377 };
David Tolnayc6b55bc2017-11-09 22:48:38 -08002378}
David Tolnay8c81f622018-07-31 23:34:35 -07002379#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002380pub fn visit_item_macro2<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemMacro2) {
David Tolnay8c81f622018-07-31 23:34:35 -07002381 for it in &_i.attrs {
2382 _visitor.visit_attribute(it)
2383 }
2384 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002385 tokens_helper(_visitor, &_i.macro_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002386 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002387 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay6af48992018-08-01 11:16:28 -07002388 skip!(_i.args);
David Tolnay7ac699c2018-08-24 14:00:58 -04002389 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay6af48992018-08-01 11:16:28 -07002390 skip!(_i.body);
David Tolnay500d8322017-12-18 00:32:51 -08002391}
David Tolnay8c81f622018-07-31 23:34:35 -07002392#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002393pub fn visit_item_mod<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemMod) {
David Tolnay8c81f622018-07-31 23:34:35 -07002394 for it in &_i.attrs {
2395 _visitor.visit_attribute(it)
2396 }
2397 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002398 tokens_helper(_visitor, &_i.mod_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002399 _visitor.visit_ident(&_i.ident);
2400 if let Some(ref it) = _i.content {
David Tolnay7ac699c2018-08-24 14:00:58 -04002401 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002402 for it in &(it).1 {
2403 _visitor.visit_item(it)
2404 }
2405 };
2406 if let Some(ref it) = _i.semi {
David Tolnay7ac699c2018-08-24 14:00:58 -04002407 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002408 };
Nika Layzell27726662017-10-24 23:16:35 -04002409}
David Tolnay8c81f622018-07-31 23:34:35 -07002410#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002411pub fn visit_item_static<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemStatic) {
David Tolnay8c81f622018-07-31 23:34:35 -07002412 for it in &_i.attrs {
2413 _visitor.visit_attribute(it)
2414 }
2415 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002416 tokens_helper(_visitor, &_i.static_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002417 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04002418 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002419 };
2420 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002421 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002422 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002423 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002424 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04002425 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002426}
David Tolnay8c81f622018-07-31 23:34:35 -07002427#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002428pub fn visit_item_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemStruct) {
David Tolnay8c81f622018-07-31 23:34:35 -07002429 for it in &_i.attrs {
2430 _visitor.visit_attribute(it)
2431 }
2432 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002433 tokens_helper(_visitor, &_i.struct_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002434 _visitor.visit_ident(&_i.ident);
2435 _visitor.visit_generics(&_i.generics);
2436 _visitor.visit_fields(&_i.fields);
2437 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002438 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002439 };
Nika Layzell27726662017-10-24 23:16:35 -04002440}
David Tolnay8c81f622018-07-31 23:34:35 -07002441#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002442pub fn visit_item_trait<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemTrait) {
David Tolnay8c81f622018-07-31 23:34:35 -07002443 for it in &_i.attrs {
2444 _visitor.visit_attribute(it)
2445 }
2446 _visitor.visit_visibility(&_i.vis);
2447 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002448 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002449 };
2450 if let Some(ref it) = _i.auto_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002451 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002452 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002453 tokens_helper(_visitor, &_i.trait_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002454 _visitor.visit_ident(&_i.ident);
2455 _visitor.visit_generics(&_i.generics);
2456 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002457 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002458 };
2459 for el in Punctuated::pairs(&_i.supertraits) {
2460 let it = el.value();
2461 _visitor.visit_type_param_bound(it)
2462 }
David Tolnay7ac699c2018-08-24 14:00:58 -04002463 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002464 for it in &_i.items {
2465 _visitor.visit_trait_item(it)
2466 }
Nika Layzell27726662017-10-24 23:16:35 -04002467}
David Tolnay8c81f622018-07-31 23:34:35 -07002468#[cfg(feature = "full")]
David Tolnayc6b04dd2018-08-30 23:22:51 -07002469pub fn visit_item_trait_alias<'ast, V: Visit<'ast> + ?Sized>(
2470 _visitor: &mut V,
2471 _i: &'ast ItemTraitAlias,
2472) {
2473 for it in &_i.attrs {
2474 _visitor.visit_attribute(it)
2475 }
2476 _visitor.visit_visibility(&_i.vis);
2477 tokens_helper(_visitor, &_i.trait_token.span);
2478 _visitor.visit_ident(&_i.ident);
2479 _visitor.visit_generics(&_i.generics);
2480 tokens_helper(_visitor, &_i.eq_token.spans);
2481 for el in Punctuated::pairs(&_i.bounds) {
2482 let it = el.value();
2483 _visitor.visit_type_param_bound(it)
2484 }
2485 tokens_helper(_visitor, &_i.semi_token.spans);
2486}
2487#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002488pub fn visit_item_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemType) {
David Tolnay8c81f622018-07-31 23:34:35 -07002489 for it in &_i.attrs {
2490 _visitor.visit_attribute(it)
2491 }
2492 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002493 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002494 _visitor.visit_ident(&_i.ident);
2495 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04002496 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002497 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002498 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002499}
David Tolnay8c81f622018-07-31 23:34:35 -07002500#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002501pub fn visit_item_union<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemUnion) {
David Tolnay8c81f622018-07-31 23:34:35 -07002502 for it in &_i.attrs {
2503 _visitor.visit_attribute(it)
2504 }
2505 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002506 tokens_helper(_visitor, &_i.union_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002507 _visitor.visit_ident(&_i.ident);
2508 _visitor.visit_generics(&_i.generics);
2509 _visitor.visit_fields_named(&_i.fields);
Nika Layzell27726662017-10-24 23:16:35 -04002510}
David Tolnay8c81f622018-07-31 23:34:35 -07002511#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002512pub fn visit_item_use<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemUse) {
David Tolnay8c81f622018-07-31 23:34:35 -07002513 for it in &_i.attrs {
2514 _visitor.visit_attribute(it)
2515 }
2516 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002517 tokens_helper(_visitor, &_i.use_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002518 if let Some(ref it) = _i.leading_colon {
David Tolnay7ac699c2018-08-24 14:00:58 -04002519 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002520 };
2521 _visitor.visit_use_tree(&_i.tree);
David Tolnay7ac699c2018-08-24 14:00:58 -04002522 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002523}
David Tolnay8c81f622018-07-31 23:34:35 -07002524#[cfg(feature = "full")]
2525pub fn visit_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
2526 _visitor: &mut V,
2527 _i: &'ast ItemVerbatim,
2528) {
David Tolnay6af48992018-08-01 11:16:28 -07002529 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05002530}
David Tolnay8c81f622018-07-31 23:34:35 -07002531#[cfg(any(feature = "full", feature = "derive"))]
2532#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002533pub fn visit_label<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Label) {
David Tolnay8c81f622018-07-31 23:34:35 -07002534 _visitor.visit_lifetime(&_i.name);
David Tolnay7ac699c2018-08-24 14:00:58 -04002535 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnaybcd498f2017-12-29 12:02:33 -05002536}
David Tolnay8c81f622018-07-31 23:34:35 -07002537#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002538pub fn visit_lifetime<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Lifetime) {
David Tolnay6af48992018-08-01 11:16:28 -07002539 skip!(_i.apostrophe);
David Tolnay8c81f622018-07-31 23:34:35 -07002540 _visitor.visit_ident(&_i.ident);
David Tolnay4ba63a02017-12-28 15:53:05 -05002541}
David Tolnay8c81f622018-07-31 23:34:35 -07002542#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002543pub fn visit_lifetime_def<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LifetimeDef) {
David Tolnay8c81f622018-07-31 23:34:35 -07002544 for it in &_i.attrs {
2545 _visitor.visit_attribute(it)
2546 }
2547 _visitor.visit_lifetime(&_i.lifetime);
2548 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002549 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002550 };
2551 for el in Punctuated::pairs(&_i.bounds) {
2552 let it = el.value();
2553 _visitor.visit_lifetime(it)
2554 }
David Tolnay4ba63a02017-12-28 15:53:05 -05002555}
David Tolnay8c81f622018-07-31 23:34:35 -07002556#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002557pub fn visit_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Lit) {
David Tolnay360efd22018-01-04 23:35:26 -08002558 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002559 Lit::Str(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002560 _visitor.visit_lit_str(_binding_0);
2561 }
David Tolnay8c81f622018-07-31 23:34:35 -07002562 Lit::ByteStr(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002563 _visitor.visit_lit_byte_str(_binding_0);
2564 }
David Tolnay8c81f622018-07-31 23:34:35 -07002565 Lit::Byte(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002566 _visitor.visit_lit_byte(_binding_0);
2567 }
David Tolnay8c81f622018-07-31 23:34:35 -07002568 Lit::Char(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002569 _visitor.visit_lit_char(_binding_0);
2570 }
David Tolnay8c81f622018-07-31 23:34:35 -07002571 Lit::Int(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002572 _visitor.visit_lit_int(_binding_0);
2573 }
David Tolnay8c81f622018-07-31 23:34:35 -07002574 Lit::Float(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002575 _visitor.visit_lit_float(_binding_0);
2576 }
David Tolnay8c81f622018-07-31 23:34:35 -07002577 Lit::Bool(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002578 _visitor.visit_lit_bool(_binding_0);
2579 }
David Tolnay8c81f622018-07-31 23:34:35 -07002580 Lit::Verbatim(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002581 _visitor.visit_lit_verbatim(_binding_0);
2582 }
2583 }
2584}
David Tolnay8c81f622018-07-31 23:34:35 -07002585#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002586pub fn visit_lit_bool<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitBool) {
David Tolnay6af48992018-08-01 11:16:28 -07002587 skip!(_i.value);
David Tolnay8c81f622018-07-31 23:34:35 -07002588 _visitor.visit_span(&_i.span);
Nika Layzell27726662017-10-24 23:16:35 -04002589}
David Tolnay8c81f622018-07-31 23:34:35 -07002590#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002591pub fn visit_lit_byte<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitByte) {
David Tolnay6af48992018-08-01 11:16:28 -07002592 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002593}
David Tolnay8c81f622018-07-31 23:34:35 -07002594#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002595pub fn visit_lit_byte_str<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitByteStr) {
David Tolnay6af48992018-08-01 11:16:28 -07002596 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002597}
David Tolnay8c81f622018-07-31 23:34:35 -07002598#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002599pub fn visit_lit_char<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitChar) {
David Tolnay6af48992018-08-01 11:16:28 -07002600 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002601}
David Tolnay8c81f622018-07-31 23:34:35 -07002602#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002603pub fn visit_lit_float<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitFloat) {
David Tolnay6af48992018-08-01 11:16:28 -07002604 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002605}
David Tolnay8c81f622018-07-31 23:34:35 -07002606#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002607pub fn visit_lit_int<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitInt) {
David Tolnay6af48992018-08-01 11:16:28 -07002608 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002609}
David Tolnay8c81f622018-07-31 23:34:35 -07002610#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002611pub fn visit_lit_str<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitStr) {
David Tolnay6af48992018-08-01 11:16:28 -07002612 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002613}
David Tolnay8c81f622018-07-31 23:34:35 -07002614#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002615pub fn visit_lit_verbatim<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitVerbatim) {
David Tolnay6af48992018-08-01 11:16:28 -07002616 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002617}
David Tolnay8c81f622018-07-31 23:34:35 -07002618#[cfg(any(feature = "full", feature = "derive"))]
2619#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002620pub fn visit_local<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Local) {
David Tolnay8c81f622018-07-31 23:34:35 -07002621 for it in &_i.attrs {
2622 _visitor.visit_attribute(it)
2623 }
David Tolnay7ac699c2018-08-24 14:00:58 -04002624 tokens_helper(_visitor, &_i.let_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002625 for el in Punctuated::pairs(&_i.pats) {
2626 let it = el.value();
2627 _visitor.visit_pat(it)
2628 }
2629 if let Some(ref it) = _i.ty {
David Tolnay7ac699c2018-08-24 14:00:58 -04002630 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002631 _visitor.visit_type(&*(it).1);
2632 };
2633 if let Some(ref it) = _i.init {
David Tolnay7ac699c2018-08-24 14:00:58 -04002634 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002635 _visitor.visit_expr(&*(it).1);
2636 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002637 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002638}
David Tolnay8c81f622018-07-31 23:34:35 -07002639#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002640pub fn visit_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Macro) {
David Tolnay8c81f622018-07-31 23:34:35 -07002641 _visitor.visit_path(&_i.path);
David Tolnay7ac699c2018-08-24 14:00:58 -04002642 tokens_helper(_visitor, &_i.bang_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002643 _visitor.visit_macro_delimiter(&_i.delimiter);
David Tolnay6af48992018-08-01 11:16:28 -07002644 skip!(_i.tts);
David Tolnayab919512017-12-30 23:31:51 -05002645}
David Tolnay8c81f622018-07-31 23:34:35 -07002646#[cfg(any(feature = "full", feature = "derive"))]
2647pub fn visit_macro_delimiter<'ast, V: Visit<'ast> + ?Sized>(
2648 _visitor: &mut V,
2649 _i: &'ast MacroDelimiter,
2650) {
David Tolnayab919512017-12-30 23:31:51 -05002651 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002652 MacroDelimiter::Paren(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002653 tokens_helper(_visitor, &_binding_0.span);
David Tolnayab919512017-12-30 23:31:51 -05002654 }
David Tolnay8c81f622018-07-31 23:34:35 -07002655 MacroDelimiter::Brace(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002656 tokens_helper(_visitor, &_binding_0.span);
David Tolnayab919512017-12-30 23:31:51 -05002657 }
David Tolnay8c81f622018-07-31 23:34:35 -07002658 MacroDelimiter::Bracket(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002659 tokens_helper(_visitor, &_binding_0.span);
David Tolnayab919512017-12-30 23:31:51 -05002660 }
2661 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002662}
David Tolnay8c81f622018-07-31 23:34:35 -07002663#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002664pub fn visit_member<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Member) {
David Tolnay85b69a42017-12-27 20:43:10 -05002665 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002666 Member::Named(ref _binding_0) => {
Alex Crichtond261d092018-05-18 13:47:35 -07002667 _visitor.visit_ident(_binding_0);
David Tolnay85b69a42017-12-27 20:43:10 -05002668 }
David Tolnay8c81f622018-07-31 23:34:35 -07002669 Member::Unnamed(ref _binding_0) => {
David Tolnay85b69a42017-12-27 20:43:10 -05002670 _visitor.visit_index(_binding_0);
2671 }
2672 }
2673}
David Tolnay8c81f622018-07-31 23:34:35 -07002674#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayaaadd782018-01-06 22:58:13 -08002675pub fn visit_meta<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Meta) {
Nika Layzell27726662017-10-24 23:16:35 -04002676 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002677 Meta::Word(ref _binding_0) => {
Alex Crichtond261d092018-05-18 13:47:35 -07002678 _visitor.visit_ident(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002679 }
David Tolnay8c81f622018-07-31 23:34:35 -07002680 Meta::List(ref _binding_0) => {
David Tolnayaaadd782018-01-06 22:58:13 -08002681 _visitor.visit_meta_list(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002682 }
David Tolnay8c81f622018-07-31 23:34:35 -07002683 Meta::NameValue(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002684 _visitor.visit_meta_name_value(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002685 }
2686 }
2687}
David Tolnay8c81f622018-07-31 23:34:35 -07002688#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayaaadd782018-01-06 22:58:13 -08002689pub fn visit_meta_list<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast MetaList) {
David Tolnay8c81f622018-07-31 23:34:35 -07002690 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002691 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002692 for el in Punctuated::pairs(&_i.nested) {
2693 let it = el.value();
2694 _visitor.visit_nested_meta(it)
2695 }
Nika Layzell27726662017-10-24 23:16:35 -04002696}
David Tolnay8c81f622018-07-31 23:34:35 -07002697#[cfg(any(feature = "full", feature = "derive"))]
2698pub fn visit_meta_name_value<'ast, V: Visit<'ast> + ?Sized>(
2699 _visitor: &mut V,
2700 _i: &'ast MetaNameValue,
2701) {
2702 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002703 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002704 _visitor.visit_lit(&_i.lit);
Nika Layzell27726662017-10-24 23:16:35 -04002705}
David Tolnay8c81f622018-07-31 23:34:35 -07002706#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002707pub fn visit_method_sig<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast MethodSig) {
David Tolnay8c81f622018-07-31 23:34:35 -07002708 if let Some(ref it) = _i.constness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002709 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002710 };
2711 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002712 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002713 };
Yusuke Sasakif00a3ef2018-07-20 22:08:42 +09002714 if let Some(ref it) = _i.asyncness {
2715 tokens_helper(_visitor, &it.span)
2716 };
David Tolnay8c81f622018-07-31 23:34:35 -07002717 if let Some(ref it) = _i.abi {
2718 _visitor.visit_abi(it)
2719 };
2720 _visitor.visit_ident(&_i.ident);
2721 _visitor.visit_fn_decl(&_i.decl);
Nika Layzell27726662017-10-24 23:16:35 -04002722}
David Tolnay8c81f622018-07-31 23:34:35 -07002723#[cfg(any(feature = "full", feature = "derive"))]
2724#[cfg(feature = "full")]
2725pub fn visit_method_turbofish<'ast, V: Visit<'ast> + ?Sized>(
2726 _visitor: &mut V,
2727 _i: &'ast MethodTurbofish,
2728) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002729 tokens_helper(_visitor, &_i.colon2_token.spans);
2730 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002731 for el in Punctuated::pairs(&_i.args) {
2732 let it = el.value();
2733 _visitor.visit_generic_method_argument(it)
2734 }
David Tolnay7ac699c2018-08-24 14:00:58 -04002735 tokens_helper(_visitor, &_i.gt_token.spans);
David Tolnayd60cfec2017-12-29 00:21:38 -05002736}
David Tolnay8c81f622018-07-31 23:34:35 -07002737#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayaaadd782018-01-06 22:58:13 -08002738pub fn visit_nested_meta<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast NestedMeta) {
Nika Layzell27726662017-10-24 23:16:35 -04002739 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002740 NestedMeta::Meta(ref _binding_0) => {
David Tolnayaaadd782018-01-06 22:58:13 -08002741 _visitor.visit_meta(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002742 }
David Tolnay8c81f622018-07-31 23:34:35 -07002743 NestedMeta::Literal(ref _binding_0) => {
David Tolnay4ba63a02017-12-28 15:53:05 -05002744 _visitor.visit_lit(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002745 }
2746 }
2747}
David Tolnay8c81f622018-07-31 23:34:35 -07002748#[cfg(any(feature = "full", feature = "derive"))]
2749pub fn visit_parenthesized_generic_arguments<'ast, V: Visit<'ast> + ?Sized>(
2750 _visitor: &mut V,
2751 _i: &'ast ParenthesizedGenericArguments,
2752) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002753 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002754 for el in Punctuated::pairs(&_i.inputs) {
2755 let it = el.value();
2756 _visitor.visit_type(it)
2757 }
2758 _visitor.visit_return_type(&_i.output);
Nika Layzell27726662017-10-24 23:16:35 -04002759}
David Tolnay8c81f622018-07-31 23:34:35 -07002760#[cfg(any(feature = "full", feature = "derive"))]
2761#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002762pub fn visit_pat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Pat) {
Nika Layzell27726662017-10-24 23:16:35 -04002763 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002764 Pat::Wild(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002765 _visitor.visit_pat_wild(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002766 }
David Tolnay8c81f622018-07-31 23:34:35 -07002767 Pat::Ident(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002768 _visitor.visit_pat_ident(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002769 }
David Tolnay8c81f622018-07-31 23:34:35 -07002770 Pat::Struct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002771 _visitor.visit_pat_struct(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002772 }
David Tolnay8c81f622018-07-31 23:34:35 -07002773 Pat::TupleStruct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002774 _visitor.visit_pat_tuple_struct(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002775 }
David Tolnay8c81f622018-07-31 23:34:35 -07002776 Pat::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002777 _visitor.visit_pat_path(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002778 }
David Tolnay8c81f622018-07-31 23:34:35 -07002779 Pat::Tuple(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002780 _visitor.visit_pat_tuple(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002781 }
David Tolnay8c81f622018-07-31 23:34:35 -07002782 Pat::Box(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002783 _visitor.visit_pat_box(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002784 }
David Tolnay8c81f622018-07-31 23:34:35 -07002785 Pat::Ref(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002786 _visitor.visit_pat_ref(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002787 }
David Tolnay8c81f622018-07-31 23:34:35 -07002788 Pat::Lit(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002789 _visitor.visit_pat_lit(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002790 }
David Tolnay8c81f622018-07-31 23:34:35 -07002791 Pat::Range(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002792 _visitor.visit_pat_range(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002793 }
David Tolnay8c81f622018-07-31 23:34:35 -07002794 Pat::Slice(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002795 _visitor.visit_pat_slice(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002796 }
David Tolnay8c81f622018-07-31 23:34:35 -07002797 Pat::Macro(ref _binding_0) => {
David Tolnay323279a2017-12-29 11:26:32 -05002798 _visitor.visit_pat_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002799 }
David Tolnay8c81f622018-07-31 23:34:35 -07002800 Pat::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002801 _visitor.visit_pat_verbatim(_binding_0);
2802 }
Nika Layzell27726662017-10-24 23:16:35 -04002803 }
2804}
David Tolnay8c81f622018-07-31 23:34:35 -07002805#[cfg(any(feature = "full", feature = "derive"))]
2806#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002807pub fn visit_pat_box<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatBox) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002808 tokens_helper(_visitor, &_i.box_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002809 _visitor.visit_pat(&*_i.pat);
Nika Layzell27726662017-10-24 23:16:35 -04002810}
David Tolnay8c81f622018-07-31 23:34:35 -07002811#[cfg(any(feature = "full", feature = "derive"))]
2812#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002813pub fn visit_pat_ident<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatIdent) {
David Tolnay8c81f622018-07-31 23:34:35 -07002814 if let Some(ref it) = _i.by_ref {
David Tolnay7ac699c2018-08-24 14:00:58 -04002815 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002816 };
2817 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04002818 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002819 };
2820 _visitor.visit_ident(&_i.ident);
2821 if let Some(ref it) = _i.subpat {
David Tolnay7ac699c2018-08-24 14:00:58 -04002822 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002823 _visitor.visit_pat(&*(it).1);
2824 };
Nika Layzell27726662017-10-24 23:16:35 -04002825}
David Tolnay8c81f622018-07-31 23:34:35 -07002826#[cfg(any(feature = "full", feature = "derive"))]
2827#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002828pub fn visit_pat_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatLit) {
David Tolnay8c81f622018-07-31 23:34:35 -07002829 _visitor.visit_expr(&*_i.expr);
Nika Layzell27726662017-10-24 23:16:35 -04002830}
David Tolnay8c81f622018-07-31 23:34:35 -07002831#[cfg(any(feature = "full", feature = "derive"))]
2832#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002833pub fn visit_pat_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatMacro) {
David Tolnay8c81f622018-07-31 23:34:35 -07002834 _visitor.visit_macro(&_i.mac);
David Tolnay323279a2017-12-29 11:26:32 -05002835}
David Tolnay8c81f622018-07-31 23:34:35 -07002836#[cfg(any(feature = "full", feature = "derive"))]
2837#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002838pub fn visit_pat_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatPath) {
David Tolnay8c81f622018-07-31 23:34:35 -07002839 if let Some(ref it) = _i.qself {
2840 _visitor.visit_qself(it)
2841 };
2842 _visitor.visit_path(&_i.path);
Nika Layzell27726662017-10-24 23:16:35 -04002843}
David Tolnay8c81f622018-07-31 23:34:35 -07002844#[cfg(any(feature = "full", feature = "derive"))]
2845#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002846pub fn visit_pat_range<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatRange) {
David Tolnay8c81f622018-07-31 23:34:35 -07002847 _visitor.visit_expr(&*_i.lo);
2848 _visitor.visit_range_limits(&_i.limits);
2849 _visitor.visit_expr(&*_i.hi);
Nika Layzell27726662017-10-24 23:16:35 -04002850}
David Tolnay8c81f622018-07-31 23:34:35 -07002851#[cfg(any(feature = "full", feature = "derive"))]
2852#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002853pub fn visit_pat_ref<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatRef) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002854 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002855 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04002856 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002857 };
2858 _visitor.visit_pat(&*_i.pat);
Nika Layzell27726662017-10-24 23:16:35 -04002859}
David Tolnay8c81f622018-07-31 23:34:35 -07002860#[cfg(any(feature = "full", feature = "derive"))]
2861#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002862pub fn visit_pat_slice<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatSlice) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002863 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002864 for el in Punctuated::pairs(&_i.front) {
2865 let it = el.value();
2866 _visitor.visit_pat(it)
2867 }
2868 if let Some(ref it) = _i.middle {
2869 _visitor.visit_pat(&**it)
2870 };
2871 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002872 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002873 };
2874 if let Some(ref it) = _i.comma_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002875 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002876 };
2877 for el in Punctuated::pairs(&_i.back) {
2878 let it = el.value();
2879 _visitor.visit_pat(it)
2880 }
Nika Layzell27726662017-10-24 23:16:35 -04002881}
David Tolnay8c81f622018-07-31 23:34:35 -07002882#[cfg(any(feature = "full", feature = "derive"))]
2883#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002884pub fn visit_pat_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatStruct) {
David Tolnay8c81f622018-07-31 23:34:35 -07002885 _visitor.visit_path(&_i.path);
David Tolnay7ac699c2018-08-24 14:00:58 -04002886 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002887 for el in Punctuated::pairs(&_i.fields) {
2888 let it = el.value();
2889 _visitor.visit_field_pat(it)
2890 }
2891 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002892 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002893 };
Nika Layzell27726662017-10-24 23:16:35 -04002894}
David Tolnay8c81f622018-07-31 23:34:35 -07002895#[cfg(any(feature = "full", feature = "derive"))]
2896#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002897pub fn visit_pat_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatTuple) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002898 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002899 for el in Punctuated::pairs(&_i.front) {
2900 let it = el.value();
2901 _visitor.visit_pat(it)
2902 }
2903 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002904 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002905 };
2906 if let Some(ref it) = _i.comma_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002907 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002908 };
2909 for el in Punctuated::pairs(&_i.back) {
2910 let it = el.value();
2911 _visitor.visit_pat(it)
2912 }
Nika Layzell27726662017-10-24 23:16:35 -04002913}
David Tolnay8c81f622018-07-31 23:34:35 -07002914#[cfg(any(feature = "full", feature = "derive"))]
2915#[cfg(feature = "full")]
2916pub fn visit_pat_tuple_struct<'ast, V: Visit<'ast> + ?Sized>(
2917 _visitor: &mut V,
2918 _i: &'ast PatTupleStruct,
2919) {
2920 _visitor.visit_path(&_i.path);
2921 _visitor.visit_pat_tuple(&_i.pat);
Nika Layzell27726662017-10-24 23:16:35 -04002922}
David Tolnay8c81f622018-07-31 23:34:35 -07002923#[cfg(any(feature = "full", feature = "derive"))]
2924#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002925pub fn visit_pat_verbatim<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatVerbatim) {
David Tolnay6af48992018-08-01 11:16:28 -07002926 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05002927}
David Tolnay8c81f622018-07-31 23:34:35 -07002928#[cfg(any(feature = "full", feature = "derive"))]
2929#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002930pub fn visit_pat_wild<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatWild) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002931 tokens_helper(_visitor, &_i.underscore_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002932}
David Tolnay8c81f622018-07-31 23:34:35 -07002933#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002934pub fn visit_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Path) {
David Tolnay8c81f622018-07-31 23:34:35 -07002935 if let Some(ref it) = _i.leading_colon {
David Tolnay7ac699c2018-08-24 14:00:58 -04002936 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002937 };
2938 for el in Punctuated::pairs(&_i.segments) {
2939 let it = el.value();
2940 _visitor.visit_path_segment(it)
2941 }
Nika Layzell27726662017-10-24 23:16:35 -04002942}
David Tolnay8c81f622018-07-31 23:34:35 -07002943#[cfg(any(feature = "full", feature = "derive"))]
2944pub fn visit_path_arguments<'ast, V: Visit<'ast> + ?Sized>(
2945 _visitor: &mut V,
2946 _i: &'ast PathArguments,
2947) {
Nika Layzellc08227a2017-12-04 16:30:17 -05002948 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002949 PathArguments::None => {}
2950 PathArguments::AngleBracketed(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002951 _visitor.visit_angle_bracketed_generic_arguments(_binding_0);
Nika Layzellc08227a2017-12-04 16:30:17 -05002952 }
David Tolnay8c81f622018-07-31 23:34:35 -07002953 PathArguments::Parenthesized(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002954 _visitor.visit_parenthesized_generic_arguments(_binding_0);
Nika Layzellc08227a2017-12-04 16:30:17 -05002955 }
2956 }
2957}
David Tolnay8c81f622018-07-31 23:34:35 -07002958#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002959pub fn visit_path_segment<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PathSegment) {
David Tolnay8c81f622018-07-31 23:34:35 -07002960 _visitor.visit_ident(&_i.ident);
2961 _visitor.visit_path_arguments(&_i.arguments);
Nika Layzell27726662017-10-24 23:16:35 -04002962}
David Tolnay8c81f622018-07-31 23:34:35 -07002963#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002964pub fn visit_predicate_eq<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PredicateEq) {
David Tolnay8c81f622018-07-31 23:34:35 -07002965 _visitor.visit_type(&_i.lhs_ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002966 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002967 _visitor.visit_type(&_i.rhs_ty);
David Tolnayd4add852018-01-01 20:13:24 -08002968}
David Tolnay8c81f622018-07-31 23:34:35 -07002969#[cfg(any(feature = "full", feature = "derive"))]
2970pub fn visit_predicate_lifetime<'ast, V: Visit<'ast> + ?Sized>(
2971 _visitor: &mut V,
2972 _i: &'ast PredicateLifetime,
2973) {
2974 _visitor.visit_lifetime(&_i.lifetime);
David Tolnay1b8e2852018-08-26 08:25:18 -04002975 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002976 for el in Punctuated::pairs(&_i.bounds) {
2977 let it = el.value();
2978 _visitor.visit_lifetime(it)
2979 }
David Tolnayd4add852018-01-01 20:13:24 -08002980}
David Tolnay8c81f622018-07-31 23:34:35 -07002981#[cfg(any(feature = "full", feature = "derive"))]
2982pub fn visit_predicate_type<'ast, V: Visit<'ast> + ?Sized>(
2983 _visitor: &mut V,
2984 _i: &'ast PredicateType,
2985) {
2986 if let Some(ref it) = _i.lifetimes {
2987 _visitor.visit_bound_lifetimes(it)
2988 };
2989 _visitor.visit_type(&_i.bounded_ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002990 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002991 for el in Punctuated::pairs(&_i.bounds) {
2992 let it = el.value();
2993 _visitor.visit_type_param_bound(it)
2994 }
David Tolnayd4add852018-01-01 20:13:24 -08002995}
David Tolnay8c81f622018-07-31 23:34:35 -07002996#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002997pub fn visit_qself<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast QSelf) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002998 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002999 _visitor.visit_type(&*_i.ty);
David Tolnay6af48992018-08-01 11:16:28 -07003000 skip!(_i.position);
David Tolnay8c81f622018-07-31 23:34:35 -07003001 if let Some(ref it) = _i.as_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003002 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003003 };
David Tolnay7ac699c2018-08-24 14:00:58 -04003004 tokens_helper(_visitor, &_i.gt_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003005}
David Tolnay8c81f622018-07-31 23:34:35 -07003006#[cfg(any(feature = "full", feature = "derive"))]
3007#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003008pub fn visit_range_limits<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast RangeLimits) {
Nika Layzell27726662017-10-24 23:16:35 -04003009 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003010 RangeLimits::HalfOpen(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003011 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003012 }
David Tolnay8c81f622018-07-31 23:34:35 -07003013 RangeLimits::Closed(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003014 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003015 }
3016 }
3017}
David Tolnay8c81f622018-07-31 23:34:35 -07003018#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003019pub fn visit_return_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ReturnType) {
David Tolnayf93b90d2017-11-11 19:21:26 -08003020 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003021 ReturnType::Default => {}
3022 ReturnType::Type(ref _binding_0, ref _binding_1) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003023 tokens_helper(_visitor, &_binding_0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003024 _visitor.visit_type(&**_binding_1);
David Tolnayf93b90d2017-11-11 19:21:26 -08003025 }
3026 }
3027}
David Tolnay8c81f622018-07-31 23:34:35 -07003028pub fn visit_span<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Span) {}
3029#[cfg(any(feature = "full", feature = "derive"))]
3030#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003031pub fn visit_stmt<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Stmt) {
Nika Layzell27726662017-10-24 23:16:35 -04003032 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003033 Stmt::Local(ref _binding_0) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08003034 _visitor.visit_local(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003035 }
David Tolnay8c81f622018-07-31 23:34:35 -07003036 Stmt::Item(ref _binding_0) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08003037 _visitor.visit_item(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003038 }
David Tolnay8c81f622018-07-31 23:34:35 -07003039 Stmt::Expr(ref _binding_0) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08003040 _visitor.visit_expr(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003041 }
David Tolnay8c81f622018-07-31 23:34:35 -07003042 Stmt::Semi(ref _binding_0, ref _binding_1) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08003043 _visitor.visit_expr(_binding_0);
David Tolnay7ac699c2018-08-24 14:00:58 -04003044 tokens_helper(_visitor, &_binding_1.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003045 }
Nika Layzell27726662017-10-24 23:16:35 -04003046 }
3047}
David Tolnay8c81f622018-07-31 23:34:35 -07003048#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003049pub fn visit_trait_bound<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TraitBound) {
David Tolnay8c81f622018-07-31 23:34:35 -07003050 if let Some(ref it) = _i.paren_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003051 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003052 };
3053 _visitor.visit_trait_bound_modifier(&_i.modifier);
3054 if let Some(ref it) = _i.lifetimes {
3055 _visitor.visit_bound_lifetimes(it)
3056 };
3057 _visitor.visit_path(&_i.path);
David Tolnay40fb8ce2018-01-02 10:53:46 -08003058}
David Tolnay8c81f622018-07-31 23:34:35 -07003059#[cfg(any(feature = "full", feature = "derive"))]
3060pub fn visit_trait_bound_modifier<'ast, V: Visit<'ast> + ?Sized>(
3061 _visitor: &mut V,
3062 _i: &'ast TraitBoundModifier,
3063) {
Nika Layzell27726662017-10-24 23:16:35 -04003064 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003065 TraitBoundModifier::None => {}
3066 TraitBoundModifier::Maybe(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003067 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003068 }
3069 }
3070}
David Tolnay8c81f622018-07-31 23:34:35 -07003071#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003072pub fn visit_trait_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TraitItem) {
Nika Layzell27726662017-10-24 23:16:35 -04003073 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003074 TraitItem::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003075 _visitor.visit_trait_item_const(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003076 }
David Tolnay8c81f622018-07-31 23:34:35 -07003077 TraitItem::Method(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003078 _visitor.visit_trait_item_method(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003079 }
David Tolnay8c81f622018-07-31 23:34:35 -07003080 TraitItem::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003081 _visitor.visit_trait_item_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003082 }
David Tolnay8c81f622018-07-31 23:34:35 -07003083 TraitItem::Macro(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003084 _visitor.visit_trait_item_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003085 }
David Tolnay8c81f622018-07-31 23:34:35 -07003086 TraitItem::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05003087 _visitor.visit_trait_item_verbatim(_binding_0);
3088 }
Nika Layzell27726662017-10-24 23:16:35 -04003089 }
3090}
David Tolnay8c81f622018-07-31 23:34:35 -07003091#[cfg(feature = "full")]
3092pub fn visit_trait_item_const<'ast, V: Visit<'ast> + ?Sized>(
3093 _visitor: &mut V,
3094 _i: &'ast TraitItemConst,
3095) {
3096 for it in &_i.attrs {
3097 _visitor.visit_attribute(it)
3098 }
David Tolnay7ac699c2018-08-24 14:00:58 -04003099 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003100 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04003101 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003102 _visitor.visit_type(&_i.ty);
3103 if let Some(ref it) = _i.default {
David Tolnay7ac699c2018-08-24 14:00:58 -04003104 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003105 _visitor.visit_expr(&(it).1);
3106 };
David Tolnay7ac699c2018-08-24 14:00:58 -04003107 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnayda705bd2017-11-10 21:58:05 -08003108}
David Tolnay8c81f622018-07-31 23:34:35 -07003109#[cfg(feature = "full")]
3110pub fn visit_trait_item_macro<'ast, V: Visit<'ast> + ?Sized>(
3111 _visitor: &mut V,
3112 _i: &'ast TraitItemMacro,
3113) {
3114 for it in &_i.attrs {
3115 _visitor.visit_attribute(it)
3116 }
3117 _visitor.visit_macro(&_i.mac);
3118 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003119 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003120 };
David Tolnayda705bd2017-11-10 21:58:05 -08003121}
David Tolnay8c81f622018-07-31 23:34:35 -07003122#[cfg(feature = "full")]
3123pub fn visit_trait_item_method<'ast, V: Visit<'ast> + ?Sized>(
3124 _visitor: &mut V,
3125 _i: &'ast TraitItemMethod,
3126) {
3127 for it in &_i.attrs {
3128 _visitor.visit_attribute(it)
3129 }
3130 _visitor.visit_method_sig(&_i.sig);
3131 if let Some(ref it) = _i.default {
3132 _visitor.visit_block(it)
3133 };
3134 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003135 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003136 };
Nika Layzell27726662017-10-24 23:16:35 -04003137}
David Tolnay8c81f622018-07-31 23:34:35 -07003138#[cfg(feature = "full")]
3139pub fn visit_trait_item_type<'ast, V: Visit<'ast> + ?Sized>(
3140 _visitor: &mut V,
3141 _i: &'ast TraitItemType,
3142) {
3143 for it in &_i.attrs {
3144 _visitor.visit_attribute(it)
3145 }
David Tolnay7ac699c2018-08-24 14:00:58 -04003146 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003147 _visitor.visit_ident(&_i.ident);
3148 _visitor.visit_generics(&_i.generics);
3149 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003150 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003151 };
3152 for el in Punctuated::pairs(&_i.bounds) {
3153 let it = el.value();
3154 _visitor.visit_type_param_bound(it)
3155 }
3156 if let Some(ref it) = _i.default {
David Tolnay7ac699c2018-08-24 14:00:58 -04003157 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003158 _visitor.visit_type(&(it).1);
3159 };
David Tolnay7ac699c2018-08-24 14:00:58 -04003160 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003161}
David Tolnay8c81f622018-07-31 23:34:35 -07003162#[cfg(feature = "full")]
3163pub fn visit_trait_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
3164 _visitor: &mut V,
3165 _i: &'ast TraitItemVerbatim,
3166) {
David Tolnay6af48992018-08-01 11:16:28 -07003167 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05003168}
David Tolnay8c81f622018-07-31 23:34:35 -07003169#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003170pub fn visit_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Type) {
Nika Layzell27726662017-10-24 23:16:35 -04003171 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003172 Type::Slice(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003173 _visitor.visit_type_slice(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003174 }
David Tolnay8c81f622018-07-31 23:34:35 -07003175 Type::Array(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003176 _visitor.visit_type_array(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003177 }
David Tolnay8c81f622018-07-31 23:34:35 -07003178 Type::Ptr(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003179 _visitor.visit_type_ptr(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003180 }
David Tolnay8c81f622018-07-31 23:34:35 -07003181 Type::Reference(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003182 _visitor.visit_type_reference(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003183 }
David Tolnay8c81f622018-07-31 23:34:35 -07003184 Type::BareFn(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003185 _visitor.visit_type_bare_fn(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003186 }
David Tolnay8c81f622018-07-31 23:34:35 -07003187 Type::Never(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003188 _visitor.visit_type_never(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003189 }
David Tolnay8c81f622018-07-31 23:34:35 -07003190 Type::Tuple(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003191 _visitor.visit_type_tuple(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003192 }
David Tolnay8c81f622018-07-31 23:34:35 -07003193 Type::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003194 _visitor.visit_type_path(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003195 }
David Tolnay8c81f622018-07-31 23:34:35 -07003196 Type::TraitObject(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003197 _visitor.visit_type_trait_object(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003198 }
David Tolnay8c81f622018-07-31 23:34:35 -07003199 Type::ImplTrait(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003200 _visitor.visit_type_impl_trait(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003201 }
David Tolnay8c81f622018-07-31 23:34:35 -07003202 Type::Paren(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003203 _visitor.visit_type_paren(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003204 }
David Tolnay8c81f622018-07-31 23:34:35 -07003205 Type::Group(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003206 _visitor.visit_type_group(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003207 }
David Tolnay8c81f622018-07-31 23:34:35 -07003208 Type::Infer(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003209 _visitor.visit_type_infer(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003210 }
David Tolnay8c81f622018-07-31 23:34:35 -07003211 Type::Macro(ref _binding_0) => {
David Tolnay323279a2017-12-29 11:26:32 -05003212 _visitor.visit_type_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003213 }
David Tolnay8c81f622018-07-31 23:34:35 -07003214 Type::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05003215 _visitor.visit_type_verbatim(_binding_0);
3216 }
Nika Layzell27726662017-10-24 23:16:35 -04003217 }
3218}
David Tolnay8c81f622018-07-31 23:34:35 -07003219#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003220pub fn visit_type_array<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeArray) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003221 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003222 _visitor.visit_type(&*_i.elem);
David Tolnay7ac699c2018-08-24 14:00:58 -04003223 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003224 _visitor.visit_expr(&_i.len);
Nika Layzell27726662017-10-24 23:16:35 -04003225}
David Tolnay8c81f622018-07-31 23:34:35 -07003226#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003227pub fn visit_type_bare_fn<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeBareFn) {
David Tolnay3779bb72018-08-26 18:46:07 -07003228 if let Some(ref it) = _i.lifetimes {
3229 _visitor.visit_bound_lifetimes(it)
3230 };
David Tolnay8c81f622018-07-31 23:34:35 -07003231 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04003232 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003233 };
3234 if let Some(ref it) = _i.abi {
3235 _visitor.visit_abi(it)
3236 };
David Tolnay7ac699c2018-08-24 14:00:58 -04003237 tokens_helper(_visitor, &_i.fn_token.span);
David Tolnay7ac699c2018-08-24 14:00:58 -04003238 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003239 for el in Punctuated::pairs(&_i.inputs) {
3240 let it = el.value();
3241 _visitor.visit_bare_fn_arg(it)
3242 }
3243 if let Some(ref it) = _i.variadic {
David Tolnay7ac699c2018-08-24 14:00:58 -04003244 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003245 };
3246 _visitor.visit_return_type(&_i.output);
Nika Layzell27726662017-10-24 23:16:35 -04003247}
David Tolnay8c81f622018-07-31 23:34:35 -07003248#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003249pub fn visit_type_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeGroup) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003250 tokens_helper(_visitor, &_i.group_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003251 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003252}
David Tolnay8c81f622018-07-31 23:34:35 -07003253#[cfg(any(feature = "full", feature = "derive"))]
3254pub fn visit_type_impl_trait<'ast, V: Visit<'ast> + ?Sized>(
3255 _visitor: &mut V,
3256 _i: &'ast TypeImplTrait,
3257) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003258 tokens_helper(_visitor, &_i.impl_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003259 for el in Punctuated::pairs(&_i.bounds) {
3260 let it = el.value();
3261 _visitor.visit_type_param_bound(it)
3262 }
Nika Layzell27726662017-10-24 23:16:35 -04003263}
David Tolnay8c81f622018-07-31 23:34:35 -07003264#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003265pub fn visit_type_infer<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeInfer) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003266 tokens_helper(_visitor, &_i.underscore_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003267}
David Tolnay8c81f622018-07-31 23:34:35 -07003268#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003269pub fn visit_type_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeMacro) {
David Tolnay8c81f622018-07-31 23:34:35 -07003270 _visitor.visit_macro(&_i.mac);
David Tolnay323279a2017-12-29 11:26:32 -05003271}
David Tolnay8c81f622018-07-31 23:34:35 -07003272#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003273pub fn visit_type_never<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeNever) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003274 tokens_helper(_visitor, &_i.bang_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003275}
David Tolnay8c81f622018-07-31 23:34:35 -07003276#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003277pub fn visit_type_param<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeParam) {
David Tolnay8c81f622018-07-31 23:34:35 -07003278 for it in &_i.attrs {
3279 _visitor.visit_attribute(it)
3280 }
3281 _visitor.visit_ident(&_i.ident);
3282 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003283 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003284 };
3285 for el in Punctuated::pairs(&_i.bounds) {
3286 let it = el.value();
3287 _visitor.visit_type_param_bound(it)
3288 }
3289 if let Some(ref it) = _i.eq_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003290 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003291 };
3292 if let Some(ref it) = _i.default {
3293 _visitor.visit_type(it)
3294 };
Nika Layzell27726662017-10-24 23:16:35 -04003295}
David Tolnay8c81f622018-07-31 23:34:35 -07003296#[cfg(any(feature = "full", feature = "derive"))]
3297pub fn visit_type_param_bound<'ast, V: Visit<'ast> + ?Sized>(
3298 _visitor: &mut V,
3299 _i: &'ast TypeParamBound,
3300) {
Nika Layzell27726662017-10-24 23:16:35 -04003301 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003302 TypeParamBound::Trait(ref _binding_0) => {
David Tolnay40fb8ce2018-01-02 10:53:46 -08003303 _visitor.visit_trait_bound(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003304 }
David Tolnay8c81f622018-07-31 23:34:35 -07003305 TypeParamBound::Lifetime(ref _binding_0) => {
David Tolnay4ba63a02017-12-28 15:53:05 -05003306 _visitor.visit_lifetime(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003307 }
3308 }
3309}
David Tolnay8c81f622018-07-31 23:34:35 -07003310#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003311pub fn visit_type_paren<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeParen) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003312 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003313 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003314}
David Tolnay8c81f622018-07-31 23:34:35 -07003315#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003316pub fn visit_type_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypePath) {
David Tolnay8c81f622018-07-31 23:34:35 -07003317 if let Some(ref it) = _i.qself {
3318 _visitor.visit_qself(it)
3319 };
3320 _visitor.visit_path(&_i.path);
Nika Layzell27726662017-10-24 23:16:35 -04003321}
David Tolnay8c81f622018-07-31 23:34:35 -07003322#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003323pub fn visit_type_ptr<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypePtr) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003324 tokens_helper(_visitor, &_i.star_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003325 if let Some(ref it) = _i.const_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003326 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003327 };
3328 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04003329 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003330 };
3331 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003332}
David Tolnay8c81f622018-07-31 23:34:35 -07003333#[cfg(any(feature = "full", feature = "derive"))]
3334pub fn visit_type_reference<'ast, V: Visit<'ast> + ?Sized>(
3335 _visitor: &mut V,
3336 _i: &'ast TypeReference,
3337) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003338 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003339 if let Some(ref it) = _i.lifetime {
3340 _visitor.visit_lifetime(it)
3341 };
3342 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04003343 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003344 };
3345 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003346}
David Tolnay8c81f622018-07-31 23:34:35 -07003347#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003348pub fn visit_type_slice<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeSlice) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003349 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003350 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003351}
David Tolnay8c81f622018-07-31 23:34:35 -07003352#[cfg(any(feature = "full", feature = "derive"))]
3353pub fn visit_type_trait_object<'ast, V: Visit<'ast> + ?Sized>(
3354 _visitor: &mut V,
3355 _i: &'ast TypeTraitObject,
3356) {
3357 if let Some(ref it) = _i.dyn_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003358 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003359 };
3360 for el in Punctuated::pairs(&_i.bounds) {
3361 let it = el.value();
3362 _visitor.visit_type_param_bound(it)
3363 }
Nika Layzell27726662017-10-24 23:16:35 -04003364}
David Tolnay8c81f622018-07-31 23:34:35 -07003365#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003366pub fn visit_type_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeTuple) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003367 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003368 for el in Punctuated::pairs(&_i.elems) {
3369 let it = el.value();
3370 _visitor.visit_type(it)
3371 }
Nika Layzell27726662017-10-24 23:16:35 -04003372}
David Tolnay8c81f622018-07-31 23:34:35 -07003373#[cfg(any(feature = "full", feature = "derive"))]
3374pub fn visit_type_verbatim<'ast, V: Visit<'ast> + ?Sized>(
3375 _visitor: &mut V,
3376 _i: &'ast TypeVerbatim,
3377) {
David Tolnay6af48992018-08-01 11:16:28 -07003378 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05003379}
David Tolnay8c81f622018-07-31 23:34:35 -07003380#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003381pub fn visit_un_op<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UnOp) {
Nika Layzell27726662017-10-24 23:16:35 -04003382 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003383 UnOp::Deref(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003384 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003385 }
David Tolnay8c81f622018-07-31 23:34:35 -07003386 UnOp::Not(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003387 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003388 }
David Tolnay8c81f622018-07-31 23:34:35 -07003389 UnOp::Neg(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003390 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003391 }
3392 }
3393}
David Tolnay8c81f622018-07-31 23:34:35 -07003394#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003395pub fn visit_use_glob<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseGlob) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003396 tokens_helper(_visitor, &_i.star_token.spans);
David Tolnay5f332a92017-12-26 00:42:45 -05003397}
David Tolnay8c81f622018-07-31 23:34:35 -07003398#[cfg(feature = "full")]
David Tolnayd97a7d22018-03-31 19:17:01 +02003399pub fn visit_use_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseGroup) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003400 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003401 for el in Punctuated::pairs(&_i.items) {
3402 let it = el.value();
3403 _visitor.visit_use_tree(it)
3404 }
David Tolnay5f332a92017-12-26 00:42:45 -05003405}
David Tolnay8c81f622018-07-31 23:34:35 -07003406#[cfg(feature = "full")]
David Tolnayd97a7d22018-03-31 19:17:01 +02003407pub fn visit_use_name<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseName) {
David Tolnay8c81f622018-07-31 23:34:35 -07003408 _visitor.visit_ident(&_i.ident);
David Tolnayd97a7d22018-03-31 19:17:01 +02003409}
David Tolnay8c81f622018-07-31 23:34:35 -07003410#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003411pub fn visit_use_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UsePath) {
David Tolnay8c81f622018-07-31 23:34:35 -07003412 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04003413 tokens_helper(_visitor, &_i.colon2_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003414 _visitor.visit_use_tree(&*_i.tree);
David Tolnayd97a7d22018-03-31 19:17:01 +02003415}
David Tolnay8c81f622018-07-31 23:34:35 -07003416#[cfg(feature = "full")]
David Tolnayd97a7d22018-03-31 19:17:01 +02003417pub fn visit_use_rename<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseRename) {
David Tolnay8c81f622018-07-31 23:34:35 -07003418 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04003419 tokens_helper(_visitor, &_i.as_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003420 _visitor.visit_ident(&_i.rename);
David Tolnay5f332a92017-12-26 00:42:45 -05003421}
David Tolnay8c81f622018-07-31 23:34:35 -07003422#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003423pub fn visit_use_tree<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseTree) {
David Tolnay5f332a92017-12-26 00:42:45 -05003424 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003425 UseTree::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003426 _visitor.visit_use_path(_binding_0);
David Tolnay5f332a92017-12-26 00:42:45 -05003427 }
David Tolnay8c81f622018-07-31 23:34:35 -07003428 UseTree::Name(ref _binding_0) => {
David Tolnayd97a7d22018-03-31 19:17:01 +02003429 _visitor.visit_use_name(_binding_0);
3430 }
David Tolnay8c81f622018-07-31 23:34:35 -07003431 UseTree::Rename(ref _binding_0) => {
David Tolnayd97a7d22018-03-31 19:17:01 +02003432 _visitor.visit_use_rename(_binding_0);
3433 }
David Tolnay8c81f622018-07-31 23:34:35 -07003434 UseTree::Glob(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003435 _visitor.visit_use_glob(_binding_0);
David Tolnay5f332a92017-12-26 00:42:45 -05003436 }
David Tolnay8c81f622018-07-31 23:34:35 -07003437 UseTree::Group(ref _binding_0) => {
David Tolnayd97a7d22018-03-31 19:17:01 +02003438 _visitor.visit_use_group(_binding_0);
David Tolnay5f332a92017-12-26 00:42:45 -05003439 }
3440 }
3441}
David Tolnay8c81f622018-07-31 23:34:35 -07003442#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003443pub fn visit_variant<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Variant) {
David Tolnay8c81f622018-07-31 23:34:35 -07003444 for it in &_i.attrs {
3445 _visitor.visit_attribute(it)
3446 }
3447 _visitor.visit_ident(&_i.ident);
3448 _visitor.visit_fields(&_i.fields);
3449 if let Some(ref it) = _i.discriminant {
David Tolnay7ac699c2018-08-24 14:00:58 -04003450 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003451 _visitor.visit_expr(&(it).1);
3452 };
Nika Layzell27726662017-10-24 23:16:35 -04003453}
David Tolnay8c81f622018-07-31 23:34:35 -07003454#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003455pub fn visit_vis_crate<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast VisCrate) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003456 tokens_helper(_visitor, &_i.crate_token.span);
Nika Layzell27726662017-10-24 23:16:35 -04003457}
David Tolnay8c81f622018-07-31 23:34:35 -07003458#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003459pub fn visit_vis_public<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast VisPublic) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003460 tokens_helper(_visitor, &_i.pub_token.span);
Nika Layzell27726662017-10-24 23:16:35 -04003461}
David Tolnay8c81f622018-07-31 23:34:35 -07003462#[cfg(any(feature = "full", feature = "derive"))]
3463pub fn visit_vis_restricted<'ast, V: Visit<'ast> + ?Sized>(
3464 _visitor: &mut V,
3465 _i: &'ast VisRestricted,
3466) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003467 tokens_helper(_visitor, &_i.pub_token.span);
3468 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003469 if let Some(ref it) = _i.in_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003470 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003471 };
3472 _visitor.visit_path(&*_i.path);
Nika Layzell27726662017-10-24 23:16:35 -04003473}
David Tolnay8c81f622018-07-31 23:34:35 -07003474#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003475pub fn visit_visibility<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Visibility) {
Nika Layzell27726662017-10-24 23:16:35 -04003476 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003477 Visibility::Public(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003478 _visitor.visit_vis_public(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003479 }
David Tolnay8c81f622018-07-31 23:34:35 -07003480 Visibility::Crate(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003481 _visitor.visit_vis_crate(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003482 }
David Tolnay8c81f622018-07-31 23:34:35 -07003483 Visibility::Restricted(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003484 _visitor.visit_vis_restricted(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003485 }
David Tolnay8c81f622018-07-31 23:34:35 -07003486 Visibility::Inherited => {}
Nika Layzell27726662017-10-24 23:16:35 -04003487 }
3488}
David Tolnay8c81f622018-07-31 23:34:35 -07003489#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003490pub fn visit_where_clause<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast WhereClause) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003491 tokens_helper(_visitor, &_i.where_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003492 for el in Punctuated::pairs(&_i.predicates) {
3493 let it = el.value();
3494 _visitor.visit_where_predicate(it)
3495 }
Nika Layzell27726662017-10-24 23:16:35 -04003496}
David Tolnay8c81f622018-07-31 23:34:35 -07003497#[cfg(any(feature = "full", feature = "derive"))]
3498pub fn visit_where_predicate<'ast, V: Visit<'ast> + ?Sized>(
3499 _visitor: &mut V,
3500 _i: &'ast WherePredicate,
3501) {
Nika Layzell27726662017-10-24 23:16:35 -04003502 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003503 WherePredicate::Type(ref _binding_0) => {
David Tolnayd4add852018-01-01 20:13:24 -08003504 _visitor.visit_predicate_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003505 }
David Tolnay8c81f622018-07-31 23:34:35 -07003506 WherePredicate::Lifetime(ref _binding_0) => {
David Tolnayd4add852018-01-01 20:13:24 -08003507 _visitor.visit_predicate_lifetime(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003508 }
David Tolnay8c81f622018-07-31 23:34:35 -07003509 WherePredicate::Eq(ref _binding_0) => {
David Tolnayd4add852018-01-01 20:13:24 -08003510 _visitor.visit_predicate_eq(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003511 }
3512 }
3513}