blob: 90b2607a3bfce03d72f75fcef639a926982759c7 [file] [log] [blame]
Nika Layzell27726662017-10-24 23:16:35 -04001// THIS FILE IS AUTOMATICALLY GENERATED; DO NOT EDIT
2
David Tolnayf0d63bf2017-12-26 12:29:47 -05003#![cfg_attr(feature = "cargo-clippy", allow(match_same_arms))]
David Tolnay0a0d78c2018-01-05 15:24:01 -08004#[cfg(any(feature = "full", feature = "derive"))]
David Tolnaycc0f0372017-12-28 19:11:04 -05005use gen::helper::visit::*;
David Tolnay8c81f622018-07-31 23:34:35 -07006use proc_macro2::Span;
7#[cfg(any(feature = "full", feature = "derive"))]
8use punctuated::Punctuated;
9use *;
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040010#[cfg(feature = "full")]
11macro_rules! full {
David Tolnay280202f2018-08-02 00:29:54 -070012 ($e:expr) => {
David Tolnay8c81f622018-07-31 23:34:35 -070013 $e
14 };
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040015}
David Tolnay0a0d78c2018-01-05 15:24:01 -080016#[cfg(all(feature = "derive", not(feature = "full")))]
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040017macro_rules! full {
David Tolnay280202f2018-08-02 00:29:54 -070018 ($e:expr) => {
David Tolnay8c81f622018-07-31 23:34:35 -070019 unreachable!()
20 };
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040021}
David Tolnay6af48992018-08-01 11:16:28 -070022#[cfg(any(feature = "full", feature = "derive"))]
23macro_rules! skip {
David Tolnay280202f2018-08-02 00:29:54 -070024 ($($tt:tt)*) => {};
David Tolnay6af48992018-08-01 11:16:28 -070025}
26#[doc = r" Syntax tree traversal to walk a shared borrow of a syntax tree."]
27#[doc = r""]
28#[doc = r" See the [module documentation] for details."]
29#[doc = r""]
30#[doc = r" [module documentation]: index.html"]
31#[doc = r""]
32#[doc = r#" *This trait is available if Syn is built with the `"visit"` feature.*"#]
David Tolnay4b4c4b62018-01-06 13:48:05 -080033pub trait Visit<'ast> {
David Tolnay8c81f622018-07-31 23:34:35 -070034 #[cfg(any(feature = "full", feature = "derive"))]
35 fn visit_abi(&mut self, i: &'ast Abi) {
36 visit_abi(self, i)
37 }
38 #[cfg(any(feature = "full", feature = "derive"))]
39 fn visit_angle_bracketed_generic_arguments(&mut self, i: &'ast AngleBracketedGenericArguments) {
40 visit_angle_bracketed_generic_arguments(self, i)
41 }
42 #[cfg(feature = "full")]
43 fn visit_arg_captured(&mut self, i: &'ast ArgCaptured) {
44 visit_arg_captured(self, i)
45 }
46 #[cfg(feature = "full")]
47 fn visit_arg_self(&mut self, i: &'ast ArgSelf) {
48 visit_arg_self(self, i)
49 }
50 #[cfg(feature = "full")]
51 fn visit_arg_self_ref(&mut self, i: &'ast ArgSelfRef) {
52 visit_arg_self_ref(self, i)
53 }
54 #[cfg(any(feature = "full", feature = "derive"))]
55 #[cfg(feature = "full")]
56 fn visit_arm(&mut self, i: &'ast Arm) {
57 visit_arm(self, i)
58 }
59 #[cfg(any(feature = "full", feature = "derive"))]
60 fn visit_attr_style(&mut self, i: &'ast AttrStyle) {
61 visit_attr_style(self, i)
62 }
63 #[cfg(any(feature = "full", feature = "derive"))]
64 fn visit_attribute(&mut self, i: &'ast Attribute) {
65 visit_attribute(self, i)
66 }
67 #[cfg(any(feature = "full", feature = "derive"))]
68 fn visit_bare_fn_arg(&mut self, i: &'ast BareFnArg) {
69 visit_bare_fn_arg(self, i)
70 }
71 #[cfg(any(feature = "full", feature = "derive"))]
72 fn visit_bare_fn_arg_name(&mut self, i: &'ast BareFnArgName) {
73 visit_bare_fn_arg_name(self, i)
74 }
75 #[cfg(any(feature = "full", feature = "derive"))]
76 fn visit_bin_op(&mut self, i: &'ast BinOp) {
77 visit_bin_op(self, i)
78 }
79 #[cfg(any(feature = "full", feature = "derive"))]
80 fn visit_binding(&mut self, i: &'ast Binding) {
81 visit_binding(self, i)
82 }
83 #[cfg(any(feature = "full", feature = "derive"))]
84 #[cfg(feature = "full")]
85 fn visit_block(&mut self, i: &'ast Block) {
86 visit_block(self, i)
87 }
88 #[cfg(any(feature = "full", feature = "derive"))]
89 fn visit_bound_lifetimes(&mut self, i: &'ast BoundLifetimes) {
90 visit_bound_lifetimes(self, i)
91 }
92 #[cfg(any(feature = "full", feature = "derive"))]
93 fn visit_const_param(&mut self, i: &'ast ConstParam) {
94 visit_const_param(self, i)
95 }
96 #[cfg(feature = "derive")]
97 fn visit_data(&mut self, i: &'ast Data) {
98 visit_data(self, i)
99 }
100 #[cfg(feature = "derive")]
101 fn visit_data_enum(&mut self, i: &'ast DataEnum) {
102 visit_data_enum(self, i)
103 }
104 #[cfg(feature = "derive")]
105 fn visit_data_struct(&mut self, i: &'ast DataStruct) {
106 visit_data_struct(self, i)
107 }
108 #[cfg(feature = "derive")]
109 fn visit_data_union(&mut self, i: &'ast DataUnion) {
110 visit_data_union(self, i)
111 }
112 #[cfg(feature = "derive")]
113 fn visit_derive_input(&mut self, i: &'ast DeriveInput) {
114 visit_derive_input(self, i)
115 }
116 #[cfg(any(feature = "full", feature = "derive"))]
117 fn visit_expr(&mut self, i: &'ast Expr) {
118 visit_expr(self, i)
119 }
120 #[cfg(feature = "full")]
121 #[cfg(any(feature = "full", feature = "derive"))]
122 fn visit_expr_array(&mut self, i: &'ast ExprArray) {
123 visit_expr_array(self, i)
124 }
125 #[cfg(feature = "full")]
126 #[cfg(any(feature = "full", feature = "derive"))]
127 fn visit_expr_assign(&mut self, i: &'ast ExprAssign) {
128 visit_expr_assign(self, i)
129 }
130 #[cfg(feature = "full")]
131 #[cfg(any(feature = "full", feature = "derive"))]
132 fn visit_expr_assign_op(&mut self, i: &'ast ExprAssignOp) {
133 visit_expr_assign_op(self, i)
134 }
David Tolnay02a9c6f2018-08-24 18:58:45 -0400135 #[cfg(feature = "full")]
136 #[cfg(any(feature = "full", feature = "derive"))]
137 fn visit_expr_async(&mut self, i: &'ast ExprAsync) {
138 visit_expr_async(self, i)
139 }
David Tolnay8c81f622018-07-31 23:34:35 -0700140 #[cfg(any(feature = "full", feature = "derive"))]
141 fn visit_expr_binary(&mut self, i: &'ast ExprBinary) {
142 visit_expr_binary(self, i)
143 }
144 #[cfg(feature = "full")]
145 #[cfg(any(feature = "full", feature = "derive"))]
146 fn visit_expr_block(&mut self, i: &'ast ExprBlock) {
147 visit_expr_block(self, i)
148 }
149 #[cfg(feature = "full")]
150 #[cfg(any(feature = "full", feature = "derive"))]
151 fn visit_expr_box(&mut self, i: &'ast ExprBox) {
152 visit_expr_box(self, i)
153 }
154 #[cfg(feature = "full")]
155 #[cfg(any(feature = "full", feature = "derive"))]
156 fn visit_expr_break(&mut self, i: &'ast ExprBreak) {
157 visit_expr_break(self, i)
158 }
159 #[cfg(any(feature = "full", feature = "derive"))]
160 fn visit_expr_call(&mut self, i: &'ast ExprCall) {
161 visit_expr_call(self, i)
162 }
163 #[cfg(any(feature = "full", feature = "derive"))]
164 fn visit_expr_cast(&mut self, i: &'ast ExprCast) {
165 visit_expr_cast(self, i)
166 }
167 #[cfg(feature = "full")]
168 #[cfg(any(feature = "full", feature = "derive"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700169 fn visit_expr_closure(&mut self, i: &'ast ExprClosure) {
170 visit_expr_closure(self, i)
171 }
172 #[cfg(feature = "full")]
173 #[cfg(any(feature = "full", feature = "derive"))]
174 fn visit_expr_continue(&mut self, i: &'ast ExprContinue) {
175 visit_expr_continue(self, i)
176 }
177 #[cfg(any(feature = "full", feature = "derive"))]
178 fn visit_expr_field(&mut self, i: &'ast ExprField) {
179 visit_expr_field(self, i)
180 }
181 #[cfg(feature = "full")]
182 #[cfg(any(feature = "full", feature = "derive"))]
183 fn visit_expr_for_loop(&mut self, i: &'ast ExprForLoop) {
184 visit_expr_for_loop(self, i)
185 }
186 #[cfg(feature = "full")]
187 #[cfg(any(feature = "full", feature = "derive"))]
188 fn visit_expr_group(&mut self, i: &'ast ExprGroup) {
189 visit_expr_group(self, i)
190 }
191 #[cfg(feature = "full")]
192 #[cfg(any(feature = "full", feature = "derive"))]
193 fn visit_expr_if(&mut self, i: &'ast ExprIf) {
194 visit_expr_if(self, i)
195 }
196 #[cfg(feature = "full")]
197 #[cfg(any(feature = "full", feature = "derive"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700198 fn visit_expr_in_place(&mut self, i: &'ast ExprInPlace) {
199 visit_expr_in_place(self, i)
200 }
201 #[cfg(any(feature = "full", feature = "derive"))]
202 fn visit_expr_index(&mut self, i: &'ast ExprIndex) {
203 visit_expr_index(self, i)
204 }
David Tolnay9c119122018-09-01 18:47:02 -0700205 #[cfg(feature = "full")]
206 #[cfg(any(feature = "full", feature = "derive"))]
207 fn visit_expr_let(&mut self, i: &'ast ExprLet) {
208 visit_expr_let(self, i)
209 }
David Tolnay8c81f622018-07-31 23:34:35 -0700210 #[cfg(any(feature = "full", feature = "derive"))]
211 fn visit_expr_lit(&mut self, i: &'ast ExprLit) {
212 visit_expr_lit(self, i)
213 }
214 #[cfg(feature = "full")]
215 #[cfg(any(feature = "full", feature = "derive"))]
216 fn visit_expr_loop(&mut self, i: &'ast ExprLoop) {
217 visit_expr_loop(self, i)
218 }
219 #[cfg(feature = "full")]
220 #[cfg(any(feature = "full", feature = "derive"))]
221 fn visit_expr_macro(&mut self, i: &'ast ExprMacro) {
222 visit_expr_macro(self, i)
223 }
224 #[cfg(feature = "full")]
225 #[cfg(any(feature = "full", feature = "derive"))]
226 fn visit_expr_match(&mut self, i: &'ast ExprMatch) {
227 visit_expr_match(self, i)
228 }
229 #[cfg(feature = "full")]
230 #[cfg(any(feature = "full", feature = "derive"))]
231 fn visit_expr_method_call(&mut self, i: &'ast ExprMethodCall) {
232 visit_expr_method_call(self, i)
233 }
234 #[cfg(any(feature = "full", feature = "derive"))]
235 fn visit_expr_paren(&mut self, i: &'ast ExprParen) {
236 visit_expr_paren(self, i)
237 }
238 #[cfg(any(feature = "full", feature = "derive"))]
239 fn visit_expr_path(&mut self, i: &'ast ExprPath) {
240 visit_expr_path(self, i)
241 }
242 #[cfg(feature = "full")]
243 #[cfg(any(feature = "full", feature = "derive"))]
244 fn visit_expr_range(&mut self, i: &'ast ExprRange) {
245 visit_expr_range(self, i)
246 }
247 #[cfg(feature = "full")]
248 #[cfg(any(feature = "full", feature = "derive"))]
249 fn visit_expr_reference(&mut self, i: &'ast ExprReference) {
250 visit_expr_reference(self, i)
251 }
252 #[cfg(feature = "full")]
253 #[cfg(any(feature = "full", feature = "derive"))]
254 fn visit_expr_repeat(&mut self, i: &'ast ExprRepeat) {
255 visit_expr_repeat(self, i)
256 }
257 #[cfg(feature = "full")]
258 #[cfg(any(feature = "full", feature = "derive"))]
259 fn visit_expr_return(&mut self, i: &'ast ExprReturn) {
260 visit_expr_return(self, i)
261 }
262 #[cfg(feature = "full")]
263 #[cfg(any(feature = "full", feature = "derive"))]
264 fn visit_expr_struct(&mut self, i: &'ast ExprStruct) {
265 visit_expr_struct(self, i)
266 }
267 #[cfg(feature = "full")]
268 #[cfg(any(feature = "full", feature = "derive"))]
269 fn visit_expr_try(&mut self, i: &'ast ExprTry) {
270 visit_expr_try(self, i)
271 }
272 #[cfg(feature = "full")]
273 #[cfg(any(feature = "full", feature = "derive"))]
David Tolnayfb2dd4b2018-08-24 16:45:34 -0400274 fn visit_expr_try_block(&mut self, i: &'ast ExprTryBlock) {
275 visit_expr_try_block(self, i)
276 }
277 #[cfg(feature = "full")]
278 #[cfg(any(feature = "full", feature = "derive"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700279 fn visit_expr_tuple(&mut self, i: &'ast ExprTuple) {
280 visit_expr_tuple(self, i)
281 }
282 #[cfg(feature = "full")]
283 #[cfg(any(feature = "full", feature = "derive"))]
284 fn visit_expr_type(&mut self, i: &'ast ExprType) {
285 visit_expr_type(self, i)
286 }
287 #[cfg(any(feature = "full", feature = "derive"))]
288 fn visit_expr_unary(&mut self, i: &'ast ExprUnary) {
289 visit_expr_unary(self, i)
290 }
291 #[cfg(feature = "full")]
292 #[cfg(any(feature = "full", feature = "derive"))]
293 fn visit_expr_unsafe(&mut self, i: &'ast ExprUnsafe) {
294 visit_expr_unsafe(self, i)
295 }
296 #[cfg(any(feature = "full", feature = "derive"))]
297 fn visit_expr_verbatim(&mut self, i: &'ast ExprVerbatim) {
298 visit_expr_verbatim(self, i)
299 }
300 #[cfg(feature = "full")]
301 #[cfg(any(feature = "full", feature = "derive"))]
302 fn visit_expr_while(&mut self, i: &'ast ExprWhile) {
303 visit_expr_while(self, i)
304 }
305 #[cfg(feature = "full")]
306 #[cfg(any(feature = "full", feature = "derive"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700307 fn visit_expr_yield(&mut self, i: &'ast ExprYield) {
308 visit_expr_yield(self, i)
309 }
310 #[cfg(any(feature = "full", feature = "derive"))]
311 fn visit_field(&mut self, i: &'ast Field) {
312 visit_field(self, i)
313 }
314 #[cfg(any(feature = "full", feature = "derive"))]
315 #[cfg(feature = "full")]
316 fn visit_field_pat(&mut self, i: &'ast FieldPat) {
317 visit_field_pat(self, i)
318 }
319 #[cfg(any(feature = "full", feature = "derive"))]
320 #[cfg(feature = "full")]
321 fn visit_field_value(&mut self, i: &'ast FieldValue) {
322 visit_field_value(self, i)
323 }
324 #[cfg(any(feature = "full", feature = "derive"))]
325 fn visit_fields(&mut self, i: &'ast Fields) {
326 visit_fields(self, i)
327 }
328 #[cfg(any(feature = "full", feature = "derive"))]
329 fn visit_fields_named(&mut self, i: &'ast FieldsNamed) {
330 visit_fields_named(self, i)
331 }
332 #[cfg(any(feature = "full", feature = "derive"))]
333 fn visit_fields_unnamed(&mut self, i: &'ast FieldsUnnamed) {
334 visit_fields_unnamed(self, i)
335 }
336 #[cfg(feature = "full")]
337 fn visit_file(&mut self, i: &'ast File) {
338 visit_file(self, i)
339 }
340 #[cfg(feature = "full")]
341 fn visit_fn_arg(&mut self, i: &'ast FnArg) {
342 visit_fn_arg(self, i)
343 }
344 #[cfg(feature = "full")]
345 fn visit_fn_decl(&mut self, i: &'ast FnDecl) {
346 visit_fn_decl(self, i)
347 }
348 #[cfg(feature = "full")]
349 fn visit_foreign_item(&mut self, i: &'ast ForeignItem) {
350 visit_foreign_item(self, i)
351 }
352 #[cfg(feature = "full")]
353 fn visit_foreign_item_fn(&mut self, i: &'ast ForeignItemFn) {
354 visit_foreign_item_fn(self, i)
355 }
356 #[cfg(feature = "full")]
David Tolnay435c1782018-08-24 16:15:44 -0400357 fn visit_foreign_item_macro(&mut self, i: &'ast ForeignItemMacro) {
358 visit_foreign_item_macro(self, i)
359 }
360 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700361 fn visit_foreign_item_static(&mut self, i: &'ast ForeignItemStatic) {
362 visit_foreign_item_static(self, i)
363 }
364 #[cfg(feature = "full")]
365 fn visit_foreign_item_type(&mut self, i: &'ast ForeignItemType) {
366 visit_foreign_item_type(self, i)
367 }
368 #[cfg(feature = "full")]
369 fn visit_foreign_item_verbatim(&mut self, i: &'ast ForeignItemVerbatim) {
370 visit_foreign_item_verbatim(self, i)
371 }
372 #[cfg(any(feature = "full", feature = "derive"))]
373 fn visit_generic_argument(&mut self, i: &'ast GenericArgument) {
374 visit_generic_argument(self, i)
375 }
376 #[cfg(any(feature = "full", feature = "derive"))]
377 #[cfg(feature = "full")]
378 fn visit_generic_method_argument(&mut self, i: &'ast GenericMethodArgument) {
379 visit_generic_method_argument(self, i)
380 }
381 #[cfg(any(feature = "full", feature = "derive"))]
382 fn visit_generic_param(&mut self, i: &'ast GenericParam) {
383 visit_generic_param(self, i)
384 }
385 #[cfg(any(feature = "full", feature = "derive"))]
386 fn visit_generics(&mut self, i: &'ast Generics) {
387 visit_generics(self, i)
388 }
David Tolnay8c81f622018-07-31 23:34:35 -0700389 fn visit_ident(&mut self, i: &'ast Ident) {
390 visit_ident(self, i)
391 }
392 #[cfg(feature = "full")]
393 fn visit_impl_item(&mut self, i: &'ast ImplItem) {
394 visit_impl_item(self, i)
395 }
396 #[cfg(feature = "full")]
397 fn visit_impl_item_const(&mut self, i: &'ast ImplItemConst) {
398 visit_impl_item_const(self, i)
399 }
400 #[cfg(feature = "full")]
David Tolnaybb82ef02018-08-24 20:15:45 -0400401 fn visit_impl_item_existential(&mut self, i: &'ast ImplItemExistential) {
402 visit_impl_item_existential(self, i)
403 }
404 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700405 fn visit_impl_item_macro(&mut self, i: &'ast ImplItemMacro) {
406 visit_impl_item_macro(self, i)
407 }
408 #[cfg(feature = "full")]
409 fn visit_impl_item_method(&mut self, i: &'ast ImplItemMethod) {
410 visit_impl_item_method(self, i)
411 }
412 #[cfg(feature = "full")]
413 fn visit_impl_item_type(&mut self, i: &'ast ImplItemType) {
414 visit_impl_item_type(self, i)
415 }
416 #[cfg(feature = "full")]
417 fn visit_impl_item_verbatim(&mut self, i: &'ast ImplItemVerbatim) {
418 visit_impl_item_verbatim(self, i)
419 }
420 #[cfg(any(feature = "full", feature = "derive"))]
421 fn visit_index(&mut self, i: &'ast Index) {
422 visit_index(self, i)
423 }
424 #[cfg(feature = "full")]
425 fn visit_item(&mut self, i: &'ast Item) {
426 visit_item(self, i)
427 }
428 #[cfg(feature = "full")]
429 fn visit_item_const(&mut self, i: &'ast ItemConst) {
430 visit_item_const(self, i)
431 }
432 #[cfg(feature = "full")]
433 fn visit_item_enum(&mut self, i: &'ast ItemEnum) {
434 visit_item_enum(self, i)
435 }
436 #[cfg(feature = "full")]
David Tolnaybb82ef02018-08-24 20:15:45 -0400437 fn visit_item_existential(&mut self, i: &'ast ItemExistential) {
438 visit_item_existential(self, i)
439 }
440 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700441 fn visit_item_extern_crate(&mut self, i: &'ast ItemExternCrate) {
442 visit_item_extern_crate(self, i)
443 }
444 #[cfg(feature = "full")]
445 fn visit_item_fn(&mut self, i: &'ast ItemFn) {
446 visit_item_fn(self, i)
447 }
448 #[cfg(feature = "full")]
449 fn visit_item_foreign_mod(&mut self, i: &'ast ItemForeignMod) {
450 visit_item_foreign_mod(self, i)
451 }
452 #[cfg(feature = "full")]
453 fn visit_item_impl(&mut self, i: &'ast ItemImpl) {
454 visit_item_impl(self, i)
455 }
456 #[cfg(feature = "full")]
457 fn visit_item_macro(&mut self, i: &'ast ItemMacro) {
458 visit_item_macro(self, i)
459 }
460 #[cfg(feature = "full")]
461 fn visit_item_macro2(&mut self, i: &'ast ItemMacro2) {
462 visit_item_macro2(self, i)
463 }
464 #[cfg(feature = "full")]
465 fn visit_item_mod(&mut self, i: &'ast ItemMod) {
466 visit_item_mod(self, i)
467 }
468 #[cfg(feature = "full")]
469 fn visit_item_static(&mut self, i: &'ast ItemStatic) {
470 visit_item_static(self, i)
471 }
472 #[cfg(feature = "full")]
473 fn visit_item_struct(&mut self, i: &'ast ItemStruct) {
474 visit_item_struct(self, i)
475 }
476 #[cfg(feature = "full")]
477 fn visit_item_trait(&mut self, i: &'ast ItemTrait) {
478 visit_item_trait(self, i)
479 }
480 #[cfg(feature = "full")]
David Tolnayc6b04dd2018-08-30 23:22:51 -0700481 fn visit_item_trait_alias(&mut self, i: &'ast ItemTraitAlias) {
482 visit_item_trait_alias(self, i)
483 }
484 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700485 fn visit_item_type(&mut self, i: &'ast ItemType) {
486 visit_item_type(self, i)
487 }
488 #[cfg(feature = "full")]
489 fn visit_item_union(&mut self, i: &'ast ItemUnion) {
490 visit_item_union(self, i)
491 }
492 #[cfg(feature = "full")]
493 fn visit_item_use(&mut self, i: &'ast ItemUse) {
494 visit_item_use(self, i)
495 }
496 #[cfg(feature = "full")]
497 fn visit_item_verbatim(&mut self, i: &'ast ItemVerbatim) {
498 visit_item_verbatim(self, i)
499 }
500 #[cfg(any(feature = "full", feature = "derive"))]
501 #[cfg(feature = "full")]
502 fn visit_label(&mut self, i: &'ast Label) {
503 visit_label(self, i)
504 }
David Tolnay8c81f622018-07-31 23:34:35 -0700505 fn visit_lifetime(&mut self, i: &'ast Lifetime) {
506 visit_lifetime(self, i)
507 }
508 #[cfg(any(feature = "full", feature = "derive"))]
509 fn visit_lifetime_def(&mut self, i: &'ast LifetimeDef) {
510 visit_lifetime_def(self, i)
511 }
512 #[cfg(any(feature = "full", feature = "derive"))]
513 fn visit_lit(&mut self, i: &'ast Lit) {
514 visit_lit(self, i)
515 }
516 #[cfg(any(feature = "full", feature = "derive"))]
517 fn visit_lit_bool(&mut self, i: &'ast LitBool) {
518 visit_lit_bool(self, i)
519 }
520 #[cfg(any(feature = "full", feature = "derive"))]
521 fn visit_lit_byte(&mut self, i: &'ast LitByte) {
522 visit_lit_byte(self, i)
523 }
524 #[cfg(any(feature = "full", feature = "derive"))]
525 fn visit_lit_byte_str(&mut self, i: &'ast LitByteStr) {
526 visit_lit_byte_str(self, i)
527 }
528 #[cfg(any(feature = "full", feature = "derive"))]
529 fn visit_lit_char(&mut self, i: &'ast LitChar) {
530 visit_lit_char(self, i)
531 }
532 #[cfg(any(feature = "full", feature = "derive"))]
533 fn visit_lit_float(&mut self, i: &'ast LitFloat) {
534 visit_lit_float(self, i)
535 }
536 #[cfg(any(feature = "full", feature = "derive"))]
537 fn visit_lit_int(&mut self, i: &'ast LitInt) {
538 visit_lit_int(self, i)
539 }
540 #[cfg(any(feature = "full", feature = "derive"))]
541 fn visit_lit_str(&mut self, i: &'ast LitStr) {
542 visit_lit_str(self, i)
543 }
544 #[cfg(any(feature = "full", feature = "derive"))]
545 fn visit_lit_verbatim(&mut self, i: &'ast LitVerbatim) {
546 visit_lit_verbatim(self, i)
547 }
548 #[cfg(any(feature = "full", feature = "derive"))]
549 #[cfg(feature = "full")]
550 fn visit_local(&mut self, i: &'ast Local) {
551 visit_local(self, i)
552 }
553 #[cfg(any(feature = "full", feature = "derive"))]
554 fn visit_macro(&mut self, i: &'ast Macro) {
555 visit_macro(self, i)
556 }
557 #[cfg(any(feature = "full", feature = "derive"))]
558 fn visit_macro_delimiter(&mut self, i: &'ast MacroDelimiter) {
559 visit_macro_delimiter(self, i)
560 }
561 #[cfg(any(feature = "full", feature = "derive"))]
562 fn visit_member(&mut self, i: &'ast Member) {
563 visit_member(self, i)
564 }
565 #[cfg(any(feature = "full", feature = "derive"))]
566 fn visit_meta(&mut self, i: &'ast Meta) {
567 visit_meta(self, i)
568 }
569 #[cfg(any(feature = "full", feature = "derive"))]
570 fn visit_meta_list(&mut self, i: &'ast MetaList) {
571 visit_meta_list(self, i)
572 }
573 #[cfg(any(feature = "full", feature = "derive"))]
574 fn visit_meta_name_value(&mut self, i: &'ast MetaNameValue) {
575 visit_meta_name_value(self, i)
576 }
577 #[cfg(feature = "full")]
578 fn visit_method_sig(&mut self, i: &'ast MethodSig) {
579 visit_method_sig(self, i)
580 }
581 #[cfg(any(feature = "full", feature = "derive"))]
582 #[cfg(feature = "full")]
583 fn visit_method_turbofish(&mut self, i: &'ast MethodTurbofish) {
584 visit_method_turbofish(self, i)
585 }
586 #[cfg(any(feature = "full", feature = "derive"))]
587 fn visit_nested_meta(&mut self, i: &'ast NestedMeta) {
588 visit_nested_meta(self, i)
589 }
590 #[cfg(any(feature = "full", feature = "derive"))]
591 fn visit_parenthesized_generic_arguments(&mut self, i: &'ast ParenthesizedGenericArguments) {
592 visit_parenthesized_generic_arguments(self, i)
593 }
594 #[cfg(any(feature = "full", feature = "derive"))]
595 #[cfg(feature = "full")]
596 fn visit_pat(&mut self, i: &'ast Pat) {
597 visit_pat(self, i)
598 }
599 #[cfg(any(feature = "full", feature = "derive"))]
600 #[cfg(feature = "full")]
601 fn visit_pat_box(&mut self, i: &'ast PatBox) {
602 visit_pat_box(self, i)
603 }
604 #[cfg(any(feature = "full", feature = "derive"))]
605 #[cfg(feature = "full")]
606 fn visit_pat_ident(&mut self, i: &'ast PatIdent) {
607 visit_pat_ident(self, i)
608 }
609 #[cfg(any(feature = "full", feature = "derive"))]
610 #[cfg(feature = "full")]
611 fn visit_pat_lit(&mut self, i: &'ast PatLit) {
612 visit_pat_lit(self, i)
613 }
614 #[cfg(any(feature = "full", feature = "derive"))]
615 #[cfg(feature = "full")]
616 fn visit_pat_macro(&mut self, i: &'ast PatMacro) {
617 visit_pat_macro(self, i)
618 }
619 #[cfg(any(feature = "full", feature = "derive"))]
620 #[cfg(feature = "full")]
621 fn visit_pat_path(&mut self, i: &'ast PatPath) {
622 visit_pat_path(self, i)
623 }
624 #[cfg(any(feature = "full", feature = "derive"))]
625 #[cfg(feature = "full")]
626 fn visit_pat_range(&mut self, i: &'ast PatRange) {
627 visit_pat_range(self, i)
628 }
629 #[cfg(any(feature = "full", feature = "derive"))]
630 #[cfg(feature = "full")]
631 fn visit_pat_ref(&mut self, i: &'ast PatRef) {
632 visit_pat_ref(self, i)
633 }
634 #[cfg(any(feature = "full", feature = "derive"))]
635 #[cfg(feature = "full")]
636 fn visit_pat_slice(&mut self, i: &'ast PatSlice) {
637 visit_pat_slice(self, i)
638 }
639 #[cfg(any(feature = "full", feature = "derive"))]
640 #[cfg(feature = "full")]
641 fn visit_pat_struct(&mut self, i: &'ast PatStruct) {
642 visit_pat_struct(self, i)
643 }
644 #[cfg(any(feature = "full", feature = "derive"))]
645 #[cfg(feature = "full")]
646 fn visit_pat_tuple(&mut self, i: &'ast PatTuple) {
647 visit_pat_tuple(self, i)
648 }
649 #[cfg(any(feature = "full", feature = "derive"))]
650 #[cfg(feature = "full")]
651 fn visit_pat_tuple_struct(&mut self, i: &'ast PatTupleStruct) {
652 visit_pat_tuple_struct(self, i)
653 }
654 #[cfg(any(feature = "full", feature = "derive"))]
655 #[cfg(feature = "full")]
656 fn visit_pat_verbatim(&mut self, i: &'ast PatVerbatim) {
657 visit_pat_verbatim(self, i)
658 }
659 #[cfg(any(feature = "full", feature = "derive"))]
660 #[cfg(feature = "full")]
661 fn visit_pat_wild(&mut self, i: &'ast PatWild) {
662 visit_pat_wild(self, i)
663 }
664 #[cfg(any(feature = "full", feature = "derive"))]
665 fn visit_path(&mut self, i: &'ast Path) {
666 visit_path(self, i)
667 }
668 #[cfg(any(feature = "full", feature = "derive"))]
669 fn visit_path_arguments(&mut self, i: &'ast PathArguments) {
670 visit_path_arguments(self, i)
671 }
672 #[cfg(any(feature = "full", feature = "derive"))]
673 fn visit_path_segment(&mut self, i: &'ast PathSegment) {
674 visit_path_segment(self, i)
675 }
676 #[cfg(any(feature = "full", feature = "derive"))]
677 fn visit_predicate_eq(&mut self, i: &'ast PredicateEq) {
678 visit_predicate_eq(self, i)
679 }
680 #[cfg(any(feature = "full", feature = "derive"))]
681 fn visit_predicate_lifetime(&mut self, i: &'ast PredicateLifetime) {
682 visit_predicate_lifetime(self, i)
683 }
684 #[cfg(any(feature = "full", feature = "derive"))]
685 fn visit_predicate_type(&mut self, i: &'ast PredicateType) {
686 visit_predicate_type(self, i)
687 }
688 #[cfg(any(feature = "full", feature = "derive"))]
689 fn visit_qself(&mut self, i: &'ast QSelf) {
690 visit_qself(self, i)
691 }
692 #[cfg(any(feature = "full", feature = "derive"))]
693 #[cfg(feature = "full")]
694 fn visit_range_limits(&mut self, i: &'ast RangeLimits) {
695 visit_range_limits(self, i)
696 }
697 #[cfg(any(feature = "full", feature = "derive"))]
698 fn visit_return_type(&mut self, i: &'ast ReturnType) {
699 visit_return_type(self, i)
700 }
David Tolnay8c81f622018-07-31 23:34:35 -0700701 fn visit_span(&mut self, i: &'ast Span) {
702 visit_span(self, i)
703 }
704 #[cfg(any(feature = "full", feature = "derive"))]
705 #[cfg(feature = "full")]
706 fn visit_stmt(&mut self, i: &'ast Stmt) {
707 visit_stmt(self, i)
708 }
709 #[cfg(any(feature = "full", feature = "derive"))]
710 fn visit_trait_bound(&mut self, i: &'ast TraitBound) {
711 visit_trait_bound(self, i)
712 }
713 #[cfg(any(feature = "full", feature = "derive"))]
714 fn visit_trait_bound_modifier(&mut self, i: &'ast TraitBoundModifier) {
715 visit_trait_bound_modifier(self, i)
716 }
717 #[cfg(feature = "full")]
718 fn visit_trait_item(&mut self, i: &'ast TraitItem) {
719 visit_trait_item(self, i)
720 }
721 #[cfg(feature = "full")]
722 fn visit_trait_item_const(&mut self, i: &'ast TraitItemConst) {
723 visit_trait_item_const(self, i)
724 }
725 #[cfg(feature = "full")]
726 fn visit_trait_item_macro(&mut self, i: &'ast TraitItemMacro) {
727 visit_trait_item_macro(self, i)
728 }
729 #[cfg(feature = "full")]
730 fn visit_trait_item_method(&mut self, i: &'ast TraitItemMethod) {
731 visit_trait_item_method(self, i)
732 }
733 #[cfg(feature = "full")]
734 fn visit_trait_item_type(&mut self, i: &'ast TraitItemType) {
735 visit_trait_item_type(self, i)
736 }
737 #[cfg(feature = "full")]
738 fn visit_trait_item_verbatim(&mut self, i: &'ast TraitItemVerbatim) {
739 visit_trait_item_verbatim(self, i)
740 }
741 #[cfg(any(feature = "full", feature = "derive"))]
742 fn visit_type(&mut self, i: &'ast Type) {
743 visit_type(self, i)
744 }
745 #[cfg(any(feature = "full", feature = "derive"))]
746 fn visit_type_array(&mut self, i: &'ast TypeArray) {
747 visit_type_array(self, i)
748 }
749 #[cfg(any(feature = "full", feature = "derive"))]
750 fn visit_type_bare_fn(&mut self, i: &'ast TypeBareFn) {
751 visit_type_bare_fn(self, i)
752 }
753 #[cfg(any(feature = "full", feature = "derive"))]
754 fn visit_type_group(&mut self, i: &'ast TypeGroup) {
755 visit_type_group(self, i)
756 }
757 #[cfg(any(feature = "full", feature = "derive"))]
758 fn visit_type_impl_trait(&mut self, i: &'ast TypeImplTrait) {
759 visit_type_impl_trait(self, i)
760 }
761 #[cfg(any(feature = "full", feature = "derive"))]
762 fn visit_type_infer(&mut self, i: &'ast TypeInfer) {
763 visit_type_infer(self, i)
764 }
765 #[cfg(any(feature = "full", feature = "derive"))]
766 fn visit_type_macro(&mut self, i: &'ast TypeMacro) {
767 visit_type_macro(self, i)
768 }
769 #[cfg(any(feature = "full", feature = "derive"))]
770 fn visit_type_never(&mut self, i: &'ast TypeNever) {
771 visit_type_never(self, i)
772 }
773 #[cfg(any(feature = "full", feature = "derive"))]
774 fn visit_type_param(&mut self, i: &'ast TypeParam) {
775 visit_type_param(self, i)
776 }
777 #[cfg(any(feature = "full", feature = "derive"))]
778 fn visit_type_param_bound(&mut self, i: &'ast TypeParamBound) {
779 visit_type_param_bound(self, i)
780 }
781 #[cfg(any(feature = "full", feature = "derive"))]
782 fn visit_type_paren(&mut self, i: &'ast TypeParen) {
783 visit_type_paren(self, i)
784 }
785 #[cfg(any(feature = "full", feature = "derive"))]
786 fn visit_type_path(&mut self, i: &'ast TypePath) {
787 visit_type_path(self, i)
788 }
789 #[cfg(any(feature = "full", feature = "derive"))]
790 fn visit_type_ptr(&mut self, i: &'ast TypePtr) {
791 visit_type_ptr(self, i)
792 }
793 #[cfg(any(feature = "full", feature = "derive"))]
794 fn visit_type_reference(&mut self, i: &'ast TypeReference) {
795 visit_type_reference(self, i)
796 }
797 #[cfg(any(feature = "full", feature = "derive"))]
798 fn visit_type_slice(&mut self, i: &'ast TypeSlice) {
799 visit_type_slice(self, i)
800 }
801 #[cfg(any(feature = "full", feature = "derive"))]
802 fn visit_type_trait_object(&mut self, i: &'ast TypeTraitObject) {
803 visit_type_trait_object(self, i)
804 }
805 #[cfg(any(feature = "full", feature = "derive"))]
806 fn visit_type_tuple(&mut self, i: &'ast TypeTuple) {
807 visit_type_tuple(self, i)
808 }
809 #[cfg(any(feature = "full", feature = "derive"))]
810 fn visit_type_verbatim(&mut self, i: &'ast TypeVerbatim) {
811 visit_type_verbatim(self, i)
812 }
813 #[cfg(any(feature = "full", feature = "derive"))]
814 fn visit_un_op(&mut self, i: &'ast UnOp) {
815 visit_un_op(self, i)
816 }
817 #[cfg(feature = "full")]
818 fn visit_use_glob(&mut self, i: &'ast UseGlob) {
819 visit_use_glob(self, i)
820 }
821 #[cfg(feature = "full")]
822 fn visit_use_group(&mut self, i: &'ast UseGroup) {
823 visit_use_group(self, i)
824 }
825 #[cfg(feature = "full")]
826 fn visit_use_name(&mut self, i: &'ast UseName) {
827 visit_use_name(self, i)
828 }
829 #[cfg(feature = "full")]
830 fn visit_use_path(&mut self, i: &'ast UsePath) {
831 visit_use_path(self, i)
832 }
833 #[cfg(feature = "full")]
834 fn visit_use_rename(&mut self, i: &'ast UseRename) {
835 visit_use_rename(self, i)
836 }
837 #[cfg(feature = "full")]
838 fn visit_use_tree(&mut self, i: &'ast UseTree) {
839 visit_use_tree(self, i)
840 }
841 #[cfg(any(feature = "full", feature = "derive"))]
842 fn visit_variant(&mut self, i: &'ast Variant) {
843 visit_variant(self, i)
844 }
845 #[cfg(any(feature = "full", feature = "derive"))]
846 fn visit_vis_crate(&mut self, i: &'ast VisCrate) {
847 visit_vis_crate(self, i)
848 }
849 #[cfg(any(feature = "full", feature = "derive"))]
850 fn visit_vis_public(&mut self, i: &'ast VisPublic) {
851 visit_vis_public(self, i)
852 }
853 #[cfg(any(feature = "full", feature = "derive"))]
854 fn visit_vis_restricted(&mut self, i: &'ast VisRestricted) {
855 visit_vis_restricted(self, i)
856 }
857 #[cfg(any(feature = "full", feature = "derive"))]
858 fn visit_visibility(&mut self, i: &'ast Visibility) {
859 visit_visibility(self, i)
860 }
861 #[cfg(any(feature = "full", feature = "derive"))]
862 fn visit_where_clause(&mut self, i: &'ast WhereClause) {
863 visit_where_clause(self, i)
864 }
865 #[cfg(any(feature = "full", feature = "derive"))]
866 fn visit_where_predicate(&mut self, i: &'ast WherePredicate) {
867 visit_where_predicate(self, i)
868 }
Nika Layzell27726662017-10-24 23:16:35 -0400869}
David Tolnay8c81f622018-07-31 23:34:35 -0700870#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800871pub fn visit_abi<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Abi) {
David Tolnay7ac699c2018-08-24 14:00:58 -0400872 tokens_helper(_visitor, &_i.extern_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -0700873 if let Some(ref it) = _i.name {
874 _visitor.visit_lit_str(it)
875 };
Nika Layzell27726662017-10-24 23:16:35 -0400876}
David Tolnay8c81f622018-07-31 23:34:35 -0700877#[cfg(any(feature = "full", feature = "derive"))]
878pub fn visit_angle_bracketed_generic_arguments<'ast, V: Visit<'ast> + ?Sized>(
879 _visitor: &mut V,
880 _i: &'ast AngleBracketedGenericArguments,
881) {
882 if let Some(ref it) = _i.colon2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -0400883 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -0700884 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400885 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700886 for el in Punctuated::pairs(&_i.args) {
887 let it = el.value();
888 _visitor.visit_generic_argument(it)
889 }
David Tolnay7ac699c2018-08-24 14:00:58 -0400890 tokens_helper(_visitor, &_i.gt_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400891}
David Tolnay8c81f622018-07-31 23:34:35 -0700892#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800893pub fn visit_arg_captured<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ArgCaptured) {
David Tolnay8c81f622018-07-31 23:34:35 -0700894 _visitor.visit_pat(&_i.pat);
David Tolnay7ac699c2018-08-24 14:00:58 -0400895 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700896 _visitor.visit_type(&_i.ty);
Nika Layzell27726662017-10-24 23:16:35 -0400897}
David Tolnay8c81f622018-07-31 23:34:35 -0700898#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800899pub fn visit_arg_self<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ArgSelf) {
David Tolnay8c81f622018-07-31 23:34:35 -0700900 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -0400901 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -0700902 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400903 tokens_helper(_visitor, &_i.self_token.span);
Nika Layzell27726662017-10-24 23:16:35 -0400904}
David Tolnay8c81f622018-07-31 23:34:35 -0700905#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800906pub fn visit_arg_self_ref<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ArgSelfRef) {
David Tolnay7ac699c2018-08-24 14:00:58 -0400907 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700908 if let Some(ref it) = _i.lifetime {
909 _visitor.visit_lifetime(it)
910 };
911 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -0400912 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -0700913 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400914 tokens_helper(_visitor, &_i.self_token.span);
Nika Layzell27726662017-10-24 23:16:35 -0400915}
David Tolnay8c81f622018-07-31 23:34:35 -0700916#[cfg(any(feature = "full", feature = "derive"))]
917#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800918pub fn visit_arm<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Arm) {
David Tolnay8c81f622018-07-31 23:34:35 -0700919 for it in &_i.attrs {
920 _visitor.visit_attribute(it)
921 }
922 if let Some(ref it) = _i.leading_vert {
David Tolnay7ac699c2018-08-24 14:00:58 -0400923 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -0700924 };
925 for el in Punctuated::pairs(&_i.pats) {
926 let it = el.value();
927 _visitor.visit_pat(it)
928 }
929 if let Some(ref it) = _i.guard {
David Tolnay7ac699c2018-08-24 14:00:58 -0400930 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -0700931 _visitor.visit_expr(&*(it).1);
932 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400933 tokens_helper(_visitor, &_i.fat_arrow_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700934 _visitor.visit_expr(&*_i.body);
935 if let Some(ref it) = _i.comma {
David Tolnay7ac699c2018-08-24 14:00:58 -0400936 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -0700937 };
Nika Layzell27726662017-10-24 23:16:35 -0400938}
David Tolnay8c81f622018-07-31 23:34:35 -0700939#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800940pub fn visit_attr_style<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast AttrStyle) {
Nika Layzell27726662017-10-24 23:16:35 -0400941 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -0700942 AttrStyle::Outer => {}
943 AttrStyle::Inner(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400944 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400945 }
946 }
947}
David Tolnay8c81f622018-07-31 23:34:35 -0700948#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800949pub fn visit_attribute<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Attribute) {
David Tolnay7ac699c2018-08-24 14:00:58 -0400950 tokens_helper(_visitor, &_i.pound_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700951 _visitor.visit_attr_style(&_i.style);
David Tolnay7ac699c2018-08-24 14:00:58 -0400952 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -0700953 _visitor.visit_path(&_i.path);
David Tolnay6af48992018-08-01 11:16:28 -0700954 skip!(_i.tts);
Nika Layzell27726662017-10-24 23:16:35 -0400955}
David Tolnay8c81f622018-07-31 23:34:35 -0700956#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800957pub fn visit_bare_fn_arg<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast BareFnArg) {
David Tolnay8c81f622018-07-31 23:34:35 -0700958 if let Some(ref it) = _i.name {
959 _visitor.visit_bare_fn_arg_name(&(it).0);
David Tolnay7ac699c2018-08-24 14:00:58 -0400960 tokens_helper(_visitor, &(it).1.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700961 };
962 _visitor.visit_type(&_i.ty);
Nika Layzell27726662017-10-24 23:16:35 -0400963}
David Tolnay8c81f622018-07-31 23:34:35 -0700964#[cfg(any(feature = "full", feature = "derive"))]
965pub fn visit_bare_fn_arg_name<'ast, V: Visit<'ast> + ?Sized>(
966 _visitor: &mut V,
967 _i: &'ast BareFnArgName,
968) {
Nika Layzell27726662017-10-24 23:16:35 -0400969 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -0700970 BareFnArgName::Named(ref _binding_0) => {
Alex Crichtond261d092018-05-18 13:47:35 -0700971 _visitor.visit_ident(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -0400972 }
David Tolnay8c81f622018-07-31 23:34:35 -0700973 BareFnArgName::Wild(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400974 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400975 }
976 }
977}
David Tolnay8c81f622018-07-31 23:34:35 -0700978#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800979pub fn visit_bin_op<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast BinOp) {
Nika Layzell27726662017-10-24 23:16:35 -0400980 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -0700981 BinOp::Add(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400982 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400983 }
David Tolnay8c81f622018-07-31 23:34:35 -0700984 BinOp::Sub(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400985 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400986 }
David Tolnay8c81f622018-07-31 23:34:35 -0700987 BinOp::Mul(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400988 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400989 }
David Tolnay8c81f622018-07-31 23:34:35 -0700990 BinOp::Div(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400991 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400992 }
David Tolnay8c81f622018-07-31 23:34:35 -0700993 BinOp::Rem(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400994 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400995 }
David Tolnay8c81f622018-07-31 23:34:35 -0700996 BinOp::And(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400997 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400998 }
David Tolnay8c81f622018-07-31 23:34:35 -0700999 BinOp::Or(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001000 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001001 }
David Tolnay8c81f622018-07-31 23:34:35 -07001002 BinOp::BitXor(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001003 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001004 }
David Tolnay8c81f622018-07-31 23:34:35 -07001005 BinOp::BitAnd(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001006 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001007 }
David Tolnay8c81f622018-07-31 23:34:35 -07001008 BinOp::BitOr(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001009 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001010 }
David Tolnay8c81f622018-07-31 23:34:35 -07001011 BinOp::Shl(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001012 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001013 }
David Tolnay8c81f622018-07-31 23:34:35 -07001014 BinOp::Shr(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001015 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001016 }
David Tolnay8c81f622018-07-31 23:34:35 -07001017 BinOp::Eq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001018 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001019 }
David Tolnay8c81f622018-07-31 23:34:35 -07001020 BinOp::Lt(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001021 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001022 }
David Tolnay8c81f622018-07-31 23:34:35 -07001023 BinOp::Le(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001024 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001025 }
David Tolnay8c81f622018-07-31 23:34:35 -07001026 BinOp::Ne(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001027 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001028 }
David Tolnay8c81f622018-07-31 23:34:35 -07001029 BinOp::Ge(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001030 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001031 }
David Tolnay8c81f622018-07-31 23:34:35 -07001032 BinOp::Gt(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001033 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001034 }
David Tolnay8c81f622018-07-31 23:34:35 -07001035 BinOp::AddEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001036 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001037 }
David Tolnay8c81f622018-07-31 23:34:35 -07001038 BinOp::SubEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001039 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001040 }
David Tolnay8c81f622018-07-31 23:34:35 -07001041 BinOp::MulEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001042 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001043 }
David Tolnay8c81f622018-07-31 23:34:35 -07001044 BinOp::DivEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001045 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001046 }
David Tolnay8c81f622018-07-31 23:34:35 -07001047 BinOp::RemEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001048 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001049 }
David Tolnay8c81f622018-07-31 23:34:35 -07001050 BinOp::BitXorEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001051 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001052 }
David Tolnay8c81f622018-07-31 23:34:35 -07001053 BinOp::BitAndEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001054 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001055 }
David Tolnay8c81f622018-07-31 23:34:35 -07001056 BinOp::BitOrEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001057 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001058 }
David Tolnay8c81f622018-07-31 23:34:35 -07001059 BinOp::ShlEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001060 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001061 }
David Tolnay8c81f622018-07-31 23:34:35 -07001062 BinOp::ShrEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001063 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001064 }
1065 }
1066}
David Tolnay8c81f622018-07-31 23:34:35 -07001067#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001068pub fn visit_binding<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Binding) {
David Tolnay8c81f622018-07-31 23:34:35 -07001069 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001070 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001071 _visitor.visit_type(&_i.ty);
David Tolnay506e43a2017-12-29 11:34:36 -05001072}
David Tolnay8c81f622018-07-31 23:34:35 -07001073#[cfg(any(feature = "full", feature = "derive"))]
1074#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001075pub fn visit_block<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Block) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001076 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001077 for it in &_i.stmts {
1078 _visitor.visit_stmt(it)
1079 }
Nika Layzell27726662017-10-24 23:16:35 -04001080}
David Tolnay8c81f622018-07-31 23:34:35 -07001081#[cfg(any(feature = "full", feature = "derive"))]
1082pub fn visit_bound_lifetimes<'ast, V: Visit<'ast> + ?Sized>(
1083 _visitor: &mut V,
1084 _i: &'ast BoundLifetimes,
1085) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001086 tokens_helper(_visitor, &_i.for_token.span);
1087 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001088 for el in Punctuated::pairs(&_i.lifetimes) {
1089 let it = el.value();
1090 _visitor.visit_lifetime_def(it)
1091 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001092 tokens_helper(_visitor, &_i.gt_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001093}
David Tolnay8c81f622018-07-31 23:34:35 -07001094#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001095pub fn visit_const_param<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ConstParam) {
David Tolnay8c81f622018-07-31 23:34:35 -07001096 for it in &_i.attrs {
1097 _visitor.visit_attribute(it)
1098 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001099 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001100 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001101 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001102 _visitor.visit_type(&_i.ty);
1103 if let Some(ref it) = _i.eq_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001104 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001105 };
1106 if let Some(ref it) = _i.default {
1107 _visitor.visit_expr(it)
1108 };
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001109}
David Tolnay8c81f622018-07-31 23:34:35 -07001110#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001111pub fn visit_data<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Data) {
David Tolnaye3d41b72017-12-31 15:24:00 -05001112 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001113 Data::Struct(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05001114 _visitor.visit_data_struct(_binding_0);
1115 }
David Tolnay8c81f622018-07-31 23:34:35 -07001116 Data::Enum(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05001117 _visitor.visit_data_enum(_binding_0);
1118 }
David Tolnay8c81f622018-07-31 23:34:35 -07001119 Data::Union(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05001120 _visitor.visit_data_union(_binding_0);
1121 }
1122 }
1123}
David Tolnay8c81f622018-07-31 23:34:35 -07001124#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001125pub fn visit_data_enum<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataEnum) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001126 tokens_helper(_visitor, &_i.enum_token.span);
1127 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001128 for el in Punctuated::pairs(&_i.variants) {
1129 let it = el.value();
1130 _visitor.visit_variant(it)
1131 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001132}
David Tolnay8c81f622018-07-31 23:34:35 -07001133#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001134pub fn visit_data_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataStruct) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001135 tokens_helper(_visitor, &_i.struct_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001136 _visitor.visit_fields(&_i.fields);
1137 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001138 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001139 };
David Tolnaye3d41b72017-12-31 15:24:00 -05001140}
David Tolnay8c81f622018-07-31 23:34:35 -07001141#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001142pub fn visit_data_union<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataUnion) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001143 tokens_helper(_visitor, &_i.union_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001144 _visitor.visit_fields_named(&_i.fields);
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_derive_input<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DeriveInput) {
David Tolnay8c81f622018-07-31 23:34:35 -07001148 for it in &_i.attrs {
1149 _visitor.visit_attribute(it)
1150 }
1151 _visitor.visit_visibility(&_i.vis);
1152 _visitor.visit_ident(&_i.ident);
1153 _visitor.visit_generics(&_i.generics);
1154 _visitor.visit_data(&_i.data);
Nika Layzell27726662017-10-24 23:16:35 -04001155}
David Tolnay8c81f622018-07-31 23:34:35 -07001156#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001157pub fn visit_expr<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Expr) {
Nika Layzell27726662017-10-24 23:16:35 -04001158 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001159 Expr::Box(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001160 full!(_visitor.visit_expr_box(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001161 }
David Tolnay8c81f622018-07-31 23:34:35 -07001162 Expr::InPlace(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001163 full!(_visitor.visit_expr_in_place(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001164 }
David Tolnay8c81f622018-07-31 23:34:35 -07001165 Expr::Array(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001166 full!(_visitor.visit_expr_array(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001167 }
David Tolnay8c81f622018-07-31 23:34:35 -07001168 Expr::Call(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001169 _visitor.visit_expr_call(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001170 }
David Tolnay8c81f622018-07-31 23:34:35 -07001171 Expr::MethodCall(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001172 full!(_visitor.visit_expr_method_call(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001173 }
David Tolnay8c81f622018-07-31 23:34:35 -07001174 Expr::Tuple(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001175 full!(_visitor.visit_expr_tuple(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001176 }
David Tolnay8c81f622018-07-31 23:34:35 -07001177 Expr::Binary(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001178 _visitor.visit_expr_binary(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001179 }
David Tolnay8c81f622018-07-31 23:34:35 -07001180 Expr::Unary(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001181 _visitor.visit_expr_unary(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001182 }
David Tolnay8c81f622018-07-31 23:34:35 -07001183 Expr::Lit(ref _binding_0) => {
David Tolnay8c91b882017-12-28 23:04:32 -05001184 _visitor.visit_expr_lit(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001185 }
David Tolnay8c81f622018-07-31 23:34:35 -07001186 Expr::Cast(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001187 _visitor.visit_expr_cast(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001188 }
David Tolnay8c81f622018-07-31 23:34:35 -07001189 Expr::Type(ref _binding_0) => {
David Tolnay0cf94f22017-12-28 23:46:26 -05001190 full!(_visitor.visit_expr_type(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001191 }
David Tolnay9c119122018-09-01 18:47:02 -07001192 Expr::Let(ref _binding_0) => {
1193 full!(_visitor.visit_expr_let(_binding_0));
1194 }
David Tolnay8c81f622018-07-31 23:34:35 -07001195 Expr::If(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001196 full!(_visitor.visit_expr_if(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001197 }
David Tolnay8c81f622018-07-31 23:34:35 -07001198 Expr::While(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001199 full!(_visitor.visit_expr_while(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001200 }
David Tolnay8c81f622018-07-31 23:34:35 -07001201 Expr::ForLoop(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001202 full!(_visitor.visit_expr_for_loop(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001203 }
David Tolnay8c81f622018-07-31 23:34:35 -07001204 Expr::Loop(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001205 full!(_visitor.visit_expr_loop(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001206 }
David Tolnay8c81f622018-07-31 23:34:35 -07001207 Expr::Match(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001208 full!(_visitor.visit_expr_match(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001209 }
David Tolnay8c81f622018-07-31 23:34:35 -07001210 Expr::Closure(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001211 full!(_visitor.visit_expr_closure(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001212 }
David Tolnay8c81f622018-07-31 23:34:35 -07001213 Expr::Unsafe(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001214 full!(_visitor.visit_expr_unsafe(_binding_0));
Nika Layzell640832a2017-12-04 13:37:09 -05001215 }
David Tolnay8c81f622018-07-31 23:34:35 -07001216 Expr::Block(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001217 full!(_visitor.visit_expr_block(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001218 }
David Tolnay8c81f622018-07-31 23:34:35 -07001219 Expr::Assign(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001220 full!(_visitor.visit_expr_assign(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001221 }
David Tolnay8c81f622018-07-31 23:34:35 -07001222 Expr::AssignOp(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001223 full!(_visitor.visit_expr_assign_op(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001224 }
David Tolnay8c81f622018-07-31 23:34:35 -07001225 Expr::Field(ref _binding_0) => {
David Tolnayd093fa92018-06-30 10:23:25 -07001226 _visitor.visit_expr_field(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001227 }
David Tolnay8c81f622018-07-31 23:34:35 -07001228 Expr::Index(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001229 _visitor.visit_expr_index(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001230 }
David Tolnay8c81f622018-07-31 23:34:35 -07001231 Expr::Range(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001232 full!(_visitor.visit_expr_range(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001233 }
David Tolnay8c81f622018-07-31 23:34:35 -07001234 Expr::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001235 _visitor.visit_expr_path(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001236 }
David Tolnay8c81f622018-07-31 23:34:35 -07001237 Expr::Reference(ref _binding_0) => {
David Tolnay00674ba2018-03-31 18:14:11 +02001238 full!(_visitor.visit_expr_reference(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001239 }
David Tolnay8c81f622018-07-31 23:34:35 -07001240 Expr::Break(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001241 full!(_visitor.visit_expr_break(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001242 }
David Tolnay8c81f622018-07-31 23:34:35 -07001243 Expr::Continue(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001244 full!(_visitor.visit_expr_continue(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001245 }
David Tolnay8c81f622018-07-31 23:34:35 -07001246 Expr::Return(ref _binding_0) => {
David Tolnayc246cd32017-12-28 23:14:32 -05001247 full!(_visitor.visit_expr_return(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001248 }
David Tolnay8c81f622018-07-31 23:34:35 -07001249 Expr::Macro(ref _binding_0) => {
David Tolnay8c91b882017-12-28 23:04:32 -05001250 full!(_visitor.visit_expr_macro(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001251 }
David Tolnay8c81f622018-07-31 23:34:35 -07001252 Expr::Struct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001253 full!(_visitor.visit_expr_struct(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001254 }
David Tolnay8c81f622018-07-31 23:34:35 -07001255 Expr::Repeat(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001256 full!(_visitor.visit_expr_repeat(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001257 }
David Tolnay8c81f622018-07-31 23:34:35 -07001258 Expr::Paren(ref _binding_0) => {
David Tolnay81ab4f62018-01-27 19:02:51 -08001259 _visitor.visit_expr_paren(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001260 }
David Tolnay8c81f622018-07-31 23:34:35 -07001261 Expr::Group(ref _binding_0) => {
David Tolnaye98775f2017-12-28 23:17:00 -05001262 full!(_visitor.visit_expr_group(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001263 }
David Tolnay8c81f622018-07-31 23:34:35 -07001264 Expr::Try(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001265 full!(_visitor.visit_expr_try(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001266 }
David Tolnay02a9c6f2018-08-24 18:58:45 -04001267 Expr::Async(ref _binding_0) => {
1268 full!(_visitor.visit_expr_async(_binding_0));
1269 }
David Tolnayfb2dd4b2018-08-24 16:45:34 -04001270 Expr::TryBlock(ref _binding_0) => {
1271 full!(_visitor.visit_expr_try_block(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001272 }
David Tolnay8c81f622018-07-31 23:34:35 -07001273 Expr::Yield(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001274 full!(_visitor.visit_expr_yield(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001275 }
David Tolnay8c81f622018-07-31 23:34:35 -07001276 Expr::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05001277 _visitor.visit_expr_verbatim(_binding_0);
1278 }
Nika Layzell27726662017-10-24 23:16:35 -04001279 }
1280}
David Tolnay8c81f622018-07-31 23:34:35 -07001281#[cfg(feature = "full")]
1282#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001283pub fn visit_expr_array<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprArray) {
David Tolnay8c81f622018-07-31 23:34:35 -07001284 for it in &_i.attrs {
1285 _visitor.visit_attribute(it)
1286 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001287 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001288 for el in Punctuated::pairs(&_i.elems) {
1289 let it = el.value();
1290 _visitor.visit_expr(it)
David Tolnaye3d41b72017-12-31 15:24:00 -05001291 }
1292}
David Tolnay8c81f622018-07-31 23:34:35 -07001293#[cfg(feature = "full")]
1294#[cfg(any(feature = "full", feature = "derive"))]
1295pub fn visit_expr_assign<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprAssign) {
1296 for it in &_i.attrs {
1297 _visitor.visit_attribute(it)
1298 }
1299 _visitor.visit_expr(&*_i.left);
David Tolnay7ac699c2018-08-24 14:00:58 -04001300 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001301 _visitor.visit_expr(&*_i.right);
1302}
1303#[cfg(feature = "full")]
1304#[cfg(any(feature = "full", feature = "derive"))]
1305pub fn visit_expr_assign_op<'ast, V: Visit<'ast> + ?Sized>(
1306 _visitor: &mut V,
1307 _i: &'ast ExprAssignOp,
1308) {
1309 for it in &_i.attrs {
1310 _visitor.visit_attribute(it)
1311 }
1312 _visitor.visit_expr(&*_i.left);
1313 _visitor.visit_bin_op(&_i.op);
1314 _visitor.visit_expr(&*_i.right);
1315}
David Tolnay02a9c6f2018-08-24 18:58:45 -04001316#[cfg(feature = "full")]
1317#[cfg(any(feature = "full", feature = "derive"))]
1318pub fn visit_expr_async<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprAsync) {
1319 for it in &_i.attrs {
1320 _visitor.visit_attribute(it)
1321 }
1322 tokens_helper(_visitor, &_i.async_token.span);
1323 if let Some(ref it) = _i.capture {
1324 tokens_helper(_visitor, &it.span)
1325 };
1326 _visitor.visit_block(&_i.block);
1327}
David Tolnay8c81f622018-07-31 23:34:35 -07001328#[cfg(any(feature = "full", feature = "derive"))]
1329pub fn visit_expr_binary<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBinary) {
1330 for it in &_i.attrs {
1331 _visitor.visit_attribute(it)
1332 }
1333 _visitor.visit_expr(&*_i.left);
1334 _visitor.visit_bin_op(&_i.op);
1335 _visitor.visit_expr(&*_i.right);
1336}
1337#[cfg(feature = "full")]
1338#[cfg(any(feature = "full", feature = "derive"))]
1339pub fn visit_expr_block<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBlock) {
1340 for it in &_i.attrs {
1341 _visitor.visit_attribute(it)
1342 }
David Tolnay1d8e9962018-08-24 19:04:20 -04001343 if let Some(ref it) = _i.label {
1344 _visitor.visit_label(it)
1345 };
David Tolnay8c81f622018-07-31 23:34:35 -07001346 _visitor.visit_block(&_i.block);
1347}
1348#[cfg(feature = "full")]
1349#[cfg(any(feature = "full", feature = "derive"))]
1350pub fn visit_expr_box<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBox) {
1351 for it in &_i.attrs {
1352 _visitor.visit_attribute(it)
1353 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001354 tokens_helper(_visitor, &_i.box_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001355 _visitor.visit_expr(&*_i.expr);
1356}
1357#[cfg(feature = "full")]
1358#[cfg(any(feature = "full", feature = "derive"))]
1359pub fn visit_expr_break<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBreak) {
1360 for it in &_i.attrs {
1361 _visitor.visit_attribute(it)
1362 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001363 tokens_helper(_visitor, &_i.break_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001364 if let Some(ref it) = _i.label {
1365 _visitor.visit_lifetime(it)
1366 };
1367 if let Some(ref it) = _i.expr {
1368 _visitor.visit_expr(&**it)
1369 };
1370}
1371#[cfg(any(feature = "full", feature = "derive"))]
1372pub fn visit_expr_call<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprCall) {
1373 for it in &_i.attrs {
1374 _visitor.visit_attribute(it)
1375 }
1376 _visitor.visit_expr(&*_i.func);
David Tolnay7ac699c2018-08-24 14:00:58 -04001377 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001378 for el in Punctuated::pairs(&_i.args) {
1379 let it = el.value();
1380 _visitor.visit_expr(it)
1381 }
1382}
1383#[cfg(any(feature = "full", feature = "derive"))]
1384pub fn visit_expr_cast<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprCast) {
1385 for it in &_i.attrs {
1386 _visitor.visit_attribute(it)
1387 }
1388 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001389 tokens_helper(_visitor, &_i.as_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001390 _visitor.visit_type(&*_i.ty);
1391}
1392#[cfg(feature = "full")]
1393#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001394pub fn visit_expr_closure<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprClosure) {
1395 for it in &_i.attrs {
1396 _visitor.visit_attribute(it)
1397 }
Yusuke Sasaki4e5d9662018-07-21 02:49:47 +09001398 if let Some(ref it) = _i.asyncness {
1399 tokens_helper(_visitor, &it.span)
1400 };
David Tolnay8c81f622018-07-31 23:34:35 -07001401 if let Some(ref it) = _i.movability {
David Tolnay7ac699c2018-08-24 14:00:58 -04001402 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001403 };
1404 if let Some(ref it) = _i.capture {
David Tolnay7ac699c2018-08-24 14:00:58 -04001405 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001406 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001407 tokens_helper(_visitor, &_i.or1_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001408 for el in Punctuated::pairs(&_i.inputs) {
1409 let it = el.value();
1410 _visitor.visit_fn_arg(it)
1411 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001412 tokens_helper(_visitor, &_i.or2_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001413 _visitor.visit_return_type(&_i.output);
1414 _visitor.visit_expr(&*_i.body);
1415}
1416#[cfg(feature = "full")]
1417#[cfg(any(feature = "full", feature = "derive"))]
1418pub fn visit_expr_continue<'ast, V: Visit<'ast> + ?Sized>(
1419 _visitor: &mut V,
1420 _i: &'ast ExprContinue,
1421) {
1422 for it in &_i.attrs {
1423 _visitor.visit_attribute(it)
1424 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001425 tokens_helper(_visitor, &_i.continue_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001426 if let Some(ref it) = _i.label {
1427 _visitor.visit_lifetime(it)
1428 };
1429}
1430#[cfg(any(feature = "full", feature = "derive"))]
1431pub fn visit_expr_field<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprField) {
1432 for it in &_i.attrs {
1433 _visitor.visit_attribute(it)
1434 }
1435 _visitor.visit_expr(&*_i.base);
David Tolnay7ac699c2018-08-24 14:00:58 -04001436 tokens_helper(_visitor, &_i.dot_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001437 _visitor.visit_member(&_i.member);
1438}
1439#[cfg(feature = "full")]
1440#[cfg(any(feature = "full", feature = "derive"))]
1441pub fn visit_expr_for_loop<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprForLoop) {
1442 for it in &_i.attrs {
1443 _visitor.visit_attribute(it)
1444 }
1445 if let Some(ref it) = _i.label {
1446 _visitor.visit_label(it)
1447 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001448 tokens_helper(_visitor, &_i.for_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001449 _visitor.visit_pat(&*_i.pat);
David Tolnay7ac699c2018-08-24 14:00:58 -04001450 tokens_helper(_visitor, &_i.in_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001451 _visitor.visit_expr(&*_i.expr);
1452 _visitor.visit_block(&_i.body);
1453}
1454#[cfg(feature = "full")]
1455#[cfg(any(feature = "full", feature = "derive"))]
1456pub fn visit_expr_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprGroup) {
1457 for it in &_i.attrs {
1458 _visitor.visit_attribute(it)
1459 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001460 tokens_helper(_visitor, &_i.group_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001461 _visitor.visit_expr(&*_i.expr);
1462}
1463#[cfg(feature = "full")]
1464#[cfg(any(feature = "full", feature = "derive"))]
1465pub fn visit_expr_if<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprIf) {
1466 for it in &_i.attrs {
1467 _visitor.visit_attribute(it)
1468 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001469 tokens_helper(_visitor, &_i.if_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001470 _visitor.visit_expr(&*_i.cond);
1471 _visitor.visit_block(&_i.then_branch);
1472 if let Some(ref it) = _i.else_branch {
David Tolnay7ac699c2018-08-24 14:00:58 -04001473 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001474 _visitor.visit_expr(&*(it).1);
1475 };
1476}
1477#[cfg(feature = "full")]
1478#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001479pub fn visit_expr_in_place<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprInPlace) {
1480 for it in &_i.attrs {
1481 _visitor.visit_attribute(it)
1482 }
1483 _visitor.visit_expr(&*_i.place);
David Tolnay7ac699c2018-08-24 14:00:58 -04001484 tokens_helper(_visitor, &_i.arrow_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001485 _visitor.visit_expr(&*_i.value);
1486}
1487#[cfg(any(feature = "full", feature = "derive"))]
1488pub fn visit_expr_index<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprIndex) {
1489 for it in &_i.attrs {
1490 _visitor.visit_attribute(it)
1491 }
1492 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001493 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001494 _visitor.visit_expr(&*_i.index);
1495}
David Tolnay9c119122018-09-01 18:47:02 -07001496#[cfg(feature = "full")]
1497#[cfg(any(feature = "full", feature = "derive"))]
1498pub fn visit_expr_let<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprLet) {
1499 for it in &_i.attrs {
1500 _visitor.visit_attribute(it)
1501 }
1502 tokens_helper(_visitor, &_i.let_token.span);
1503 for el in Punctuated::pairs(&_i.pats) {
1504 let it = el.value();
1505 _visitor.visit_pat(it)
1506 }
1507 tokens_helper(_visitor, &_i.eq_token.spans);
1508 _visitor.visit_expr(&*_i.expr);
1509}
David Tolnay8c81f622018-07-31 23:34:35 -07001510#[cfg(any(feature = "full", feature = "derive"))]
1511pub fn visit_expr_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprLit) {
1512 for it in &_i.attrs {
1513 _visitor.visit_attribute(it)
1514 }
1515 _visitor.visit_lit(&_i.lit);
1516}
1517#[cfg(feature = "full")]
1518#[cfg(any(feature = "full", feature = "derive"))]
1519pub fn visit_expr_loop<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprLoop) {
1520 for it in &_i.attrs {
1521 _visitor.visit_attribute(it)
1522 }
1523 if let Some(ref it) = _i.label {
1524 _visitor.visit_label(it)
1525 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001526 tokens_helper(_visitor, &_i.loop_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001527 _visitor.visit_block(&_i.body);
1528}
1529#[cfg(feature = "full")]
1530#[cfg(any(feature = "full", feature = "derive"))]
1531pub fn visit_expr_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprMacro) {
1532 for it in &_i.attrs {
1533 _visitor.visit_attribute(it)
1534 }
1535 _visitor.visit_macro(&_i.mac);
1536}
1537#[cfg(feature = "full")]
1538#[cfg(any(feature = "full", feature = "derive"))]
1539pub fn visit_expr_match<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprMatch) {
1540 for it in &_i.attrs {
1541 _visitor.visit_attribute(it)
1542 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001543 tokens_helper(_visitor, &_i.match_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001544 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001545 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001546 for it in &_i.arms {
1547 _visitor.visit_arm(it)
1548 }
1549}
1550#[cfg(feature = "full")]
1551#[cfg(any(feature = "full", feature = "derive"))]
1552pub fn visit_expr_method_call<'ast, V: Visit<'ast> + ?Sized>(
1553 _visitor: &mut V,
1554 _i: &'ast ExprMethodCall,
1555) {
1556 for it in &_i.attrs {
1557 _visitor.visit_attribute(it)
1558 }
1559 _visitor.visit_expr(&*_i.receiver);
David Tolnay7ac699c2018-08-24 14:00:58 -04001560 tokens_helper(_visitor, &_i.dot_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001561 _visitor.visit_ident(&_i.method);
1562 if let Some(ref it) = _i.turbofish {
1563 _visitor.visit_method_turbofish(it)
1564 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001565 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001566 for el in Punctuated::pairs(&_i.args) {
1567 let it = el.value();
1568 _visitor.visit_expr(it)
1569 }
1570}
1571#[cfg(any(feature = "full", feature = "derive"))]
1572pub fn visit_expr_paren<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprParen) {
1573 for it in &_i.attrs {
1574 _visitor.visit_attribute(it)
1575 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001576 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001577 _visitor.visit_expr(&*_i.expr);
1578}
1579#[cfg(any(feature = "full", feature = "derive"))]
1580pub fn visit_expr_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprPath) {
1581 for it in &_i.attrs {
1582 _visitor.visit_attribute(it)
1583 }
1584 if let Some(ref it) = _i.qself {
1585 _visitor.visit_qself(it)
1586 };
1587 _visitor.visit_path(&_i.path);
1588}
1589#[cfg(feature = "full")]
1590#[cfg(any(feature = "full", feature = "derive"))]
1591pub fn visit_expr_range<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprRange) {
1592 for it in &_i.attrs {
1593 _visitor.visit_attribute(it)
1594 }
1595 if let Some(ref it) = _i.from {
1596 _visitor.visit_expr(&**it)
1597 };
1598 _visitor.visit_range_limits(&_i.limits);
1599 if let Some(ref it) = _i.to {
1600 _visitor.visit_expr(&**it)
1601 };
1602}
1603#[cfg(feature = "full")]
1604#[cfg(any(feature = "full", feature = "derive"))]
1605pub fn visit_expr_reference<'ast, V: Visit<'ast> + ?Sized>(
1606 _visitor: &mut V,
1607 _i: &'ast ExprReference,
1608) {
1609 for it in &_i.attrs {
1610 _visitor.visit_attribute(it)
1611 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001612 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001613 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04001614 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001615 };
1616 _visitor.visit_expr(&*_i.expr);
1617}
1618#[cfg(feature = "full")]
1619#[cfg(any(feature = "full", feature = "derive"))]
1620pub fn visit_expr_repeat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprRepeat) {
1621 for it in &_i.attrs {
1622 _visitor.visit_attribute(it)
1623 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001624 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001625 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001626 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001627 _visitor.visit_expr(&*_i.len);
1628}
1629#[cfg(feature = "full")]
1630#[cfg(any(feature = "full", feature = "derive"))]
1631pub fn visit_expr_return<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprReturn) {
1632 for it in &_i.attrs {
1633 _visitor.visit_attribute(it)
1634 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001635 tokens_helper(_visitor, &_i.return_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001636 if let Some(ref it) = _i.expr {
1637 _visitor.visit_expr(&**it)
1638 };
1639}
1640#[cfg(feature = "full")]
1641#[cfg(any(feature = "full", feature = "derive"))]
1642pub fn visit_expr_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprStruct) {
1643 for it in &_i.attrs {
1644 _visitor.visit_attribute(it)
1645 }
1646 _visitor.visit_path(&_i.path);
David Tolnay7ac699c2018-08-24 14:00:58 -04001647 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001648 for el in Punctuated::pairs(&_i.fields) {
1649 let it = el.value();
1650 _visitor.visit_field_value(it)
1651 }
1652 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001653 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001654 };
1655 if let Some(ref it) = _i.rest {
1656 _visitor.visit_expr(&**it)
1657 };
1658}
1659#[cfg(feature = "full")]
1660#[cfg(any(feature = "full", feature = "derive"))]
1661pub fn visit_expr_try<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprTry) {
1662 for it in &_i.attrs {
1663 _visitor.visit_attribute(it)
1664 }
1665 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001666 tokens_helper(_visitor, &_i.question_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001667}
1668#[cfg(feature = "full")]
1669#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayfb2dd4b2018-08-24 16:45:34 -04001670pub fn visit_expr_try_block<'ast, V: Visit<'ast> + ?Sized>(
1671 _visitor: &mut V,
1672 _i: &'ast ExprTryBlock,
1673) {
1674 for it in &_i.attrs {
1675 _visitor.visit_attribute(it)
1676 }
1677 tokens_helper(_visitor, &_i.try_token.span);
1678 _visitor.visit_block(&_i.block);
1679}
1680#[cfg(feature = "full")]
1681#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001682pub fn visit_expr_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprTuple) {
1683 for it in &_i.attrs {
1684 _visitor.visit_attribute(it)
1685 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001686 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001687 for el in Punctuated::pairs(&_i.elems) {
1688 let it = el.value();
1689 _visitor.visit_expr(it)
1690 }
1691}
1692#[cfg(feature = "full")]
1693#[cfg(any(feature = "full", feature = "derive"))]
1694pub fn visit_expr_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprType) {
1695 for it in &_i.attrs {
1696 _visitor.visit_attribute(it)
1697 }
1698 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001699 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001700 _visitor.visit_type(&*_i.ty);
1701}
1702#[cfg(any(feature = "full", feature = "derive"))]
1703pub fn visit_expr_unary<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprUnary) {
1704 for it in &_i.attrs {
1705 _visitor.visit_attribute(it)
1706 }
1707 _visitor.visit_un_op(&_i.op);
1708 _visitor.visit_expr(&*_i.expr);
1709}
1710#[cfg(feature = "full")]
1711#[cfg(any(feature = "full", feature = "derive"))]
1712pub fn visit_expr_unsafe<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprUnsafe) {
1713 for it in &_i.attrs {
1714 _visitor.visit_attribute(it)
1715 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001716 tokens_helper(_visitor, &_i.unsafe_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001717 _visitor.visit_block(&_i.block);
1718}
1719#[cfg(any(feature = "full", feature = "derive"))]
1720pub fn visit_expr_verbatim<'ast, V: Visit<'ast> + ?Sized>(
1721 _visitor: &mut V,
1722 _i: &'ast ExprVerbatim,
1723) {
David Tolnay6af48992018-08-01 11:16:28 -07001724 skip!(_i.tts);
David Tolnay8c81f622018-07-31 23:34:35 -07001725}
1726#[cfg(feature = "full")]
1727#[cfg(any(feature = "full", feature = "derive"))]
1728pub fn visit_expr_while<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprWhile) {
1729 for it in &_i.attrs {
1730 _visitor.visit_attribute(it)
1731 }
1732 if let Some(ref it) = _i.label {
1733 _visitor.visit_label(it)
1734 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001735 tokens_helper(_visitor, &_i.while_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001736 _visitor.visit_expr(&*_i.cond);
1737 _visitor.visit_block(&_i.body);
1738}
1739#[cfg(feature = "full")]
1740#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001741pub fn visit_expr_yield<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprYield) {
1742 for it in &_i.attrs {
1743 _visitor.visit_attribute(it)
1744 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001745 tokens_helper(_visitor, &_i.yield_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001746 if let Some(ref it) = _i.expr {
1747 _visitor.visit_expr(&**it)
1748 };
1749}
1750#[cfg(any(feature = "full", feature = "derive"))]
1751pub fn visit_field<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Field) {
1752 for it in &_i.attrs {
1753 _visitor.visit_attribute(it)
1754 }
1755 _visitor.visit_visibility(&_i.vis);
1756 if let Some(ref it) = _i.ident {
1757 _visitor.visit_ident(it)
1758 };
1759 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001760 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001761 };
1762 _visitor.visit_type(&_i.ty);
1763}
1764#[cfg(any(feature = "full", feature = "derive"))]
1765#[cfg(feature = "full")]
1766pub fn visit_field_pat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldPat) {
1767 for it in &_i.attrs {
1768 _visitor.visit_attribute(it)
1769 }
1770 _visitor.visit_member(&_i.member);
1771 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001772 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001773 };
1774 _visitor.visit_pat(&*_i.pat);
1775}
1776#[cfg(any(feature = "full", feature = "derive"))]
1777#[cfg(feature = "full")]
1778pub fn visit_field_value<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldValue) {
1779 for it in &_i.attrs {
1780 _visitor.visit_attribute(it)
1781 }
1782 _visitor.visit_member(&_i.member);
1783 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001784 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001785 };
1786 _visitor.visit_expr(&_i.expr);
1787}
1788#[cfg(any(feature = "full", feature = "derive"))]
1789pub fn visit_fields<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Fields) {
1790 match *_i {
1791 Fields::Named(ref _binding_0) => {
1792 _visitor.visit_fields_named(_binding_0);
1793 }
1794 Fields::Unnamed(ref _binding_0) => {
1795 _visitor.visit_fields_unnamed(_binding_0);
1796 }
1797 Fields::Unit => {}
1798 }
1799}
1800#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001801pub fn visit_fields_named<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldsNamed) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001802 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001803 for el in Punctuated::pairs(&_i.named) {
1804 let it = el.value();
1805 _visitor.visit_field(it)
1806 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001807}
David Tolnay8c81f622018-07-31 23:34:35 -07001808#[cfg(any(feature = "full", feature = "derive"))]
1809pub fn visit_fields_unnamed<'ast, V: Visit<'ast> + ?Sized>(
1810 _visitor: &mut V,
1811 _i: &'ast FieldsUnnamed,
1812) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001813 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001814 for el in Punctuated::pairs(&_i.unnamed) {
1815 let it = el.value();
1816 _visitor.visit_field(it)
1817 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001818}
David Tolnay8c81f622018-07-31 23:34:35 -07001819#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001820pub fn visit_file<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast File) {
David Tolnay6af48992018-08-01 11:16:28 -07001821 skip!(_i.shebang);
David Tolnay8c81f622018-07-31 23:34:35 -07001822 for it in &_i.attrs {
1823 _visitor.visit_attribute(it)
1824 }
1825 for it in &_i.items {
1826 _visitor.visit_item(it)
1827 }
Nika Layzell27726662017-10-24 23:16:35 -04001828}
David Tolnay8c81f622018-07-31 23:34:35 -07001829#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001830pub fn visit_fn_arg<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FnArg) {
Nika Layzell27726662017-10-24 23:16:35 -04001831 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001832 FnArg::SelfRef(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001833 _visitor.visit_arg_self_ref(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001834 }
David Tolnay8c81f622018-07-31 23:34:35 -07001835 FnArg::SelfValue(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001836 _visitor.visit_arg_self(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001837 }
David Tolnay8c81f622018-07-31 23:34:35 -07001838 FnArg::Captured(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001839 _visitor.visit_arg_captured(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001840 }
David Tolnay8c81f622018-07-31 23:34:35 -07001841 FnArg::Inferred(ref _binding_0) => {
David Tolnay80ed55f2017-12-27 22:54:40 -05001842 _visitor.visit_pat(_binding_0);
1843 }
David Tolnay8c81f622018-07-31 23:34:35 -07001844 FnArg::Ignored(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001845 _visitor.visit_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001846 }
1847 }
1848}
David Tolnay8c81f622018-07-31 23:34:35 -07001849#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001850pub fn visit_fn_decl<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FnDecl) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001851 tokens_helper(_visitor, &_i.fn_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001852 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04001853 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001854 for el in Punctuated::pairs(&_i.inputs) {
1855 let it = el.value();
1856 _visitor.visit_fn_arg(it)
1857 }
1858 if let Some(ref it) = _i.variadic {
David Tolnay7ac699c2018-08-24 14:00:58 -04001859 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001860 };
1861 _visitor.visit_return_type(&_i.output);
Nika Layzell27726662017-10-24 23:16:35 -04001862}
David Tolnay8c81f622018-07-31 23:34:35 -07001863#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001864pub fn visit_foreign_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ForeignItem) {
Nika Layzell27726662017-10-24 23:16:35 -04001865 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001866 ForeignItem::Fn(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001867 _visitor.visit_foreign_item_fn(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001868 }
David Tolnay8c81f622018-07-31 23:34:35 -07001869 ForeignItem::Static(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001870 _visitor.visit_foreign_item_static(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001871 }
David Tolnay8c81f622018-07-31 23:34:35 -07001872 ForeignItem::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001873 _visitor.visit_foreign_item_type(_binding_0);
David Tolnay199bcbb2017-11-12 10:33:52 -08001874 }
David Tolnay435c1782018-08-24 16:15:44 -04001875 ForeignItem::Macro(ref _binding_0) => {
1876 _visitor.visit_foreign_item_macro(_binding_0);
1877 }
David Tolnay8c81f622018-07-31 23:34:35 -07001878 ForeignItem::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05001879 _visitor.visit_foreign_item_verbatim(_binding_0);
1880 }
Nika Layzell27726662017-10-24 23:16:35 -04001881 }
1882}
David Tolnay8c81f622018-07-31 23:34:35 -07001883#[cfg(feature = "full")]
1884pub fn visit_foreign_item_fn<'ast, V: Visit<'ast> + ?Sized>(
1885 _visitor: &mut V,
1886 _i: &'ast ForeignItemFn,
1887) {
1888 for it in &_i.attrs {
1889 _visitor.visit_attribute(it)
1890 }
1891 _visitor.visit_visibility(&_i.vis);
1892 _visitor.visit_ident(&_i.ident);
1893 _visitor.visit_fn_decl(&*_i.decl);
David Tolnay7ac699c2018-08-24 14:00:58 -04001894 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay8894f602017-11-11 12:11:04 -08001895}
David Tolnay8c81f622018-07-31 23:34:35 -07001896#[cfg(feature = "full")]
David Tolnay435c1782018-08-24 16:15:44 -04001897pub fn visit_foreign_item_macro<'ast, V: Visit<'ast> + ?Sized>(
1898 _visitor: &mut V,
1899 _i: &'ast ForeignItemMacro,
1900) {
1901 for it in &_i.attrs {
1902 _visitor.visit_attribute(it)
1903 }
1904 _visitor.visit_macro(&_i.mac);
1905 if let Some(ref it) = _i.semi_token {
1906 tokens_helper(_visitor, &it.spans)
1907 };
1908}
1909#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001910pub fn visit_foreign_item_static<'ast, V: Visit<'ast> + ?Sized>(
1911 _visitor: &mut V,
1912 _i: &'ast ForeignItemStatic,
1913) {
1914 for it in &_i.attrs {
1915 _visitor.visit_attribute(it)
1916 }
1917 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04001918 tokens_helper(_visitor, &_i.static_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001919 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04001920 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001921 };
1922 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001923 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001924 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04001925 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001926}
David Tolnay8c81f622018-07-31 23:34:35 -07001927#[cfg(feature = "full")]
1928pub fn visit_foreign_item_type<'ast, V: Visit<'ast> + ?Sized>(
1929 _visitor: &mut V,
1930 _i: &'ast ForeignItemType,
1931) {
1932 for it in &_i.attrs {
1933 _visitor.visit_attribute(it)
1934 }
1935 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04001936 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001937 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001938 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay199bcbb2017-11-12 10:33:52 -08001939}
David Tolnay8c81f622018-07-31 23:34:35 -07001940#[cfg(feature = "full")]
1941pub fn visit_foreign_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
1942 _visitor: &mut V,
1943 _i: &'ast ForeignItemVerbatim,
1944) {
David Tolnay6af48992018-08-01 11:16:28 -07001945 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05001946}
David Tolnay8c81f622018-07-31 23:34:35 -07001947#[cfg(any(feature = "full", feature = "derive"))]
1948pub fn visit_generic_argument<'ast, V: Visit<'ast> + ?Sized>(
1949 _visitor: &mut V,
1950 _i: &'ast GenericArgument,
1951) {
Nika Layzell357885a2017-12-04 15:47:07 -05001952 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001953 GenericArgument::Lifetime(ref _binding_0) => {
David Tolnay4ba63a02017-12-28 15:53:05 -05001954 _visitor.visit_lifetime(_binding_0);
Nika Layzell357885a2017-12-04 15:47:07 -05001955 }
David Tolnay8c81f622018-07-31 23:34:35 -07001956 GenericArgument::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001957 _visitor.visit_type(_binding_0);
Nika Layzell357885a2017-12-04 15:47:07 -05001958 }
David Tolnay8c81f622018-07-31 23:34:35 -07001959 GenericArgument::Binding(ref _binding_0) => {
David Tolnay506e43a2017-12-29 11:34:36 -05001960 _visitor.visit_binding(_binding_0);
Nika Layzell357885a2017-12-04 15:47:07 -05001961 }
David Tolnay8c81f622018-07-31 23:34:35 -07001962 GenericArgument::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001963 _visitor.visit_expr(_binding_0);
Nika Layzellc680e612017-12-04 19:07:20 -05001964 }
Nika Layzell357885a2017-12-04 15:47:07 -05001965 }
1966}
David Tolnay8c81f622018-07-31 23:34:35 -07001967#[cfg(any(feature = "full", feature = "derive"))]
1968#[cfg(feature = "full")]
1969pub fn visit_generic_method_argument<'ast, V: Visit<'ast> + ?Sized>(
1970 _visitor: &mut V,
1971 _i: &'ast GenericMethodArgument,
1972) {
David Tolnayd60cfec2017-12-29 00:21:38 -05001973 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001974 GenericMethodArgument::Type(ref _binding_0) => {
David Tolnayd60cfec2017-12-29 00:21:38 -05001975 _visitor.visit_type(_binding_0);
1976 }
David Tolnay8c81f622018-07-31 23:34:35 -07001977 GenericMethodArgument::Const(ref _binding_0) => {
David Tolnayd60cfec2017-12-29 00:21:38 -05001978 _visitor.visit_expr(_binding_0);
1979 }
1980 }
1981}
David Tolnay8c81f622018-07-31 23:34:35 -07001982#[cfg(any(feature = "full", feature = "derive"))]
1983pub fn visit_generic_param<'ast, V: Visit<'ast> + ?Sized>(
1984 _visitor: &mut V,
1985 _i: &'ast GenericParam,
1986) {
David Tolnayc2f1aba2017-11-12 20:29:22 -08001987 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001988 GenericParam::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001989 _visitor.visit_type_param(_binding_0);
David Tolnayc2f1aba2017-11-12 20:29:22 -08001990 }
David Tolnay8c81f622018-07-31 23:34:35 -07001991 GenericParam::Lifetime(ref _binding_0) => {
David Tolnay517f3692018-01-01 20:17:23 -08001992 _visitor.visit_lifetime_def(_binding_0);
1993 }
David Tolnay8c81f622018-07-31 23:34:35 -07001994 GenericParam::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001995 _visitor.visit_const_param(_binding_0);
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001996 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08001997 }
1998}
David Tolnay8c81f622018-07-31 23:34:35 -07001999#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002000pub fn visit_generics<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Generics) {
David Tolnay8c81f622018-07-31 23:34:35 -07002001 if let Some(ref it) = _i.lt_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002002 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002003 };
2004 for el in Punctuated::pairs(&_i.params) {
2005 let it = el.value();
2006 _visitor.visit_generic_param(it)
2007 }
2008 if let Some(ref it) = _i.gt_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002009 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002010 };
2011 if let Some(ref it) = _i.where_clause {
2012 _visitor.visit_where_clause(it)
2013 };
Nika Layzell27726662017-10-24 23:16:35 -04002014}
David Tolnay8c81f622018-07-31 23:34:35 -07002015pub fn visit_ident<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Ident) {}
2016#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002017pub fn visit_impl_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ImplItem) {
Nika Layzell27726662017-10-24 23:16:35 -04002018 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002019 ImplItem::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002020 _visitor.visit_impl_item_const(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002021 }
David Tolnay8c81f622018-07-31 23:34:35 -07002022 ImplItem::Method(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002023 _visitor.visit_impl_item_method(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002024 }
David Tolnay8c81f622018-07-31 23:34:35 -07002025 ImplItem::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002026 _visitor.visit_impl_item_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002027 }
David Tolnaybb82ef02018-08-24 20:15:45 -04002028 ImplItem::Existential(ref _binding_0) => {
2029 _visitor.visit_impl_item_existential(_binding_0);
2030 }
David Tolnay8c81f622018-07-31 23:34:35 -07002031 ImplItem::Macro(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002032 _visitor.visit_impl_item_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002033 }
David Tolnay8c81f622018-07-31 23:34:35 -07002034 ImplItem::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002035 _visitor.visit_impl_item_verbatim(_binding_0);
2036 }
Nika Layzell27726662017-10-24 23:16:35 -04002037 }
2038}
David Tolnay8c81f622018-07-31 23:34:35 -07002039#[cfg(feature = "full")]
2040pub fn visit_impl_item_const<'ast, V: Visit<'ast> + ?Sized>(
2041 _visitor: &mut V,
2042 _i: &'ast ImplItemConst,
2043) {
2044 for it in &_i.attrs {
2045 _visitor.visit_attribute(it)
2046 }
2047 _visitor.visit_visibility(&_i.vis);
2048 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002049 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002050 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002051 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002052 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002053 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002054 _visitor.visit_type(&_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002055 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002056 _visitor.visit_expr(&_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04002057 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay857628c2017-11-11 12:25:31 -08002058}
David Tolnay8c81f622018-07-31 23:34:35 -07002059#[cfg(feature = "full")]
David Tolnaybb82ef02018-08-24 20:15:45 -04002060pub fn visit_impl_item_existential<'ast, V: Visit<'ast> + ?Sized>(
2061 _visitor: &mut V,
2062 _i: &'ast ImplItemExistential,
2063) {
2064 for it in &_i.attrs {
2065 _visitor.visit_attribute(it)
2066 }
2067 tokens_helper(_visitor, &_i.existential_token.span);
2068 tokens_helper(_visitor, &_i.type_token.span);
2069 _visitor.visit_ident(&_i.ident);
2070 _visitor.visit_generics(&_i.generics);
2071 if let Some(ref it) = _i.colon_token {
2072 tokens_helper(_visitor, &it.spans)
2073 };
2074 for el in Punctuated::pairs(&_i.bounds) {
2075 let it = el.value();
2076 _visitor.visit_type_param_bound(it)
2077 }
2078 tokens_helper(_visitor, &_i.semi_token.spans);
2079}
2080#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07002081pub fn visit_impl_item_macro<'ast, V: Visit<'ast> + ?Sized>(
2082 _visitor: &mut V,
2083 _i: &'ast ImplItemMacro,
2084) {
2085 for it in &_i.attrs {
2086 _visitor.visit_attribute(it)
2087 }
2088 _visitor.visit_macro(&_i.mac);
2089 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002090 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002091 };
David Tolnay857628c2017-11-11 12:25:31 -08002092}
David Tolnay8c81f622018-07-31 23:34:35 -07002093#[cfg(feature = "full")]
2094pub fn visit_impl_item_method<'ast, V: Visit<'ast> + ?Sized>(
2095 _visitor: &mut V,
2096 _i: &'ast ImplItemMethod,
2097) {
2098 for it in &_i.attrs {
2099 _visitor.visit_attribute(it)
2100 }
2101 _visitor.visit_visibility(&_i.vis);
2102 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002103 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002104 };
2105 _visitor.visit_method_sig(&_i.sig);
2106 _visitor.visit_block(&_i.block);
Nika Layzell27726662017-10-24 23:16:35 -04002107}
David Tolnay8c81f622018-07-31 23:34:35 -07002108#[cfg(feature = "full")]
2109pub fn visit_impl_item_type<'ast, V: Visit<'ast> + ?Sized>(
2110 _visitor: &mut V,
2111 _i: &'ast ImplItemType,
2112) {
2113 for it in &_i.attrs {
2114 _visitor.visit_attribute(it)
2115 }
2116 _visitor.visit_visibility(&_i.vis);
2117 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002118 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002119 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002120 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002121 _visitor.visit_ident(&_i.ident);
2122 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04002123 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002124 _visitor.visit_type(&_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002125 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002126}
David Tolnay8c81f622018-07-31 23:34:35 -07002127#[cfg(feature = "full")]
2128pub fn visit_impl_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
2129 _visitor: &mut V,
2130 _i: &'ast ImplItemVerbatim,
2131) {
David Tolnay6af48992018-08-01 11:16:28 -07002132 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05002133}
David Tolnay8c81f622018-07-31 23:34:35 -07002134#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002135pub fn visit_index<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Index) {
David Tolnay6af48992018-08-01 11:16:28 -07002136 skip!(_i.index);
David Tolnay8c81f622018-07-31 23:34:35 -07002137 _visitor.visit_span(&_i.span);
David Tolnay85b69a42017-12-27 20:43:10 -05002138}
David Tolnay8c81f622018-07-31 23:34:35 -07002139#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002140pub fn visit_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Item) {
Nika Layzell27726662017-10-24 23:16:35 -04002141 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002142 Item::ExternCrate(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002143 _visitor.visit_item_extern_crate(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002144 }
David Tolnay8c81f622018-07-31 23:34:35 -07002145 Item::Use(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002146 _visitor.visit_item_use(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002147 }
David Tolnay8c81f622018-07-31 23:34:35 -07002148 Item::Static(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002149 _visitor.visit_item_static(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002150 }
David Tolnay8c81f622018-07-31 23:34:35 -07002151 Item::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002152 _visitor.visit_item_const(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002153 }
David Tolnay8c81f622018-07-31 23:34:35 -07002154 Item::Fn(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002155 _visitor.visit_item_fn(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002156 }
David Tolnay8c81f622018-07-31 23:34:35 -07002157 Item::Mod(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002158 _visitor.visit_item_mod(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002159 }
David Tolnay8c81f622018-07-31 23:34:35 -07002160 Item::ForeignMod(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002161 _visitor.visit_item_foreign_mod(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002162 }
David Tolnay8c81f622018-07-31 23:34:35 -07002163 Item::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002164 _visitor.visit_item_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002165 }
David Tolnaybb82ef02018-08-24 20:15:45 -04002166 Item::Existential(ref _binding_0) => {
2167 _visitor.visit_item_existential(_binding_0);
2168 }
David Tolnay8c81f622018-07-31 23:34:35 -07002169 Item::Struct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002170 _visitor.visit_item_struct(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002171 }
David Tolnay8c81f622018-07-31 23:34:35 -07002172 Item::Enum(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05002173 _visitor.visit_item_enum(_binding_0);
2174 }
David Tolnay8c81f622018-07-31 23:34:35 -07002175 Item::Union(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002176 _visitor.visit_item_union(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002177 }
David Tolnay8c81f622018-07-31 23:34:35 -07002178 Item::Trait(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002179 _visitor.visit_item_trait(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002180 }
David Tolnayc6b04dd2018-08-30 23:22:51 -07002181 Item::TraitAlias(ref _binding_0) => {
2182 _visitor.visit_item_trait_alias(_binding_0);
2183 }
David Tolnay8c81f622018-07-31 23:34:35 -07002184 Item::Impl(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002185 _visitor.visit_item_impl(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002186 }
David Tolnay8c81f622018-07-31 23:34:35 -07002187 Item::Macro(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002188 _visitor.visit_item_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002189 }
David Tolnay8c81f622018-07-31 23:34:35 -07002190 Item::Macro2(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002191 _visitor.visit_item_macro2(_binding_0);
David Tolnay500d8322017-12-18 00:32:51 -08002192 }
David Tolnay8c81f622018-07-31 23:34:35 -07002193 Item::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002194 _visitor.visit_item_verbatim(_binding_0);
2195 }
Nika Layzell27726662017-10-24 23:16:35 -04002196 }
2197}
David Tolnay8c81f622018-07-31 23:34:35 -07002198#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002199pub fn visit_item_const<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemConst) {
David Tolnay8c81f622018-07-31 23:34:35 -07002200 for it in &_i.attrs {
2201 _visitor.visit_attribute(it)
2202 }
2203 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002204 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002205 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002206 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002207 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002208 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002209 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04002210 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnayc6b55bc2017-11-09 22:48:38 -08002211}
David Tolnay8c81f622018-07-31 23:34:35 -07002212#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002213pub fn visit_item_enum<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemEnum) {
David Tolnay8c81f622018-07-31 23:34:35 -07002214 for it in &_i.attrs {
2215 _visitor.visit_attribute(it)
2216 }
2217 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002218 tokens_helper(_visitor, &_i.enum_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002219 _visitor.visit_ident(&_i.ident);
2220 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04002221 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002222 for el in Punctuated::pairs(&_i.variants) {
2223 let it = el.value();
2224 _visitor.visit_variant(it)
2225 }
David Tolnayc6b55bc2017-11-09 22:48:38 -08002226}
David Tolnay8c81f622018-07-31 23:34:35 -07002227#[cfg(feature = "full")]
David Tolnaybb82ef02018-08-24 20:15:45 -04002228pub fn visit_item_existential<'ast, V: Visit<'ast> + ?Sized>(
2229 _visitor: &mut V,
2230 _i: &'ast ItemExistential,
2231) {
2232 for it in &_i.attrs {
2233 _visitor.visit_attribute(it)
2234 }
2235 _visitor.visit_visibility(&_i.vis);
2236 tokens_helper(_visitor, &_i.existential_token.span);
2237 tokens_helper(_visitor, &_i.type_token.span);
2238 _visitor.visit_ident(&_i.ident);
2239 _visitor.visit_generics(&_i.generics);
2240 if let Some(ref it) = _i.colon_token {
2241 tokens_helper(_visitor, &it.spans)
2242 };
2243 for el in Punctuated::pairs(&_i.bounds) {
2244 let it = el.value();
2245 _visitor.visit_type_param_bound(it)
2246 }
2247 tokens_helper(_visitor, &_i.semi_token.spans);
2248}
2249#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07002250pub fn visit_item_extern_crate<'ast, V: Visit<'ast> + ?Sized>(
2251 _visitor: &mut V,
2252 _i: &'ast ItemExternCrate,
2253) {
2254 for it in &_i.attrs {
2255 _visitor.visit_attribute(it)
2256 }
2257 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002258 tokens_helper(_visitor, &_i.extern_token.span);
2259 tokens_helper(_visitor, &_i.crate_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002260 _visitor.visit_ident(&_i.ident);
2261 if let Some(ref it) = _i.rename {
David Tolnay7ac699c2018-08-24 14:00:58 -04002262 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002263 _visitor.visit_ident(&(it).1);
2264 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002265 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnayc6b55bc2017-11-09 22:48:38 -08002266}
David Tolnay8c81f622018-07-31 23:34:35 -07002267#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002268pub fn visit_item_fn<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemFn) {
David Tolnay8c81f622018-07-31 23:34:35 -07002269 for it in &_i.attrs {
2270 _visitor.visit_attribute(it)
2271 }
2272 _visitor.visit_visibility(&_i.vis);
2273 if let Some(ref it) = _i.constness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002274 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002275 };
2276 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002277 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002278 };
Yusuke Sasakif00a3ef2018-07-20 22:08:42 +09002279 if let Some(ref it) = _i.asyncness {
2280 tokens_helper(_visitor, &it.span)
2281 };
David Tolnay8c81f622018-07-31 23:34:35 -07002282 if let Some(ref it) = _i.abi {
2283 _visitor.visit_abi(it)
2284 };
2285 _visitor.visit_ident(&_i.ident);
2286 _visitor.visit_fn_decl(&*_i.decl);
2287 _visitor.visit_block(&*_i.block);
David Tolnayc6b55bc2017-11-09 22:48:38 -08002288}
David Tolnay8c81f622018-07-31 23:34:35 -07002289#[cfg(feature = "full")]
2290pub fn visit_item_foreign_mod<'ast, V: Visit<'ast> + ?Sized>(
2291 _visitor: &mut V,
2292 _i: &'ast ItemForeignMod,
2293) {
2294 for it in &_i.attrs {
2295 _visitor.visit_attribute(it)
2296 }
2297 _visitor.visit_abi(&_i.abi);
David Tolnay7ac699c2018-08-24 14:00:58 -04002298 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002299 for it in &_i.items {
2300 _visitor.visit_foreign_item(it)
2301 }
David Tolnayc6b55bc2017-11-09 22:48:38 -08002302}
David Tolnay8c81f622018-07-31 23:34:35 -07002303#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002304pub fn visit_item_impl<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemImpl) {
David Tolnay8c81f622018-07-31 23:34:35 -07002305 for it in &_i.attrs {
2306 _visitor.visit_attribute(it)
2307 }
2308 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002309 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002310 };
2311 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002312 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002313 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002314 tokens_helper(_visitor, &_i.impl_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002315 _visitor.visit_generics(&_i.generics);
2316 if let Some(ref it) = _i.trait_ {
2317 if let Some(ref it) = (it).0 {
David Tolnay7ac699c2018-08-24 14:00:58 -04002318 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002319 };
2320 _visitor.visit_path(&(it).1);
David Tolnay7ac699c2018-08-24 14:00:58 -04002321 tokens_helper(_visitor, &(it).2.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002322 };
2323 _visitor.visit_type(&*_i.self_ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002324 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002325 for it in &_i.items {
2326 _visitor.visit_impl_item(it)
2327 }
David Tolnayc6b55bc2017-11-09 22:48:38 -08002328}
David Tolnay8c81f622018-07-31 23:34:35 -07002329#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002330pub fn visit_item_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemMacro) {
David Tolnay8c81f622018-07-31 23:34:35 -07002331 for it in &_i.attrs {
2332 _visitor.visit_attribute(it)
2333 }
2334 if let Some(ref it) = _i.ident {
2335 _visitor.visit_ident(it)
2336 };
2337 _visitor.visit_macro(&_i.mac);
2338 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002339 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002340 };
David Tolnayc6b55bc2017-11-09 22:48:38 -08002341}
David Tolnay8c81f622018-07-31 23:34:35 -07002342#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002343pub fn visit_item_macro2<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemMacro2) {
David Tolnay8c81f622018-07-31 23:34:35 -07002344 for it in &_i.attrs {
2345 _visitor.visit_attribute(it)
2346 }
2347 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002348 tokens_helper(_visitor, &_i.macro_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002349 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002350 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay6af48992018-08-01 11:16:28 -07002351 skip!(_i.args);
David Tolnay7ac699c2018-08-24 14:00:58 -04002352 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay6af48992018-08-01 11:16:28 -07002353 skip!(_i.body);
David Tolnay500d8322017-12-18 00:32:51 -08002354}
David Tolnay8c81f622018-07-31 23:34:35 -07002355#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002356pub fn visit_item_mod<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemMod) {
David Tolnay8c81f622018-07-31 23:34:35 -07002357 for it in &_i.attrs {
2358 _visitor.visit_attribute(it)
2359 }
2360 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002361 tokens_helper(_visitor, &_i.mod_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002362 _visitor.visit_ident(&_i.ident);
2363 if let Some(ref it) = _i.content {
David Tolnay7ac699c2018-08-24 14:00:58 -04002364 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002365 for it in &(it).1 {
2366 _visitor.visit_item(it)
2367 }
2368 };
2369 if let Some(ref it) = _i.semi {
David Tolnay7ac699c2018-08-24 14:00:58 -04002370 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002371 };
Nika Layzell27726662017-10-24 23:16:35 -04002372}
David Tolnay8c81f622018-07-31 23:34:35 -07002373#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002374pub fn visit_item_static<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemStatic) {
David Tolnay8c81f622018-07-31 23:34:35 -07002375 for it in &_i.attrs {
2376 _visitor.visit_attribute(it)
2377 }
2378 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002379 tokens_helper(_visitor, &_i.static_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002380 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04002381 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002382 };
2383 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002384 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002385 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002386 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002387 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04002388 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002389}
David Tolnay8c81f622018-07-31 23:34:35 -07002390#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002391pub fn visit_item_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemStruct) {
David Tolnay8c81f622018-07-31 23:34:35 -07002392 for it in &_i.attrs {
2393 _visitor.visit_attribute(it)
2394 }
2395 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002396 tokens_helper(_visitor, &_i.struct_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002397 _visitor.visit_ident(&_i.ident);
2398 _visitor.visit_generics(&_i.generics);
2399 _visitor.visit_fields(&_i.fields);
2400 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002401 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002402 };
Nika Layzell27726662017-10-24 23:16:35 -04002403}
David Tolnay8c81f622018-07-31 23:34:35 -07002404#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002405pub fn visit_item_trait<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemTrait) {
David Tolnay8c81f622018-07-31 23:34:35 -07002406 for it in &_i.attrs {
2407 _visitor.visit_attribute(it)
2408 }
2409 _visitor.visit_visibility(&_i.vis);
2410 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002411 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002412 };
2413 if let Some(ref it) = _i.auto_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002414 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002415 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002416 tokens_helper(_visitor, &_i.trait_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002417 _visitor.visit_ident(&_i.ident);
2418 _visitor.visit_generics(&_i.generics);
2419 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002420 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002421 };
2422 for el in Punctuated::pairs(&_i.supertraits) {
2423 let it = el.value();
2424 _visitor.visit_type_param_bound(it)
2425 }
David Tolnay7ac699c2018-08-24 14:00:58 -04002426 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002427 for it in &_i.items {
2428 _visitor.visit_trait_item(it)
2429 }
Nika Layzell27726662017-10-24 23:16:35 -04002430}
David Tolnay8c81f622018-07-31 23:34:35 -07002431#[cfg(feature = "full")]
David Tolnayc6b04dd2018-08-30 23:22:51 -07002432pub fn visit_item_trait_alias<'ast, V: Visit<'ast> + ?Sized>(
2433 _visitor: &mut V,
2434 _i: &'ast ItemTraitAlias,
2435) {
2436 for it in &_i.attrs {
2437 _visitor.visit_attribute(it)
2438 }
2439 _visitor.visit_visibility(&_i.vis);
2440 tokens_helper(_visitor, &_i.trait_token.span);
2441 _visitor.visit_ident(&_i.ident);
2442 _visitor.visit_generics(&_i.generics);
2443 tokens_helper(_visitor, &_i.eq_token.spans);
2444 for el in Punctuated::pairs(&_i.bounds) {
2445 let it = el.value();
2446 _visitor.visit_type_param_bound(it)
2447 }
2448 tokens_helper(_visitor, &_i.semi_token.spans);
2449}
2450#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002451pub fn visit_item_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemType) {
David Tolnay8c81f622018-07-31 23:34:35 -07002452 for it in &_i.attrs {
2453 _visitor.visit_attribute(it)
2454 }
2455 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002456 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002457 _visitor.visit_ident(&_i.ident);
2458 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04002459 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002460 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002461 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002462}
David Tolnay8c81f622018-07-31 23:34:35 -07002463#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002464pub fn visit_item_union<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemUnion) {
David Tolnay8c81f622018-07-31 23:34:35 -07002465 for it in &_i.attrs {
2466 _visitor.visit_attribute(it)
2467 }
2468 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002469 tokens_helper(_visitor, &_i.union_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002470 _visitor.visit_ident(&_i.ident);
2471 _visitor.visit_generics(&_i.generics);
2472 _visitor.visit_fields_named(&_i.fields);
Nika Layzell27726662017-10-24 23:16:35 -04002473}
David Tolnay8c81f622018-07-31 23:34:35 -07002474#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002475pub fn visit_item_use<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemUse) {
David Tolnay8c81f622018-07-31 23:34:35 -07002476 for it in &_i.attrs {
2477 _visitor.visit_attribute(it)
2478 }
2479 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002480 tokens_helper(_visitor, &_i.use_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002481 if let Some(ref it) = _i.leading_colon {
David Tolnay7ac699c2018-08-24 14:00:58 -04002482 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002483 };
2484 _visitor.visit_use_tree(&_i.tree);
David Tolnay7ac699c2018-08-24 14:00:58 -04002485 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002486}
David Tolnay8c81f622018-07-31 23:34:35 -07002487#[cfg(feature = "full")]
2488pub fn visit_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
2489 _visitor: &mut V,
2490 _i: &'ast ItemVerbatim,
2491) {
David Tolnay6af48992018-08-01 11:16:28 -07002492 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05002493}
David Tolnay8c81f622018-07-31 23:34:35 -07002494#[cfg(any(feature = "full", feature = "derive"))]
2495#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002496pub fn visit_label<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Label) {
David Tolnay8c81f622018-07-31 23:34:35 -07002497 _visitor.visit_lifetime(&_i.name);
David Tolnay7ac699c2018-08-24 14:00:58 -04002498 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnaybcd498f2017-12-29 12:02:33 -05002499}
David Tolnay4b4c4b62018-01-06 13:48:05 -08002500pub fn visit_lifetime<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Lifetime) {
David Tolnay17f63892018-08-31 10:36:32 -07002501 _visitor.visit_span(&_i.apostrophe);
David Tolnay8c81f622018-07-31 23:34:35 -07002502 _visitor.visit_ident(&_i.ident);
David Tolnay4ba63a02017-12-28 15:53:05 -05002503}
David Tolnay8c81f622018-07-31 23:34:35 -07002504#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002505pub fn visit_lifetime_def<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LifetimeDef) {
David Tolnay8c81f622018-07-31 23:34:35 -07002506 for it in &_i.attrs {
2507 _visitor.visit_attribute(it)
2508 }
2509 _visitor.visit_lifetime(&_i.lifetime);
2510 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002511 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002512 };
2513 for el in Punctuated::pairs(&_i.bounds) {
2514 let it = el.value();
2515 _visitor.visit_lifetime(it)
2516 }
David Tolnay4ba63a02017-12-28 15:53:05 -05002517}
David Tolnay8c81f622018-07-31 23:34:35 -07002518#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002519pub fn visit_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Lit) {
David Tolnay360efd22018-01-04 23:35:26 -08002520 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002521 Lit::Str(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002522 _visitor.visit_lit_str(_binding_0);
2523 }
David Tolnay8c81f622018-07-31 23:34:35 -07002524 Lit::ByteStr(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002525 _visitor.visit_lit_byte_str(_binding_0);
2526 }
David Tolnay8c81f622018-07-31 23:34:35 -07002527 Lit::Byte(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002528 _visitor.visit_lit_byte(_binding_0);
2529 }
David Tolnay8c81f622018-07-31 23:34:35 -07002530 Lit::Char(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002531 _visitor.visit_lit_char(_binding_0);
2532 }
David Tolnay8c81f622018-07-31 23:34:35 -07002533 Lit::Int(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002534 _visitor.visit_lit_int(_binding_0);
2535 }
David Tolnay8c81f622018-07-31 23:34:35 -07002536 Lit::Float(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002537 _visitor.visit_lit_float(_binding_0);
2538 }
David Tolnay8c81f622018-07-31 23:34:35 -07002539 Lit::Bool(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002540 _visitor.visit_lit_bool(_binding_0);
2541 }
David Tolnay8c81f622018-07-31 23:34:35 -07002542 Lit::Verbatim(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002543 _visitor.visit_lit_verbatim(_binding_0);
2544 }
2545 }
2546}
David Tolnay8c81f622018-07-31 23:34:35 -07002547#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002548pub fn visit_lit_bool<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitBool) {
David Tolnay6af48992018-08-01 11:16:28 -07002549 skip!(_i.value);
David Tolnay8c81f622018-07-31 23:34:35 -07002550 _visitor.visit_span(&_i.span);
Nika Layzell27726662017-10-24 23:16:35 -04002551}
David Tolnay8c81f622018-07-31 23:34:35 -07002552#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002553pub fn visit_lit_byte<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitByte) {
David Tolnay6af48992018-08-01 11:16:28 -07002554 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002555}
David Tolnay8c81f622018-07-31 23:34:35 -07002556#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002557pub fn visit_lit_byte_str<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitByteStr) {
David Tolnay6af48992018-08-01 11:16:28 -07002558 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002559}
David Tolnay8c81f622018-07-31 23:34:35 -07002560#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002561pub fn visit_lit_char<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitChar) {
David Tolnay6af48992018-08-01 11:16:28 -07002562 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002563}
David Tolnay8c81f622018-07-31 23:34:35 -07002564#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002565pub fn visit_lit_float<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitFloat) {
David Tolnay6af48992018-08-01 11:16:28 -07002566 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002567}
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_int<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitInt) {
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_str<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitStr) {
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_verbatim<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitVerbatim) {
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"))]
2581#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002582pub fn visit_local<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Local) {
David Tolnay8c81f622018-07-31 23:34:35 -07002583 for it in &_i.attrs {
2584 _visitor.visit_attribute(it)
2585 }
David Tolnay7ac699c2018-08-24 14:00:58 -04002586 tokens_helper(_visitor, &_i.let_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002587 for el in Punctuated::pairs(&_i.pats) {
2588 let it = el.value();
2589 _visitor.visit_pat(it)
2590 }
2591 if let Some(ref it) = _i.ty {
David Tolnay7ac699c2018-08-24 14:00:58 -04002592 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002593 _visitor.visit_type(&*(it).1);
2594 };
2595 if let Some(ref it) = _i.init {
David Tolnay7ac699c2018-08-24 14:00:58 -04002596 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002597 _visitor.visit_expr(&*(it).1);
2598 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002599 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002600}
David Tolnay8c81f622018-07-31 23:34:35 -07002601#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002602pub fn visit_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Macro) {
David Tolnay8c81f622018-07-31 23:34:35 -07002603 _visitor.visit_path(&_i.path);
David Tolnay7ac699c2018-08-24 14:00:58 -04002604 tokens_helper(_visitor, &_i.bang_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002605 _visitor.visit_macro_delimiter(&_i.delimiter);
David Tolnay6af48992018-08-01 11:16:28 -07002606 skip!(_i.tts);
David Tolnayab919512017-12-30 23:31:51 -05002607}
David Tolnay8c81f622018-07-31 23:34:35 -07002608#[cfg(any(feature = "full", feature = "derive"))]
2609pub fn visit_macro_delimiter<'ast, V: Visit<'ast> + ?Sized>(
2610 _visitor: &mut V,
2611 _i: &'ast MacroDelimiter,
2612) {
David Tolnayab919512017-12-30 23:31:51 -05002613 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002614 MacroDelimiter::Paren(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002615 tokens_helper(_visitor, &_binding_0.span);
David Tolnayab919512017-12-30 23:31:51 -05002616 }
David Tolnay8c81f622018-07-31 23:34:35 -07002617 MacroDelimiter::Brace(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002618 tokens_helper(_visitor, &_binding_0.span);
David Tolnayab919512017-12-30 23:31:51 -05002619 }
David Tolnay8c81f622018-07-31 23:34:35 -07002620 MacroDelimiter::Bracket(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002621 tokens_helper(_visitor, &_binding_0.span);
David Tolnayab919512017-12-30 23:31:51 -05002622 }
2623 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002624}
David Tolnay8c81f622018-07-31 23:34:35 -07002625#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002626pub fn visit_member<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Member) {
David Tolnay85b69a42017-12-27 20:43:10 -05002627 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002628 Member::Named(ref _binding_0) => {
Alex Crichtond261d092018-05-18 13:47:35 -07002629 _visitor.visit_ident(_binding_0);
David Tolnay85b69a42017-12-27 20:43:10 -05002630 }
David Tolnay8c81f622018-07-31 23:34:35 -07002631 Member::Unnamed(ref _binding_0) => {
David Tolnay85b69a42017-12-27 20:43:10 -05002632 _visitor.visit_index(_binding_0);
2633 }
2634 }
2635}
David Tolnay8c81f622018-07-31 23:34:35 -07002636#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayaaadd782018-01-06 22:58:13 -08002637pub fn visit_meta<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Meta) {
Nika Layzell27726662017-10-24 23:16:35 -04002638 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002639 Meta::Word(ref _binding_0) => {
Alex Crichtond261d092018-05-18 13:47:35 -07002640 _visitor.visit_ident(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002641 }
David Tolnay8c81f622018-07-31 23:34:35 -07002642 Meta::List(ref _binding_0) => {
David Tolnayaaadd782018-01-06 22:58:13 -08002643 _visitor.visit_meta_list(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002644 }
David Tolnay8c81f622018-07-31 23:34:35 -07002645 Meta::NameValue(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002646 _visitor.visit_meta_name_value(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002647 }
2648 }
2649}
David Tolnay8c81f622018-07-31 23:34:35 -07002650#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayaaadd782018-01-06 22:58:13 -08002651pub fn visit_meta_list<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast MetaList) {
David Tolnay8c81f622018-07-31 23:34:35 -07002652 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002653 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002654 for el in Punctuated::pairs(&_i.nested) {
2655 let it = el.value();
2656 _visitor.visit_nested_meta(it)
2657 }
Nika Layzell27726662017-10-24 23:16:35 -04002658}
David Tolnay8c81f622018-07-31 23:34:35 -07002659#[cfg(any(feature = "full", feature = "derive"))]
2660pub fn visit_meta_name_value<'ast, V: Visit<'ast> + ?Sized>(
2661 _visitor: &mut V,
2662 _i: &'ast MetaNameValue,
2663) {
2664 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002665 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002666 _visitor.visit_lit(&_i.lit);
Nika Layzell27726662017-10-24 23:16:35 -04002667}
David Tolnay8c81f622018-07-31 23:34:35 -07002668#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002669pub fn visit_method_sig<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast MethodSig) {
David Tolnay8c81f622018-07-31 23:34:35 -07002670 if let Some(ref it) = _i.constness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002671 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002672 };
2673 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002674 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002675 };
Yusuke Sasakif00a3ef2018-07-20 22:08:42 +09002676 if let Some(ref it) = _i.asyncness {
2677 tokens_helper(_visitor, &it.span)
2678 };
David Tolnay8c81f622018-07-31 23:34:35 -07002679 if let Some(ref it) = _i.abi {
2680 _visitor.visit_abi(it)
2681 };
2682 _visitor.visit_ident(&_i.ident);
2683 _visitor.visit_fn_decl(&_i.decl);
Nika Layzell27726662017-10-24 23:16:35 -04002684}
David Tolnay8c81f622018-07-31 23:34:35 -07002685#[cfg(any(feature = "full", feature = "derive"))]
2686#[cfg(feature = "full")]
2687pub fn visit_method_turbofish<'ast, V: Visit<'ast> + ?Sized>(
2688 _visitor: &mut V,
2689 _i: &'ast MethodTurbofish,
2690) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002691 tokens_helper(_visitor, &_i.colon2_token.spans);
2692 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002693 for el in Punctuated::pairs(&_i.args) {
2694 let it = el.value();
2695 _visitor.visit_generic_method_argument(it)
2696 }
David Tolnay7ac699c2018-08-24 14:00:58 -04002697 tokens_helper(_visitor, &_i.gt_token.spans);
David Tolnayd60cfec2017-12-29 00:21:38 -05002698}
David Tolnay8c81f622018-07-31 23:34:35 -07002699#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayaaadd782018-01-06 22:58:13 -08002700pub fn visit_nested_meta<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast NestedMeta) {
Nika Layzell27726662017-10-24 23:16:35 -04002701 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002702 NestedMeta::Meta(ref _binding_0) => {
David Tolnayaaadd782018-01-06 22:58:13 -08002703 _visitor.visit_meta(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002704 }
David Tolnay8c81f622018-07-31 23:34:35 -07002705 NestedMeta::Literal(ref _binding_0) => {
David Tolnay4ba63a02017-12-28 15:53:05 -05002706 _visitor.visit_lit(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002707 }
2708 }
2709}
David Tolnay8c81f622018-07-31 23:34:35 -07002710#[cfg(any(feature = "full", feature = "derive"))]
2711pub fn visit_parenthesized_generic_arguments<'ast, V: Visit<'ast> + ?Sized>(
2712 _visitor: &mut V,
2713 _i: &'ast ParenthesizedGenericArguments,
2714) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002715 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002716 for el in Punctuated::pairs(&_i.inputs) {
2717 let it = el.value();
2718 _visitor.visit_type(it)
2719 }
2720 _visitor.visit_return_type(&_i.output);
Nika Layzell27726662017-10-24 23:16:35 -04002721}
David Tolnay8c81f622018-07-31 23:34:35 -07002722#[cfg(any(feature = "full", feature = "derive"))]
2723#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002724pub fn visit_pat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Pat) {
Nika Layzell27726662017-10-24 23:16:35 -04002725 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002726 Pat::Wild(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002727 _visitor.visit_pat_wild(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002728 }
David Tolnay8c81f622018-07-31 23:34:35 -07002729 Pat::Ident(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002730 _visitor.visit_pat_ident(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002731 }
David Tolnay8c81f622018-07-31 23:34:35 -07002732 Pat::Struct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002733 _visitor.visit_pat_struct(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002734 }
David Tolnay8c81f622018-07-31 23:34:35 -07002735 Pat::TupleStruct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002736 _visitor.visit_pat_tuple_struct(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002737 }
David Tolnay8c81f622018-07-31 23:34:35 -07002738 Pat::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002739 _visitor.visit_pat_path(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002740 }
David Tolnay8c81f622018-07-31 23:34:35 -07002741 Pat::Tuple(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002742 _visitor.visit_pat_tuple(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002743 }
David Tolnay8c81f622018-07-31 23:34:35 -07002744 Pat::Box(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002745 _visitor.visit_pat_box(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002746 }
David Tolnay8c81f622018-07-31 23:34:35 -07002747 Pat::Ref(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002748 _visitor.visit_pat_ref(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002749 }
David Tolnay8c81f622018-07-31 23:34:35 -07002750 Pat::Lit(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002751 _visitor.visit_pat_lit(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002752 }
David Tolnay8c81f622018-07-31 23:34:35 -07002753 Pat::Range(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002754 _visitor.visit_pat_range(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002755 }
David Tolnay8c81f622018-07-31 23:34:35 -07002756 Pat::Slice(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002757 _visitor.visit_pat_slice(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002758 }
David Tolnay8c81f622018-07-31 23:34:35 -07002759 Pat::Macro(ref _binding_0) => {
David Tolnay323279a2017-12-29 11:26:32 -05002760 _visitor.visit_pat_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002761 }
David Tolnay8c81f622018-07-31 23:34:35 -07002762 Pat::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002763 _visitor.visit_pat_verbatim(_binding_0);
2764 }
Nika Layzell27726662017-10-24 23:16:35 -04002765 }
2766}
David Tolnay8c81f622018-07-31 23:34:35 -07002767#[cfg(any(feature = "full", feature = "derive"))]
2768#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002769pub fn visit_pat_box<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatBox) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002770 tokens_helper(_visitor, &_i.box_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002771 _visitor.visit_pat(&*_i.pat);
Nika Layzell27726662017-10-24 23:16:35 -04002772}
David Tolnay8c81f622018-07-31 23:34:35 -07002773#[cfg(any(feature = "full", feature = "derive"))]
2774#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002775pub fn visit_pat_ident<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatIdent) {
David Tolnay8c81f622018-07-31 23:34:35 -07002776 if let Some(ref it) = _i.by_ref {
David Tolnay7ac699c2018-08-24 14:00:58 -04002777 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002778 };
2779 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04002780 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002781 };
2782 _visitor.visit_ident(&_i.ident);
2783 if let Some(ref it) = _i.subpat {
David Tolnay7ac699c2018-08-24 14:00:58 -04002784 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002785 _visitor.visit_pat(&*(it).1);
2786 };
Nika Layzell27726662017-10-24 23:16:35 -04002787}
David Tolnay8c81f622018-07-31 23:34:35 -07002788#[cfg(any(feature = "full", feature = "derive"))]
2789#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002790pub fn visit_pat_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatLit) {
David Tolnay8c81f622018-07-31 23:34:35 -07002791 _visitor.visit_expr(&*_i.expr);
Nika Layzell27726662017-10-24 23:16:35 -04002792}
David Tolnay8c81f622018-07-31 23:34:35 -07002793#[cfg(any(feature = "full", feature = "derive"))]
2794#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002795pub fn visit_pat_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatMacro) {
David Tolnay8c81f622018-07-31 23:34:35 -07002796 _visitor.visit_macro(&_i.mac);
David Tolnay323279a2017-12-29 11:26:32 -05002797}
David Tolnay8c81f622018-07-31 23:34:35 -07002798#[cfg(any(feature = "full", feature = "derive"))]
2799#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002800pub fn visit_pat_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatPath) {
David Tolnay8c81f622018-07-31 23:34:35 -07002801 if let Some(ref it) = _i.qself {
2802 _visitor.visit_qself(it)
2803 };
2804 _visitor.visit_path(&_i.path);
Nika Layzell27726662017-10-24 23:16:35 -04002805}
David Tolnay8c81f622018-07-31 23:34:35 -07002806#[cfg(any(feature = "full", feature = "derive"))]
2807#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002808pub fn visit_pat_range<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatRange) {
David Tolnay8c81f622018-07-31 23:34:35 -07002809 _visitor.visit_expr(&*_i.lo);
2810 _visitor.visit_range_limits(&_i.limits);
2811 _visitor.visit_expr(&*_i.hi);
Nika Layzell27726662017-10-24 23:16:35 -04002812}
David Tolnay8c81f622018-07-31 23:34:35 -07002813#[cfg(any(feature = "full", feature = "derive"))]
2814#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002815pub fn visit_pat_ref<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatRef) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002816 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002817 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04002818 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002819 };
2820 _visitor.visit_pat(&*_i.pat);
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_slice<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatSlice) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002825 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002826 for el in Punctuated::pairs(&_i.front) {
2827 let it = el.value();
2828 _visitor.visit_pat(it)
2829 }
2830 if let Some(ref it) = _i.middle {
2831 _visitor.visit_pat(&**it)
2832 };
2833 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002834 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002835 };
2836 if let Some(ref it) = _i.comma_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002837 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002838 };
2839 for el in Punctuated::pairs(&_i.back) {
2840 let it = el.value();
2841 _visitor.visit_pat(it)
2842 }
Nika Layzell27726662017-10-24 23:16:35 -04002843}
David Tolnay8c81f622018-07-31 23:34:35 -07002844#[cfg(any(feature = "full", feature = "derive"))]
2845#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002846pub fn visit_pat_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatStruct) {
David Tolnay8c81f622018-07-31 23:34:35 -07002847 _visitor.visit_path(&_i.path);
David Tolnay7ac699c2018-08-24 14:00:58 -04002848 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002849 for el in Punctuated::pairs(&_i.fields) {
2850 let it = el.value();
2851 _visitor.visit_field_pat(it)
2852 }
2853 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002854 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002855 };
Nika Layzell27726662017-10-24 23:16:35 -04002856}
David Tolnay8c81f622018-07-31 23:34:35 -07002857#[cfg(any(feature = "full", feature = "derive"))]
2858#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002859pub fn visit_pat_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatTuple) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002860 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002861 for el in Punctuated::pairs(&_i.front) {
2862 let it = el.value();
2863 _visitor.visit_pat(it)
2864 }
2865 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002866 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002867 };
2868 if let Some(ref it) = _i.comma_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002869 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002870 };
2871 for el in Punctuated::pairs(&_i.back) {
2872 let it = el.value();
2873 _visitor.visit_pat(it)
2874 }
Nika Layzell27726662017-10-24 23:16:35 -04002875}
David Tolnay8c81f622018-07-31 23:34:35 -07002876#[cfg(any(feature = "full", feature = "derive"))]
2877#[cfg(feature = "full")]
2878pub fn visit_pat_tuple_struct<'ast, V: Visit<'ast> + ?Sized>(
2879 _visitor: &mut V,
2880 _i: &'ast PatTupleStruct,
2881) {
2882 _visitor.visit_path(&_i.path);
2883 _visitor.visit_pat_tuple(&_i.pat);
Nika Layzell27726662017-10-24 23:16:35 -04002884}
David Tolnay8c81f622018-07-31 23:34:35 -07002885#[cfg(any(feature = "full", feature = "derive"))]
2886#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002887pub fn visit_pat_verbatim<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatVerbatim) {
David Tolnay6af48992018-08-01 11:16:28 -07002888 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05002889}
David Tolnay8c81f622018-07-31 23:34:35 -07002890#[cfg(any(feature = "full", feature = "derive"))]
2891#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002892pub fn visit_pat_wild<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatWild) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002893 tokens_helper(_visitor, &_i.underscore_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002894}
David Tolnay8c81f622018-07-31 23:34:35 -07002895#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002896pub fn visit_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Path) {
David Tolnay8c81f622018-07-31 23:34:35 -07002897 if let Some(ref it) = _i.leading_colon {
David Tolnay7ac699c2018-08-24 14:00:58 -04002898 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002899 };
2900 for el in Punctuated::pairs(&_i.segments) {
2901 let it = el.value();
2902 _visitor.visit_path_segment(it)
2903 }
Nika Layzell27726662017-10-24 23:16:35 -04002904}
David Tolnay8c81f622018-07-31 23:34:35 -07002905#[cfg(any(feature = "full", feature = "derive"))]
2906pub fn visit_path_arguments<'ast, V: Visit<'ast> + ?Sized>(
2907 _visitor: &mut V,
2908 _i: &'ast PathArguments,
2909) {
Nika Layzellc08227a2017-12-04 16:30:17 -05002910 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002911 PathArguments::None => {}
2912 PathArguments::AngleBracketed(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002913 _visitor.visit_angle_bracketed_generic_arguments(_binding_0);
Nika Layzellc08227a2017-12-04 16:30:17 -05002914 }
David Tolnay8c81f622018-07-31 23:34:35 -07002915 PathArguments::Parenthesized(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002916 _visitor.visit_parenthesized_generic_arguments(_binding_0);
Nika Layzellc08227a2017-12-04 16:30:17 -05002917 }
2918 }
2919}
David Tolnay8c81f622018-07-31 23:34:35 -07002920#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002921pub fn visit_path_segment<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PathSegment) {
David Tolnay8c81f622018-07-31 23:34:35 -07002922 _visitor.visit_ident(&_i.ident);
2923 _visitor.visit_path_arguments(&_i.arguments);
Nika Layzell27726662017-10-24 23:16:35 -04002924}
David Tolnay8c81f622018-07-31 23:34:35 -07002925#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002926pub fn visit_predicate_eq<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PredicateEq) {
David Tolnay8c81f622018-07-31 23:34:35 -07002927 _visitor.visit_type(&_i.lhs_ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002928 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002929 _visitor.visit_type(&_i.rhs_ty);
David Tolnayd4add852018-01-01 20:13:24 -08002930}
David Tolnay8c81f622018-07-31 23:34:35 -07002931#[cfg(any(feature = "full", feature = "derive"))]
2932pub fn visit_predicate_lifetime<'ast, V: Visit<'ast> + ?Sized>(
2933 _visitor: &mut V,
2934 _i: &'ast PredicateLifetime,
2935) {
2936 _visitor.visit_lifetime(&_i.lifetime);
David Tolnay1b8e2852018-08-26 08:25:18 -04002937 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002938 for el in Punctuated::pairs(&_i.bounds) {
2939 let it = el.value();
2940 _visitor.visit_lifetime(it)
2941 }
David Tolnayd4add852018-01-01 20:13:24 -08002942}
David Tolnay8c81f622018-07-31 23:34:35 -07002943#[cfg(any(feature = "full", feature = "derive"))]
2944pub fn visit_predicate_type<'ast, V: Visit<'ast> + ?Sized>(
2945 _visitor: &mut V,
2946 _i: &'ast PredicateType,
2947) {
2948 if let Some(ref it) = _i.lifetimes {
2949 _visitor.visit_bound_lifetimes(it)
2950 };
2951 _visitor.visit_type(&_i.bounded_ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002952 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002953 for el in Punctuated::pairs(&_i.bounds) {
2954 let it = el.value();
2955 _visitor.visit_type_param_bound(it)
2956 }
David Tolnayd4add852018-01-01 20:13:24 -08002957}
David Tolnay8c81f622018-07-31 23:34:35 -07002958#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002959pub fn visit_qself<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast QSelf) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002960 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002961 _visitor.visit_type(&*_i.ty);
David Tolnay6af48992018-08-01 11:16:28 -07002962 skip!(_i.position);
David Tolnay8c81f622018-07-31 23:34:35 -07002963 if let Some(ref it) = _i.as_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002964 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002965 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002966 tokens_helper(_visitor, &_i.gt_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002967}
David Tolnay8c81f622018-07-31 23:34:35 -07002968#[cfg(any(feature = "full", feature = "derive"))]
2969#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002970pub fn visit_range_limits<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast RangeLimits) {
Nika Layzell27726662017-10-24 23:16:35 -04002971 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002972 RangeLimits::HalfOpen(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002973 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002974 }
David Tolnay8c81f622018-07-31 23:34:35 -07002975 RangeLimits::Closed(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002976 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002977 }
2978 }
2979}
David Tolnay8c81f622018-07-31 23:34:35 -07002980#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002981pub fn visit_return_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ReturnType) {
David Tolnayf93b90d2017-11-11 19:21:26 -08002982 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002983 ReturnType::Default => {}
2984 ReturnType::Type(ref _binding_0, ref _binding_1) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002985 tokens_helper(_visitor, &_binding_0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002986 _visitor.visit_type(&**_binding_1);
David Tolnayf93b90d2017-11-11 19:21:26 -08002987 }
2988 }
2989}
David Tolnay8c81f622018-07-31 23:34:35 -07002990pub fn visit_span<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Span) {}
2991#[cfg(any(feature = "full", feature = "derive"))]
2992#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002993pub fn visit_stmt<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Stmt) {
Nika Layzell27726662017-10-24 23:16:35 -04002994 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002995 Stmt::Local(ref _binding_0) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08002996 _visitor.visit_local(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002997 }
David Tolnay8c81f622018-07-31 23:34:35 -07002998 Stmt::Item(ref _binding_0) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08002999 _visitor.visit_item(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003000 }
David Tolnay8c81f622018-07-31 23:34:35 -07003001 Stmt::Expr(ref _binding_0) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08003002 _visitor.visit_expr(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003003 }
David Tolnay8c81f622018-07-31 23:34:35 -07003004 Stmt::Semi(ref _binding_0, ref _binding_1) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08003005 _visitor.visit_expr(_binding_0);
David Tolnay7ac699c2018-08-24 14:00:58 -04003006 tokens_helper(_visitor, &_binding_1.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003007 }
Nika Layzell27726662017-10-24 23:16:35 -04003008 }
3009}
David Tolnay8c81f622018-07-31 23:34:35 -07003010#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003011pub fn visit_trait_bound<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TraitBound) {
David Tolnay8c81f622018-07-31 23:34:35 -07003012 if let Some(ref it) = _i.paren_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003013 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003014 };
3015 _visitor.visit_trait_bound_modifier(&_i.modifier);
3016 if let Some(ref it) = _i.lifetimes {
3017 _visitor.visit_bound_lifetimes(it)
3018 };
3019 _visitor.visit_path(&_i.path);
David Tolnay40fb8ce2018-01-02 10:53:46 -08003020}
David Tolnay8c81f622018-07-31 23:34:35 -07003021#[cfg(any(feature = "full", feature = "derive"))]
3022pub fn visit_trait_bound_modifier<'ast, V: Visit<'ast> + ?Sized>(
3023 _visitor: &mut V,
3024 _i: &'ast TraitBoundModifier,
3025) {
Nika Layzell27726662017-10-24 23:16:35 -04003026 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003027 TraitBoundModifier::None => {}
3028 TraitBoundModifier::Maybe(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003029 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003030 }
3031 }
3032}
David Tolnay8c81f622018-07-31 23:34:35 -07003033#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003034pub fn visit_trait_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TraitItem) {
Nika Layzell27726662017-10-24 23:16:35 -04003035 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003036 TraitItem::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003037 _visitor.visit_trait_item_const(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003038 }
David Tolnay8c81f622018-07-31 23:34:35 -07003039 TraitItem::Method(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003040 _visitor.visit_trait_item_method(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003041 }
David Tolnay8c81f622018-07-31 23:34:35 -07003042 TraitItem::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003043 _visitor.visit_trait_item_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003044 }
David Tolnay8c81f622018-07-31 23:34:35 -07003045 TraitItem::Macro(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003046 _visitor.visit_trait_item_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003047 }
David Tolnay8c81f622018-07-31 23:34:35 -07003048 TraitItem::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05003049 _visitor.visit_trait_item_verbatim(_binding_0);
3050 }
Nika Layzell27726662017-10-24 23:16:35 -04003051 }
3052}
David Tolnay8c81f622018-07-31 23:34:35 -07003053#[cfg(feature = "full")]
3054pub fn visit_trait_item_const<'ast, V: Visit<'ast> + ?Sized>(
3055 _visitor: &mut V,
3056 _i: &'ast TraitItemConst,
3057) {
3058 for it in &_i.attrs {
3059 _visitor.visit_attribute(it)
3060 }
David Tolnay7ac699c2018-08-24 14:00:58 -04003061 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003062 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04003063 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003064 _visitor.visit_type(&_i.ty);
3065 if let Some(ref it) = _i.default {
David Tolnay7ac699c2018-08-24 14:00:58 -04003066 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003067 _visitor.visit_expr(&(it).1);
3068 };
David Tolnay7ac699c2018-08-24 14:00:58 -04003069 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnayda705bd2017-11-10 21:58:05 -08003070}
David Tolnay8c81f622018-07-31 23:34:35 -07003071#[cfg(feature = "full")]
3072pub fn visit_trait_item_macro<'ast, V: Visit<'ast> + ?Sized>(
3073 _visitor: &mut V,
3074 _i: &'ast TraitItemMacro,
3075) {
3076 for it in &_i.attrs {
3077 _visitor.visit_attribute(it)
3078 }
3079 _visitor.visit_macro(&_i.mac);
3080 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003081 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003082 };
David Tolnayda705bd2017-11-10 21:58:05 -08003083}
David Tolnay8c81f622018-07-31 23:34:35 -07003084#[cfg(feature = "full")]
3085pub fn visit_trait_item_method<'ast, V: Visit<'ast> + ?Sized>(
3086 _visitor: &mut V,
3087 _i: &'ast TraitItemMethod,
3088) {
3089 for it in &_i.attrs {
3090 _visitor.visit_attribute(it)
3091 }
3092 _visitor.visit_method_sig(&_i.sig);
3093 if let Some(ref it) = _i.default {
3094 _visitor.visit_block(it)
3095 };
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 };
Nika Layzell27726662017-10-24 23:16:35 -04003099}
David Tolnay8c81f622018-07-31 23:34:35 -07003100#[cfg(feature = "full")]
3101pub fn visit_trait_item_type<'ast, V: Visit<'ast> + ?Sized>(
3102 _visitor: &mut V,
3103 _i: &'ast TraitItemType,
3104) {
3105 for it in &_i.attrs {
3106 _visitor.visit_attribute(it)
3107 }
David Tolnay7ac699c2018-08-24 14:00:58 -04003108 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003109 _visitor.visit_ident(&_i.ident);
3110 _visitor.visit_generics(&_i.generics);
3111 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003112 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003113 };
3114 for el in Punctuated::pairs(&_i.bounds) {
3115 let it = el.value();
3116 _visitor.visit_type_param_bound(it)
3117 }
3118 if let Some(ref it) = _i.default {
David Tolnay7ac699c2018-08-24 14:00:58 -04003119 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003120 _visitor.visit_type(&(it).1);
3121 };
David Tolnay7ac699c2018-08-24 14:00:58 -04003122 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003123}
David Tolnay8c81f622018-07-31 23:34:35 -07003124#[cfg(feature = "full")]
3125pub fn visit_trait_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
3126 _visitor: &mut V,
3127 _i: &'ast TraitItemVerbatim,
3128) {
David Tolnay6af48992018-08-01 11:16:28 -07003129 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05003130}
David Tolnay8c81f622018-07-31 23:34:35 -07003131#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003132pub fn visit_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Type) {
Nika Layzell27726662017-10-24 23:16:35 -04003133 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003134 Type::Slice(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003135 _visitor.visit_type_slice(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003136 }
David Tolnay8c81f622018-07-31 23:34:35 -07003137 Type::Array(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003138 _visitor.visit_type_array(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003139 }
David Tolnay8c81f622018-07-31 23:34:35 -07003140 Type::Ptr(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003141 _visitor.visit_type_ptr(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003142 }
David Tolnay8c81f622018-07-31 23:34:35 -07003143 Type::Reference(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003144 _visitor.visit_type_reference(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003145 }
David Tolnay8c81f622018-07-31 23:34:35 -07003146 Type::BareFn(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003147 _visitor.visit_type_bare_fn(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003148 }
David Tolnay8c81f622018-07-31 23:34:35 -07003149 Type::Never(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003150 _visitor.visit_type_never(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003151 }
David Tolnay8c81f622018-07-31 23:34:35 -07003152 Type::Tuple(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003153 _visitor.visit_type_tuple(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003154 }
David Tolnay8c81f622018-07-31 23:34:35 -07003155 Type::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003156 _visitor.visit_type_path(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003157 }
David Tolnay8c81f622018-07-31 23:34:35 -07003158 Type::TraitObject(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003159 _visitor.visit_type_trait_object(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003160 }
David Tolnay8c81f622018-07-31 23:34:35 -07003161 Type::ImplTrait(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003162 _visitor.visit_type_impl_trait(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003163 }
David Tolnay8c81f622018-07-31 23:34:35 -07003164 Type::Paren(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003165 _visitor.visit_type_paren(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003166 }
David Tolnay8c81f622018-07-31 23:34:35 -07003167 Type::Group(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003168 _visitor.visit_type_group(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003169 }
David Tolnay8c81f622018-07-31 23:34:35 -07003170 Type::Infer(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003171 _visitor.visit_type_infer(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003172 }
David Tolnay8c81f622018-07-31 23:34:35 -07003173 Type::Macro(ref _binding_0) => {
David Tolnay323279a2017-12-29 11:26:32 -05003174 _visitor.visit_type_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003175 }
David Tolnay8c81f622018-07-31 23:34:35 -07003176 Type::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05003177 _visitor.visit_type_verbatim(_binding_0);
3178 }
Nika Layzell27726662017-10-24 23:16:35 -04003179 }
3180}
David Tolnay8c81f622018-07-31 23:34:35 -07003181#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003182pub fn visit_type_array<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeArray) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003183 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003184 _visitor.visit_type(&*_i.elem);
David Tolnay7ac699c2018-08-24 14:00:58 -04003185 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003186 _visitor.visit_expr(&_i.len);
Nika Layzell27726662017-10-24 23:16:35 -04003187}
David Tolnay8c81f622018-07-31 23:34:35 -07003188#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003189pub fn visit_type_bare_fn<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeBareFn) {
David Tolnay3779bb72018-08-26 18:46:07 -07003190 if let Some(ref it) = _i.lifetimes {
3191 _visitor.visit_bound_lifetimes(it)
3192 };
David Tolnay8c81f622018-07-31 23:34:35 -07003193 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04003194 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003195 };
3196 if let Some(ref it) = _i.abi {
3197 _visitor.visit_abi(it)
3198 };
David Tolnay7ac699c2018-08-24 14:00:58 -04003199 tokens_helper(_visitor, &_i.fn_token.span);
David Tolnay7ac699c2018-08-24 14:00:58 -04003200 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003201 for el in Punctuated::pairs(&_i.inputs) {
3202 let it = el.value();
3203 _visitor.visit_bare_fn_arg(it)
3204 }
3205 if let Some(ref it) = _i.variadic {
David Tolnay7ac699c2018-08-24 14:00:58 -04003206 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003207 };
3208 _visitor.visit_return_type(&_i.output);
Nika Layzell27726662017-10-24 23:16:35 -04003209}
David Tolnay8c81f622018-07-31 23:34:35 -07003210#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003211pub fn visit_type_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeGroup) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003212 tokens_helper(_visitor, &_i.group_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003213 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003214}
David Tolnay8c81f622018-07-31 23:34:35 -07003215#[cfg(any(feature = "full", feature = "derive"))]
3216pub fn visit_type_impl_trait<'ast, V: Visit<'ast> + ?Sized>(
3217 _visitor: &mut V,
3218 _i: &'ast TypeImplTrait,
3219) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003220 tokens_helper(_visitor, &_i.impl_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003221 for el in Punctuated::pairs(&_i.bounds) {
3222 let it = el.value();
3223 _visitor.visit_type_param_bound(it)
3224 }
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_infer<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeInfer) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003228 tokens_helper(_visitor, &_i.underscore_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003229}
David Tolnay8c81f622018-07-31 23:34:35 -07003230#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003231pub fn visit_type_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeMacro) {
David Tolnay8c81f622018-07-31 23:34:35 -07003232 _visitor.visit_macro(&_i.mac);
David Tolnay323279a2017-12-29 11:26:32 -05003233}
David Tolnay8c81f622018-07-31 23:34:35 -07003234#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003235pub fn visit_type_never<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeNever) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003236 tokens_helper(_visitor, &_i.bang_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003237}
David Tolnay8c81f622018-07-31 23:34:35 -07003238#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003239pub fn visit_type_param<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeParam) {
David Tolnay8c81f622018-07-31 23:34:35 -07003240 for it in &_i.attrs {
3241 _visitor.visit_attribute(it)
3242 }
3243 _visitor.visit_ident(&_i.ident);
3244 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003245 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003246 };
3247 for el in Punctuated::pairs(&_i.bounds) {
3248 let it = el.value();
3249 _visitor.visit_type_param_bound(it)
3250 }
3251 if let Some(ref it) = _i.eq_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003252 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003253 };
3254 if let Some(ref it) = _i.default {
3255 _visitor.visit_type(it)
3256 };
Nika Layzell27726662017-10-24 23:16:35 -04003257}
David Tolnay8c81f622018-07-31 23:34:35 -07003258#[cfg(any(feature = "full", feature = "derive"))]
3259pub fn visit_type_param_bound<'ast, V: Visit<'ast> + ?Sized>(
3260 _visitor: &mut V,
3261 _i: &'ast TypeParamBound,
3262) {
Nika Layzell27726662017-10-24 23:16:35 -04003263 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003264 TypeParamBound::Trait(ref _binding_0) => {
David Tolnay40fb8ce2018-01-02 10:53:46 -08003265 _visitor.visit_trait_bound(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003266 }
David Tolnay8c81f622018-07-31 23:34:35 -07003267 TypeParamBound::Lifetime(ref _binding_0) => {
David Tolnay4ba63a02017-12-28 15:53:05 -05003268 _visitor.visit_lifetime(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003269 }
3270 }
3271}
David Tolnay8c81f622018-07-31 23:34:35 -07003272#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003273pub fn visit_type_paren<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeParen) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003274 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003275 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003276}
David Tolnay8c81f622018-07-31 23:34:35 -07003277#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003278pub fn visit_type_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypePath) {
David Tolnay8c81f622018-07-31 23:34:35 -07003279 if let Some(ref it) = _i.qself {
3280 _visitor.visit_qself(it)
3281 };
3282 _visitor.visit_path(&_i.path);
Nika Layzell27726662017-10-24 23:16:35 -04003283}
David Tolnay8c81f622018-07-31 23:34:35 -07003284#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003285pub fn visit_type_ptr<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypePtr) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003286 tokens_helper(_visitor, &_i.star_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003287 if let Some(ref it) = _i.const_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003288 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003289 };
3290 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04003291 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003292 };
3293 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003294}
David Tolnay8c81f622018-07-31 23:34:35 -07003295#[cfg(any(feature = "full", feature = "derive"))]
3296pub fn visit_type_reference<'ast, V: Visit<'ast> + ?Sized>(
3297 _visitor: &mut V,
3298 _i: &'ast TypeReference,
3299) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003300 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003301 if let Some(ref it) = _i.lifetime {
3302 _visitor.visit_lifetime(it)
3303 };
3304 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04003305 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003306 };
3307 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003308}
David Tolnay8c81f622018-07-31 23:34:35 -07003309#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003310pub fn visit_type_slice<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeSlice) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003311 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003312 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003313}
David Tolnay8c81f622018-07-31 23:34:35 -07003314#[cfg(any(feature = "full", feature = "derive"))]
3315pub fn visit_type_trait_object<'ast, V: Visit<'ast> + ?Sized>(
3316 _visitor: &mut V,
3317 _i: &'ast TypeTraitObject,
3318) {
3319 if let Some(ref it) = _i.dyn_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003320 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003321 };
3322 for el in Punctuated::pairs(&_i.bounds) {
3323 let it = el.value();
3324 _visitor.visit_type_param_bound(it)
3325 }
Nika Layzell27726662017-10-24 23:16:35 -04003326}
David Tolnay8c81f622018-07-31 23:34:35 -07003327#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003328pub fn visit_type_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeTuple) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003329 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003330 for el in Punctuated::pairs(&_i.elems) {
3331 let it = el.value();
3332 _visitor.visit_type(it)
3333 }
Nika Layzell27726662017-10-24 23:16:35 -04003334}
David Tolnay8c81f622018-07-31 23:34:35 -07003335#[cfg(any(feature = "full", feature = "derive"))]
3336pub fn visit_type_verbatim<'ast, V: Visit<'ast> + ?Sized>(
3337 _visitor: &mut V,
3338 _i: &'ast TypeVerbatim,
3339) {
David Tolnay6af48992018-08-01 11:16:28 -07003340 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05003341}
David Tolnay8c81f622018-07-31 23:34:35 -07003342#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003343pub fn visit_un_op<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UnOp) {
Nika Layzell27726662017-10-24 23:16:35 -04003344 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003345 UnOp::Deref(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003346 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003347 }
David Tolnay8c81f622018-07-31 23:34:35 -07003348 UnOp::Not(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003349 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003350 }
David Tolnay8c81f622018-07-31 23:34:35 -07003351 UnOp::Neg(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003352 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003353 }
3354 }
3355}
David Tolnay8c81f622018-07-31 23:34:35 -07003356#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003357pub fn visit_use_glob<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseGlob) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003358 tokens_helper(_visitor, &_i.star_token.spans);
David Tolnay5f332a92017-12-26 00:42:45 -05003359}
David Tolnay8c81f622018-07-31 23:34:35 -07003360#[cfg(feature = "full")]
David Tolnayd97a7d22018-03-31 19:17:01 +02003361pub fn visit_use_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseGroup) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003362 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003363 for el in Punctuated::pairs(&_i.items) {
3364 let it = el.value();
3365 _visitor.visit_use_tree(it)
3366 }
David Tolnay5f332a92017-12-26 00:42:45 -05003367}
David Tolnay8c81f622018-07-31 23:34:35 -07003368#[cfg(feature = "full")]
David Tolnayd97a7d22018-03-31 19:17:01 +02003369pub fn visit_use_name<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseName) {
David Tolnay8c81f622018-07-31 23:34:35 -07003370 _visitor.visit_ident(&_i.ident);
David Tolnayd97a7d22018-03-31 19:17:01 +02003371}
David Tolnay8c81f622018-07-31 23:34:35 -07003372#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003373pub fn visit_use_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UsePath) {
David Tolnay8c81f622018-07-31 23:34:35 -07003374 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04003375 tokens_helper(_visitor, &_i.colon2_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003376 _visitor.visit_use_tree(&*_i.tree);
David Tolnayd97a7d22018-03-31 19:17:01 +02003377}
David Tolnay8c81f622018-07-31 23:34:35 -07003378#[cfg(feature = "full")]
David Tolnayd97a7d22018-03-31 19:17:01 +02003379pub fn visit_use_rename<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseRename) {
David Tolnay8c81f622018-07-31 23:34:35 -07003380 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04003381 tokens_helper(_visitor, &_i.as_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003382 _visitor.visit_ident(&_i.rename);
David Tolnay5f332a92017-12-26 00:42:45 -05003383}
David Tolnay8c81f622018-07-31 23:34:35 -07003384#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003385pub fn visit_use_tree<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseTree) {
David Tolnay5f332a92017-12-26 00:42:45 -05003386 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003387 UseTree::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003388 _visitor.visit_use_path(_binding_0);
David Tolnay5f332a92017-12-26 00:42:45 -05003389 }
David Tolnay8c81f622018-07-31 23:34:35 -07003390 UseTree::Name(ref _binding_0) => {
David Tolnayd97a7d22018-03-31 19:17:01 +02003391 _visitor.visit_use_name(_binding_0);
3392 }
David Tolnay8c81f622018-07-31 23:34:35 -07003393 UseTree::Rename(ref _binding_0) => {
David Tolnayd97a7d22018-03-31 19:17:01 +02003394 _visitor.visit_use_rename(_binding_0);
3395 }
David Tolnay8c81f622018-07-31 23:34:35 -07003396 UseTree::Glob(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003397 _visitor.visit_use_glob(_binding_0);
David Tolnay5f332a92017-12-26 00:42:45 -05003398 }
David Tolnay8c81f622018-07-31 23:34:35 -07003399 UseTree::Group(ref _binding_0) => {
David Tolnayd97a7d22018-03-31 19:17:01 +02003400 _visitor.visit_use_group(_binding_0);
David Tolnay5f332a92017-12-26 00:42:45 -05003401 }
3402 }
3403}
David Tolnay8c81f622018-07-31 23:34:35 -07003404#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003405pub fn visit_variant<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Variant) {
David Tolnay8c81f622018-07-31 23:34:35 -07003406 for it in &_i.attrs {
3407 _visitor.visit_attribute(it)
3408 }
3409 _visitor.visit_ident(&_i.ident);
3410 _visitor.visit_fields(&_i.fields);
3411 if let Some(ref it) = _i.discriminant {
David Tolnay7ac699c2018-08-24 14:00:58 -04003412 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003413 _visitor.visit_expr(&(it).1);
3414 };
Nika Layzell27726662017-10-24 23:16:35 -04003415}
David Tolnay8c81f622018-07-31 23:34:35 -07003416#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003417pub fn visit_vis_crate<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast VisCrate) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003418 tokens_helper(_visitor, &_i.crate_token.span);
Nika Layzell27726662017-10-24 23:16:35 -04003419}
David Tolnay8c81f622018-07-31 23:34:35 -07003420#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003421pub fn visit_vis_public<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast VisPublic) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003422 tokens_helper(_visitor, &_i.pub_token.span);
Nika Layzell27726662017-10-24 23:16:35 -04003423}
David Tolnay8c81f622018-07-31 23:34:35 -07003424#[cfg(any(feature = "full", feature = "derive"))]
3425pub fn visit_vis_restricted<'ast, V: Visit<'ast> + ?Sized>(
3426 _visitor: &mut V,
3427 _i: &'ast VisRestricted,
3428) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003429 tokens_helper(_visitor, &_i.pub_token.span);
3430 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003431 if let Some(ref it) = _i.in_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003432 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003433 };
3434 _visitor.visit_path(&*_i.path);
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_visibility<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Visibility) {
Nika Layzell27726662017-10-24 23:16:35 -04003438 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003439 Visibility::Public(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003440 _visitor.visit_vis_public(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003441 }
David Tolnay8c81f622018-07-31 23:34:35 -07003442 Visibility::Crate(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003443 _visitor.visit_vis_crate(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003444 }
David Tolnay8c81f622018-07-31 23:34:35 -07003445 Visibility::Restricted(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003446 _visitor.visit_vis_restricted(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003447 }
David Tolnay8c81f622018-07-31 23:34:35 -07003448 Visibility::Inherited => {}
Nika Layzell27726662017-10-24 23:16:35 -04003449 }
3450}
David Tolnay8c81f622018-07-31 23:34:35 -07003451#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003452pub fn visit_where_clause<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast WhereClause) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003453 tokens_helper(_visitor, &_i.where_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003454 for el in Punctuated::pairs(&_i.predicates) {
3455 let it = el.value();
3456 _visitor.visit_where_predicate(it)
3457 }
Nika Layzell27726662017-10-24 23:16:35 -04003458}
David Tolnay8c81f622018-07-31 23:34:35 -07003459#[cfg(any(feature = "full", feature = "derive"))]
3460pub fn visit_where_predicate<'ast, V: Visit<'ast> + ?Sized>(
3461 _visitor: &mut V,
3462 _i: &'ast WherePredicate,
3463) {
Nika Layzell27726662017-10-24 23:16:35 -04003464 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003465 WherePredicate::Type(ref _binding_0) => {
David Tolnayd4add852018-01-01 20:13:24 -08003466 _visitor.visit_predicate_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003467 }
David Tolnay8c81f622018-07-31 23:34:35 -07003468 WherePredicate::Lifetime(ref _binding_0) => {
David Tolnayd4add852018-01-01 20:13:24 -08003469 _visitor.visit_predicate_lifetime(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003470 }
David Tolnay8c81f622018-07-31 23:34:35 -07003471 WherePredicate::Eq(ref _binding_0) => {
David Tolnayd4add852018-01-01 20:13:24 -08003472 _visitor.visit_predicate_eq(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003473 }
3474 }
3475}