blob: b82e2d810d741de842045252584e2a30f5f080da [file] [log] [blame]
Nika Layzell27726662017-10-24 23:16:35 -04001// THIS FILE IS AUTOMATICALLY GENERATED; DO NOT EDIT
2
David Tolnayc1f55792018-11-21 01:39:42 -08003#![cfg_attr(feature = "cargo-clippy", allow(trivially_copy_pass_by_ref))]
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}
David Tolnay53160352019-02-07 23:36:17 +010026/// Syntax tree traversal to walk a shared borrow of a syntax tree.
27///
28/// See the [module documentation] for details.
29///
30/// [module documentation]: index.html
31///
32/// *This trait is available if Syn is built with the `"visit"` feature.*
David Tolnay4b4c4b62018-01-06 13:48:05 -080033pub trait Visit<'ast> {
David Tolnay8c81f622018-07-31 23:34:35 -070034 #[cfg(any(feature = "full", feature = "derive"))]
35 fn visit_abi(&mut self, i: &'ast Abi) {
36 visit_abi(self, i)
37 }
38 #[cfg(any(feature = "full", feature = "derive"))]
39 fn visit_angle_bracketed_generic_arguments(&mut self, i: &'ast AngleBracketedGenericArguments) {
40 visit_angle_bracketed_generic_arguments(self, i)
41 }
42 #[cfg(feature = "full")]
43 fn visit_arg_captured(&mut self, i: &'ast ArgCaptured) {
44 visit_arg_captured(self, i)
45 }
46 #[cfg(feature = "full")]
47 fn visit_arg_self(&mut self, i: &'ast ArgSelf) {
48 visit_arg_self(self, i)
49 }
50 #[cfg(feature = "full")]
51 fn visit_arg_self_ref(&mut self, i: &'ast ArgSelfRef) {
52 visit_arg_self_ref(self, i)
53 }
54 #[cfg(any(feature = "full", feature = "derive"))]
55 #[cfg(feature = "full")]
56 fn visit_arm(&mut self, i: &'ast Arm) {
57 visit_arm(self, i)
58 }
59 #[cfg(any(feature = "full", feature = "derive"))]
60 fn visit_attr_style(&mut self, i: &'ast AttrStyle) {
61 visit_attr_style(self, i)
62 }
63 #[cfg(any(feature = "full", feature = "derive"))]
64 fn visit_attribute(&mut self, i: &'ast Attribute) {
65 visit_attribute(self, i)
66 }
67 #[cfg(any(feature = "full", feature = "derive"))]
68 fn visit_bare_fn_arg(&mut self, i: &'ast BareFnArg) {
69 visit_bare_fn_arg(self, i)
70 }
71 #[cfg(any(feature = "full", feature = "derive"))]
72 fn visit_bare_fn_arg_name(&mut self, i: &'ast BareFnArgName) {
73 visit_bare_fn_arg_name(self, i)
74 }
75 #[cfg(any(feature = "full", feature = "derive"))]
76 fn visit_bin_op(&mut self, i: &'ast BinOp) {
77 visit_bin_op(self, i)
78 }
79 #[cfg(any(feature = "full", feature = "derive"))]
80 fn visit_binding(&mut self, i: &'ast Binding) {
81 visit_binding(self, i)
82 }
83 #[cfg(any(feature = "full", feature = "derive"))]
84 #[cfg(feature = "full")]
85 fn visit_block(&mut self, i: &'ast Block) {
86 visit_block(self, i)
87 }
88 #[cfg(any(feature = "full", feature = "derive"))]
89 fn visit_bound_lifetimes(&mut self, i: &'ast BoundLifetimes) {
90 visit_bound_lifetimes(self, i)
91 }
92 #[cfg(any(feature = "full", feature = "derive"))]
93 fn visit_const_param(&mut self, i: &'ast ConstParam) {
94 visit_const_param(self, i)
95 }
David Tolnay9d0882a2018-09-01 19:49:14 -070096 #[cfg(any(feature = "full", feature = "derive"))]
97 fn visit_constraint(&mut self, i: &'ast Constraint) {
98 visit_constraint(self, i)
99 }
David Tolnay8c81f622018-07-31 23:34:35 -0700100 #[cfg(feature = "derive")]
101 fn visit_data(&mut self, i: &'ast Data) {
102 visit_data(self, i)
103 }
104 #[cfg(feature = "derive")]
105 fn visit_data_enum(&mut self, i: &'ast DataEnum) {
106 visit_data_enum(self, i)
107 }
108 #[cfg(feature = "derive")]
109 fn visit_data_struct(&mut self, i: &'ast DataStruct) {
110 visit_data_struct(self, i)
111 }
112 #[cfg(feature = "derive")]
113 fn visit_data_union(&mut self, i: &'ast DataUnion) {
114 visit_data_union(self, i)
115 }
116 #[cfg(feature = "derive")]
117 fn visit_derive_input(&mut self, i: &'ast DeriveInput) {
118 visit_derive_input(self, i)
119 }
120 #[cfg(any(feature = "full", feature = "derive"))]
121 fn visit_expr(&mut self, i: &'ast Expr) {
122 visit_expr(self, i)
123 }
124 #[cfg(feature = "full")]
125 #[cfg(any(feature = "full", feature = "derive"))]
126 fn visit_expr_array(&mut self, i: &'ast ExprArray) {
127 visit_expr_array(self, i)
128 }
129 #[cfg(feature = "full")]
130 #[cfg(any(feature = "full", feature = "derive"))]
131 fn visit_expr_assign(&mut self, i: &'ast ExprAssign) {
132 visit_expr_assign(self, i)
133 }
134 #[cfg(feature = "full")]
135 #[cfg(any(feature = "full", feature = "derive"))]
136 fn visit_expr_assign_op(&mut self, i: &'ast ExprAssignOp) {
137 visit_expr_assign_op(self, i)
138 }
David Tolnay02a9c6f2018-08-24 18:58:45 -0400139 #[cfg(feature = "full")]
140 #[cfg(any(feature = "full", feature = "derive"))]
141 fn visit_expr_async(&mut self, i: &'ast ExprAsync) {
142 visit_expr_async(self, i)
143 }
David Tolnay8c81f622018-07-31 23:34:35 -0700144 #[cfg(any(feature = "full", feature = "derive"))]
145 fn visit_expr_binary(&mut self, i: &'ast ExprBinary) {
146 visit_expr_binary(self, i)
147 }
148 #[cfg(feature = "full")]
149 #[cfg(any(feature = "full", feature = "derive"))]
150 fn visit_expr_block(&mut self, i: &'ast ExprBlock) {
151 visit_expr_block(self, i)
152 }
153 #[cfg(feature = "full")]
154 #[cfg(any(feature = "full", feature = "derive"))]
155 fn visit_expr_box(&mut self, i: &'ast ExprBox) {
156 visit_expr_box(self, i)
157 }
158 #[cfg(feature = "full")]
159 #[cfg(any(feature = "full", feature = "derive"))]
160 fn visit_expr_break(&mut self, i: &'ast ExprBreak) {
161 visit_expr_break(self, i)
162 }
163 #[cfg(any(feature = "full", feature = "derive"))]
164 fn visit_expr_call(&mut self, i: &'ast ExprCall) {
165 visit_expr_call(self, i)
166 }
167 #[cfg(any(feature = "full", feature = "derive"))]
168 fn visit_expr_cast(&mut self, i: &'ast ExprCast) {
169 visit_expr_cast(self, i)
170 }
171 #[cfg(feature = "full")]
172 #[cfg(any(feature = "full", feature = "derive"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700173 fn visit_expr_closure(&mut self, i: &'ast ExprClosure) {
174 visit_expr_closure(self, i)
175 }
176 #[cfg(feature = "full")]
177 #[cfg(any(feature = "full", feature = "derive"))]
178 fn visit_expr_continue(&mut self, i: &'ast ExprContinue) {
179 visit_expr_continue(self, i)
180 }
181 #[cfg(any(feature = "full", feature = "derive"))]
182 fn visit_expr_field(&mut self, i: &'ast ExprField) {
183 visit_expr_field(self, i)
184 }
185 #[cfg(feature = "full")]
186 #[cfg(any(feature = "full", feature = "derive"))]
187 fn visit_expr_for_loop(&mut self, i: &'ast ExprForLoop) {
188 visit_expr_for_loop(self, i)
189 }
190 #[cfg(feature = "full")]
191 #[cfg(any(feature = "full", feature = "derive"))]
192 fn visit_expr_group(&mut self, i: &'ast ExprGroup) {
193 visit_expr_group(self, i)
194 }
195 #[cfg(feature = "full")]
196 #[cfg(any(feature = "full", feature = "derive"))]
197 fn visit_expr_if(&mut self, i: &'ast ExprIf) {
198 visit_expr_if(self, i)
199 }
200 #[cfg(feature = "full")]
201 #[cfg(any(feature = "full", feature = "derive"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700202 fn visit_expr_in_place(&mut self, i: &'ast ExprInPlace) {
203 visit_expr_in_place(self, i)
204 }
205 #[cfg(any(feature = "full", feature = "derive"))]
206 fn visit_expr_index(&mut self, i: &'ast ExprIndex) {
207 visit_expr_index(self, i)
208 }
David Tolnay9c119122018-09-01 18:47:02 -0700209 #[cfg(feature = "full")]
210 #[cfg(any(feature = "full", feature = "derive"))]
211 fn visit_expr_let(&mut self, i: &'ast ExprLet) {
212 visit_expr_let(self, i)
213 }
David Tolnay8c81f622018-07-31 23:34:35 -0700214 #[cfg(any(feature = "full", feature = "derive"))]
215 fn visit_expr_lit(&mut self, i: &'ast ExprLit) {
216 visit_expr_lit(self, i)
217 }
218 #[cfg(feature = "full")]
219 #[cfg(any(feature = "full", feature = "derive"))]
220 fn visit_expr_loop(&mut self, i: &'ast ExprLoop) {
221 visit_expr_loop(self, i)
222 }
223 #[cfg(feature = "full")]
224 #[cfg(any(feature = "full", feature = "derive"))]
225 fn visit_expr_macro(&mut self, i: &'ast ExprMacro) {
226 visit_expr_macro(self, i)
227 }
228 #[cfg(feature = "full")]
229 #[cfg(any(feature = "full", feature = "derive"))]
230 fn visit_expr_match(&mut self, i: &'ast ExprMatch) {
231 visit_expr_match(self, i)
232 }
233 #[cfg(feature = "full")]
234 #[cfg(any(feature = "full", feature = "derive"))]
235 fn visit_expr_method_call(&mut self, i: &'ast ExprMethodCall) {
236 visit_expr_method_call(self, i)
237 }
238 #[cfg(any(feature = "full", feature = "derive"))]
239 fn visit_expr_paren(&mut self, i: &'ast ExprParen) {
240 visit_expr_paren(self, i)
241 }
242 #[cfg(any(feature = "full", feature = "derive"))]
243 fn visit_expr_path(&mut self, i: &'ast ExprPath) {
244 visit_expr_path(self, i)
245 }
246 #[cfg(feature = "full")]
247 #[cfg(any(feature = "full", feature = "derive"))]
248 fn visit_expr_range(&mut self, i: &'ast ExprRange) {
249 visit_expr_range(self, i)
250 }
251 #[cfg(feature = "full")]
252 #[cfg(any(feature = "full", feature = "derive"))]
253 fn visit_expr_reference(&mut self, i: &'ast ExprReference) {
254 visit_expr_reference(self, i)
255 }
256 #[cfg(feature = "full")]
257 #[cfg(any(feature = "full", feature = "derive"))]
258 fn visit_expr_repeat(&mut self, i: &'ast ExprRepeat) {
259 visit_expr_repeat(self, i)
260 }
261 #[cfg(feature = "full")]
262 #[cfg(any(feature = "full", feature = "derive"))]
263 fn visit_expr_return(&mut self, i: &'ast ExprReturn) {
264 visit_expr_return(self, i)
265 }
266 #[cfg(feature = "full")]
267 #[cfg(any(feature = "full", feature = "derive"))]
268 fn visit_expr_struct(&mut self, i: &'ast ExprStruct) {
269 visit_expr_struct(self, i)
270 }
271 #[cfg(feature = "full")]
272 #[cfg(any(feature = "full", feature = "derive"))]
273 fn visit_expr_try(&mut self, i: &'ast ExprTry) {
274 visit_expr_try(self, i)
275 }
276 #[cfg(feature = "full")]
277 #[cfg(any(feature = "full", feature = "derive"))]
David Tolnayfb2dd4b2018-08-24 16:45:34 -0400278 fn visit_expr_try_block(&mut self, i: &'ast ExprTryBlock) {
279 visit_expr_try_block(self, i)
280 }
281 #[cfg(feature = "full")]
282 #[cfg(any(feature = "full", feature = "derive"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700283 fn visit_expr_tuple(&mut self, i: &'ast ExprTuple) {
284 visit_expr_tuple(self, i)
285 }
286 #[cfg(feature = "full")]
287 #[cfg(any(feature = "full", feature = "derive"))]
288 fn visit_expr_type(&mut self, i: &'ast ExprType) {
289 visit_expr_type(self, i)
290 }
291 #[cfg(any(feature = "full", feature = "derive"))]
292 fn visit_expr_unary(&mut self, i: &'ast ExprUnary) {
293 visit_expr_unary(self, i)
294 }
295 #[cfg(feature = "full")]
296 #[cfg(any(feature = "full", feature = "derive"))]
297 fn visit_expr_unsafe(&mut self, i: &'ast ExprUnsafe) {
298 visit_expr_unsafe(self, i)
299 }
300 #[cfg(any(feature = "full", feature = "derive"))]
301 fn visit_expr_verbatim(&mut self, i: &'ast ExprVerbatim) {
302 visit_expr_verbatim(self, i)
303 }
304 #[cfg(feature = "full")]
305 #[cfg(any(feature = "full", feature = "derive"))]
306 fn visit_expr_while(&mut self, i: &'ast ExprWhile) {
307 visit_expr_while(self, i)
308 }
309 #[cfg(feature = "full")]
310 #[cfg(any(feature = "full", feature = "derive"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700311 fn visit_expr_yield(&mut self, i: &'ast ExprYield) {
312 visit_expr_yield(self, i)
313 }
314 #[cfg(any(feature = "full", feature = "derive"))]
315 fn visit_field(&mut self, i: &'ast Field) {
316 visit_field(self, i)
317 }
318 #[cfg(any(feature = "full", feature = "derive"))]
319 #[cfg(feature = "full")]
320 fn visit_field_pat(&mut self, i: &'ast FieldPat) {
321 visit_field_pat(self, i)
322 }
323 #[cfg(any(feature = "full", feature = "derive"))]
324 #[cfg(feature = "full")]
325 fn visit_field_value(&mut self, i: &'ast FieldValue) {
326 visit_field_value(self, i)
327 }
328 #[cfg(any(feature = "full", feature = "derive"))]
329 fn visit_fields(&mut self, i: &'ast Fields) {
330 visit_fields(self, i)
331 }
332 #[cfg(any(feature = "full", feature = "derive"))]
333 fn visit_fields_named(&mut self, i: &'ast FieldsNamed) {
334 visit_fields_named(self, i)
335 }
336 #[cfg(any(feature = "full", feature = "derive"))]
337 fn visit_fields_unnamed(&mut self, i: &'ast FieldsUnnamed) {
338 visit_fields_unnamed(self, i)
339 }
340 #[cfg(feature = "full")]
341 fn visit_file(&mut self, i: &'ast File) {
342 visit_file(self, i)
343 }
344 #[cfg(feature = "full")]
345 fn visit_fn_arg(&mut self, i: &'ast FnArg) {
346 visit_fn_arg(self, i)
347 }
348 #[cfg(feature = "full")]
349 fn visit_fn_decl(&mut self, i: &'ast FnDecl) {
350 visit_fn_decl(self, i)
351 }
352 #[cfg(feature = "full")]
353 fn visit_foreign_item(&mut self, i: &'ast ForeignItem) {
354 visit_foreign_item(self, i)
355 }
356 #[cfg(feature = "full")]
357 fn visit_foreign_item_fn(&mut self, i: &'ast ForeignItemFn) {
358 visit_foreign_item_fn(self, i)
359 }
360 #[cfg(feature = "full")]
David Tolnay435c1782018-08-24 16:15:44 -0400361 fn visit_foreign_item_macro(&mut self, i: &'ast ForeignItemMacro) {
362 visit_foreign_item_macro(self, i)
363 }
364 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700365 fn visit_foreign_item_static(&mut self, i: &'ast ForeignItemStatic) {
366 visit_foreign_item_static(self, i)
367 }
368 #[cfg(feature = "full")]
369 fn visit_foreign_item_type(&mut self, i: &'ast ForeignItemType) {
370 visit_foreign_item_type(self, i)
371 }
372 #[cfg(feature = "full")]
373 fn visit_foreign_item_verbatim(&mut self, i: &'ast ForeignItemVerbatim) {
374 visit_foreign_item_verbatim(self, i)
375 }
376 #[cfg(any(feature = "full", feature = "derive"))]
377 fn visit_generic_argument(&mut self, i: &'ast GenericArgument) {
378 visit_generic_argument(self, i)
379 }
380 #[cfg(any(feature = "full", feature = "derive"))]
381 #[cfg(feature = "full")]
382 fn visit_generic_method_argument(&mut self, i: &'ast GenericMethodArgument) {
383 visit_generic_method_argument(self, i)
384 }
385 #[cfg(any(feature = "full", feature = "derive"))]
386 fn visit_generic_param(&mut self, i: &'ast GenericParam) {
387 visit_generic_param(self, i)
388 }
389 #[cfg(any(feature = "full", feature = "derive"))]
390 fn visit_generics(&mut self, i: &'ast Generics) {
391 visit_generics(self, i)
392 }
David Tolnay8c81f622018-07-31 23:34:35 -0700393 fn visit_ident(&mut self, i: &'ast Ident) {
394 visit_ident(self, i)
395 }
396 #[cfg(feature = "full")]
397 fn visit_impl_item(&mut self, i: &'ast ImplItem) {
398 visit_impl_item(self, i)
399 }
400 #[cfg(feature = "full")]
401 fn visit_impl_item_const(&mut self, i: &'ast ImplItemConst) {
402 visit_impl_item_const(self, i)
403 }
404 #[cfg(feature = "full")]
David Tolnaybb82ef02018-08-24 20:15:45 -0400405 fn visit_impl_item_existential(&mut self, i: &'ast ImplItemExistential) {
406 visit_impl_item_existential(self, i)
407 }
408 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700409 fn visit_impl_item_macro(&mut self, i: &'ast ImplItemMacro) {
410 visit_impl_item_macro(self, i)
411 }
412 #[cfg(feature = "full")]
413 fn visit_impl_item_method(&mut self, i: &'ast ImplItemMethod) {
414 visit_impl_item_method(self, i)
415 }
416 #[cfg(feature = "full")]
417 fn visit_impl_item_type(&mut self, i: &'ast ImplItemType) {
418 visit_impl_item_type(self, i)
419 }
420 #[cfg(feature = "full")]
421 fn visit_impl_item_verbatim(&mut self, i: &'ast ImplItemVerbatim) {
422 visit_impl_item_verbatim(self, i)
423 }
424 #[cfg(any(feature = "full", feature = "derive"))]
425 fn visit_index(&mut self, i: &'ast Index) {
426 visit_index(self, i)
427 }
428 #[cfg(feature = "full")]
429 fn visit_item(&mut self, i: &'ast Item) {
430 visit_item(self, i)
431 }
432 #[cfg(feature = "full")]
433 fn visit_item_const(&mut self, i: &'ast ItemConst) {
434 visit_item_const(self, i)
435 }
436 #[cfg(feature = "full")]
437 fn visit_item_enum(&mut self, i: &'ast ItemEnum) {
438 visit_item_enum(self, i)
439 }
440 #[cfg(feature = "full")]
David Tolnaybb82ef02018-08-24 20:15:45 -0400441 fn visit_item_existential(&mut self, i: &'ast ItemExistential) {
442 visit_item_existential(self, i)
443 }
444 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700445 fn visit_item_extern_crate(&mut self, i: &'ast ItemExternCrate) {
446 visit_item_extern_crate(self, i)
447 }
448 #[cfg(feature = "full")]
449 fn visit_item_fn(&mut self, i: &'ast ItemFn) {
450 visit_item_fn(self, i)
451 }
452 #[cfg(feature = "full")]
453 fn visit_item_foreign_mod(&mut self, i: &'ast ItemForeignMod) {
454 visit_item_foreign_mod(self, i)
455 }
456 #[cfg(feature = "full")]
457 fn visit_item_impl(&mut self, i: &'ast ItemImpl) {
458 visit_item_impl(self, i)
459 }
460 #[cfg(feature = "full")]
461 fn visit_item_macro(&mut self, i: &'ast ItemMacro) {
462 visit_item_macro(self, i)
463 }
464 #[cfg(feature = "full")]
465 fn visit_item_macro2(&mut self, i: &'ast ItemMacro2) {
466 visit_item_macro2(self, i)
467 }
468 #[cfg(feature = "full")]
469 fn visit_item_mod(&mut self, i: &'ast ItemMod) {
470 visit_item_mod(self, i)
471 }
472 #[cfg(feature = "full")]
473 fn visit_item_static(&mut self, i: &'ast ItemStatic) {
474 visit_item_static(self, i)
475 }
476 #[cfg(feature = "full")]
477 fn visit_item_struct(&mut self, i: &'ast ItemStruct) {
478 visit_item_struct(self, i)
479 }
480 #[cfg(feature = "full")]
481 fn visit_item_trait(&mut self, i: &'ast ItemTrait) {
482 visit_item_trait(self, i)
483 }
484 #[cfg(feature = "full")]
David Tolnayc6b04dd2018-08-30 23:22:51 -0700485 fn visit_item_trait_alias(&mut self, i: &'ast ItemTraitAlias) {
486 visit_item_trait_alias(self, i)
487 }
488 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700489 fn visit_item_type(&mut self, i: &'ast ItemType) {
490 visit_item_type(self, i)
491 }
492 #[cfg(feature = "full")]
493 fn visit_item_union(&mut self, i: &'ast ItemUnion) {
494 visit_item_union(self, i)
495 }
496 #[cfg(feature = "full")]
497 fn visit_item_use(&mut self, i: &'ast ItemUse) {
498 visit_item_use(self, i)
499 }
500 #[cfg(feature = "full")]
501 fn visit_item_verbatim(&mut self, i: &'ast ItemVerbatim) {
502 visit_item_verbatim(self, i)
503 }
504 #[cfg(any(feature = "full", feature = "derive"))]
505 #[cfg(feature = "full")]
506 fn visit_label(&mut self, i: &'ast Label) {
507 visit_label(self, i)
508 }
David Tolnay8c81f622018-07-31 23:34:35 -0700509 fn visit_lifetime(&mut self, i: &'ast Lifetime) {
510 visit_lifetime(self, i)
511 }
512 #[cfg(any(feature = "full", feature = "derive"))]
513 fn visit_lifetime_def(&mut self, i: &'ast LifetimeDef) {
514 visit_lifetime_def(self, i)
515 }
516 #[cfg(any(feature = "full", feature = "derive"))]
517 fn visit_lit(&mut self, i: &'ast Lit) {
518 visit_lit(self, i)
519 }
520 #[cfg(any(feature = "full", feature = "derive"))]
521 fn visit_lit_bool(&mut self, i: &'ast LitBool) {
522 visit_lit_bool(self, i)
523 }
524 #[cfg(any(feature = "full", feature = "derive"))]
525 fn visit_lit_byte(&mut self, i: &'ast LitByte) {
526 visit_lit_byte(self, i)
527 }
528 #[cfg(any(feature = "full", feature = "derive"))]
529 fn visit_lit_byte_str(&mut self, i: &'ast LitByteStr) {
530 visit_lit_byte_str(self, i)
531 }
532 #[cfg(any(feature = "full", feature = "derive"))]
533 fn visit_lit_char(&mut self, i: &'ast LitChar) {
534 visit_lit_char(self, i)
535 }
536 #[cfg(any(feature = "full", feature = "derive"))]
537 fn visit_lit_float(&mut self, i: &'ast LitFloat) {
538 visit_lit_float(self, i)
539 }
540 #[cfg(any(feature = "full", feature = "derive"))]
541 fn visit_lit_int(&mut self, i: &'ast LitInt) {
542 visit_lit_int(self, i)
543 }
544 #[cfg(any(feature = "full", feature = "derive"))]
545 fn visit_lit_str(&mut self, i: &'ast LitStr) {
546 visit_lit_str(self, i)
547 }
548 #[cfg(any(feature = "full", feature = "derive"))]
549 fn visit_lit_verbatim(&mut self, i: &'ast LitVerbatim) {
550 visit_lit_verbatim(self, i)
551 }
552 #[cfg(any(feature = "full", feature = "derive"))]
553 #[cfg(feature = "full")]
554 fn visit_local(&mut self, i: &'ast Local) {
555 visit_local(self, i)
556 }
557 #[cfg(any(feature = "full", feature = "derive"))]
558 fn visit_macro(&mut self, i: &'ast Macro) {
559 visit_macro(self, i)
560 }
561 #[cfg(any(feature = "full", feature = "derive"))]
562 fn visit_macro_delimiter(&mut self, i: &'ast MacroDelimiter) {
563 visit_macro_delimiter(self, i)
564 }
565 #[cfg(any(feature = "full", feature = "derive"))]
566 fn visit_member(&mut self, i: &'ast Member) {
567 visit_member(self, i)
568 }
569 #[cfg(any(feature = "full", feature = "derive"))]
570 fn visit_meta(&mut self, i: &'ast Meta) {
571 visit_meta(self, i)
572 }
573 #[cfg(any(feature = "full", feature = "derive"))]
574 fn visit_meta_list(&mut self, i: &'ast MetaList) {
575 visit_meta_list(self, i)
576 }
577 #[cfg(any(feature = "full", feature = "derive"))]
578 fn visit_meta_name_value(&mut self, i: &'ast MetaNameValue) {
579 visit_meta_name_value(self, i)
580 }
581 #[cfg(feature = "full")]
582 fn visit_method_sig(&mut self, i: &'ast MethodSig) {
583 visit_method_sig(self, i)
584 }
585 #[cfg(any(feature = "full", feature = "derive"))]
586 #[cfg(feature = "full")]
587 fn visit_method_turbofish(&mut self, i: &'ast MethodTurbofish) {
588 visit_method_turbofish(self, i)
589 }
590 #[cfg(any(feature = "full", feature = "derive"))]
591 fn visit_nested_meta(&mut self, i: &'ast NestedMeta) {
592 visit_nested_meta(self, i)
593 }
594 #[cfg(any(feature = "full", feature = "derive"))]
595 fn visit_parenthesized_generic_arguments(&mut self, i: &'ast ParenthesizedGenericArguments) {
596 visit_parenthesized_generic_arguments(self, i)
597 }
598 #[cfg(any(feature = "full", feature = "derive"))]
599 #[cfg(feature = "full")]
600 fn visit_pat(&mut self, i: &'ast Pat) {
601 visit_pat(self, i)
602 }
603 #[cfg(any(feature = "full", feature = "derive"))]
604 #[cfg(feature = "full")]
605 fn visit_pat_box(&mut self, i: &'ast PatBox) {
606 visit_pat_box(self, i)
607 }
608 #[cfg(any(feature = "full", feature = "derive"))]
609 #[cfg(feature = "full")]
610 fn visit_pat_ident(&mut self, i: &'ast PatIdent) {
611 visit_pat_ident(self, i)
612 }
613 #[cfg(any(feature = "full", feature = "derive"))]
614 #[cfg(feature = "full")]
615 fn visit_pat_lit(&mut self, i: &'ast PatLit) {
616 visit_pat_lit(self, i)
617 }
618 #[cfg(any(feature = "full", feature = "derive"))]
619 #[cfg(feature = "full")]
620 fn visit_pat_macro(&mut self, i: &'ast PatMacro) {
621 visit_pat_macro(self, i)
622 }
623 #[cfg(any(feature = "full", feature = "derive"))]
624 #[cfg(feature = "full")]
625 fn visit_pat_path(&mut self, i: &'ast PatPath) {
626 visit_pat_path(self, i)
627 }
628 #[cfg(any(feature = "full", feature = "derive"))]
629 #[cfg(feature = "full")]
630 fn visit_pat_range(&mut self, i: &'ast PatRange) {
631 visit_pat_range(self, i)
632 }
633 #[cfg(any(feature = "full", feature = "derive"))]
634 #[cfg(feature = "full")]
635 fn visit_pat_ref(&mut self, i: &'ast PatRef) {
636 visit_pat_ref(self, i)
637 }
638 #[cfg(any(feature = "full", feature = "derive"))]
639 #[cfg(feature = "full")]
640 fn visit_pat_slice(&mut self, i: &'ast PatSlice) {
641 visit_pat_slice(self, i)
642 }
643 #[cfg(any(feature = "full", feature = "derive"))]
644 #[cfg(feature = "full")]
645 fn visit_pat_struct(&mut self, i: &'ast PatStruct) {
646 visit_pat_struct(self, i)
647 }
648 #[cfg(any(feature = "full", feature = "derive"))]
649 #[cfg(feature = "full")]
650 fn visit_pat_tuple(&mut self, i: &'ast PatTuple) {
651 visit_pat_tuple(self, i)
652 }
653 #[cfg(any(feature = "full", feature = "derive"))]
654 #[cfg(feature = "full")]
655 fn visit_pat_tuple_struct(&mut self, i: &'ast PatTupleStruct) {
656 visit_pat_tuple_struct(self, i)
657 }
658 #[cfg(any(feature = "full", feature = "derive"))]
659 #[cfg(feature = "full")]
660 fn visit_pat_verbatim(&mut self, i: &'ast PatVerbatim) {
661 visit_pat_verbatim(self, i)
662 }
663 #[cfg(any(feature = "full", feature = "derive"))]
664 #[cfg(feature = "full")]
665 fn visit_pat_wild(&mut self, i: &'ast PatWild) {
666 visit_pat_wild(self, i)
667 }
668 #[cfg(any(feature = "full", feature = "derive"))]
669 fn visit_path(&mut self, i: &'ast Path) {
670 visit_path(self, i)
671 }
672 #[cfg(any(feature = "full", feature = "derive"))]
673 fn visit_path_arguments(&mut self, i: &'ast PathArguments) {
674 visit_path_arguments(self, i)
675 }
676 #[cfg(any(feature = "full", feature = "derive"))]
677 fn visit_path_segment(&mut self, i: &'ast PathSegment) {
678 visit_path_segment(self, i)
679 }
680 #[cfg(any(feature = "full", feature = "derive"))]
681 fn visit_predicate_eq(&mut self, i: &'ast PredicateEq) {
682 visit_predicate_eq(self, i)
683 }
684 #[cfg(any(feature = "full", feature = "derive"))]
685 fn visit_predicate_lifetime(&mut self, i: &'ast PredicateLifetime) {
686 visit_predicate_lifetime(self, i)
687 }
688 #[cfg(any(feature = "full", feature = "derive"))]
689 fn visit_predicate_type(&mut self, i: &'ast PredicateType) {
690 visit_predicate_type(self, i)
691 }
692 #[cfg(any(feature = "full", feature = "derive"))]
693 fn visit_qself(&mut self, i: &'ast QSelf) {
694 visit_qself(self, i)
695 }
696 #[cfg(any(feature = "full", feature = "derive"))]
697 #[cfg(feature = "full")]
698 fn visit_range_limits(&mut self, i: &'ast RangeLimits) {
699 visit_range_limits(self, i)
700 }
701 #[cfg(any(feature = "full", feature = "derive"))]
702 fn visit_return_type(&mut self, i: &'ast ReturnType) {
703 visit_return_type(self, i)
704 }
David Tolnay8c81f622018-07-31 23:34:35 -0700705 fn visit_span(&mut self, i: &'ast Span) {
706 visit_span(self, i)
707 }
708 #[cfg(any(feature = "full", feature = "derive"))]
709 #[cfg(feature = "full")]
710 fn visit_stmt(&mut self, i: &'ast Stmt) {
711 visit_stmt(self, i)
712 }
713 #[cfg(any(feature = "full", feature = "derive"))]
714 fn visit_trait_bound(&mut self, i: &'ast TraitBound) {
715 visit_trait_bound(self, i)
716 }
717 #[cfg(any(feature = "full", feature = "derive"))]
718 fn visit_trait_bound_modifier(&mut self, i: &'ast TraitBoundModifier) {
719 visit_trait_bound_modifier(self, i)
720 }
721 #[cfg(feature = "full")]
722 fn visit_trait_item(&mut self, i: &'ast TraitItem) {
723 visit_trait_item(self, i)
724 }
725 #[cfg(feature = "full")]
726 fn visit_trait_item_const(&mut self, i: &'ast TraitItemConst) {
727 visit_trait_item_const(self, i)
728 }
729 #[cfg(feature = "full")]
730 fn visit_trait_item_macro(&mut self, i: &'ast TraitItemMacro) {
731 visit_trait_item_macro(self, i)
732 }
733 #[cfg(feature = "full")]
734 fn visit_trait_item_method(&mut self, i: &'ast TraitItemMethod) {
735 visit_trait_item_method(self, i)
736 }
737 #[cfg(feature = "full")]
738 fn visit_trait_item_type(&mut self, i: &'ast TraitItemType) {
739 visit_trait_item_type(self, i)
740 }
741 #[cfg(feature = "full")]
742 fn visit_trait_item_verbatim(&mut self, i: &'ast TraitItemVerbatim) {
743 visit_trait_item_verbatim(self, i)
744 }
745 #[cfg(any(feature = "full", feature = "derive"))]
746 fn visit_type(&mut self, i: &'ast Type) {
747 visit_type(self, i)
748 }
749 #[cfg(any(feature = "full", feature = "derive"))]
750 fn visit_type_array(&mut self, i: &'ast TypeArray) {
751 visit_type_array(self, i)
752 }
753 #[cfg(any(feature = "full", feature = "derive"))]
754 fn visit_type_bare_fn(&mut self, i: &'ast TypeBareFn) {
755 visit_type_bare_fn(self, i)
756 }
757 #[cfg(any(feature = "full", feature = "derive"))]
758 fn visit_type_group(&mut self, i: &'ast TypeGroup) {
759 visit_type_group(self, i)
760 }
761 #[cfg(any(feature = "full", feature = "derive"))]
762 fn visit_type_impl_trait(&mut self, i: &'ast TypeImplTrait) {
763 visit_type_impl_trait(self, i)
764 }
765 #[cfg(any(feature = "full", feature = "derive"))]
766 fn visit_type_infer(&mut self, i: &'ast TypeInfer) {
767 visit_type_infer(self, i)
768 }
769 #[cfg(any(feature = "full", feature = "derive"))]
770 fn visit_type_macro(&mut self, i: &'ast TypeMacro) {
771 visit_type_macro(self, i)
772 }
773 #[cfg(any(feature = "full", feature = "derive"))]
774 fn visit_type_never(&mut self, i: &'ast TypeNever) {
775 visit_type_never(self, i)
776 }
777 #[cfg(any(feature = "full", feature = "derive"))]
778 fn visit_type_param(&mut self, i: &'ast TypeParam) {
779 visit_type_param(self, i)
780 }
781 #[cfg(any(feature = "full", feature = "derive"))]
782 fn visit_type_param_bound(&mut self, i: &'ast TypeParamBound) {
783 visit_type_param_bound(self, i)
784 }
785 #[cfg(any(feature = "full", feature = "derive"))]
786 fn visit_type_paren(&mut self, i: &'ast TypeParen) {
787 visit_type_paren(self, i)
788 }
789 #[cfg(any(feature = "full", feature = "derive"))]
790 fn visit_type_path(&mut self, i: &'ast TypePath) {
791 visit_type_path(self, i)
792 }
793 #[cfg(any(feature = "full", feature = "derive"))]
794 fn visit_type_ptr(&mut self, i: &'ast TypePtr) {
795 visit_type_ptr(self, i)
796 }
797 #[cfg(any(feature = "full", feature = "derive"))]
798 fn visit_type_reference(&mut self, i: &'ast TypeReference) {
799 visit_type_reference(self, i)
800 }
801 #[cfg(any(feature = "full", feature = "derive"))]
802 fn visit_type_slice(&mut self, i: &'ast TypeSlice) {
803 visit_type_slice(self, i)
804 }
805 #[cfg(any(feature = "full", feature = "derive"))]
806 fn visit_type_trait_object(&mut self, i: &'ast TypeTraitObject) {
807 visit_type_trait_object(self, i)
808 }
809 #[cfg(any(feature = "full", feature = "derive"))]
810 fn visit_type_tuple(&mut self, i: &'ast TypeTuple) {
811 visit_type_tuple(self, i)
812 }
813 #[cfg(any(feature = "full", feature = "derive"))]
814 fn visit_type_verbatim(&mut self, i: &'ast TypeVerbatim) {
815 visit_type_verbatim(self, i)
816 }
817 #[cfg(any(feature = "full", feature = "derive"))]
818 fn visit_un_op(&mut self, i: &'ast UnOp) {
819 visit_un_op(self, i)
820 }
821 #[cfg(feature = "full")]
822 fn visit_use_glob(&mut self, i: &'ast UseGlob) {
823 visit_use_glob(self, i)
824 }
825 #[cfg(feature = "full")]
826 fn visit_use_group(&mut self, i: &'ast UseGroup) {
827 visit_use_group(self, i)
828 }
829 #[cfg(feature = "full")]
830 fn visit_use_name(&mut self, i: &'ast UseName) {
831 visit_use_name(self, i)
832 }
833 #[cfg(feature = "full")]
834 fn visit_use_path(&mut self, i: &'ast UsePath) {
835 visit_use_path(self, i)
836 }
837 #[cfg(feature = "full")]
838 fn visit_use_rename(&mut self, i: &'ast UseRename) {
839 visit_use_rename(self, i)
840 }
841 #[cfg(feature = "full")]
842 fn visit_use_tree(&mut self, i: &'ast UseTree) {
843 visit_use_tree(self, i)
844 }
845 #[cfg(any(feature = "full", feature = "derive"))]
846 fn visit_variant(&mut self, i: &'ast Variant) {
847 visit_variant(self, i)
848 }
849 #[cfg(any(feature = "full", feature = "derive"))]
850 fn visit_vis_crate(&mut self, i: &'ast VisCrate) {
851 visit_vis_crate(self, i)
852 }
853 #[cfg(any(feature = "full", feature = "derive"))]
854 fn visit_vis_public(&mut self, i: &'ast VisPublic) {
855 visit_vis_public(self, i)
856 }
857 #[cfg(any(feature = "full", feature = "derive"))]
858 fn visit_vis_restricted(&mut self, i: &'ast VisRestricted) {
859 visit_vis_restricted(self, i)
860 }
861 #[cfg(any(feature = "full", feature = "derive"))]
862 fn visit_visibility(&mut self, i: &'ast Visibility) {
863 visit_visibility(self, i)
864 }
865 #[cfg(any(feature = "full", feature = "derive"))]
866 fn visit_where_clause(&mut self, i: &'ast WhereClause) {
867 visit_where_clause(self, i)
868 }
869 #[cfg(any(feature = "full", feature = "derive"))]
870 fn visit_where_predicate(&mut self, i: &'ast WherePredicate) {
871 visit_where_predicate(self, i)
872 }
Nika Layzell27726662017-10-24 23:16:35 -0400873}
David Tolnay8c81f622018-07-31 23:34:35 -0700874#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800875pub fn visit_abi<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Abi) {
David Tolnay7ac699c2018-08-24 14:00:58 -0400876 tokens_helper(_visitor, &_i.extern_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -0700877 if let Some(ref it) = _i.name {
878 _visitor.visit_lit_str(it)
879 };
Nika Layzell27726662017-10-24 23:16:35 -0400880}
David Tolnay8c81f622018-07-31 23:34:35 -0700881#[cfg(any(feature = "full", feature = "derive"))]
882pub fn visit_angle_bracketed_generic_arguments<'ast, V: Visit<'ast> + ?Sized>(
883 _visitor: &mut V,
884 _i: &'ast AngleBracketedGenericArguments,
885) {
886 if let Some(ref it) = _i.colon2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -0400887 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -0700888 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400889 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700890 for el in Punctuated::pairs(&_i.args) {
891 let it = el.value();
892 _visitor.visit_generic_argument(it)
893 }
David Tolnay7ac699c2018-08-24 14:00:58 -0400894 tokens_helper(_visitor, &_i.gt_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400895}
David Tolnay8c81f622018-07-31 23:34:35 -0700896#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800897pub fn visit_arg_captured<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ArgCaptured) {
David Tolnay8c81f622018-07-31 23:34:35 -0700898 _visitor.visit_pat(&_i.pat);
David Tolnay7ac699c2018-08-24 14:00:58 -0400899 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700900 _visitor.visit_type(&_i.ty);
Nika Layzell27726662017-10-24 23:16:35 -0400901}
David Tolnay8c81f622018-07-31 23:34:35 -0700902#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800903pub fn visit_arg_self<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ArgSelf) {
David Tolnay8c81f622018-07-31 23:34:35 -0700904 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -0400905 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -0700906 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400907 tokens_helper(_visitor, &_i.self_token.span);
Nika Layzell27726662017-10-24 23:16:35 -0400908}
David Tolnay8c81f622018-07-31 23:34:35 -0700909#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800910pub fn visit_arg_self_ref<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ArgSelfRef) {
David Tolnay7ac699c2018-08-24 14:00:58 -0400911 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700912 if let Some(ref it) = _i.lifetime {
913 _visitor.visit_lifetime(it)
914 };
915 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -0400916 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -0700917 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400918 tokens_helper(_visitor, &_i.self_token.span);
Nika Layzell27726662017-10-24 23:16:35 -0400919}
David Tolnay8c81f622018-07-31 23:34:35 -0700920#[cfg(any(feature = "full", feature = "derive"))]
921#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800922pub fn visit_arm<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Arm) {
David Tolnay8c81f622018-07-31 23:34:35 -0700923 for it in &_i.attrs {
924 _visitor.visit_attribute(it)
925 }
926 if let Some(ref it) = _i.leading_vert {
David Tolnay7ac699c2018-08-24 14:00:58 -0400927 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -0700928 };
929 for el in Punctuated::pairs(&_i.pats) {
930 let it = el.value();
931 _visitor.visit_pat(it)
932 }
933 if let Some(ref it) = _i.guard {
David Tolnay7ac699c2018-08-24 14:00:58 -0400934 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -0700935 _visitor.visit_expr(&*(it).1);
936 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400937 tokens_helper(_visitor, &_i.fat_arrow_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700938 _visitor.visit_expr(&*_i.body);
939 if let Some(ref it) = _i.comma {
David Tolnay7ac699c2018-08-24 14:00:58 -0400940 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -0700941 };
Nika Layzell27726662017-10-24 23:16:35 -0400942}
David Tolnay8c81f622018-07-31 23:34:35 -0700943#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800944pub fn visit_attr_style<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast AttrStyle) {
Nika Layzell27726662017-10-24 23:16:35 -0400945 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -0700946 AttrStyle::Outer => {}
947 AttrStyle::Inner(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400948 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400949 }
950 }
951}
David Tolnay8c81f622018-07-31 23:34:35 -0700952#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800953pub fn visit_attribute<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Attribute) {
David Tolnay7ac699c2018-08-24 14:00:58 -0400954 tokens_helper(_visitor, &_i.pound_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700955 _visitor.visit_attr_style(&_i.style);
David Tolnay7ac699c2018-08-24 14:00:58 -0400956 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -0700957 _visitor.visit_path(&_i.path);
David Tolnay6af48992018-08-01 11:16:28 -0700958 skip!(_i.tts);
Nika Layzell27726662017-10-24 23:16:35 -0400959}
David Tolnay8c81f622018-07-31 23:34:35 -0700960#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800961pub fn visit_bare_fn_arg<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast BareFnArg) {
David Tolnay8c81f622018-07-31 23:34:35 -0700962 if let Some(ref it) = _i.name {
963 _visitor.visit_bare_fn_arg_name(&(it).0);
David Tolnay7ac699c2018-08-24 14:00:58 -0400964 tokens_helper(_visitor, &(it).1.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700965 };
966 _visitor.visit_type(&_i.ty);
Nika Layzell27726662017-10-24 23:16:35 -0400967}
David Tolnay8c81f622018-07-31 23:34:35 -0700968#[cfg(any(feature = "full", feature = "derive"))]
969pub fn visit_bare_fn_arg_name<'ast, V: Visit<'ast> + ?Sized>(
970 _visitor: &mut V,
971 _i: &'ast BareFnArgName,
972) {
Nika Layzell27726662017-10-24 23:16:35 -0400973 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -0700974 BareFnArgName::Named(ref _binding_0) => {
Alex Crichtond261d092018-05-18 13:47:35 -0700975 _visitor.visit_ident(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -0400976 }
David Tolnay8c81f622018-07-31 23:34:35 -0700977 BareFnArgName::Wild(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400978 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400979 }
980 }
981}
David Tolnay8c81f622018-07-31 23:34:35 -0700982#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800983pub fn visit_bin_op<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast BinOp) {
Nika Layzell27726662017-10-24 23:16:35 -0400984 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -0700985 BinOp::Add(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400986 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400987 }
David Tolnay8c81f622018-07-31 23:34:35 -0700988 BinOp::Sub(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400989 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400990 }
David Tolnay8c81f622018-07-31 23:34:35 -0700991 BinOp::Mul(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400992 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400993 }
David Tolnay8c81f622018-07-31 23:34:35 -0700994 BinOp::Div(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400995 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400996 }
David Tolnay8c81f622018-07-31 23:34:35 -0700997 BinOp::Rem(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400998 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400999 }
David Tolnay8c81f622018-07-31 23:34:35 -07001000 BinOp::And(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001001 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001002 }
David Tolnay8c81f622018-07-31 23:34:35 -07001003 BinOp::Or(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001004 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001005 }
David Tolnay8c81f622018-07-31 23:34:35 -07001006 BinOp::BitXor(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001007 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001008 }
David Tolnay8c81f622018-07-31 23:34:35 -07001009 BinOp::BitAnd(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001010 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001011 }
David Tolnay8c81f622018-07-31 23:34:35 -07001012 BinOp::BitOr(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001013 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001014 }
David Tolnay8c81f622018-07-31 23:34:35 -07001015 BinOp::Shl(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001016 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001017 }
David Tolnay8c81f622018-07-31 23:34:35 -07001018 BinOp::Shr(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001019 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001020 }
David Tolnay8c81f622018-07-31 23:34:35 -07001021 BinOp::Eq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001022 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001023 }
David Tolnay8c81f622018-07-31 23:34:35 -07001024 BinOp::Lt(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001025 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001026 }
David Tolnay8c81f622018-07-31 23:34:35 -07001027 BinOp::Le(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001028 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001029 }
David Tolnay8c81f622018-07-31 23:34:35 -07001030 BinOp::Ne(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001031 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001032 }
David Tolnay8c81f622018-07-31 23:34:35 -07001033 BinOp::Ge(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001034 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001035 }
David Tolnay8c81f622018-07-31 23:34:35 -07001036 BinOp::Gt(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001037 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001038 }
David Tolnay8c81f622018-07-31 23:34:35 -07001039 BinOp::AddEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001040 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001041 }
David Tolnay8c81f622018-07-31 23:34:35 -07001042 BinOp::SubEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001043 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001044 }
David Tolnay8c81f622018-07-31 23:34:35 -07001045 BinOp::MulEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001046 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001047 }
David Tolnay8c81f622018-07-31 23:34:35 -07001048 BinOp::DivEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001049 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001050 }
David Tolnay8c81f622018-07-31 23:34:35 -07001051 BinOp::RemEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001052 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001053 }
David Tolnay8c81f622018-07-31 23:34:35 -07001054 BinOp::BitXorEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001055 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001056 }
David Tolnay8c81f622018-07-31 23:34:35 -07001057 BinOp::BitAndEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001058 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001059 }
David Tolnay8c81f622018-07-31 23:34:35 -07001060 BinOp::BitOrEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001061 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001062 }
David Tolnay8c81f622018-07-31 23:34:35 -07001063 BinOp::ShlEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001064 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001065 }
David Tolnay8c81f622018-07-31 23:34:35 -07001066 BinOp::ShrEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001067 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001068 }
1069 }
1070}
David Tolnay8c81f622018-07-31 23:34:35 -07001071#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001072pub fn visit_binding<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Binding) {
David Tolnay8c81f622018-07-31 23:34:35 -07001073 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001074 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001075 _visitor.visit_type(&_i.ty);
David Tolnay506e43a2017-12-29 11:34:36 -05001076}
David Tolnay8c81f622018-07-31 23:34:35 -07001077#[cfg(any(feature = "full", feature = "derive"))]
1078#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001079pub fn visit_block<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Block) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001080 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001081 for it in &_i.stmts {
1082 _visitor.visit_stmt(it)
1083 }
Nika Layzell27726662017-10-24 23:16:35 -04001084}
David Tolnay8c81f622018-07-31 23:34:35 -07001085#[cfg(any(feature = "full", feature = "derive"))]
1086pub fn visit_bound_lifetimes<'ast, V: Visit<'ast> + ?Sized>(
1087 _visitor: &mut V,
1088 _i: &'ast BoundLifetimes,
1089) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001090 tokens_helper(_visitor, &_i.for_token.span);
1091 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001092 for el in Punctuated::pairs(&_i.lifetimes) {
1093 let it = el.value();
1094 _visitor.visit_lifetime_def(it)
1095 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001096 tokens_helper(_visitor, &_i.gt_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001097}
David Tolnay8c81f622018-07-31 23:34:35 -07001098#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001099pub fn visit_const_param<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ConstParam) {
David Tolnay8c81f622018-07-31 23:34:35 -07001100 for it in &_i.attrs {
1101 _visitor.visit_attribute(it)
1102 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001103 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001104 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001105 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001106 _visitor.visit_type(&_i.ty);
1107 if let Some(ref it) = _i.eq_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001108 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001109 };
1110 if let Some(ref it) = _i.default {
1111 _visitor.visit_expr(it)
1112 };
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001113}
David Tolnay9d0882a2018-09-01 19:49:14 -07001114#[cfg(any(feature = "full", feature = "derive"))]
1115pub fn visit_constraint<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Constraint) {
1116 _visitor.visit_ident(&_i.ident);
1117 tokens_helper(_visitor, &_i.colon_token.spans);
1118 for el in Punctuated::pairs(&_i.bounds) {
1119 let it = el.value();
1120 _visitor.visit_type_param_bound(it)
1121 }
1122}
David Tolnay8c81f622018-07-31 23:34:35 -07001123#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001124pub fn visit_data<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Data) {
David Tolnaye3d41b72017-12-31 15:24:00 -05001125 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001126 Data::Struct(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05001127 _visitor.visit_data_struct(_binding_0);
1128 }
David Tolnay8c81f622018-07-31 23:34:35 -07001129 Data::Enum(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05001130 _visitor.visit_data_enum(_binding_0);
1131 }
David Tolnay8c81f622018-07-31 23:34:35 -07001132 Data::Union(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05001133 _visitor.visit_data_union(_binding_0);
1134 }
1135 }
1136}
David Tolnay8c81f622018-07-31 23:34:35 -07001137#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001138pub fn visit_data_enum<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataEnum) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001139 tokens_helper(_visitor, &_i.enum_token.span);
1140 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001141 for el in Punctuated::pairs(&_i.variants) {
1142 let it = el.value();
1143 _visitor.visit_variant(it)
1144 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001145}
David Tolnay8c81f622018-07-31 23:34:35 -07001146#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001147pub fn visit_data_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataStruct) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001148 tokens_helper(_visitor, &_i.struct_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001149 _visitor.visit_fields(&_i.fields);
1150 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001151 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001152 };
David Tolnaye3d41b72017-12-31 15:24:00 -05001153}
David Tolnay8c81f622018-07-31 23:34:35 -07001154#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001155pub fn visit_data_union<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataUnion) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001156 tokens_helper(_visitor, &_i.union_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001157 _visitor.visit_fields_named(&_i.fields);
David Tolnaye3d41b72017-12-31 15:24:00 -05001158}
David Tolnay8c81f622018-07-31 23:34:35 -07001159#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001160pub fn visit_derive_input<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DeriveInput) {
David Tolnay8c81f622018-07-31 23:34:35 -07001161 for it in &_i.attrs {
1162 _visitor.visit_attribute(it)
1163 }
1164 _visitor.visit_visibility(&_i.vis);
1165 _visitor.visit_ident(&_i.ident);
1166 _visitor.visit_generics(&_i.generics);
1167 _visitor.visit_data(&_i.data);
Nika Layzell27726662017-10-24 23:16:35 -04001168}
David Tolnay8c81f622018-07-31 23:34:35 -07001169#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001170pub fn visit_expr<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Expr) {
Nika Layzell27726662017-10-24 23:16:35 -04001171 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001172 Expr::Box(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001173 full!(_visitor.visit_expr_box(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001174 }
David Tolnay8c81f622018-07-31 23:34:35 -07001175 Expr::InPlace(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001176 full!(_visitor.visit_expr_in_place(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001177 }
David Tolnay8c81f622018-07-31 23:34:35 -07001178 Expr::Array(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001179 full!(_visitor.visit_expr_array(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001180 }
David Tolnay8c81f622018-07-31 23:34:35 -07001181 Expr::Call(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001182 _visitor.visit_expr_call(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001183 }
David Tolnay8c81f622018-07-31 23:34:35 -07001184 Expr::MethodCall(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001185 full!(_visitor.visit_expr_method_call(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001186 }
David Tolnay8c81f622018-07-31 23:34:35 -07001187 Expr::Tuple(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001188 full!(_visitor.visit_expr_tuple(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001189 }
David Tolnay8c81f622018-07-31 23:34:35 -07001190 Expr::Binary(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001191 _visitor.visit_expr_binary(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001192 }
David Tolnay8c81f622018-07-31 23:34:35 -07001193 Expr::Unary(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001194 _visitor.visit_expr_unary(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001195 }
David Tolnay8c81f622018-07-31 23:34:35 -07001196 Expr::Lit(ref _binding_0) => {
David Tolnay8c91b882017-12-28 23:04:32 -05001197 _visitor.visit_expr_lit(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001198 }
David Tolnay8c81f622018-07-31 23:34:35 -07001199 Expr::Cast(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001200 _visitor.visit_expr_cast(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001201 }
David Tolnay8c81f622018-07-31 23:34:35 -07001202 Expr::Type(ref _binding_0) => {
David Tolnay0cf94f22017-12-28 23:46:26 -05001203 full!(_visitor.visit_expr_type(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001204 }
David Tolnay9c119122018-09-01 18:47:02 -07001205 Expr::Let(ref _binding_0) => {
1206 full!(_visitor.visit_expr_let(_binding_0));
1207 }
David Tolnay8c81f622018-07-31 23:34:35 -07001208 Expr::If(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001209 full!(_visitor.visit_expr_if(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001210 }
David Tolnay8c81f622018-07-31 23:34:35 -07001211 Expr::While(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001212 full!(_visitor.visit_expr_while(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001213 }
David Tolnay8c81f622018-07-31 23:34:35 -07001214 Expr::ForLoop(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001215 full!(_visitor.visit_expr_for_loop(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001216 }
David Tolnay8c81f622018-07-31 23:34:35 -07001217 Expr::Loop(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001218 full!(_visitor.visit_expr_loop(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001219 }
David Tolnay8c81f622018-07-31 23:34:35 -07001220 Expr::Match(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001221 full!(_visitor.visit_expr_match(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001222 }
David Tolnay8c81f622018-07-31 23:34:35 -07001223 Expr::Closure(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001224 full!(_visitor.visit_expr_closure(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001225 }
David Tolnay8c81f622018-07-31 23:34:35 -07001226 Expr::Unsafe(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001227 full!(_visitor.visit_expr_unsafe(_binding_0));
Nika Layzell640832a2017-12-04 13:37:09 -05001228 }
David Tolnay8c81f622018-07-31 23:34:35 -07001229 Expr::Block(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001230 full!(_visitor.visit_expr_block(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001231 }
David Tolnay8c81f622018-07-31 23:34:35 -07001232 Expr::Assign(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001233 full!(_visitor.visit_expr_assign(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001234 }
David Tolnay8c81f622018-07-31 23:34:35 -07001235 Expr::AssignOp(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001236 full!(_visitor.visit_expr_assign_op(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001237 }
David Tolnay8c81f622018-07-31 23:34:35 -07001238 Expr::Field(ref _binding_0) => {
David Tolnayd093fa92018-06-30 10:23:25 -07001239 _visitor.visit_expr_field(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001240 }
David Tolnay8c81f622018-07-31 23:34:35 -07001241 Expr::Index(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001242 _visitor.visit_expr_index(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001243 }
David Tolnay8c81f622018-07-31 23:34:35 -07001244 Expr::Range(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001245 full!(_visitor.visit_expr_range(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001246 }
David Tolnay8c81f622018-07-31 23:34:35 -07001247 Expr::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001248 _visitor.visit_expr_path(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001249 }
David Tolnay8c81f622018-07-31 23:34:35 -07001250 Expr::Reference(ref _binding_0) => {
David Tolnay00674ba2018-03-31 18:14:11 +02001251 full!(_visitor.visit_expr_reference(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001252 }
David Tolnay8c81f622018-07-31 23:34:35 -07001253 Expr::Break(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001254 full!(_visitor.visit_expr_break(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001255 }
David Tolnay8c81f622018-07-31 23:34:35 -07001256 Expr::Continue(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001257 full!(_visitor.visit_expr_continue(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001258 }
David Tolnay8c81f622018-07-31 23:34:35 -07001259 Expr::Return(ref _binding_0) => {
David Tolnayc246cd32017-12-28 23:14:32 -05001260 full!(_visitor.visit_expr_return(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001261 }
David Tolnay8c81f622018-07-31 23:34:35 -07001262 Expr::Macro(ref _binding_0) => {
David Tolnay8c91b882017-12-28 23:04:32 -05001263 full!(_visitor.visit_expr_macro(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001264 }
David Tolnay8c81f622018-07-31 23:34:35 -07001265 Expr::Struct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001266 full!(_visitor.visit_expr_struct(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001267 }
David Tolnay8c81f622018-07-31 23:34:35 -07001268 Expr::Repeat(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001269 full!(_visitor.visit_expr_repeat(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001270 }
David Tolnay8c81f622018-07-31 23:34:35 -07001271 Expr::Paren(ref _binding_0) => {
David Tolnay81ab4f62018-01-27 19:02:51 -08001272 _visitor.visit_expr_paren(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001273 }
David Tolnay8c81f622018-07-31 23:34:35 -07001274 Expr::Group(ref _binding_0) => {
David Tolnaye98775f2017-12-28 23:17:00 -05001275 full!(_visitor.visit_expr_group(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001276 }
David Tolnay8c81f622018-07-31 23:34:35 -07001277 Expr::Try(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001278 full!(_visitor.visit_expr_try(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001279 }
David Tolnay02a9c6f2018-08-24 18:58:45 -04001280 Expr::Async(ref _binding_0) => {
1281 full!(_visitor.visit_expr_async(_binding_0));
1282 }
David Tolnayfb2dd4b2018-08-24 16:45:34 -04001283 Expr::TryBlock(ref _binding_0) => {
1284 full!(_visitor.visit_expr_try_block(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001285 }
David Tolnay8c81f622018-07-31 23:34:35 -07001286 Expr::Yield(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001287 full!(_visitor.visit_expr_yield(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001288 }
David Tolnay8c81f622018-07-31 23:34:35 -07001289 Expr::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05001290 _visitor.visit_expr_verbatim(_binding_0);
1291 }
Nika Layzell27726662017-10-24 23:16:35 -04001292 }
1293}
David Tolnay8c81f622018-07-31 23:34:35 -07001294#[cfg(feature = "full")]
1295#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001296pub fn visit_expr_array<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprArray) {
David Tolnay8c81f622018-07-31 23:34:35 -07001297 for it in &_i.attrs {
1298 _visitor.visit_attribute(it)
1299 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001300 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001301 for el in Punctuated::pairs(&_i.elems) {
1302 let it = el.value();
1303 _visitor.visit_expr(it)
David Tolnaye3d41b72017-12-31 15:24:00 -05001304 }
1305}
David Tolnay8c81f622018-07-31 23:34:35 -07001306#[cfg(feature = "full")]
1307#[cfg(any(feature = "full", feature = "derive"))]
1308pub fn visit_expr_assign<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprAssign) {
1309 for it in &_i.attrs {
1310 _visitor.visit_attribute(it)
1311 }
1312 _visitor.visit_expr(&*_i.left);
David Tolnay7ac699c2018-08-24 14:00:58 -04001313 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001314 _visitor.visit_expr(&*_i.right);
1315}
1316#[cfg(feature = "full")]
1317#[cfg(any(feature = "full", feature = "derive"))]
1318pub fn visit_expr_assign_op<'ast, V: Visit<'ast> + ?Sized>(
1319 _visitor: &mut V,
1320 _i: &'ast ExprAssignOp,
1321) {
1322 for it in &_i.attrs {
1323 _visitor.visit_attribute(it)
1324 }
1325 _visitor.visit_expr(&*_i.left);
1326 _visitor.visit_bin_op(&_i.op);
1327 _visitor.visit_expr(&*_i.right);
1328}
David Tolnay02a9c6f2018-08-24 18:58:45 -04001329#[cfg(feature = "full")]
1330#[cfg(any(feature = "full", feature = "derive"))]
1331pub fn visit_expr_async<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprAsync) {
1332 for it in &_i.attrs {
1333 _visitor.visit_attribute(it)
1334 }
1335 tokens_helper(_visitor, &_i.async_token.span);
1336 if let Some(ref it) = _i.capture {
1337 tokens_helper(_visitor, &it.span)
1338 };
1339 _visitor.visit_block(&_i.block);
1340}
David Tolnay8c81f622018-07-31 23:34:35 -07001341#[cfg(any(feature = "full", feature = "derive"))]
1342pub fn visit_expr_binary<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBinary) {
1343 for it in &_i.attrs {
1344 _visitor.visit_attribute(it)
1345 }
1346 _visitor.visit_expr(&*_i.left);
1347 _visitor.visit_bin_op(&_i.op);
1348 _visitor.visit_expr(&*_i.right);
1349}
1350#[cfg(feature = "full")]
1351#[cfg(any(feature = "full", feature = "derive"))]
1352pub fn visit_expr_block<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBlock) {
1353 for it in &_i.attrs {
1354 _visitor.visit_attribute(it)
1355 }
David Tolnay1d8e9962018-08-24 19:04:20 -04001356 if let Some(ref it) = _i.label {
1357 _visitor.visit_label(it)
1358 };
David Tolnay8c81f622018-07-31 23:34:35 -07001359 _visitor.visit_block(&_i.block);
1360}
1361#[cfg(feature = "full")]
1362#[cfg(any(feature = "full", feature = "derive"))]
1363pub fn visit_expr_box<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBox) {
1364 for it in &_i.attrs {
1365 _visitor.visit_attribute(it)
1366 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001367 tokens_helper(_visitor, &_i.box_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001368 _visitor.visit_expr(&*_i.expr);
1369}
1370#[cfg(feature = "full")]
1371#[cfg(any(feature = "full", feature = "derive"))]
1372pub fn visit_expr_break<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBreak) {
1373 for it in &_i.attrs {
1374 _visitor.visit_attribute(it)
1375 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001376 tokens_helper(_visitor, &_i.break_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001377 if let Some(ref it) = _i.label {
1378 _visitor.visit_lifetime(it)
1379 };
1380 if let Some(ref it) = _i.expr {
1381 _visitor.visit_expr(&**it)
1382 };
1383}
1384#[cfg(any(feature = "full", feature = "derive"))]
1385pub fn visit_expr_call<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprCall) {
1386 for it in &_i.attrs {
1387 _visitor.visit_attribute(it)
1388 }
1389 _visitor.visit_expr(&*_i.func);
David Tolnay7ac699c2018-08-24 14:00:58 -04001390 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001391 for el in Punctuated::pairs(&_i.args) {
1392 let it = el.value();
1393 _visitor.visit_expr(it)
1394 }
1395}
1396#[cfg(any(feature = "full", feature = "derive"))]
1397pub fn visit_expr_cast<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprCast) {
1398 for it in &_i.attrs {
1399 _visitor.visit_attribute(it)
1400 }
1401 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001402 tokens_helper(_visitor, &_i.as_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001403 _visitor.visit_type(&*_i.ty);
1404}
1405#[cfg(feature = "full")]
1406#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001407pub fn visit_expr_closure<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprClosure) {
1408 for it in &_i.attrs {
1409 _visitor.visit_attribute(it)
1410 }
Yusuke Sasaki4e5d9662018-07-21 02:49:47 +09001411 if let Some(ref it) = _i.asyncness {
1412 tokens_helper(_visitor, &it.span)
1413 };
David Tolnay8c81f622018-07-31 23:34:35 -07001414 if let Some(ref it) = _i.movability {
David Tolnay7ac699c2018-08-24 14:00:58 -04001415 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001416 };
1417 if let Some(ref it) = _i.capture {
David Tolnay7ac699c2018-08-24 14:00:58 -04001418 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001419 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001420 tokens_helper(_visitor, &_i.or1_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001421 for el in Punctuated::pairs(&_i.inputs) {
1422 let it = el.value();
1423 _visitor.visit_fn_arg(it)
1424 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001425 tokens_helper(_visitor, &_i.or2_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001426 _visitor.visit_return_type(&_i.output);
1427 _visitor.visit_expr(&*_i.body);
1428}
1429#[cfg(feature = "full")]
1430#[cfg(any(feature = "full", feature = "derive"))]
1431pub fn visit_expr_continue<'ast, V: Visit<'ast> + ?Sized>(
1432 _visitor: &mut V,
1433 _i: &'ast ExprContinue,
1434) {
1435 for it in &_i.attrs {
1436 _visitor.visit_attribute(it)
1437 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001438 tokens_helper(_visitor, &_i.continue_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001439 if let Some(ref it) = _i.label {
1440 _visitor.visit_lifetime(it)
1441 };
1442}
1443#[cfg(any(feature = "full", feature = "derive"))]
1444pub fn visit_expr_field<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprField) {
1445 for it in &_i.attrs {
1446 _visitor.visit_attribute(it)
1447 }
1448 _visitor.visit_expr(&*_i.base);
David Tolnay7ac699c2018-08-24 14:00:58 -04001449 tokens_helper(_visitor, &_i.dot_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001450 _visitor.visit_member(&_i.member);
1451}
1452#[cfg(feature = "full")]
1453#[cfg(any(feature = "full", feature = "derive"))]
1454pub fn visit_expr_for_loop<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprForLoop) {
1455 for it in &_i.attrs {
1456 _visitor.visit_attribute(it)
1457 }
1458 if let Some(ref it) = _i.label {
1459 _visitor.visit_label(it)
1460 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001461 tokens_helper(_visitor, &_i.for_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001462 _visitor.visit_pat(&*_i.pat);
David Tolnay7ac699c2018-08-24 14:00:58 -04001463 tokens_helper(_visitor, &_i.in_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001464 _visitor.visit_expr(&*_i.expr);
1465 _visitor.visit_block(&_i.body);
1466}
1467#[cfg(feature = "full")]
1468#[cfg(any(feature = "full", feature = "derive"))]
1469pub fn visit_expr_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprGroup) {
1470 for it in &_i.attrs {
1471 _visitor.visit_attribute(it)
1472 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001473 tokens_helper(_visitor, &_i.group_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001474 _visitor.visit_expr(&*_i.expr);
1475}
1476#[cfg(feature = "full")]
1477#[cfg(any(feature = "full", feature = "derive"))]
1478pub fn visit_expr_if<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprIf) {
1479 for it in &_i.attrs {
1480 _visitor.visit_attribute(it)
1481 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001482 tokens_helper(_visitor, &_i.if_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001483 _visitor.visit_expr(&*_i.cond);
1484 _visitor.visit_block(&_i.then_branch);
1485 if let Some(ref it) = _i.else_branch {
David Tolnay7ac699c2018-08-24 14:00:58 -04001486 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001487 _visitor.visit_expr(&*(it).1);
1488 };
1489}
1490#[cfg(feature = "full")]
1491#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001492pub fn visit_expr_in_place<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprInPlace) {
1493 for it in &_i.attrs {
1494 _visitor.visit_attribute(it)
1495 }
1496 _visitor.visit_expr(&*_i.place);
David Tolnay7ac699c2018-08-24 14:00:58 -04001497 tokens_helper(_visitor, &_i.arrow_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001498 _visitor.visit_expr(&*_i.value);
1499}
1500#[cfg(any(feature = "full", feature = "derive"))]
1501pub fn visit_expr_index<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprIndex) {
1502 for it in &_i.attrs {
1503 _visitor.visit_attribute(it)
1504 }
1505 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001506 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001507 _visitor.visit_expr(&*_i.index);
1508}
David Tolnay9c119122018-09-01 18:47:02 -07001509#[cfg(feature = "full")]
1510#[cfg(any(feature = "full", feature = "derive"))]
1511pub fn visit_expr_let<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprLet) {
1512 for it in &_i.attrs {
1513 _visitor.visit_attribute(it)
1514 }
1515 tokens_helper(_visitor, &_i.let_token.span);
1516 for el in Punctuated::pairs(&_i.pats) {
1517 let it = el.value();
1518 _visitor.visit_pat(it)
1519 }
1520 tokens_helper(_visitor, &_i.eq_token.spans);
1521 _visitor.visit_expr(&*_i.expr);
1522}
David Tolnay8c81f622018-07-31 23:34:35 -07001523#[cfg(any(feature = "full", feature = "derive"))]
1524pub fn visit_expr_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprLit) {
1525 for it in &_i.attrs {
1526 _visitor.visit_attribute(it)
1527 }
1528 _visitor.visit_lit(&_i.lit);
1529}
1530#[cfg(feature = "full")]
1531#[cfg(any(feature = "full", feature = "derive"))]
1532pub fn visit_expr_loop<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprLoop) {
1533 for it in &_i.attrs {
1534 _visitor.visit_attribute(it)
1535 }
1536 if let Some(ref it) = _i.label {
1537 _visitor.visit_label(it)
1538 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001539 tokens_helper(_visitor, &_i.loop_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001540 _visitor.visit_block(&_i.body);
1541}
1542#[cfg(feature = "full")]
1543#[cfg(any(feature = "full", feature = "derive"))]
1544pub fn visit_expr_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprMacro) {
1545 for it in &_i.attrs {
1546 _visitor.visit_attribute(it)
1547 }
1548 _visitor.visit_macro(&_i.mac);
1549}
1550#[cfg(feature = "full")]
1551#[cfg(any(feature = "full", feature = "derive"))]
1552pub fn visit_expr_match<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprMatch) {
1553 for it in &_i.attrs {
1554 _visitor.visit_attribute(it)
1555 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001556 tokens_helper(_visitor, &_i.match_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001557 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001558 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001559 for it in &_i.arms {
1560 _visitor.visit_arm(it)
1561 }
1562}
1563#[cfg(feature = "full")]
1564#[cfg(any(feature = "full", feature = "derive"))]
1565pub fn visit_expr_method_call<'ast, V: Visit<'ast> + ?Sized>(
1566 _visitor: &mut V,
1567 _i: &'ast ExprMethodCall,
1568) {
1569 for it in &_i.attrs {
1570 _visitor.visit_attribute(it)
1571 }
1572 _visitor.visit_expr(&*_i.receiver);
David Tolnay7ac699c2018-08-24 14:00:58 -04001573 tokens_helper(_visitor, &_i.dot_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001574 _visitor.visit_ident(&_i.method);
1575 if let Some(ref it) = _i.turbofish {
1576 _visitor.visit_method_turbofish(it)
1577 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001578 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001579 for el in Punctuated::pairs(&_i.args) {
1580 let it = el.value();
1581 _visitor.visit_expr(it)
1582 }
1583}
1584#[cfg(any(feature = "full", feature = "derive"))]
1585pub fn visit_expr_paren<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprParen) {
1586 for it in &_i.attrs {
1587 _visitor.visit_attribute(it)
1588 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001589 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001590 _visitor.visit_expr(&*_i.expr);
1591}
1592#[cfg(any(feature = "full", feature = "derive"))]
1593pub fn visit_expr_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprPath) {
1594 for it in &_i.attrs {
1595 _visitor.visit_attribute(it)
1596 }
1597 if let Some(ref it) = _i.qself {
1598 _visitor.visit_qself(it)
1599 };
1600 _visitor.visit_path(&_i.path);
1601}
1602#[cfg(feature = "full")]
1603#[cfg(any(feature = "full", feature = "derive"))]
1604pub fn visit_expr_range<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprRange) {
1605 for it in &_i.attrs {
1606 _visitor.visit_attribute(it)
1607 }
1608 if let Some(ref it) = _i.from {
1609 _visitor.visit_expr(&**it)
1610 };
1611 _visitor.visit_range_limits(&_i.limits);
1612 if let Some(ref it) = _i.to {
1613 _visitor.visit_expr(&**it)
1614 };
1615}
1616#[cfg(feature = "full")]
1617#[cfg(any(feature = "full", feature = "derive"))]
1618pub fn visit_expr_reference<'ast, V: Visit<'ast> + ?Sized>(
1619 _visitor: &mut V,
1620 _i: &'ast ExprReference,
1621) {
1622 for it in &_i.attrs {
1623 _visitor.visit_attribute(it)
1624 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001625 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001626 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04001627 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001628 };
1629 _visitor.visit_expr(&*_i.expr);
1630}
1631#[cfg(feature = "full")]
1632#[cfg(any(feature = "full", feature = "derive"))]
1633pub fn visit_expr_repeat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprRepeat) {
1634 for it in &_i.attrs {
1635 _visitor.visit_attribute(it)
1636 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001637 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001638 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001639 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001640 _visitor.visit_expr(&*_i.len);
1641}
1642#[cfg(feature = "full")]
1643#[cfg(any(feature = "full", feature = "derive"))]
1644pub fn visit_expr_return<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprReturn) {
1645 for it in &_i.attrs {
1646 _visitor.visit_attribute(it)
1647 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001648 tokens_helper(_visitor, &_i.return_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001649 if let Some(ref it) = _i.expr {
1650 _visitor.visit_expr(&**it)
1651 };
1652}
1653#[cfg(feature = "full")]
1654#[cfg(any(feature = "full", feature = "derive"))]
1655pub fn visit_expr_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprStruct) {
1656 for it in &_i.attrs {
1657 _visitor.visit_attribute(it)
1658 }
1659 _visitor.visit_path(&_i.path);
David Tolnay7ac699c2018-08-24 14:00:58 -04001660 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001661 for el in Punctuated::pairs(&_i.fields) {
1662 let it = el.value();
1663 _visitor.visit_field_value(it)
1664 }
1665 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001666 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001667 };
1668 if let Some(ref it) = _i.rest {
1669 _visitor.visit_expr(&**it)
1670 };
1671}
1672#[cfg(feature = "full")]
1673#[cfg(any(feature = "full", feature = "derive"))]
1674pub fn visit_expr_try<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprTry) {
1675 for it in &_i.attrs {
1676 _visitor.visit_attribute(it)
1677 }
1678 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001679 tokens_helper(_visitor, &_i.question_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001680}
1681#[cfg(feature = "full")]
1682#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayfb2dd4b2018-08-24 16:45:34 -04001683pub fn visit_expr_try_block<'ast, V: Visit<'ast> + ?Sized>(
1684 _visitor: &mut V,
1685 _i: &'ast ExprTryBlock,
1686) {
1687 for it in &_i.attrs {
1688 _visitor.visit_attribute(it)
1689 }
1690 tokens_helper(_visitor, &_i.try_token.span);
1691 _visitor.visit_block(&_i.block);
1692}
1693#[cfg(feature = "full")]
1694#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001695pub fn visit_expr_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprTuple) {
1696 for it in &_i.attrs {
1697 _visitor.visit_attribute(it)
1698 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001699 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001700 for el in Punctuated::pairs(&_i.elems) {
1701 let it = el.value();
1702 _visitor.visit_expr(it)
1703 }
1704}
1705#[cfg(feature = "full")]
1706#[cfg(any(feature = "full", feature = "derive"))]
1707pub fn visit_expr_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprType) {
1708 for it in &_i.attrs {
1709 _visitor.visit_attribute(it)
1710 }
1711 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001712 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001713 _visitor.visit_type(&*_i.ty);
1714}
1715#[cfg(any(feature = "full", feature = "derive"))]
1716pub fn visit_expr_unary<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprUnary) {
1717 for it in &_i.attrs {
1718 _visitor.visit_attribute(it)
1719 }
1720 _visitor.visit_un_op(&_i.op);
1721 _visitor.visit_expr(&*_i.expr);
1722}
1723#[cfg(feature = "full")]
1724#[cfg(any(feature = "full", feature = "derive"))]
1725pub fn visit_expr_unsafe<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprUnsafe) {
1726 for it in &_i.attrs {
1727 _visitor.visit_attribute(it)
1728 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001729 tokens_helper(_visitor, &_i.unsafe_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001730 _visitor.visit_block(&_i.block);
1731}
1732#[cfg(any(feature = "full", feature = "derive"))]
1733pub fn visit_expr_verbatim<'ast, V: Visit<'ast> + ?Sized>(
1734 _visitor: &mut V,
1735 _i: &'ast ExprVerbatim,
1736) {
David Tolnay6af48992018-08-01 11:16:28 -07001737 skip!(_i.tts);
David Tolnay8c81f622018-07-31 23:34:35 -07001738}
1739#[cfg(feature = "full")]
1740#[cfg(any(feature = "full", feature = "derive"))]
1741pub fn visit_expr_while<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprWhile) {
1742 for it in &_i.attrs {
1743 _visitor.visit_attribute(it)
1744 }
1745 if let Some(ref it) = _i.label {
1746 _visitor.visit_label(it)
1747 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001748 tokens_helper(_visitor, &_i.while_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001749 _visitor.visit_expr(&*_i.cond);
1750 _visitor.visit_block(&_i.body);
1751}
1752#[cfg(feature = "full")]
1753#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001754pub fn visit_expr_yield<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprYield) {
1755 for it in &_i.attrs {
1756 _visitor.visit_attribute(it)
1757 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001758 tokens_helper(_visitor, &_i.yield_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001759 if let Some(ref it) = _i.expr {
1760 _visitor.visit_expr(&**it)
1761 };
1762}
1763#[cfg(any(feature = "full", feature = "derive"))]
1764pub fn visit_field<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Field) {
1765 for it in &_i.attrs {
1766 _visitor.visit_attribute(it)
1767 }
1768 _visitor.visit_visibility(&_i.vis);
1769 if let Some(ref it) = _i.ident {
1770 _visitor.visit_ident(it)
1771 };
1772 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001773 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001774 };
1775 _visitor.visit_type(&_i.ty);
1776}
1777#[cfg(any(feature = "full", feature = "derive"))]
1778#[cfg(feature = "full")]
1779pub fn visit_field_pat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldPat) {
1780 for it in &_i.attrs {
1781 _visitor.visit_attribute(it)
1782 }
1783 _visitor.visit_member(&_i.member);
1784 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001785 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001786 };
1787 _visitor.visit_pat(&*_i.pat);
1788}
1789#[cfg(any(feature = "full", feature = "derive"))]
1790#[cfg(feature = "full")]
1791pub fn visit_field_value<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldValue) {
1792 for it in &_i.attrs {
1793 _visitor.visit_attribute(it)
1794 }
1795 _visitor.visit_member(&_i.member);
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_expr(&_i.expr);
1800}
1801#[cfg(any(feature = "full", feature = "derive"))]
1802pub fn visit_fields<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Fields) {
1803 match *_i {
1804 Fields::Named(ref _binding_0) => {
1805 _visitor.visit_fields_named(_binding_0);
1806 }
1807 Fields::Unnamed(ref _binding_0) => {
1808 _visitor.visit_fields_unnamed(_binding_0);
1809 }
1810 Fields::Unit => {}
1811 }
1812}
1813#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001814pub fn visit_fields_named<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldsNamed) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001815 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001816 for el in Punctuated::pairs(&_i.named) {
1817 let it = el.value();
1818 _visitor.visit_field(it)
1819 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001820}
David Tolnay8c81f622018-07-31 23:34:35 -07001821#[cfg(any(feature = "full", feature = "derive"))]
1822pub fn visit_fields_unnamed<'ast, V: Visit<'ast> + ?Sized>(
1823 _visitor: &mut V,
1824 _i: &'ast FieldsUnnamed,
1825) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001826 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001827 for el in Punctuated::pairs(&_i.unnamed) {
1828 let it = el.value();
1829 _visitor.visit_field(it)
1830 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001831}
David Tolnay8c81f622018-07-31 23:34:35 -07001832#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001833pub fn visit_file<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast File) {
David Tolnay6af48992018-08-01 11:16:28 -07001834 skip!(_i.shebang);
David Tolnay8c81f622018-07-31 23:34:35 -07001835 for it in &_i.attrs {
1836 _visitor.visit_attribute(it)
1837 }
1838 for it in &_i.items {
1839 _visitor.visit_item(it)
1840 }
Nika Layzell27726662017-10-24 23:16:35 -04001841}
David Tolnay8c81f622018-07-31 23:34:35 -07001842#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001843pub fn visit_fn_arg<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FnArg) {
Nika Layzell27726662017-10-24 23:16:35 -04001844 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001845 FnArg::SelfRef(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001846 _visitor.visit_arg_self_ref(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001847 }
David Tolnay8c81f622018-07-31 23:34:35 -07001848 FnArg::SelfValue(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001849 _visitor.visit_arg_self(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001850 }
David Tolnay8c81f622018-07-31 23:34:35 -07001851 FnArg::Captured(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001852 _visitor.visit_arg_captured(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001853 }
David Tolnay8c81f622018-07-31 23:34:35 -07001854 FnArg::Inferred(ref _binding_0) => {
David Tolnay80ed55f2017-12-27 22:54:40 -05001855 _visitor.visit_pat(_binding_0);
1856 }
David Tolnay8c81f622018-07-31 23:34:35 -07001857 FnArg::Ignored(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001858 _visitor.visit_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001859 }
1860 }
1861}
David Tolnay8c81f622018-07-31 23:34:35 -07001862#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001863pub fn visit_fn_decl<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FnDecl) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001864 tokens_helper(_visitor, &_i.fn_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001865 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04001866 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001867 for el in Punctuated::pairs(&_i.inputs) {
1868 let it = el.value();
1869 _visitor.visit_fn_arg(it)
1870 }
1871 if let Some(ref it) = _i.variadic {
David Tolnay7ac699c2018-08-24 14:00:58 -04001872 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001873 };
1874 _visitor.visit_return_type(&_i.output);
Nika Layzell27726662017-10-24 23:16:35 -04001875}
David Tolnay8c81f622018-07-31 23:34:35 -07001876#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001877pub fn visit_foreign_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ForeignItem) {
Nika Layzell27726662017-10-24 23:16:35 -04001878 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001879 ForeignItem::Fn(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001880 _visitor.visit_foreign_item_fn(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001881 }
David Tolnay8c81f622018-07-31 23:34:35 -07001882 ForeignItem::Static(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001883 _visitor.visit_foreign_item_static(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001884 }
David Tolnay8c81f622018-07-31 23:34:35 -07001885 ForeignItem::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001886 _visitor.visit_foreign_item_type(_binding_0);
David Tolnay199bcbb2017-11-12 10:33:52 -08001887 }
David Tolnay435c1782018-08-24 16:15:44 -04001888 ForeignItem::Macro(ref _binding_0) => {
1889 _visitor.visit_foreign_item_macro(_binding_0);
1890 }
David Tolnay8c81f622018-07-31 23:34:35 -07001891 ForeignItem::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05001892 _visitor.visit_foreign_item_verbatim(_binding_0);
1893 }
Nika Layzell27726662017-10-24 23:16:35 -04001894 }
1895}
David Tolnay8c81f622018-07-31 23:34:35 -07001896#[cfg(feature = "full")]
1897pub fn visit_foreign_item_fn<'ast, V: Visit<'ast> + ?Sized>(
1898 _visitor: &mut V,
1899 _i: &'ast ForeignItemFn,
1900) {
1901 for it in &_i.attrs {
1902 _visitor.visit_attribute(it)
1903 }
1904 _visitor.visit_visibility(&_i.vis);
1905 _visitor.visit_ident(&_i.ident);
1906 _visitor.visit_fn_decl(&*_i.decl);
David Tolnay7ac699c2018-08-24 14:00:58 -04001907 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay8894f602017-11-11 12:11:04 -08001908}
David Tolnay8c81f622018-07-31 23:34:35 -07001909#[cfg(feature = "full")]
David Tolnay435c1782018-08-24 16:15:44 -04001910pub fn visit_foreign_item_macro<'ast, V: Visit<'ast> + ?Sized>(
1911 _visitor: &mut V,
1912 _i: &'ast ForeignItemMacro,
1913) {
1914 for it in &_i.attrs {
1915 _visitor.visit_attribute(it)
1916 }
1917 _visitor.visit_macro(&_i.mac);
1918 if let Some(ref it) = _i.semi_token {
1919 tokens_helper(_visitor, &it.spans)
1920 };
1921}
1922#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001923pub fn visit_foreign_item_static<'ast, V: Visit<'ast> + ?Sized>(
1924 _visitor: &mut V,
1925 _i: &'ast ForeignItemStatic,
1926) {
1927 for it in &_i.attrs {
1928 _visitor.visit_attribute(it)
1929 }
1930 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04001931 tokens_helper(_visitor, &_i.static_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001932 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04001933 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001934 };
1935 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001936 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001937 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04001938 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001939}
David Tolnay8c81f622018-07-31 23:34:35 -07001940#[cfg(feature = "full")]
1941pub fn visit_foreign_item_type<'ast, V: Visit<'ast> + ?Sized>(
1942 _visitor: &mut V,
1943 _i: &'ast ForeignItemType,
1944) {
1945 for it in &_i.attrs {
1946 _visitor.visit_attribute(it)
1947 }
1948 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04001949 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001950 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001951 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay199bcbb2017-11-12 10:33:52 -08001952}
David Tolnay8c81f622018-07-31 23:34:35 -07001953#[cfg(feature = "full")]
1954pub fn visit_foreign_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
1955 _visitor: &mut V,
1956 _i: &'ast ForeignItemVerbatim,
1957) {
David Tolnay6af48992018-08-01 11:16:28 -07001958 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05001959}
David Tolnay8c81f622018-07-31 23:34:35 -07001960#[cfg(any(feature = "full", feature = "derive"))]
1961pub fn visit_generic_argument<'ast, V: Visit<'ast> + ?Sized>(
1962 _visitor: &mut V,
1963 _i: &'ast GenericArgument,
1964) {
Nika Layzell357885a2017-12-04 15:47:07 -05001965 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001966 GenericArgument::Lifetime(ref _binding_0) => {
David Tolnay4ba63a02017-12-28 15:53:05 -05001967 _visitor.visit_lifetime(_binding_0);
Nika Layzell357885a2017-12-04 15:47:07 -05001968 }
David Tolnay8c81f622018-07-31 23:34:35 -07001969 GenericArgument::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001970 _visitor.visit_type(_binding_0);
Nika Layzell357885a2017-12-04 15:47:07 -05001971 }
David Tolnay8c81f622018-07-31 23:34:35 -07001972 GenericArgument::Binding(ref _binding_0) => {
David Tolnay506e43a2017-12-29 11:34:36 -05001973 _visitor.visit_binding(_binding_0);
Nika Layzell357885a2017-12-04 15:47:07 -05001974 }
David Tolnay9d0882a2018-09-01 19:49:14 -07001975 GenericArgument::Constraint(ref _binding_0) => {
1976 _visitor.visit_constraint(_binding_0);
1977 }
David Tolnay8c81f622018-07-31 23:34:35 -07001978 GenericArgument::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001979 _visitor.visit_expr(_binding_0);
Nika Layzellc680e612017-12-04 19:07:20 -05001980 }
Nika Layzell357885a2017-12-04 15:47:07 -05001981 }
1982}
David Tolnay8c81f622018-07-31 23:34:35 -07001983#[cfg(any(feature = "full", feature = "derive"))]
1984#[cfg(feature = "full")]
1985pub fn visit_generic_method_argument<'ast, V: Visit<'ast> + ?Sized>(
1986 _visitor: &mut V,
1987 _i: &'ast GenericMethodArgument,
1988) {
David Tolnayd60cfec2017-12-29 00:21:38 -05001989 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001990 GenericMethodArgument::Type(ref _binding_0) => {
David Tolnayd60cfec2017-12-29 00:21:38 -05001991 _visitor.visit_type(_binding_0);
1992 }
David Tolnay8c81f622018-07-31 23:34:35 -07001993 GenericMethodArgument::Const(ref _binding_0) => {
David Tolnayd60cfec2017-12-29 00:21:38 -05001994 _visitor.visit_expr(_binding_0);
1995 }
1996 }
1997}
David Tolnay8c81f622018-07-31 23:34:35 -07001998#[cfg(any(feature = "full", feature = "derive"))]
1999pub fn visit_generic_param<'ast, V: Visit<'ast> + ?Sized>(
2000 _visitor: &mut V,
2001 _i: &'ast GenericParam,
2002) {
David Tolnayc2f1aba2017-11-12 20:29:22 -08002003 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002004 GenericParam::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002005 _visitor.visit_type_param(_binding_0);
David Tolnayc2f1aba2017-11-12 20:29:22 -08002006 }
David Tolnay8c81f622018-07-31 23:34:35 -07002007 GenericParam::Lifetime(ref _binding_0) => {
David Tolnay517f3692018-01-01 20:17:23 -08002008 _visitor.visit_lifetime_def(_binding_0);
2009 }
David Tolnay8c81f622018-07-31 23:34:35 -07002010 GenericParam::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002011 _visitor.visit_const_param(_binding_0);
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05002012 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08002013 }
2014}
David Tolnay8c81f622018-07-31 23:34:35 -07002015#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002016pub fn visit_generics<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Generics) {
David Tolnay8c81f622018-07-31 23:34:35 -07002017 if let Some(ref it) = _i.lt_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002018 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002019 };
2020 for el in Punctuated::pairs(&_i.params) {
2021 let it = el.value();
2022 _visitor.visit_generic_param(it)
2023 }
2024 if let Some(ref it) = _i.gt_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002025 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002026 };
2027 if let Some(ref it) = _i.where_clause {
2028 _visitor.visit_where_clause(it)
2029 };
Nika Layzell27726662017-10-24 23:16:35 -04002030}
David Tolnay8c81f622018-07-31 23:34:35 -07002031pub fn visit_ident<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Ident) {}
2032#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002033pub fn visit_impl_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ImplItem) {
Nika Layzell27726662017-10-24 23:16:35 -04002034 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002035 ImplItem::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002036 _visitor.visit_impl_item_const(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002037 }
David Tolnay8c81f622018-07-31 23:34:35 -07002038 ImplItem::Method(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002039 _visitor.visit_impl_item_method(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002040 }
David Tolnay8c81f622018-07-31 23:34:35 -07002041 ImplItem::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002042 _visitor.visit_impl_item_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002043 }
David Tolnaybb82ef02018-08-24 20:15:45 -04002044 ImplItem::Existential(ref _binding_0) => {
2045 _visitor.visit_impl_item_existential(_binding_0);
2046 }
David Tolnay8c81f622018-07-31 23:34:35 -07002047 ImplItem::Macro(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002048 _visitor.visit_impl_item_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002049 }
David Tolnay8c81f622018-07-31 23:34:35 -07002050 ImplItem::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002051 _visitor.visit_impl_item_verbatim(_binding_0);
2052 }
Nika Layzell27726662017-10-24 23:16:35 -04002053 }
2054}
David Tolnay8c81f622018-07-31 23:34:35 -07002055#[cfg(feature = "full")]
2056pub fn visit_impl_item_const<'ast, V: Visit<'ast> + ?Sized>(
2057 _visitor: &mut V,
2058 _i: &'ast ImplItemConst,
2059) {
2060 for it in &_i.attrs {
2061 _visitor.visit_attribute(it)
2062 }
2063 _visitor.visit_visibility(&_i.vis);
2064 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002065 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002066 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002067 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002068 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002069 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002070 _visitor.visit_type(&_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002071 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002072 _visitor.visit_expr(&_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04002073 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay857628c2017-11-11 12:25:31 -08002074}
David Tolnay8c81f622018-07-31 23:34:35 -07002075#[cfg(feature = "full")]
David Tolnaybb82ef02018-08-24 20:15:45 -04002076pub fn visit_impl_item_existential<'ast, V: Visit<'ast> + ?Sized>(
2077 _visitor: &mut V,
2078 _i: &'ast ImplItemExistential,
2079) {
2080 for it in &_i.attrs {
2081 _visitor.visit_attribute(it)
2082 }
2083 tokens_helper(_visitor, &_i.existential_token.span);
2084 tokens_helper(_visitor, &_i.type_token.span);
2085 _visitor.visit_ident(&_i.ident);
2086 _visitor.visit_generics(&_i.generics);
2087 if let Some(ref it) = _i.colon_token {
2088 tokens_helper(_visitor, &it.spans)
2089 };
2090 for el in Punctuated::pairs(&_i.bounds) {
2091 let it = el.value();
2092 _visitor.visit_type_param_bound(it)
2093 }
2094 tokens_helper(_visitor, &_i.semi_token.spans);
2095}
2096#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07002097pub fn visit_impl_item_macro<'ast, V: Visit<'ast> + ?Sized>(
2098 _visitor: &mut V,
2099 _i: &'ast ImplItemMacro,
2100) {
2101 for it in &_i.attrs {
2102 _visitor.visit_attribute(it)
2103 }
2104 _visitor.visit_macro(&_i.mac);
2105 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002106 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002107 };
David Tolnay857628c2017-11-11 12:25:31 -08002108}
David Tolnay8c81f622018-07-31 23:34:35 -07002109#[cfg(feature = "full")]
2110pub fn visit_impl_item_method<'ast, V: Visit<'ast> + ?Sized>(
2111 _visitor: &mut V,
2112 _i: &'ast ImplItemMethod,
2113) {
2114 for it in &_i.attrs {
2115 _visitor.visit_attribute(it)
2116 }
2117 _visitor.visit_visibility(&_i.vis);
2118 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002119 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002120 };
2121 _visitor.visit_method_sig(&_i.sig);
2122 _visitor.visit_block(&_i.block);
Nika Layzell27726662017-10-24 23:16:35 -04002123}
David Tolnay8c81f622018-07-31 23:34:35 -07002124#[cfg(feature = "full")]
2125pub fn visit_impl_item_type<'ast, V: Visit<'ast> + ?Sized>(
2126 _visitor: &mut V,
2127 _i: &'ast ImplItemType,
2128) {
2129 for it in &_i.attrs {
2130 _visitor.visit_attribute(it)
2131 }
2132 _visitor.visit_visibility(&_i.vis);
2133 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002134 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002135 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002136 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002137 _visitor.visit_ident(&_i.ident);
2138 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04002139 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002140 _visitor.visit_type(&_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002141 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002142}
David Tolnay8c81f622018-07-31 23:34:35 -07002143#[cfg(feature = "full")]
2144pub fn visit_impl_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
2145 _visitor: &mut V,
2146 _i: &'ast ImplItemVerbatim,
2147) {
David Tolnay6af48992018-08-01 11:16:28 -07002148 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05002149}
David Tolnay8c81f622018-07-31 23:34:35 -07002150#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002151pub fn visit_index<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Index) {
David Tolnay6af48992018-08-01 11:16:28 -07002152 skip!(_i.index);
David Tolnay8c81f622018-07-31 23:34:35 -07002153 _visitor.visit_span(&_i.span);
David Tolnay85b69a42017-12-27 20:43:10 -05002154}
David Tolnay8c81f622018-07-31 23:34:35 -07002155#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002156pub fn visit_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Item) {
Nika Layzell27726662017-10-24 23:16:35 -04002157 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002158 Item::ExternCrate(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002159 _visitor.visit_item_extern_crate(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002160 }
David Tolnay8c81f622018-07-31 23:34:35 -07002161 Item::Use(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002162 _visitor.visit_item_use(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002163 }
David Tolnay8c81f622018-07-31 23:34:35 -07002164 Item::Static(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002165 _visitor.visit_item_static(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002166 }
David Tolnay8c81f622018-07-31 23:34:35 -07002167 Item::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002168 _visitor.visit_item_const(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002169 }
David Tolnay8c81f622018-07-31 23:34:35 -07002170 Item::Fn(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002171 _visitor.visit_item_fn(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002172 }
David Tolnay8c81f622018-07-31 23:34:35 -07002173 Item::Mod(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002174 _visitor.visit_item_mod(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002175 }
David Tolnay8c81f622018-07-31 23:34:35 -07002176 Item::ForeignMod(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002177 _visitor.visit_item_foreign_mod(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002178 }
David Tolnay8c81f622018-07-31 23:34:35 -07002179 Item::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002180 _visitor.visit_item_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002181 }
David Tolnaybb82ef02018-08-24 20:15:45 -04002182 Item::Existential(ref _binding_0) => {
2183 _visitor.visit_item_existential(_binding_0);
2184 }
David Tolnay8c81f622018-07-31 23:34:35 -07002185 Item::Struct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002186 _visitor.visit_item_struct(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002187 }
David Tolnay8c81f622018-07-31 23:34:35 -07002188 Item::Enum(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05002189 _visitor.visit_item_enum(_binding_0);
2190 }
David Tolnay8c81f622018-07-31 23:34:35 -07002191 Item::Union(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002192 _visitor.visit_item_union(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002193 }
David Tolnay8c81f622018-07-31 23:34:35 -07002194 Item::Trait(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002195 _visitor.visit_item_trait(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002196 }
David Tolnayc6b04dd2018-08-30 23:22:51 -07002197 Item::TraitAlias(ref _binding_0) => {
2198 _visitor.visit_item_trait_alias(_binding_0);
2199 }
David Tolnay8c81f622018-07-31 23:34:35 -07002200 Item::Impl(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002201 _visitor.visit_item_impl(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002202 }
David Tolnay8c81f622018-07-31 23:34:35 -07002203 Item::Macro(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002204 _visitor.visit_item_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002205 }
David Tolnay8c81f622018-07-31 23:34:35 -07002206 Item::Macro2(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002207 _visitor.visit_item_macro2(_binding_0);
David Tolnay500d8322017-12-18 00:32:51 -08002208 }
David Tolnay8c81f622018-07-31 23:34:35 -07002209 Item::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002210 _visitor.visit_item_verbatim(_binding_0);
2211 }
Nika Layzell27726662017-10-24 23:16:35 -04002212 }
2213}
David Tolnay8c81f622018-07-31 23:34:35 -07002214#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002215pub fn visit_item_const<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemConst) {
David Tolnay8c81f622018-07-31 23:34:35 -07002216 for it in &_i.attrs {
2217 _visitor.visit_attribute(it)
2218 }
2219 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002220 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002221 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002222 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002223 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002224 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002225 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04002226 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnayc6b55bc2017-11-09 22:48:38 -08002227}
David Tolnay8c81f622018-07-31 23:34:35 -07002228#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002229pub fn visit_item_enum<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemEnum) {
David Tolnay8c81f622018-07-31 23:34:35 -07002230 for it in &_i.attrs {
2231 _visitor.visit_attribute(it)
2232 }
2233 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002234 tokens_helper(_visitor, &_i.enum_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002235 _visitor.visit_ident(&_i.ident);
2236 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04002237 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002238 for el in Punctuated::pairs(&_i.variants) {
2239 let it = el.value();
2240 _visitor.visit_variant(it)
2241 }
David Tolnayc6b55bc2017-11-09 22:48:38 -08002242}
David Tolnay8c81f622018-07-31 23:34:35 -07002243#[cfg(feature = "full")]
David Tolnaybb82ef02018-08-24 20:15:45 -04002244pub fn visit_item_existential<'ast, V: Visit<'ast> + ?Sized>(
2245 _visitor: &mut V,
2246 _i: &'ast ItemExistential,
2247) {
2248 for it in &_i.attrs {
2249 _visitor.visit_attribute(it)
2250 }
2251 _visitor.visit_visibility(&_i.vis);
2252 tokens_helper(_visitor, &_i.existential_token.span);
2253 tokens_helper(_visitor, &_i.type_token.span);
2254 _visitor.visit_ident(&_i.ident);
2255 _visitor.visit_generics(&_i.generics);
2256 if let Some(ref it) = _i.colon_token {
2257 tokens_helper(_visitor, &it.spans)
2258 };
2259 for el in Punctuated::pairs(&_i.bounds) {
2260 let it = el.value();
2261 _visitor.visit_type_param_bound(it)
2262 }
2263 tokens_helper(_visitor, &_i.semi_token.spans);
2264}
2265#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07002266pub fn visit_item_extern_crate<'ast, V: Visit<'ast> + ?Sized>(
2267 _visitor: &mut V,
2268 _i: &'ast ItemExternCrate,
2269) {
2270 for it in &_i.attrs {
2271 _visitor.visit_attribute(it)
2272 }
2273 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002274 tokens_helper(_visitor, &_i.extern_token.span);
2275 tokens_helper(_visitor, &_i.crate_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002276 _visitor.visit_ident(&_i.ident);
2277 if let Some(ref it) = _i.rename {
David Tolnay7ac699c2018-08-24 14:00:58 -04002278 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002279 _visitor.visit_ident(&(it).1);
2280 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002281 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnayc6b55bc2017-11-09 22:48:38 -08002282}
David Tolnay8c81f622018-07-31 23:34:35 -07002283#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002284pub fn visit_item_fn<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemFn) {
David Tolnay8c81f622018-07-31 23:34:35 -07002285 for it in &_i.attrs {
2286 _visitor.visit_attribute(it)
2287 }
2288 _visitor.visit_visibility(&_i.vis);
2289 if let Some(ref it) = _i.constness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002290 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002291 };
2292 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002293 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002294 };
Yusuke Sasakif00a3ef2018-07-20 22:08:42 +09002295 if let Some(ref it) = _i.asyncness {
2296 tokens_helper(_visitor, &it.span)
2297 };
David Tolnay8c81f622018-07-31 23:34:35 -07002298 if let Some(ref it) = _i.abi {
2299 _visitor.visit_abi(it)
2300 };
2301 _visitor.visit_ident(&_i.ident);
2302 _visitor.visit_fn_decl(&*_i.decl);
2303 _visitor.visit_block(&*_i.block);
David Tolnayc6b55bc2017-11-09 22:48:38 -08002304}
David Tolnay8c81f622018-07-31 23:34:35 -07002305#[cfg(feature = "full")]
2306pub fn visit_item_foreign_mod<'ast, V: Visit<'ast> + ?Sized>(
2307 _visitor: &mut V,
2308 _i: &'ast ItemForeignMod,
2309) {
2310 for it in &_i.attrs {
2311 _visitor.visit_attribute(it)
2312 }
2313 _visitor.visit_abi(&_i.abi);
David Tolnay7ac699c2018-08-24 14:00:58 -04002314 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002315 for it in &_i.items {
2316 _visitor.visit_foreign_item(it)
2317 }
David Tolnayc6b55bc2017-11-09 22:48:38 -08002318}
David Tolnay8c81f622018-07-31 23:34:35 -07002319#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002320pub fn visit_item_impl<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemImpl) {
David Tolnay8c81f622018-07-31 23:34:35 -07002321 for it in &_i.attrs {
2322 _visitor.visit_attribute(it)
2323 }
2324 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002325 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002326 };
2327 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002328 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002329 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002330 tokens_helper(_visitor, &_i.impl_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002331 _visitor.visit_generics(&_i.generics);
2332 if let Some(ref it) = _i.trait_ {
2333 if let Some(ref it) = (it).0 {
David Tolnay7ac699c2018-08-24 14:00:58 -04002334 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002335 };
2336 _visitor.visit_path(&(it).1);
David Tolnay7ac699c2018-08-24 14:00:58 -04002337 tokens_helper(_visitor, &(it).2.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002338 };
2339 _visitor.visit_type(&*_i.self_ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002340 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002341 for it in &_i.items {
2342 _visitor.visit_impl_item(it)
2343 }
David Tolnayc6b55bc2017-11-09 22:48:38 -08002344}
David Tolnay8c81f622018-07-31 23:34:35 -07002345#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002346pub fn visit_item_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemMacro) {
David Tolnay8c81f622018-07-31 23:34:35 -07002347 for it in &_i.attrs {
2348 _visitor.visit_attribute(it)
2349 }
2350 if let Some(ref it) = _i.ident {
2351 _visitor.visit_ident(it)
2352 };
2353 _visitor.visit_macro(&_i.mac);
2354 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002355 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002356 };
David Tolnayc6b55bc2017-11-09 22:48:38 -08002357}
David Tolnay8c81f622018-07-31 23:34:35 -07002358#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002359pub fn visit_item_macro2<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemMacro2) {
David Tolnay8c81f622018-07-31 23:34:35 -07002360 for it in &_i.attrs {
2361 _visitor.visit_attribute(it)
2362 }
2363 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002364 tokens_helper(_visitor, &_i.macro_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002365 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002366 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay6af48992018-08-01 11:16:28 -07002367 skip!(_i.args);
David Tolnay7ac699c2018-08-24 14:00:58 -04002368 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay6af48992018-08-01 11:16:28 -07002369 skip!(_i.body);
David Tolnay500d8322017-12-18 00:32:51 -08002370}
David Tolnay8c81f622018-07-31 23:34:35 -07002371#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002372pub fn visit_item_mod<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemMod) {
David Tolnay8c81f622018-07-31 23:34:35 -07002373 for it in &_i.attrs {
2374 _visitor.visit_attribute(it)
2375 }
2376 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002377 tokens_helper(_visitor, &_i.mod_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002378 _visitor.visit_ident(&_i.ident);
2379 if let Some(ref it) = _i.content {
David Tolnay7ac699c2018-08-24 14:00:58 -04002380 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002381 for it in &(it).1 {
2382 _visitor.visit_item(it)
2383 }
2384 };
2385 if let Some(ref it) = _i.semi {
David Tolnay7ac699c2018-08-24 14:00:58 -04002386 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002387 };
Nika Layzell27726662017-10-24 23:16:35 -04002388}
David Tolnay8c81f622018-07-31 23:34:35 -07002389#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002390pub fn visit_item_static<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemStatic) {
David Tolnay8c81f622018-07-31 23:34:35 -07002391 for it in &_i.attrs {
2392 _visitor.visit_attribute(it)
2393 }
2394 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002395 tokens_helper(_visitor, &_i.static_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002396 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04002397 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002398 };
2399 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002400 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002401 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002402 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002403 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04002404 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002405}
David Tolnay8c81f622018-07-31 23:34:35 -07002406#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002407pub fn visit_item_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemStruct) {
David Tolnay8c81f622018-07-31 23:34:35 -07002408 for it in &_i.attrs {
2409 _visitor.visit_attribute(it)
2410 }
2411 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002412 tokens_helper(_visitor, &_i.struct_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002413 _visitor.visit_ident(&_i.ident);
2414 _visitor.visit_generics(&_i.generics);
2415 _visitor.visit_fields(&_i.fields);
2416 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002417 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002418 };
Nika Layzell27726662017-10-24 23:16:35 -04002419}
David Tolnay8c81f622018-07-31 23:34:35 -07002420#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002421pub fn visit_item_trait<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemTrait) {
David Tolnay8c81f622018-07-31 23:34:35 -07002422 for it in &_i.attrs {
2423 _visitor.visit_attribute(it)
2424 }
2425 _visitor.visit_visibility(&_i.vis);
2426 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002427 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002428 };
2429 if let Some(ref it) = _i.auto_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002430 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002431 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002432 tokens_helper(_visitor, &_i.trait_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002433 _visitor.visit_ident(&_i.ident);
2434 _visitor.visit_generics(&_i.generics);
2435 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002436 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002437 };
2438 for el in Punctuated::pairs(&_i.supertraits) {
2439 let it = el.value();
2440 _visitor.visit_type_param_bound(it)
2441 }
David Tolnay7ac699c2018-08-24 14:00:58 -04002442 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002443 for it in &_i.items {
2444 _visitor.visit_trait_item(it)
2445 }
Nika Layzell27726662017-10-24 23:16:35 -04002446}
David Tolnay8c81f622018-07-31 23:34:35 -07002447#[cfg(feature = "full")]
David Tolnayc6b04dd2018-08-30 23:22:51 -07002448pub fn visit_item_trait_alias<'ast, V: Visit<'ast> + ?Sized>(
2449 _visitor: &mut V,
2450 _i: &'ast ItemTraitAlias,
2451) {
2452 for it in &_i.attrs {
2453 _visitor.visit_attribute(it)
2454 }
2455 _visitor.visit_visibility(&_i.vis);
2456 tokens_helper(_visitor, &_i.trait_token.span);
2457 _visitor.visit_ident(&_i.ident);
2458 _visitor.visit_generics(&_i.generics);
2459 tokens_helper(_visitor, &_i.eq_token.spans);
2460 for el in Punctuated::pairs(&_i.bounds) {
2461 let it = el.value();
2462 _visitor.visit_type_param_bound(it)
2463 }
2464 tokens_helper(_visitor, &_i.semi_token.spans);
2465}
2466#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002467pub fn visit_item_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemType) {
David Tolnay8c81f622018-07-31 23:34:35 -07002468 for it in &_i.attrs {
2469 _visitor.visit_attribute(it)
2470 }
2471 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002472 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002473 _visitor.visit_ident(&_i.ident);
2474 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04002475 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002476 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002477 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002478}
David Tolnay8c81f622018-07-31 23:34:35 -07002479#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002480pub fn visit_item_union<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemUnion) {
David Tolnay8c81f622018-07-31 23:34:35 -07002481 for it in &_i.attrs {
2482 _visitor.visit_attribute(it)
2483 }
2484 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002485 tokens_helper(_visitor, &_i.union_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002486 _visitor.visit_ident(&_i.ident);
2487 _visitor.visit_generics(&_i.generics);
2488 _visitor.visit_fields_named(&_i.fields);
Nika Layzell27726662017-10-24 23:16:35 -04002489}
David Tolnay8c81f622018-07-31 23:34:35 -07002490#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002491pub fn visit_item_use<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemUse) {
David Tolnay8c81f622018-07-31 23:34:35 -07002492 for it in &_i.attrs {
2493 _visitor.visit_attribute(it)
2494 }
2495 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002496 tokens_helper(_visitor, &_i.use_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002497 if let Some(ref it) = _i.leading_colon {
David Tolnay7ac699c2018-08-24 14:00:58 -04002498 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002499 };
2500 _visitor.visit_use_tree(&_i.tree);
David Tolnay7ac699c2018-08-24 14:00:58 -04002501 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002502}
David Tolnay8c81f622018-07-31 23:34:35 -07002503#[cfg(feature = "full")]
2504pub fn visit_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
2505 _visitor: &mut V,
2506 _i: &'ast ItemVerbatim,
2507) {
David Tolnay6af48992018-08-01 11:16:28 -07002508 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05002509}
David Tolnay8c81f622018-07-31 23:34:35 -07002510#[cfg(any(feature = "full", feature = "derive"))]
2511#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002512pub fn visit_label<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Label) {
David Tolnay8c81f622018-07-31 23:34:35 -07002513 _visitor.visit_lifetime(&_i.name);
David Tolnay7ac699c2018-08-24 14:00:58 -04002514 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnaybcd498f2017-12-29 12:02:33 -05002515}
David Tolnay4b4c4b62018-01-06 13:48:05 -08002516pub fn visit_lifetime<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Lifetime) {
David Tolnay17f63892018-08-31 10:36:32 -07002517 _visitor.visit_span(&_i.apostrophe);
David Tolnay8c81f622018-07-31 23:34:35 -07002518 _visitor.visit_ident(&_i.ident);
David Tolnay4ba63a02017-12-28 15:53:05 -05002519}
David Tolnay8c81f622018-07-31 23:34:35 -07002520#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002521pub fn visit_lifetime_def<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LifetimeDef) {
David Tolnay8c81f622018-07-31 23:34:35 -07002522 for it in &_i.attrs {
2523 _visitor.visit_attribute(it)
2524 }
2525 _visitor.visit_lifetime(&_i.lifetime);
2526 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002527 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002528 };
2529 for el in Punctuated::pairs(&_i.bounds) {
2530 let it = el.value();
2531 _visitor.visit_lifetime(it)
2532 }
David Tolnay4ba63a02017-12-28 15:53:05 -05002533}
David Tolnay8c81f622018-07-31 23:34:35 -07002534#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002535pub fn visit_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Lit) {
David Tolnay360efd22018-01-04 23:35:26 -08002536 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002537 Lit::Str(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002538 _visitor.visit_lit_str(_binding_0);
2539 }
David Tolnay8c81f622018-07-31 23:34:35 -07002540 Lit::ByteStr(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002541 _visitor.visit_lit_byte_str(_binding_0);
2542 }
David Tolnay8c81f622018-07-31 23:34:35 -07002543 Lit::Byte(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002544 _visitor.visit_lit_byte(_binding_0);
2545 }
David Tolnay8c81f622018-07-31 23:34:35 -07002546 Lit::Char(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002547 _visitor.visit_lit_char(_binding_0);
2548 }
David Tolnay8c81f622018-07-31 23:34:35 -07002549 Lit::Int(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002550 _visitor.visit_lit_int(_binding_0);
2551 }
David Tolnay8c81f622018-07-31 23:34:35 -07002552 Lit::Float(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002553 _visitor.visit_lit_float(_binding_0);
2554 }
David Tolnay8c81f622018-07-31 23:34:35 -07002555 Lit::Bool(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002556 _visitor.visit_lit_bool(_binding_0);
2557 }
David Tolnay8c81f622018-07-31 23:34:35 -07002558 Lit::Verbatim(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002559 _visitor.visit_lit_verbatim(_binding_0);
2560 }
2561 }
2562}
David Tolnay8c81f622018-07-31 23:34:35 -07002563#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002564pub fn visit_lit_bool<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitBool) {
David Tolnay6af48992018-08-01 11:16:28 -07002565 skip!(_i.value);
David Tolnay8c81f622018-07-31 23:34:35 -07002566 _visitor.visit_span(&_i.span);
Nika Layzell27726662017-10-24 23:16:35 -04002567}
David Tolnay8c81f622018-07-31 23:34:35 -07002568#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002569pub fn visit_lit_byte<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitByte) {
David Tolnay6af48992018-08-01 11:16:28 -07002570 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002571}
David Tolnay8c81f622018-07-31 23:34:35 -07002572#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002573pub fn visit_lit_byte_str<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitByteStr) {
David Tolnay6af48992018-08-01 11:16:28 -07002574 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002575}
David Tolnay8c81f622018-07-31 23:34:35 -07002576#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002577pub fn visit_lit_char<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitChar) {
David Tolnay6af48992018-08-01 11:16:28 -07002578 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002579}
David Tolnay8c81f622018-07-31 23:34:35 -07002580#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002581pub fn visit_lit_float<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitFloat) {
David Tolnay6af48992018-08-01 11:16:28 -07002582 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002583}
David Tolnay8c81f622018-07-31 23:34:35 -07002584#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002585pub fn visit_lit_int<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitInt) {
David Tolnay6af48992018-08-01 11:16:28 -07002586 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002587}
David Tolnay8c81f622018-07-31 23:34:35 -07002588#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002589pub fn visit_lit_str<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitStr) {
David Tolnay6af48992018-08-01 11:16:28 -07002590 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002591}
David Tolnay8c81f622018-07-31 23:34:35 -07002592#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002593pub fn visit_lit_verbatim<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitVerbatim) {
David Tolnay6af48992018-08-01 11:16:28 -07002594 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002595}
David Tolnay8c81f622018-07-31 23:34:35 -07002596#[cfg(any(feature = "full", feature = "derive"))]
2597#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002598pub fn visit_local<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Local) {
David Tolnay8c81f622018-07-31 23:34:35 -07002599 for it in &_i.attrs {
2600 _visitor.visit_attribute(it)
2601 }
David Tolnay7ac699c2018-08-24 14:00:58 -04002602 tokens_helper(_visitor, &_i.let_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002603 for el in Punctuated::pairs(&_i.pats) {
2604 let it = el.value();
2605 _visitor.visit_pat(it)
2606 }
2607 if let Some(ref it) = _i.ty {
David Tolnay7ac699c2018-08-24 14:00:58 -04002608 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002609 _visitor.visit_type(&*(it).1);
2610 };
2611 if let Some(ref it) = _i.init {
David Tolnay7ac699c2018-08-24 14:00:58 -04002612 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002613 _visitor.visit_expr(&*(it).1);
2614 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002615 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002616}
David Tolnay8c81f622018-07-31 23:34:35 -07002617#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002618pub fn visit_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Macro) {
David Tolnay8c81f622018-07-31 23:34:35 -07002619 _visitor.visit_path(&_i.path);
David Tolnay7ac699c2018-08-24 14:00:58 -04002620 tokens_helper(_visitor, &_i.bang_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002621 _visitor.visit_macro_delimiter(&_i.delimiter);
David Tolnay6af48992018-08-01 11:16:28 -07002622 skip!(_i.tts);
David Tolnayab919512017-12-30 23:31:51 -05002623}
David Tolnay8c81f622018-07-31 23:34:35 -07002624#[cfg(any(feature = "full", feature = "derive"))]
2625pub fn visit_macro_delimiter<'ast, V: Visit<'ast> + ?Sized>(
2626 _visitor: &mut V,
2627 _i: &'ast MacroDelimiter,
2628) {
David Tolnayab919512017-12-30 23:31:51 -05002629 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002630 MacroDelimiter::Paren(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002631 tokens_helper(_visitor, &_binding_0.span);
David Tolnayab919512017-12-30 23:31:51 -05002632 }
David Tolnay8c81f622018-07-31 23:34:35 -07002633 MacroDelimiter::Brace(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002634 tokens_helper(_visitor, &_binding_0.span);
David Tolnayab919512017-12-30 23:31:51 -05002635 }
David Tolnay8c81f622018-07-31 23:34:35 -07002636 MacroDelimiter::Bracket(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002637 tokens_helper(_visitor, &_binding_0.span);
David Tolnayab919512017-12-30 23:31:51 -05002638 }
2639 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002640}
David Tolnay8c81f622018-07-31 23:34:35 -07002641#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002642pub fn visit_member<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Member) {
David Tolnay85b69a42017-12-27 20:43:10 -05002643 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002644 Member::Named(ref _binding_0) => {
Alex Crichtond261d092018-05-18 13:47:35 -07002645 _visitor.visit_ident(_binding_0);
David Tolnay85b69a42017-12-27 20:43:10 -05002646 }
David Tolnay8c81f622018-07-31 23:34:35 -07002647 Member::Unnamed(ref _binding_0) => {
David Tolnay85b69a42017-12-27 20:43:10 -05002648 _visitor.visit_index(_binding_0);
2649 }
2650 }
2651}
David Tolnay8c81f622018-07-31 23:34:35 -07002652#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayaaadd782018-01-06 22:58:13 -08002653pub fn visit_meta<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Meta) {
Nika Layzell27726662017-10-24 23:16:35 -04002654 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002655 Meta::Word(ref _binding_0) => {
Alex Crichtond261d092018-05-18 13:47:35 -07002656 _visitor.visit_ident(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002657 }
David Tolnay8c81f622018-07-31 23:34:35 -07002658 Meta::List(ref _binding_0) => {
David Tolnayaaadd782018-01-06 22:58:13 -08002659 _visitor.visit_meta_list(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002660 }
David Tolnay8c81f622018-07-31 23:34:35 -07002661 Meta::NameValue(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002662 _visitor.visit_meta_name_value(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002663 }
2664 }
2665}
David Tolnay8c81f622018-07-31 23:34:35 -07002666#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayaaadd782018-01-06 22:58:13 -08002667pub fn visit_meta_list<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast MetaList) {
David Tolnay8c81f622018-07-31 23:34:35 -07002668 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002669 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002670 for el in Punctuated::pairs(&_i.nested) {
2671 let it = el.value();
2672 _visitor.visit_nested_meta(it)
2673 }
Nika Layzell27726662017-10-24 23:16:35 -04002674}
David Tolnay8c81f622018-07-31 23:34:35 -07002675#[cfg(any(feature = "full", feature = "derive"))]
2676pub fn visit_meta_name_value<'ast, V: Visit<'ast> + ?Sized>(
2677 _visitor: &mut V,
2678 _i: &'ast MetaNameValue,
2679) {
2680 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002681 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002682 _visitor.visit_lit(&_i.lit);
Nika Layzell27726662017-10-24 23:16:35 -04002683}
David Tolnay8c81f622018-07-31 23:34:35 -07002684#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002685pub fn visit_method_sig<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast MethodSig) {
David Tolnay8c81f622018-07-31 23:34:35 -07002686 if let Some(ref it) = _i.constness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002687 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002688 };
2689 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002690 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002691 };
Yusuke Sasakif00a3ef2018-07-20 22:08:42 +09002692 if let Some(ref it) = _i.asyncness {
2693 tokens_helper(_visitor, &it.span)
2694 };
David Tolnay8c81f622018-07-31 23:34:35 -07002695 if let Some(ref it) = _i.abi {
2696 _visitor.visit_abi(it)
2697 };
2698 _visitor.visit_ident(&_i.ident);
2699 _visitor.visit_fn_decl(&_i.decl);
Nika Layzell27726662017-10-24 23:16:35 -04002700}
David Tolnay8c81f622018-07-31 23:34:35 -07002701#[cfg(any(feature = "full", feature = "derive"))]
2702#[cfg(feature = "full")]
2703pub fn visit_method_turbofish<'ast, V: Visit<'ast> + ?Sized>(
2704 _visitor: &mut V,
2705 _i: &'ast MethodTurbofish,
2706) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002707 tokens_helper(_visitor, &_i.colon2_token.spans);
2708 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002709 for el in Punctuated::pairs(&_i.args) {
2710 let it = el.value();
2711 _visitor.visit_generic_method_argument(it)
2712 }
David Tolnay7ac699c2018-08-24 14:00:58 -04002713 tokens_helper(_visitor, &_i.gt_token.spans);
David Tolnayd60cfec2017-12-29 00:21:38 -05002714}
David Tolnay8c81f622018-07-31 23:34:35 -07002715#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayaaadd782018-01-06 22:58:13 -08002716pub fn visit_nested_meta<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast NestedMeta) {
Nika Layzell27726662017-10-24 23:16:35 -04002717 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002718 NestedMeta::Meta(ref _binding_0) => {
David Tolnayaaadd782018-01-06 22:58:13 -08002719 _visitor.visit_meta(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002720 }
David Tolnay8c81f622018-07-31 23:34:35 -07002721 NestedMeta::Literal(ref _binding_0) => {
David Tolnay4ba63a02017-12-28 15:53:05 -05002722 _visitor.visit_lit(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002723 }
2724 }
2725}
David Tolnay8c81f622018-07-31 23:34:35 -07002726#[cfg(any(feature = "full", feature = "derive"))]
2727pub fn visit_parenthesized_generic_arguments<'ast, V: Visit<'ast> + ?Sized>(
2728 _visitor: &mut V,
2729 _i: &'ast ParenthesizedGenericArguments,
2730) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002731 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002732 for el in Punctuated::pairs(&_i.inputs) {
2733 let it = el.value();
2734 _visitor.visit_type(it)
2735 }
2736 _visitor.visit_return_type(&_i.output);
Nika Layzell27726662017-10-24 23:16:35 -04002737}
David Tolnay8c81f622018-07-31 23:34:35 -07002738#[cfg(any(feature = "full", feature = "derive"))]
2739#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002740pub fn visit_pat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Pat) {
Nika Layzell27726662017-10-24 23:16:35 -04002741 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002742 Pat::Wild(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002743 _visitor.visit_pat_wild(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002744 }
David Tolnay8c81f622018-07-31 23:34:35 -07002745 Pat::Ident(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002746 _visitor.visit_pat_ident(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002747 }
David Tolnay8c81f622018-07-31 23:34:35 -07002748 Pat::Struct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002749 _visitor.visit_pat_struct(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002750 }
David Tolnay8c81f622018-07-31 23:34:35 -07002751 Pat::TupleStruct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002752 _visitor.visit_pat_tuple_struct(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002753 }
David Tolnay8c81f622018-07-31 23:34:35 -07002754 Pat::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002755 _visitor.visit_pat_path(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002756 }
David Tolnay8c81f622018-07-31 23:34:35 -07002757 Pat::Tuple(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002758 _visitor.visit_pat_tuple(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002759 }
David Tolnay8c81f622018-07-31 23:34:35 -07002760 Pat::Box(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002761 _visitor.visit_pat_box(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002762 }
David Tolnay8c81f622018-07-31 23:34:35 -07002763 Pat::Ref(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002764 _visitor.visit_pat_ref(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002765 }
David Tolnay8c81f622018-07-31 23:34:35 -07002766 Pat::Lit(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002767 _visitor.visit_pat_lit(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002768 }
David Tolnay8c81f622018-07-31 23:34:35 -07002769 Pat::Range(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002770 _visitor.visit_pat_range(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002771 }
David Tolnay8c81f622018-07-31 23:34:35 -07002772 Pat::Slice(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002773 _visitor.visit_pat_slice(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002774 }
David Tolnay8c81f622018-07-31 23:34:35 -07002775 Pat::Macro(ref _binding_0) => {
David Tolnay323279a2017-12-29 11:26:32 -05002776 _visitor.visit_pat_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002777 }
David Tolnay8c81f622018-07-31 23:34:35 -07002778 Pat::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002779 _visitor.visit_pat_verbatim(_binding_0);
2780 }
Nika Layzell27726662017-10-24 23:16:35 -04002781 }
2782}
David Tolnay8c81f622018-07-31 23:34:35 -07002783#[cfg(any(feature = "full", feature = "derive"))]
2784#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002785pub fn visit_pat_box<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatBox) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002786 tokens_helper(_visitor, &_i.box_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002787 _visitor.visit_pat(&*_i.pat);
Nika Layzell27726662017-10-24 23:16:35 -04002788}
David Tolnay8c81f622018-07-31 23:34:35 -07002789#[cfg(any(feature = "full", feature = "derive"))]
2790#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002791pub fn visit_pat_ident<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatIdent) {
David Tolnay8c81f622018-07-31 23:34:35 -07002792 if let Some(ref it) = _i.by_ref {
David Tolnay7ac699c2018-08-24 14:00:58 -04002793 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002794 };
2795 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04002796 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002797 };
2798 _visitor.visit_ident(&_i.ident);
2799 if let Some(ref it) = _i.subpat {
David Tolnay7ac699c2018-08-24 14:00:58 -04002800 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002801 _visitor.visit_pat(&*(it).1);
2802 };
Nika Layzell27726662017-10-24 23:16:35 -04002803}
David Tolnay8c81f622018-07-31 23:34:35 -07002804#[cfg(any(feature = "full", feature = "derive"))]
2805#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002806pub fn visit_pat_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatLit) {
David Tolnay8c81f622018-07-31 23:34:35 -07002807 _visitor.visit_expr(&*_i.expr);
Nika Layzell27726662017-10-24 23:16:35 -04002808}
David Tolnay8c81f622018-07-31 23:34:35 -07002809#[cfg(any(feature = "full", feature = "derive"))]
2810#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002811pub fn visit_pat_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatMacro) {
David Tolnay8c81f622018-07-31 23:34:35 -07002812 _visitor.visit_macro(&_i.mac);
David Tolnay323279a2017-12-29 11:26:32 -05002813}
David Tolnay8c81f622018-07-31 23:34:35 -07002814#[cfg(any(feature = "full", feature = "derive"))]
2815#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002816pub fn visit_pat_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatPath) {
David Tolnay8c81f622018-07-31 23:34:35 -07002817 if let Some(ref it) = _i.qself {
2818 _visitor.visit_qself(it)
2819 };
2820 _visitor.visit_path(&_i.path);
Nika Layzell27726662017-10-24 23:16:35 -04002821}
David Tolnay8c81f622018-07-31 23:34:35 -07002822#[cfg(any(feature = "full", feature = "derive"))]
2823#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002824pub fn visit_pat_range<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatRange) {
David Tolnay8c81f622018-07-31 23:34:35 -07002825 _visitor.visit_expr(&*_i.lo);
2826 _visitor.visit_range_limits(&_i.limits);
2827 _visitor.visit_expr(&*_i.hi);
Nika Layzell27726662017-10-24 23:16:35 -04002828}
David Tolnay8c81f622018-07-31 23:34:35 -07002829#[cfg(any(feature = "full", feature = "derive"))]
2830#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002831pub fn visit_pat_ref<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatRef) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002832 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002833 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04002834 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002835 };
2836 _visitor.visit_pat(&*_i.pat);
Nika Layzell27726662017-10-24 23:16:35 -04002837}
David Tolnay8c81f622018-07-31 23:34:35 -07002838#[cfg(any(feature = "full", feature = "derive"))]
2839#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002840pub fn visit_pat_slice<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatSlice) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002841 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002842 for el in Punctuated::pairs(&_i.front) {
2843 let it = el.value();
2844 _visitor.visit_pat(it)
2845 }
2846 if let Some(ref it) = _i.middle {
2847 _visitor.visit_pat(&**it)
2848 };
2849 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002850 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002851 };
2852 if let Some(ref it) = _i.comma_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002853 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002854 };
2855 for el in Punctuated::pairs(&_i.back) {
2856 let it = el.value();
2857 _visitor.visit_pat(it)
2858 }
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_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatStruct) {
David Tolnay8c81f622018-07-31 23:34:35 -07002863 _visitor.visit_path(&_i.path);
David Tolnay7ac699c2018-08-24 14:00:58 -04002864 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002865 for el in Punctuated::pairs(&_i.fields) {
2866 let it = el.value();
2867 _visitor.visit_field_pat(it)
2868 }
2869 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002870 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002871 };
Nika Layzell27726662017-10-24 23:16:35 -04002872}
David Tolnay8c81f622018-07-31 23:34:35 -07002873#[cfg(any(feature = "full", feature = "derive"))]
2874#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002875pub fn visit_pat_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatTuple) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002876 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002877 for el in Punctuated::pairs(&_i.front) {
2878 let it = el.value();
2879 _visitor.visit_pat(it)
2880 }
2881 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002882 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002883 };
2884 if let Some(ref it) = _i.comma_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002885 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002886 };
2887 for el in Punctuated::pairs(&_i.back) {
2888 let it = el.value();
2889 _visitor.visit_pat(it)
2890 }
Nika Layzell27726662017-10-24 23:16:35 -04002891}
David Tolnay8c81f622018-07-31 23:34:35 -07002892#[cfg(any(feature = "full", feature = "derive"))]
2893#[cfg(feature = "full")]
2894pub fn visit_pat_tuple_struct<'ast, V: Visit<'ast> + ?Sized>(
2895 _visitor: &mut V,
2896 _i: &'ast PatTupleStruct,
2897) {
2898 _visitor.visit_path(&_i.path);
2899 _visitor.visit_pat_tuple(&_i.pat);
Nika Layzell27726662017-10-24 23:16:35 -04002900}
David Tolnay8c81f622018-07-31 23:34:35 -07002901#[cfg(any(feature = "full", feature = "derive"))]
2902#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002903pub fn visit_pat_verbatim<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatVerbatim) {
David Tolnay6af48992018-08-01 11:16:28 -07002904 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05002905}
David Tolnay8c81f622018-07-31 23:34:35 -07002906#[cfg(any(feature = "full", feature = "derive"))]
2907#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002908pub fn visit_pat_wild<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatWild) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002909 tokens_helper(_visitor, &_i.underscore_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002910}
David Tolnay8c81f622018-07-31 23:34:35 -07002911#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002912pub fn visit_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Path) {
David Tolnay8c81f622018-07-31 23:34:35 -07002913 if let Some(ref it) = _i.leading_colon {
David Tolnay7ac699c2018-08-24 14:00:58 -04002914 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002915 };
2916 for el in Punctuated::pairs(&_i.segments) {
2917 let it = el.value();
2918 _visitor.visit_path_segment(it)
2919 }
Nika Layzell27726662017-10-24 23:16:35 -04002920}
David Tolnay8c81f622018-07-31 23:34:35 -07002921#[cfg(any(feature = "full", feature = "derive"))]
2922pub fn visit_path_arguments<'ast, V: Visit<'ast> + ?Sized>(
2923 _visitor: &mut V,
2924 _i: &'ast PathArguments,
2925) {
Nika Layzellc08227a2017-12-04 16:30:17 -05002926 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002927 PathArguments::None => {}
2928 PathArguments::AngleBracketed(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002929 _visitor.visit_angle_bracketed_generic_arguments(_binding_0);
Nika Layzellc08227a2017-12-04 16:30:17 -05002930 }
David Tolnay8c81f622018-07-31 23:34:35 -07002931 PathArguments::Parenthesized(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002932 _visitor.visit_parenthesized_generic_arguments(_binding_0);
Nika Layzellc08227a2017-12-04 16:30:17 -05002933 }
2934 }
2935}
David Tolnay8c81f622018-07-31 23:34:35 -07002936#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002937pub fn visit_path_segment<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PathSegment) {
David Tolnay8c81f622018-07-31 23:34:35 -07002938 _visitor.visit_ident(&_i.ident);
2939 _visitor.visit_path_arguments(&_i.arguments);
Nika Layzell27726662017-10-24 23:16:35 -04002940}
David Tolnay8c81f622018-07-31 23:34:35 -07002941#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002942pub fn visit_predicate_eq<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PredicateEq) {
David Tolnay8c81f622018-07-31 23:34:35 -07002943 _visitor.visit_type(&_i.lhs_ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002944 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002945 _visitor.visit_type(&_i.rhs_ty);
David Tolnayd4add852018-01-01 20:13:24 -08002946}
David Tolnay8c81f622018-07-31 23:34:35 -07002947#[cfg(any(feature = "full", feature = "derive"))]
2948pub fn visit_predicate_lifetime<'ast, V: Visit<'ast> + ?Sized>(
2949 _visitor: &mut V,
2950 _i: &'ast PredicateLifetime,
2951) {
2952 _visitor.visit_lifetime(&_i.lifetime);
David Tolnay1b8e2852018-08-26 08:25:18 -04002953 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002954 for el in Punctuated::pairs(&_i.bounds) {
2955 let it = el.value();
2956 _visitor.visit_lifetime(it)
2957 }
David Tolnayd4add852018-01-01 20:13:24 -08002958}
David Tolnay8c81f622018-07-31 23:34:35 -07002959#[cfg(any(feature = "full", feature = "derive"))]
2960pub fn visit_predicate_type<'ast, V: Visit<'ast> + ?Sized>(
2961 _visitor: &mut V,
2962 _i: &'ast PredicateType,
2963) {
2964 if let Some(ref it) = _i.lifetimes {
2965 _visitor.visit_bound_lifetimes(it)
2966 };
2967 _visitor.visit_type(&_i.bounded_ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002968 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002969 for el in Punctuated::pairs(&_i.bounds) {
2970 let it = el.value();
2971 _visitor.visit_type_param_bound(it)
2972 }
David Tolnayd4add852018-01-01 20:13:24 -08002973}
David Tolnay8c81f622018-07-31 23:34:35 -07002974#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002975pub fn visit_qself<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast QSelf) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002976 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002977 _visitor.visit_type(&*_i.ty);
David Tolnay6af48992018-08-01 11:16:28 -07002978 skip!(_i.position);
David Tolnay8c81f622018-07-31 23:34:35 -07002979 if let Some(ref it) = _i.as_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002980 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002981 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002982 tokens_helper(_visitor, &_i.gt_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002983}
David Tolnay8c81f622018-07-31 23:34:35 -07002984#[cfg(any(feature = "full", feature = "derive"))]
2985#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002986pub fn visit_range_limits<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast RangeLimits) {
Nika Layzell27726662017-10-24 23:16:35 -04002987 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002988 RangeLimits::HalfOpen(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002989 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002990 }
David Tolnay8c81f622018-07-31 23:34:35 -07002991 RangeLimits::Closed(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002992 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002993 }
2994 }
2995}
David Tolnay8c81f622018-07-31 23:34:35 -07002996#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002997pub fn visit_return_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ReturnType) {
David Tolnayf93b90d2017-11-11 19:21:26 -08002998 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002999 ReturnType::Default => {}
3000 ReturnType::Type(ref _binding_0, ref _binding_1) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003001 tokens_helper(_visitor, &_binding_0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003002 _visitor.visit_type(&**_binding_1);
David Tolnayf93b90d2017-11-11 19:21:26 -08003003 }
3004 }
3005}
David Tolnay8c81f622018-07-31 23:34:35 -07003006pub fn visit_span<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Span) {}
3007#[cfg(any(feature = "full", feature = "derive"))]
3008#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003009pub fn visit_stmt<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Stmt) {
Nika Layzell27726662017-10-24 23:16:35 -04003010 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003011 Stmt::Local(ref _binding_0) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08003012 _visitor.visit_local(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003013 }
David Tolnay8c81f622018-07-31 23:34:35 -07003014 Stmt::Item(ref _binding_0) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08003015 _visitor.visit_item(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003016 }
David Tolnay8c81f622018-07-31 23:34:35 -07003017 Stmt::Expr(ref _binding_0) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08003018 _visitor.visit_expr(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003019 }
David Tolnay8c81f622018-07-31 23:34:35 -07003020 Stmt::Semi(ref _binding_0, ref _binding_1) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08003021 _visitor.visit_expr(_binding_0);
David Tolnay7ac699c2018-08-24 14:00:58 -04003022 tokens_helper(_visitor, &_binding_1.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003023 }
Nika Layzell27726662017-10-24 23:16:35 -04003024 }
3025}
David Tolnay8c81f622018-07-31 23:34:35 -07003026#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003027pub fn visit_trait_bound<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TraitBound) {
David Tolnay8c81f622018-07-31 23:34:35 -07003028 if let Some(ref it) = _i.paren_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003029 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003030 };
3031 _visitor.visit_trait_bound_modifier(&_i.modifier);
3032 if let Some(ref it) = _i.lifetimes {
3033 _visitor.visit_bound_lifetimes(it)
3034 };
3035 _visitor.visit_path(&_i.path);
David Tolnay40fb8ce2018-01-02 10:53:46 -08003036}
David Tolnay8c81f622018-07-31 23:34:35 -07003037#[cfg(any(feature = "full", feature = "derive"))]
3038pub fn visit_trait_bound_modifier<'ast, V: Visit<'ast> + ?Sized>(
3039 _visitor: &mut V,
3040 _i: &'ast TraitBoundModifier,
3041) {
Nika Layzell27726662017-10-24 23:16:35 -04003042 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003043 TraitBoundModifier::None => {}
3044 TraitBoundModifier::Maybe(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003045 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003046 }
3047 }
3048}
David Tolnay8c81f622018-07-31 23:34:35 -07003049#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003050pub fn visit_trait_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TraitItem) {
Nika Layzell27726662017-10-24 23:16:35 -04003051 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003052 TraitItem::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003053 _visitor.visit_trait_item_const(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003054 }
David Tolnay8c81f622018-07-31 23:34:35 -07003055 TraitItem::Method(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003056 _visitor.visit_trait_item_method(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003057 }
David Tolnay8c81f622018-07-31 23:34:35 -07003058 TraitItem::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003059 _visitor.visit_trait_item_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003060 }
David Tolnay8c81f622018-07-31 23:34:35 -07003061 TraitItem::Macro(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003062 _visitor.visit_trait_item_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003063 }
David Tolnay8c81f622018-07-31 23:34:35 -07003064 TraitItem::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05003065 _visitor.visit_trait_item_verbatim(_binding_0);
3066 }
Nika Layzell27726662017-10-24 23:16:35 -04003067 }
3068}
David Tolnay8c81f622018-07-31 23:34:35 -07003069#[cfg(feature = "full")]
3070pub fn visit_trait_item_const<'ast, V: Visit<'ast> + ?Sized>(
3071 _visitor: &mut V,
3072 _i: &'ast TraitItemConst,
3073) {
3074 for it in &_i.attrs {
3075 _visitor.visit_attribute(it)
3076 }
David Tolnay7ac699c2018-08-24 14:00:58 -04003077 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003078 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04003079 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003080 _visitor.visit_type(&_i.ty);
3081 if let Some(ref it) = _i.default {
David Tolnay7ac699c2018-08-24 14:00:58 -04003082 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003083 _visitor.visit_expr(&(it).1);
3084 };
David Tolnay7ac699c2018-08-24 14:00:58 -04003085 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnayda705bd2017-11-10 21:58:05 -08003086}
David Tolnay8c81f622018-07-31 23:34:35 -07003087#[cfg(feature = "full")]
3088pub fn visit_trait_item_macro<'ast, V: Visit<'ast> + ?Sized>(
3089 _visitor: &mut V,
3090 _i: &'ast TraitItemMacro,
3091) {
3092 for it in &_i.attrs {
3093 _visitor.visit_attribute(it)
3094 }
3095 _visitor.visit_macro(&_i.mac);
3096 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003097 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003098 };
David Tolnayda705bd2017-11-10 21:58:05 -08003099}
David Tolnay8c81f622018-07-31 23:34:35 -07003100#[cfg(feature = "full")]
3101pub fn visit_trait_item_method<'ast, V: Visit<'ast> + ?Sized>(
3102 _visitor: &mut V,
3103 _i: &'ast TraitItemMethod,
3104) {
3105 for it in &_i.attrs {
3106 _visitor.visit_attribute(it)
3107 }
3108 _visitor.visit_method_sig(&_i.sig);
3109 if let Some(ref it) = _i.default {
3110 _visitor.visit_block(it)
3111 };
3112 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003113 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003114 };
Nika Layzell27726662017-10-24 23:16:35 -04003115}
David Tolnay8c81f622018-07-31 23:34:35 -07003116#[cfg(feature = "full")]
3117pub fn visit_trait_item_type<'ast, V: Visit<'ast> + ?Sized>(
3118 _visitor: &mut V,
3119 _i: &'ast TraitItemType,
3120) {
3121 for it in &_i.attrs {
3122 _visitor.visit_attribute(it)
3123 }
David Tolnay7ac699c2018-08-24 14:00:58 -04003124 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003125 _visitor.visit_ident(&_i.ident);
3126 _visitor.visit_generics(&_i.generics);
3127 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003128 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003129 };
3130 for el in Punctuated::pairs(&_i.bounds) {
3131 let it = el.value();
3132 _visitor.visit_type_param_bound(it)
3133 }
3134 if let Some(ref it) = _i.default {
David Tolnay7ac699c2018-08-24 14:00:58 -04003135 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003136 _visitor.visit_type(&(it).1);
3137 };
David Tolnay7ac699c2018-08-24 14:00:58 -04003138 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003139}
David Tolnay8c81f622018-07-31 23:34:35 -07003140#[cfg(feature = "full")]
3141pub fn visit_trait_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
3142 _visitor: &mut V,
3143 _i: &'ast TraitItemVerbatim,
3144) {
David Tolnay6af48992018-08-01 11:16:28 -07003145 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05003146}
David Tolnay8c81f622018-07-31 23:34:35 -07003147#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003148pub fn visit_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Type) {
Nika Layzell27726662017-10-24 23:16:35 -04003149 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003150 Type::Slice(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003151 _visitor.visit_type_slice(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003152 }
David Tolnay8c81f622018-07-31 23:34:35 -07003153 Type::Array(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003154 _visitor.visit_type_array(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003155 }
David Tolnay8c81f622018-07-31 23:34:35 -07003156 Type::Ptr(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003157 _visitor.visit_type_ptr(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003158 }
David Tolnay8c81f622018-07-31 23:34:35 -07003159 Type::Reference(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003160 _visitor.visit_type_reference(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003161 }
David Tolnay8c81f622018-07-31 23:34:35 -07003162 Type::BareFn(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003163 _visitor.visit_type_bare_fn(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003164 }
David Tolnay8c81f622018-07-31 23:34:35 -07003165 Type::Never(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003166 _visitor.visit_type_never(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003167 }
David Tolnay8c81f622018-07-31 23:34:35 -07003168 Type::Tuple(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003169 _visitor.visit_type_tuple(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003170 }
David Tolnay8c81f622018-07-31 23:34:35 -07003171 Type::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003172 _visitor.visit_type_path(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003173 }
David Tolnay8c81f622018-07-31 23:34:35 -07003174 Type::TraitObject(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003175 _visitor.visit_type_trait_object(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003176 }
David Tolnay8c81f622018-07-31 23:34:35 -07003177 Type::ImplTrait(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003178 _visitor.visit_type_impl_trait(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003179 }
David Tolnay8c81f622018-07-31 23:34:35 -07003180 Type::Paren(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003181 _visitor.visit_type_paren(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003182 }
David Tolnay8c81f622018-07-31 23:34:35 -07003183 Type::Group(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003184 _visitor.visit_type_group(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003185 }
David Tolnay8c81f622018-07-31 23:34:35 -07003186 Type::Infer(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003187 _visitor.visit_type_infer(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003188 }
David Tolnay8c81f622018-07-31 23:34:35 -07003189 Type::Macro(ref _binding_0) => {
David Tolnay323279a2017-12-29 11:26:32 -05003190 _visitor.visit_type_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003191 }
David Tolnay8c81f622018-07-31 23:34:35 -07003192 Type::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05003193 _visitor.visit_type_verbatim(_binding_0);
3194 }
Nika Layzell27726662017-10-24 23:16:35 -04003195 }
3196}
David Tolnay8c81f622018-07-31 23:34:35 -07003197#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003198pub fn visit_type_array<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeArray) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003199 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003200 _visitor.visit_type(&*_i.elem);
David Tolnay7ac699c2018-08-24 14:00:58 -04003201 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003202 _visitor.visit_expr(&_i.len);
Nika Layzell27726662017-10-24 23:16:35 -04003203}
David Tolnay8c81f622018-07-31 23:34:35 -07003204#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003205pub fn visit_type_bare_fn<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeBareFn) {
David Tolnay3779bb72018-08-26 18:46:07 -07003206 if let Some(ref it) = _i.lifetimes {
3207 _visitor.visit_bound_lifetimes(it)
3208 };
David Tolnay8c81f622018-07-31 23:34:35 -07003209 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04003210 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003211 };
3212 if let Some(ref it) = _i.abi {
3213 _visitor.visit_abi(it)
3214 };
David Tolnay7ac699c2018-08-24 14:00:58 -04003215 tokens_helper(_visitor, &_i.fn_token.span);
David Tolnay7ac699c2018-08-24 14:00:58 -04003216 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003217 for el in Punctuated::pairs(&_i.inputs) {
3218 let it = el.value();
3219 _visitor.visit_bare_fn_arg(it)
3220 }
3221 if let Some(ref it) = _i.variadic {
David Tolnay7ac699c2018-08-24 14:00:58 -04003222 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003223 };
3224 _visitor.visit_return_type(&_i.output);
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_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeGroup) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003228 tokens_helper(_visitor, &_i.group_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003229 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003230}
David Tolnay8c81f622018-07-31 23:34:35 -07003231#[cfg(any(feature = "full", feature = "derive"))]
3232pub fn visit_type_impl_trait<'ast, V: Visit<'ast> + ?Sized>(
3233 _visitor: &mut V,
3234 _i: &'ast TypeImplTrait,
3235) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003236 tokens_helper(_visitor, &_i.impl_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003237 for el in Punctuated::pairs(&_i.bounds) {
3238 let it = el.value();
3239 _visitor.visit_type_param_bound(it)
3240 }
Nika Layzell27726662017-10-24 23:16:35 -04003241}
David Tolnay8c81f622018-07-31 23:34:35 -07003242#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003243pub fn visit_type_infer<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeInfer) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003244 tokens_helper(_visitor, &_i.underscore_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003245}
David Tolnay8c81f622018-07-31 23:34:35 -07003246#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003247pub fn visit_type_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeMacro) {
David Tolnay8c81f622018-07-31 23:34:35 -07003248 _visitor.visit_macro(&_i.mac);
David Tolnay323279a2017-12-29 11:26:32 -05003249}
David Tolnay8c81f622018-07-31 23:34:35 -07003250#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003251pub fn visit_type_never<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeNever) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003252 tokens_helper(_visitor, &_i.bang_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003253}
David Tolnay8c81f622018-07-31 23:34:35 -07003254#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003255pub fn visit_type_param<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeParam) {
David Tolnay8c81f622018-07-31 23:34:35 -07003256 for it in &_i.attrs {
3257 _visitor.visit_attribute(it)
3258 }
3259 _visitor.visit_ident(&_i.ident);
3260 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003261 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003262 };
3263 for el in Punctuated::pairs(&_i.bounds) {
3264 let it = el.value();
3265 _visitor.visit_type_param_bound(it)
3266 }
3267 if let Some(ref it) = _i.eq_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003268 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003269 };
3270 if let Some(ref it) = _i.default {
3271 _visitor.visit_type(it)
3272 };
Nika Layzell27726662017-10-24 23:16:35 -04003273}
David Tolnay8c81f622018-07-31 23:34:35 -07003274#[cfg(any(feature = "full", feature = "derive"))]
3275pub fn visit_type_param_bound<'ast, V: Visit<'ast> + ?Sized>(
3276 _visitor: &mut V,
3277 _i: &'ast TypeParamBound,
3278) {
Nika Layzell27726662017-10-24 23:16:35 -04003279 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003280 TypeParamBound::Trait(ref _binding_0) => {
David Tolnay40fb8ce2018-01-02 10:53:46 -08003281 _visitor.visit_trait_bound(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003282 }
David Tolnay8c81f622018-07-31 23:34:35 -07003283 TypeParamBound::Lifetime(ref _binding_0) => {
David Tolnay4ba63a02017-12-28 15:53:05 -05003284 _visitor.visit_lifetime(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003285 }
3286 }
3287}
David Tolnay8c81f622018-07-31 23:34:35 -07003288#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003289pub fn visit_type_paren<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeParen) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003290 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003291 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003292}
David Tolnay8c81f622018-07-31 23:34:35 -07003293#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003294pub fn visit_type_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypePath) {
David Tolnay8c81f622018-07-31 23:34:35 -07003295 if let Some(ref it) = _i.qself {
3296 _visitor.visit_qself(it)
3297 };
3298 _visitor.visit_path(&_i.path);
Nika Layzell27726662017-10-24 23:16:35 -04003299}
David Tolnay8c81f622018-07-31 23:34:35 -07003300#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003301pub fn visit_type_ptr<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypePtr) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003302 tokens_helper(_visitor, &_i.star_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003303 if let Some(ref it) = _i.const_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003304 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003305 };
3306 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04003307 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003308 };
3309 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003310}
David Tolnay8c81f622018-07-31 23:34:35 -07003311#[cfg(any(feature = "full", feature = "derive"))]
3312pub fn visit_type_reference<'ast, V: Visit<'ast> + ?Sized>(
3313 _visitor: &mut V,
3314 _i: &'ast TypeReference,
3315) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003316 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003317 if let Some(ref it) = _i.lifetime {
3318 _visitor.visit_lifetime(it)
3319 };
3320 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04003321 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003322 };
3323 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003324}
David Tolnay8c81f622018-07-31 23:34:35 -07003325#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003326pub fn visit_type_slice<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeSlice) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003327 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003328 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003329}
David Tolnay8c81f622018-07-31 23:34:35 -07003330#[cfg(any(feature = "full", feature = "derive"))]
3331pub fn visit_type_trait_object<'ast, V: Visit<'ast> + ?Sized>(
3332 _visitor: &mut V,
3333 _i: &'ast TypeTraitObject,
3334) {
3335 if let Some(ref it) = _i.dyn_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003336 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003337 };
3338 for el in Punctuated::pairs(&_i.bounds) {
3339 let it = el.value();
3340 _visitor.visit_type_param_bound(it)
3341 }
Nika Layzell27726662017-10-24 23:16:35 -04003342}
David Tolnay8c81f622018-07-31 23:34:35 -07003343#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003344pub fn visit_type_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeTuple) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003345 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003346 for el in Punctuated::pairs(&_i.elems) {
3347 let it = el.value();
3348 _visitor.visit_type(it)
3349 }
Nika Layzell27726662017-10-24 23:16:35 -04003350}
David Tolnay8c81f622018-07-31 23:34:35 -07003351#[cfg(any(feature = "full", feature = "derive"))]
3352pub fn visit_type_verbatim<'ast, V: Visit<'ast> + ?Sized>(
3353 _visitor: &mut V,
3354 _i: &'ast TypeVerbatim,
3355) {
David Tolnay6af48992018-08-01 11:16:28 -07003356 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05003357}
David Tolnay8c81f622018-07-31 23:34:35 -07003358#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003359pub fn visit_un_op<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UnOp) {
Nika Layzell27726662017-10-24 23:16:35 -04003360 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003361 UnOp::Deref(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003362 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003363 }
David Tolnay8c81f622018-07-31 23:34:35 -07003364 UnOp::Not(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003365 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003366 }
David Tolnay8c81f622018-07-31 23:34:35 -07003367 UnOp::Neg(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003368 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003369 }
3370 }
3371}
David Tolnay8c81f622018-07-31 23:34:35 -07003372#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003373pub fn visit_use_glob<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseGlob) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003374 tokens_helper(_visitor, &_i.star_token.spans);
David Tolnay5f332a92017-12-26 00:42:45 -05003375}
David Tolnay8c81f622018-07-31 23:34:35 -07003376#[cfg(feature = "full")]
David Tolnayd97a7d22018-03-31 19:17:01 +02003377pub fn visit_use_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseGroup) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003378 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003379 for el in Punctuated::pairs(&_i.items) {
3380 let it = el.value();
3381 _visitor.visit_use_tree(it)
3382 }
David Tolnay5f332a92017-12-26 00:42:45 -05003383}
David Tolnay8c81f622018-07-31 23:34:35 -07003384#[cfg(feature = "full")]
David Tolnayd97a7d22018-03-31 19:17:01 +02003385pub fn visit_use_name<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseName) {
David Tolnay8c81f622018-07-31 23:34:35 -07003386 _visitor.visit_ident(&_i.ident);
David Tolnayd97a7d22018-03-31 19:17:01 +02003387}
David Tolnay8c81f622018-07-31 23:34:35 -07003388#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003389pub fn visit_use_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UsePath) {
David Tolnay8c81f622018-07-31 23:34:35 -07003390 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04003391 tokens_helper(_visitor, &_i.colon2_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003392 _visitor.visit_use_tree(&*_i.tree);
David Tolnayd97a7d22018-03-31 19:17:01 +02003393}
David Tolnay8c81f622018-07-31 23:34:35 -07003394#[cfg(feature = "full")]
David Tolnayd97a7d22018-03-31 19:17:01 +02003395pub fn visit_use_rename<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseRename) {
David Tolnay8c81f622018-07-31 23:34:35 -07003396 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04003397 tokens_helper(_visitor, &_i.as_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003398 _visitor.visit_ident(&_i.rename);
David Tolnay5f332a92017-12-26 00:42:45 -05003399}
David Tolnay8c81f622018-07-31 23:34:35 -07003400#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003401pub fn visit_use_tree<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseTree) {
David Tolnay5f332a92017-12-26 00:42:45 -05003402 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003403 UseTree::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003404 _visitor.visit_use_path(_binding_0);
David Tolnay5f332a92017-12-26 00:42:45 -05003405 }
David Tolnay8c81f622018-07-31 23:34:35 -07003406 UseTree::Name(ref _binding_0) => {
David Tolnayd97a7d22018-03-31 19:17:01 +02003407 _visitor.visit_use_name(_binding_0);
3408 }
David Tolnay8c81f622018-07-31 23:34:35 -07003409 UseTree::Rename(ref _binding_0) => {
David Tolnayd97a7d22018-03-31 19:17:01 +02003410 _visitor.visit_use_rename(_binding_0);
3411 }
David Tolnay8c81f622018-07-31 23:34:35 -07003412 UseTree::Glob(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003413 _visitor.visit_use_glob(_binding_0);
David Tolnay5f332a92017-12-26 00:42:45 -05003414 }
David Tolnay8c81f622018-07-31 23:34:35 -07003415 UseTree::Group(ref _binding_0) => {
David Tolnayd97a7d22018-03-31 19:17:01 +02003416 _visitor.visit_use_group(_binding_0);
David Tolnay5f332a92017-12-26 00:42:45 -05003417 }
3418 }
3419}
David Tolnay8c81f622018-07-31 23:34:35 -07003420#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003421pub fn visit_variant<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Variant) {
David Tolnay8c81f622018-07-31 23:34:35 -07003422 for it in &_i.attrs {
3423 _visitor.visit_attribute(it)
3424 }
3425 _visitor.visit_ident(&_i.ident);
3426 _visitor.visit_fields(&_i.fields);
3427 if let Some(ref it) = _i.discriminant {
David Tolnay7ac699c2018-08-24 14:00:58 -04003428 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003429 _visitor.visit_expr(&(it).1);
3430 };
Nika Layzell27726662017-10-24 23:16:35 -04003431}
David Tolnay8c81f622018-07-31 23:34:35 -07003432#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003433pub fn visit_vis_crate<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast VisCrate) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003434 tokens_helper(_visitor, &_i.crate_token.span);
Nika Layzell27726662017-10-24 23:16:35 -04003435}
David Tolnay8c81f622018-07-31 23:34:35 -07003436#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003437pub fn visit_vis_public<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast VisPublic) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003438 tokens_helper(_visitor, &_i.pub_token.span);
Nika Layzell27726662017-10-24 23:16:35 -04003439}
David Tolnay8c81f622018-07-31 23:34:35 -07003440#[cfg(any(feature = "full", feature = "derive"))]
3441pub fn visit_vis_restricted<'ast, V: Visit<'ast> + ?Sized>(
3442 _visitor: &mut V,
3443 _i: &'ast VisRestricted,
3444) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003445 tokens_helper(_visitor, &_i.pub_token.span);
3446 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003447 if let Some(ref it) = _i.in_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003448 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003449 };
3450 _visitor.visit_path(&*_i.path);
Nika Layzell27726662017-10-24 23:16:35 -04003451}
David Tolnay8c81f622018-07-31 23:34:35 -07003452#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003453pub fn visit_visibility<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Visibility) {
Nika Layzell27726662017-10-24 23:16:35 -04003454 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003455 Visibility::Public(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003456 _visitor.visit_vis_public(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003457 }
David Tolnay8c81f622018-07-31 23:34:35 -07003458 Visibility::Crate(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003459 _visitor.visit_vis_crate(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003460 }
David Tolnay8c81f622018-07-31 23:34:35 -07003461 Visibility::Restricted(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003462 _visitor.visit_vis_restricted(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003463 }
David Tolnay8c81f622018-07-31 23:34:35 -07003464 Visibility::Inherited => {}
Nika Layzell27726662017-10-24 23:16:35 -04003465 }
3466}
David Tolnay8c81f622018-07-31 23:34:35 -07003467#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003468pub fn visit_where_clause<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast WhereClause) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003469 tokens_helper(_visitor, &_i.where_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003470 for el in Punctuated::pairs(&_i.predicates) {
3471 let it = el.value();
3472 _visitor.visit_where_predicate(it)
3473 }
Nika Layzell27726662017-10-24 23:16:35 -04003474}
David Tolnay8c81f622018-07-31 23:34:35 -07003475#[cfg(any(feature = "full", feature = "derive"))]
3476pub fn visit_where_predicate<'ast, V: Visit<'ast> + ?Sized>(
3477 _visitor: &mut V,
3478 _i: &'ast WherePredicate,
3479) {
Nika Layzell27726662017-10-24 23:16:35 -04003480 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003481 WherePredicate::Type(ref _binding_0) => {
David Tolnayd4add852018-01-01 20:13:24 -08003482 _visitor.visit_predicate_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003483 }
David Tolnay8c81f622018-07-31 23:34:35 -07003484 WherePredicate::Lifetime(ref _binding_0) => {
David Tolnayd4add852018-01-01 20:13:24 -08003485 _visitor.visit_predicate_lifetime(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003486 }
David Tolnay8c81f622018-07-31 23:34:35 -07003487 WherePredicate::Eq(ref _binding_0) => {
David Tolnayd4add852018-01-01 20:13:24 -08003488 _visitor.visit_predicate_eq(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003489 }
3490 }
3491}