blob: c95a8cd538cf99e860b4acbeba27db5533214028 [file] [log] [blame]
Nika Layzell27726662017-10-24 23:16:35 -04001// THIS FILE IS AUTOMATICALLY GENERATED; DO NOT EDIT
2
David Tolnay9d7622b2018-11-21 01:49:47 -08003#![cfg_attr(
4 feature = "cargo-clippy",
5 allow(match_same_arms, trivially_copy_pass_by_ref)
6)]
David Tolnay0a0d78c2018-01-05 15:24:01 -08007#[cfg(any(feature = "full", feature = "derive"))]
David Tolnaycc0f0372017-12-28 19:11:04 -05008use gen::helper::visit::*;
David Tolnay8c81f622018-07-31 23:34:35 -07009use proc_macro2::Span;
10#[cfg(any(feature = "full", feature = "derive"))]
11use punctuated::Punctuated;
12use *;
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040013#[cfg(feature = "full")]
14macro_rules! full {
David Tolnay280202f2018-08-02 00:29:54 -070015 ($e:expr) => {
David Tolnay8c81f622018-07-31 23:34:35 -070016 $e
17 };
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040018}
David Tolnay0a0d78c2018-01-05 15:24:01 -080019#[cfg(all(feature = "derive", not(feature = "full")))]
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040020macro_rules! full {
David Tolnay280202f2018-08-02 00:29:54 -070021 ($e:expr) => {
David Tolnay8c81f622018-07-31 23:34:35 -070022 unreachable!()
23 };
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040024}
David Tolnay6af48992018-08-01 11:16:28 -070025#[cfg(any(feature = "full", feature = "derive"))]
26macro_rules! skip {
David Tolnay280202f2018-08-02 00:29:54 -070027 ($($tt:tt)*) => {};
David Tolnay6af48992018-08-01 11:16:28 -070028}
29#[doc = r" Syntax tree traversal to walk a shared borrow of a syntax tree."]
30#[doc = r""]
31#[doc = r" See the [module documentation] for details."]
32#[doc = r""]
33#[doc = r" [module documentation]: index.html"]
34#[doc = r""]
35#[doc = r#" *This trait is available if Syn is built with the `"visit"` feature.*"#]
David Tolnay4b4c4b62018-01-06 13:48:05 -080036pub trait Visit<'ast> {
David Tolnay8c81f622018-07-31 23:34:35 -070037 #[cfg(any(feature = "full", feature = "derive"))]
38 fn visit_abi(&mut self, i: &'ast Abi) {
39 visit_abi(self, i)
40 }
41 #[cfg(any(feature = "full", feature = "derive"))]
42 fn visit_angle_bracketed_generic_arguments(&mut self, i: &'ast AngleBracketedGenericArguments) {
43 visit_angle_bracketed_generic_arguments(self, i)
44 }
45 #[cfg(feature = "full")]
46 fn visit_arg_captured(&mut self, i: &'ast ArgCaptured) {
47 visit_arg_captured(self, i)
48 }
49 #[cfg(feature = "full")]
50 fn visit_arg_self(&mut self, i: &'ast ArgSelf) {
51 visit_arg_self(self, i)
52 }
53 #[cfg(feature = "full")]
54 fn visit_arg_self_ref(&mut self, i: &'ast ArgSelfRef) {
55 visit_arg_self_ref(self, i)
56 }
57 #[cfg(any(feature = "full", feature = "derive"))]
58 #[cfg(feature = "full")]
59 fn visit_arm(&mut self, i: &'ast Arm) {
60 visit_arm(self, i)
61 }
62 #[cfg(any(feature = "full", feature = "derive"))]
63 fn visit_attr_style(&mut self, i: &'ast AttrStyle) {
64 visit_attr_style(self, i)
65 }
66 #[cfg(any(feature = "full", feature = "derive"))]
67 fn visit_attribute(&mut self, i: &'ast Attribute) {
68 visit_attribute(self, i)
69 }
70 #[cfg(any(feature = "full", feature = "derive"))]
71 fn visit_bare_fn_arg(&mut self, i: &'ast BareFnArg) {
72 visit_bare_fn_arg(self, i)
73 }
74 #[cfg(any(feature = "full", feature = "derive"))]
75 fn visit_bare_fn_arg_name(&mut self, i: &'ast BareFnArgName) {
76 visit_bare_fn_arg_name(self, i)
77 }
78 #[cfg(any(feature = "full", feature = "derive"))]
79 fn visit_bin_op(&mut self, i: &'ast BinOp) {
80 visit_bin_op(self, i)
81 }
82 #[cfg(any(feature = "full", feature = "derive"))]
83 fn visit_binding(&mut self, i: &'ast Binding) {
84 visit_binding(self, i)
85 }
86 #[cfg(any(feature = "full", feature = "derive"))]
87 #[cfg(feature = "full")]
88 fn visit_block(&mut self, i: &'ast Block) {
89 visit_block(self, i)
90 }
91 #[cfg(any(feature = "full", feature = "derive"))]
92 fn visit_bound_lifetimes(&mut self, i: &'ast BoundLifetimes) {
93 visit_bound_lifetimes(self, i)
94 }
95 #[cfg(any(feature = "full", feature = "derive"))]
96 fn visit_const_param(&mut self, i: &'ast ConstParam) {
97 visit_const_param(self, i)
98 }
David Tolnay9d0882a2018-09-01 19:49:14 -070099 #[cfg(any(feature = "full", feature = "derive"))]
100 fn visit_constraint(&mut self, i: &'ast Constraint) {
101 visit_constraint(self, i)
102 }
David Tolnay8c81f622018-07-31 23:34:35 -0700103 #[cfg(feature = "derive")]
104 fn visit_data(&mut self, i: &'ast Data) {
105 visit_data(self, i)
106 }
107 #[cfg(feature = "derive")]
108 fn visit_data_enum(&mut self, i: &'ast DataEnum) {
109 visit_data_enum(self, i)
110 }
111 #[cfg(feature = "derive")]
112 fn visit_data_struct(&mut self, i: &'ast DataStruct) {
113 visit_data_struct(self, i)
114 }
115 #[cfg(feature = "derive")]
116 fn visit_data_union(&mut self, i: &'ast DataUnion) {
117 visit_data_union(self, i)
118 }
119 #[cfg(feature = "derive")]
120 fn visit_derive_input(&mut self, i: &'ast DeriveInput) {
121 visit_derive_input(self, i)
122 }
123 #[cfg(any(feature = "full", feature = "derive"))]
124 fn visit_expr(&mut self, i: &'ast Expr) {
125 visit_expr(self, i)
126 }
127 #[cfg(feature = "full")]
128 #[cfg(any(feature = "full", feature = "derive"))]
129 fn visit_expr_array(&mut self, i: &'ast ExprArray) {
130 visit_expr_array(self, i)
131 }
132 #[cfg(feature = "full")]
133 #[cfg(any(feature = "full", feature = "derive"))]
134 fn visit_expr_assign(&mut self, i: &'ast ExprAssign) {
135 visit_expr_assign(self, i)
136 }
137 #[cfg(feature = "full")]
138 #[cfg(any(feature = "full", feature = "derive"))]
139 fn visit_expr_assign_op(&mut self, i: &'ast ExprAssignOp) {
140 visit_expr_assign_op(self, i)
141 }
David Tolnay02a9c6f2018-08-24 18:58:45 -0400142 #[cfg(feature = "full")]
143 #[cfg(any(feature = "full", feature = "derive"))]
144 fn visit_expr_async(&mut self, i: &'ast ExprAsync) {
145 visit_expr_async(self, i)
146 }
David Tolnay8c81f622018-07-31 23:34:35 -0700147 #[cfg(any(feature = "full", feature = "derive"))]
148 fn visit_expr_binary(&mut self, i: &'ast ExprBinary) {
149 visit_expr_binary(self, i)
150 }
151 #[cfg(feature = "full")]
152 #[cfg(any(feature = "full", feature = "derive"))]
153 fn visit_expr_block(&mut self, i: &'ast ExprBlock) {
154 visit_expr_block(self, i)
155 }
156 #[cfg(feature = "full")]
157 #[cfg(any(feature = "full", feature = "derive"))]
158 fn visit_expr_box(&mut self, i: &'ast ExprBox) {
159 visit_expr_box(self, i)
160 }
161 #[cfg(feature = "full")]
162 #[cfg(any(feature = "full", feature = "derive"))]
163 fn visit_expr_break(&mut self, i: &'ast ExprBreak) {
164 visit_expr_break(self, i)
165 }
166 #[cfg(any(feature = "full", feature = "derive"))]
167 fn visit_expr_call(&mut self, i: &'ast ExprCall) {
168 visit_expr_call(self, i)
169 }
170 #[cfg(any(feature = "full", feature = "derive"))]
171 fn visit_expr_cast(&mut self, i: &'ast ExprCast) {
172 visit_expr_cast(self, i)
173 }
174 #[cfg(feature = "full")]
175 #[cfg(any(feature = "full", feature = "derive"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700176 fn visit_expr_closure(&mut self, i: &'ast ExprClosure) {
177 visit_expr_closure(self, i)
178 }
179 #[cfg(feature = "full")]
180 #[cfg(any(feature = "full", feature = "derive"))]
181 fn visit_expr_continue(&mut self, i: &'ast ExprContinue) {
182 visit_expr_continue(self, i)
183 }
184 #[cfg(any(feature = "full", feature = "derive"))]
185 fn visit_expr_field(&mut self, i: &'ast ExprField) {
186 visit_expr_field(self, i)
187 }
188 #[cfg(feature = "full")]
189 #[cfg(any(feature = "full", feature = "derive"))]
190 fn visit_expr_for_loop(&mut self, i: &'ast ExprForLoop) {
191 visit_expr_for_loop(self, i)
192 }
193 #[cfg(feature = "full")]
194 #[cfg(any(feature = "full", feature = "derive"))]
195 fn visit_expr_group(&mut self, i: &'ast ExprGroup) {
196 visit_expr_group(self, i)
197 }
198 #[cfg(feature = "full")]
199 #[cfg(any(feature = "full", feature = "derive"))]
200 fn visit_expr_if(&mut self, i: &'ast ExprIf) {
201 visit_expr_if(self, i)
202 }
203 #[cfg(feature = "full")]
204 #[cfg(any(feature = "full", feature = "derive"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700205 fn visit_expr_in_place(&mut self, i: &'ast ExprInPlace) {
206 visit_expr_in_place(self, i)
207 }
208 #[cfg(any(feature = "full", feature = "derive"))]
209 fn visit_expr_index(&mut self, i: &'ast ExprIndex) {
210 visit_expr_index(self, i)
211 }
David Tolnay9c119122018-09-01 18:47:02 -0700212 #[cfg(feature = "full")]
213 #[cfg(any(feature = "full", feature = "derive"))]
214 fn visit_expr_let(&mut self, i: &'ast ExprLet) {
215 visit_expr_let(self, i)
216 }
David Tolnay8c81f622018-07-31 23:34:35 -0700217 #[cfg(any(feature = "full", feature = "derive"))]
218 fn visit_expr_lit(&mut self, i: &'ast ExprLit) {
219 visit_expr_lit(self, i)
220 }
221 #[cfg(feature = "full")]
222 #[cfg(any(feature = "full", feature = "derive"))]
223 fn visit_expr_loop(&mut self, i: &'ast ExprLoop) {
224 visit_expr_loop(self, i)
225 }
226 #[cfg(feature = "full")]
227 #[cfg(any(feature = "full", feature = "derive"))]
228 fn visit_expr_macro(&mut self, i: &'ast ExprMacro) {
229 visit_expr_macro(self, i)
230 }
231 #[cfg(feature = "full")]
232 #[cfg(any(feature = "full", feature = "derive"))]
233 fn visit_expr_match(&mut self, i: &'ast ExprMatch) {
234 visit_expr_match(self, i)
235 }
236 #[cfg(feature = "full")]
237 #[cfg(any(feature = "full", feature = "derive"))]
238 fn visit_expr_method_call(&mut self, i: &'ast ExprMethodCall) {
239 visit_expr_method_call(self, i)
240 }
241 #[cfg(any(feature = "full", feature = "derive"))]
242 fn visit_expr_paren(&mut self, i: &'ast ExprParen) {
243 visit_expr_paren(self, i)
244 }
245 #[cfg(any(feature = "full", feature = "derive"))]
246 fn visit_expr_path(&mut self, i: &'ast ExprPath) {
247 visit_expr_path(self, i)
248 }
249 #[cfg(feature = "full")]
250 #[cfg(any(feature = "full", feature = "derive"))]
251 fn visit_expr_range(&mut self, i: &'ast ExprRange) {
252 visit_expr_range(self, i)
253 }
254 #[cfg(feature = "full")]
255 #[cfg(any(feature = "full", feature = "derive"))]
256 fn visit_expr_reference(&mut self, i: &'ast ExprReference) {
257 visit_expr_reference(self, i)
258 }
259 #[cfg(feature = "full")]
260 #[cfg(any(feature = "full", feature = "derive"))]
261 fn visit_expr_repeat(&mut self, i: &'ast ExprRepeat) {
262 visit_expr_repeat(self, i)
263 }
264 #[cfg(feature = "full")]
265 #[cfg(any(feature = "full", feature = "derive"))]
266 fn visit_expr_return(&mut self, i: &'ast ExprReturn) {
267 visit_expr_return(self, i)
268 }
269 #[cfg(feature = "full")]
270 #[cfg(any(feature = "full", feature = "derive"))]
271 fn visit_expr_struct(&mut self, i: &'ast ExprStruct) {
272 visit_expr_struct(self, i)
273 }
274 #[cfg(feature = "full")]
275 #[cfg(any(feature = "full", feature = "derive"))]
276 fn visit_expr_try(&mut self, i: &'ast ExprTry) {
277 visit_expr_try(self, i)
278 }
279 #[cfg(feature = "full")]
280 #[cfg(any(feature = "full", feature = "derive"))]
David Tolnayfb2dd4b2018-08-24 16:45:34 -0400281 fn visit_expr_try_block(&mut self, i: &'ast ExprTryBlock) {
282 visit_expr_try_block(self, i)
283 }
284 #[cfg(feature = "full")]
285 #[cfg(any(feature = "full", feature = "derive"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700286 fn visit_expr_tuple(&mut self, i: &'ast ExprTuple) {
287 visit_expr_tuple(self, i)
288 }
289 #[cfg(feature = "full")]
290 #[cfg(any(feature = "full", feature = "derive"))]
291 fn visit_expr_type(&mut self, i: &'ast ExprType) {
292 visit_expr_type(self, i)
293 }
294 #[cfg(any(feature = "full", feature = "derive"))]
295 fn visit_expr_unary(&mut self, i: &'ast ExprUnary) {
296 visit_expr_unary(self, i)
297 }
298 #[cfg(feature = "full")]
299 #[cfg(any(feature = "full", feature = "derive"))]
300 fn visit_expr_unsafe(&mut self, i: &'ast ExprUnsafe) {
301 visit_expr_unsafe(self, i)
302 }
303 #[cfg(any(feature = "full", feature = "derive"))]
304 fn visit_expr_verbatim(&mut self, i: &'ast ExprVerbatim) {
305 visit_expr_verbatim(self, i)
306 }
307 #[cfg(feature = "full")]
308 #[cfg(any(feature = "full", feature = "derive"))]
309 fn visit_expr_while(&mut self, i: &'ast ExprWhile) {
310 visit_expr_while(self, i)
311 }
312 #[cfg(feature = "full")]
313 #[cfg(any(feature = "full", feature = "derive"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700314 fn visit_expr_yield(&mut self, i: &'ast ExprYield) {
315 visit_expr_yield(self, i)
316 }
317 #[cfg(any(feature = "full", feature = "derive"))]
318 fn visit_field(&mut self, i: &'ast Field) {
319 visit_field(self, i)
320 }
321 #[cfg(any(feature = "full", feature = "derive"))]
322 #[cfg(feature = "full")]
323 fn visit_field_pat(&mut self, i: &'ast FieldPat) {
324 visit_field_pat(self, i)
325 }
326 #[cfg(any(feature = "full", feature = "derive"))]
327 #[cfg(feature = "full")]
328 fn visit_field_value(&mut self, i: &'ast FieldValue) {
329 visit_field_value(self, i)
330 }
331 #[cfg(any(feature = "full", feature = "derive"))]
332 fn visit_fields(&mut self, i: &'ast Fields) {
333 visit_fields(self, i)
334 }
335 #[cfg(any(feature = "full", feature = "derive"))]
336 fn visit_fields_named(&mut self, i: &'ast FieldsNamed) {
337 visit_fields_named(self, i)
338 }
339 #[cfg(any(feature = "full", feature = "derive"))]
340 fn visit_fields_unnamed(&mut self, i: &'ast FieldsUnnamed) {
341 visit_fields_unnamed(self, i)
342 }
343 #[cfg(feature = "full")]
344 fn visit_file(&mut self, i: &'ast File) {
345 visit_file(self, i)
346 }
347 #[cfg(feature = "full")]
348 fn visit_fn_arg(&mut self, i: &'ast FnArg) {
349 visit_fn_arg(self, i)
350 }
351 #[cfg(feature = "full")]
352 fn visit_fn_decl(&mut self, i: &'ast FnDecl) {
353 visit_fn_decl(self, i)
354 }
355 #[cfg(feature = "full")]
356 fn visit_foreign_item(&mut self, i: &'ast ForeignItem) {
357 visit_foreign_item(self, i)
358 }
359 #[cfg(feature = "full")]
360 fn visit_foreign_item_fn(&mut self, i: &'ast ForeignItemFn) {
361 visit_foreign_item_fn(self, i)
362 }
363 #[cfg(feature = "full")]
David Tolnay435c1782018-08-24 16:15:44 -0400364 fn visit_foreign_item_macro(&mut self, i: &'ast ForeignItemMacro) {
365 visit_foreign_item_macro(self, i)
366 }
367 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700368 fn visit_foreign_item_static(&mut self, i: &'ast ForeignItemStatic) {
369 visit_foreign_item_static(self, i)
370 }
371 #[cfg(feature = "full")]
372 fn visit_foreign_item_type(&mut self, i: &'ast ForeignItemType) {
373 visit_foreign_item_type(self, i)
374 }
375 #[cfg(feature = "full")]
376 fn visit_foreign_item_verbatim(&mut self, i: &'ast ForeignItemVerbatim) {
377 visit_foreign_item_verbatim(self, i)
378 }
379 #[cfg(any(feature = "full", feature = "derive"))]
380 fn visit_generic_argument(&mut self, i: &'ast GenericArgument) {
381 visit_generic_argument(self, i)
382 }
383 #[cfg(any(feature = "full", feature = "derive"))]
384 #[cfg(feature = "full")]
385 fn visit_generic_method_argument(&mut self, i: &'ast GenericMethodArgument) {
386 visit_generic_method_argument(self, i)
387 }
388 #[cfg(any(feature = "full", feature = "derive"))]
389 fn visit_generic_param(&mut self, i: &'ast GenericParam) {
390 visit_generic_param(self, i)
391 }
392 #[cfg(any(feature = "full", feature = "derive"))]
393 fn visit_generics(&mut self, i: &'ast Generics) {
394 visit_generics(self, i)
395 }
David Tolnay8c81f622018-07-31 23:34:35 -0700396 fn visit_ident(&mut self, i: &'ast Ident) {
397 visit_ident(self, i)
398 }
399 #[cfg(feature = "full")]
400 fn visit_impl_item(&mut self, i: &'ast ImplItem) {
401 visit_impl_item(self, i)
402 }
403 #[cfg(feature = "full")]
404 fn visit_impl_item_const(&mut self, i: &'ast ImplItemConst) {
405 visit_impl_item_const(self, i)
406 }
407 #[cfg(feature = "full")]
David Tolnaybb82ef02018-08-24 20:15:45 -0400408 fn visit_impl_item_existential(&mut self, i: &'ast ImplItemExistential) {
409 visit_impl_item_existential(self, i)
410 }
411 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700412 fn visit_impl_item_macro(&mut self, i: &'ast ImplItemMacro) {
413 visit_impl_item_macro(self, i)
414 }
415 #[cfg(feature = "full")]
416 fn visit_impl_item_method(&mut self, i: &'ast ImplItemMethod) {
417 visit_impl_item_method(self, i)
418 }
419 #[cfg(feature = "full")]
420 fn visit_impl_item_type(&mut self, i: &'ast ImplItemType) {
421 visit_impl_item_type(self, i)
422 }
423 #[cfg(feature = "full")]
424 fn visit_impl_item_verbatim(&mut self, i: &'ast ImplItemVerbatim) {
425 visit_impl_item_verbatim(self, i)
426 }
427 #[cfg(any(feature = "full", feature = "derive"))]
428 fn visit_index(&mut self, i: &'ast Index) {
429 visit_index(self, i)
430 }
431 #[cfg(feature = "full")]
432 fn visit_item(&mut self, i: &'ast Item) {
433 visit_item(self, i)
434 }
435 #[cfg(feature = "full")]
436 fn visit_item_const(&mut self, i: &'ast ItemConst) {
437 visit_item_const(self, i)
438 }
439 #[cfg(feature = "full")]
440 fn visit_item_enum(&mut self, i: &'ast ItemEnum) {
441 visit_item_enum(self, i)
442 }
443 #[cfg(feature = "full")]
David Tolnaybb82ef02018-08-24 20:15:45 -0400444 fn visit_item_existential(&mut self, i: &'ast ItemExistential) {
445 visit_item_existential(self, i)
446 }
447 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700448 fn visit_item_extern_crate(&mut self, i: &'ast ItemExternCrate) {
449 visit_item_extern_crate(self, i)
450 }
451 #[cfg(feature = "full")]
452 fn visit_item_fn(&mut self, i: &'ast ItemFn) {
453 visit_item_fn(self, i)
454 }
455 #[cfg(feature = "full")]
456 fn visit_item_foreign_mod(&mut self, i: &'ast ItemForeignMod) {
457 visit_item_foreign_mod(self, i)
458 }
459 #[cfg(feature = "full")]
460 fn visit_item_impl(&mut self, i: &'ast ItemImpl) {
461 visit_item_impl(self, i)
462 }
463 #[cfg(feature = "full")]
464 fn visit_item_macro(&mut self, i: &'ast ItemMacro) {
465 visit_item_macro(self, i)
466 }
467 #[cfg(feature = "full")]
468 fn visit_item_macro2(&mut self, i: &'ast ItemMacro2) {
469 visit_item_macro2(self, i)
470 }
471 #[cfg(feature = "full")]
472 fn visit_item_mod(&mut self, i: &'ast ItemMod) {
473 visit_item_mod(self, i)
474 }
475 #[cfg(feature = "full")]
476 fn visit_item_static(&mut self, i: &'ast ItemStatic) {
477 visit_item_static(self, i)
478 }
479 #[cfg(feature = "full")]
480 fn visit_item_struct(&mut self, i: &'ast ItemStruct) {
481 visit_item_struct(self, i)
482 }
483 #[cfg(feature = "full")]
484 fn visit_item_trait(&mut self, i: &'ast ItemTrait) {
485 visit_item_trait(self, i)
486 }
487 #[cfg(feature = "full")]
David Tolnayc6b04dd2018-08-30 23:22:51 -0700488 fn visit_item_trait_alias(&mut self, i: &'ast ItemTraitAlias) {
489 visit_item_trait_alias(self, i)
490 }
491 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700492 fn visit_item_type(&mut self, i: &'ast ItemType) {
493 visit_item_type(self, i)
494 }
495 #[cfg(feature = "full")]
496 fn visit_item_union(&mut self, i: &'ast ItemUnion) {
497 visit_item_union(self, i)
498 }
499 #[cfg(feature = "full")]
500 fn visit_item_use(&mut self, i: &'ast ItemUse) {
501 visit_item_use(self, i)
502 }
503 #[cfg(feature = "full")]
504 fn visit_item_verbatim(&mut self, i: &'ast ItemVerbatim) {
505 visit_item_verbatim(self, i)
506 }
507 #[cfg(any(feature = "full", feature = "derive"))]
508 #[cfg(feature = "full")]
509 fn visit_label(&mut self, i: &'ast Label) {
510 visit_label(self, i)
511 }
David Tolnay8c81f622018-07-31 23:34:35 -0700512 fn visit_lifetime(&mut self, i: &'ast Lifetime) {
513 visit_lifetime(self, i)
514 }
515 #[cfg(any(feature = "full", feature = "derive"))]
516 fn visit_lifetime_def(&mut self, i: &'ast LifetimeDef) {
517 visit_lifetime_def(self, i)
518 }
519 #[cfg(any(feature = "full", feature = "derive"))]
520 fn visit_lit(&mut self, i: &'ast Lit) {
521 visit_lit(self, i)
522 }
523 #[cfg(any(feature = "full", feature = "derive"))]
524 fn visit_lit_bool(&mut self, i: &'ast LitBool) {
525 visit_lit_bool(self, i)
526 }
527 #[cfg(any(feature = "full", feature = "derive"))]
528 fn visit_lit_byte(&mut self, i: &'ast LitByte) {
529 visit_lit_byte(self, i)
530 }
531 #[cfg(any(feature = "full", feature = "derive"))]
532 fn visit_lit_byte_str(&mut self, i: &'ast LitByteStr) {
533 visit_lit_byte_str(self, i)
534 }
535 #[cfg(any(feature = "full", feature = "derive"))]
536 fn visit_lit_char(&mut self, i: &'ast LitChar) {
537 visit_lit_char(self, i)
538 }
539 #[cfg(any(feature = "full", feature = "derive"))]
540 fn visit_lit_float(&mut self, i: &'ast LitFloat) {
541 visit_lit_float(self, i)
542 }
543 #[cfg(any(feature = "full", feature = "derive"))]
544 fn visit_lit_int(&mut self, i: &'ast LitInt) {
545 visit_lit_int(self, i)
546 }
547 #[cfg(any(feature = "full", feature = "derive"))]
548 fn visit_lit_str(&mut self, i: &'ast LitStr) {
549 visit_lit_str(self, i)
550 }
551 #[cfg(any(feature = "full", feature = "derive"))]
552 fn visit_lit_verbatim(&mut self, i: &'ast LitVerbatim) {
553 visit_lit_verbatim(self, i)
554 }
555 #[cfg(any(feature = "full", feature = "derive"))]
556 #[cfg(feature = "full")]
557 fn visit_local(&mut self, i: &'ast Local) {
558 visit_local(self, i)
559 }
560 #[cfg(any(feature = "full", feature = "derive"))]
561 fn visit_macro(&mut self, i: &'ast Macro) {
562 visit_macro(self, i)
563 }
564 #[cfg(any(feature = "full", feature = "derive"))]
565 fn visit_macro_delimiter(&mut self, i: &'ast MacroDelimiter) {
566 visit_macro_delimiter(self, i)
567 }
568 #[cfg(any(feature = "full", feature = "derive"))]
569 fn visit_member(&mut self, i: &'ast Member) {
570 visit_member(self, i)
571 }
572 #[cfg(any(feature = "full", feature = "derive"))]
573 fn visit_meta(&mut self, i: &'ast Meta) {
574 visit_meta(self, i)
575 }
576 #[cfg(any(feature = "full", feature = "derive"))]
577 fn visit_meta_list(&mut self, i: &'ast MetaList) {
578 visit_meta_list(self, i)
579 }
580 #[cfg(any(feature = "full", feature = "derive"))]
581 fn visit_meta_name_value(&mut self, i: &'ast MetaNameValue) {
582 visit_meta_name_value(self, i)
583 }
584 #[cfg(feature = "full")]
585 fn visit_method_sig(&mut self, i: &'ast MethodSig) {
586 visit_method_sig(self, i)
587 }
588 #[cfg(any(feature = "full", feature = "derive"))]
589 #[cfg(feature = "full")]
590 fn visit_method_turbofish(&mut self, i: &'ast MethodTurbofish) {
591 visit_method_turbofish(self, i)
592 }
593 #[cfg(any(feature = "full", feature = "derive"))]
594 fn visit_nested_meta(&mut self, i: &'ast NestedMeta) {
595 visit_nested_meta(self, i)
596 }
597 #[cfg(any(feature = "full", feature = "derive"))]
598 fn visit_parenthesized_generic_arguments(&mut self, i: &'ast ParenthesizedGenericArguments) {
599 visit_parenthesized_generic_arguments(self, i)
600 }
601 #[cfg(any(feature = "full", feature = "derive"))]
602 #[cfg(feature = "full")]
603 fn visit_pat(&mut self, i: &'ast Pat) {
604 visit_pat(self, i)
605 }
606 #[cfg(any(feature = "full", feature = "derive"))]
607 #[cfg(feature = "full")]
608 fn visit_pat_box(&mut self, i: &'ast PatBox) {
609 visit_pat_box(self, i)
610 }
611 #[cfg(any(feature = "full", feature = "derive"))]
612 #[cfg(feature = "full")]
613 fn visit_pat_ident(&mut self, i: &'ast PatIdent) {
614 visit_pat_ident(self, i)
615 }
616 #[cfg(any(feature = "full", feature = "derive"))]
617 #[cfg(feature = "full")]
618 fn visit_pat_lit(&mut self, i: &'ast PatLit) {
619 visit_pat_lit(self, i)
620 }
621 #[cfg(any(feature = "full", feature = "derive"))]
622 #[cfg(feature = "full")]
623 fn visit_pat_macro(&mut self, i: &'ast PatMacro) {
624 visit_pat_macro(self, i)
625 }
626 #[cfg(any(feature = "full", feature = "derive"))]
627 #[cfg(feature = "full")]
628 fn visit_pat_path(&mut self, i: &'ast PatPath) {
629 visit_pat_path(self, i)
630 }
631 #[cfg(any(feature = "full", feature = "derive"))]
632 #[cfg(feature = "full")]
633 fn visit_pat_range(&mut self, i: &'ast PatRange) {
634 visit_pat_range(self, i)
635 }
636 #[cfg(any(feature = "full", feature = "derive"))]
637 #[cfg(feature = "full")]
638 fn visit_pat_ref(&mut self, i: &'ast PatRef) {
639 visit_pat_ref(self, i)
640 }
641 #[cfg(any(feature = "full", feature = "derive"))]
642 #[cfg(feature = "full")]
643 fn visit_pat_slice(&mut self, i: &'ast PatSlice) {
644 visit_pat_slice(self, i)
645 }
646 #[cfg(any(feature = "full", feature = "derive"))]
647 #[cfg(feature = "full")]
648 fn visit_pat_struct(&mut self, i: &'ast PatStruct) {
649 visit_pat_struct(self, i)
650 }
651 #[cfg(any(feature = "full", feature = "derive"))]
652 #[cfg(feature = "full")]
653 fn visit_pat_tuple(&mut self, i: &'ast PatTuple) {
654 visit_pat_tuple(self, i)
655 }
656 #[cfg(any(feature = "full", feature = "derive"))]
657 #[cfg(feature = "full")]
658 fn visit_pat_tuple_struct(&mut self, i: &'ast PatTupleStruct) {
659 visit_pat_tuple_struct(self, i)
660 }
661 #[cfg(any(feature = "full", feature = "derive"))]
662 #[cfg(feature = "full")]
663 fn visit_pat_verbatim(&mut self, i: &'ast PatVerbatim) {
664 visit_pat_verbatim(self, i)
665 }
666 #[cfg(any(feature = "full", feature = "derive"))]
667 #[cfg(feature = "full")]
668 fn visit_pat_wild(&mut self, i: &'ast PatWild) {
669 visit_pat_wild(self, i)
670 }
671 #[cfg(any(feature = "full", feature = "derive"))]
672 fn visit_path(&mut self, i: &'ast Path) {
673 visit_path(self, i)
674 }
675 #[cfg(any(feature = "full", feature = "derive"))]
676 fn visit_path_arguments(&mut self, i: &'ast PathArguments) {
677 visit_path_arguments(self, i)
678 }
679 #[cfg(any(feature = "full", feature = "derive"))]
680 fn visit_path_segment(&mut self, i: &'ast PathSegment) {
681 visit_path_segment(self, i)
682 }
683 #[cfg(any(feature = "full", feature = "derive"))]
684 fn visit_predicate_eq(&mut self, i: &'ast PredicateEq) {
685 visit_predicate_eq(self, i)
686 }
687 #[cfg(any(feature = "full", feature = "derive"))]
688 fn visit_predicate_lifetime(&mut self, i: &'ast PredicateLifetime) {
689 visit_predicate_lifetime(self, i)
690 }
691 #[cfg(any(feature = "full", feature = "derive"))]
692 fn visit_predicate_type(&mut self, i: &'ast PredicateType) {
693 visit_predicate_type(self, i)
694 }
695 #[cfg(any(feature = "full", feature = "derive"))]
696 fn visit_qself(&mut self, i: &'ast QSelf) {
697 visit_qself(self, i)
698 }
699 #[cfg(any(feature = "full", feature = "derive"))]
700 #[cfg(feature = "full")]
701 fn visit_range_limits(&mut self, i: &'ast RangeLimits) {
702 visit_range_limits(self, i)
703 }
704 #[cfg(any(feature = "full", feature = "derive"))]
705 fn visit_return_type(&mut self, i: &'ast ReturnType) {
706 visit_return_type(self, i)
707 }
David Tolnay8c81f622018-07-31 23:34:35 -0700708 fn visit_span(&mut self, i: &'ast Span) {
709 visit_span(self, i)
710 }
711 #[cfg(any(feature = "full", feature = "derive"))]
712 #[cfg(feature = "full")]
713 fn visit_stmt(&mut self, i: &'ast Stmt) {
714 visit_stmt(self, i)
715 }
716 #[cfg(any(feature = "full", feature = "derive"))]
717 fn visit_trait_bound(&mut self, i: &'ast TraitBound) {
718 visit_trait_bound(self, i)
719 }
720 #[cfg(any(feature = "full", feature = "derive"))]
721 fn visit_trait_bound_modifier(&mut self, i: &'ast TraitBoundModifier) {
722 visit_trait_bound_modifier(self, i)
723 }
724 #[cfg(feature = "full")]
725 fn visit_trait_item(&mut self, i: &'ast TraitItem) {
726 visit_trait_item(self, i)
727 }
728 #[cfg(feature = "full")]
729 fn visit_trait_item_const(&mut self, i: &'ast TraitItemConst) {
730 visit_trait_item_const(self, i)
731 }
732 #[cfg(feature = "full")]
733 fn visit_trait_item_macro(&mut self, i: &'ast TraitItemMacro) {
734 visit_trait_item_macro(self, i)
735 }
736 #[cfg(feature = "full")]
737 fn visit_trait_item_method(&mut self, i: &'ast TraitItemMethod) {
738 visit_trait_item_method(self, i)
739 }
740 #[cfg(feature = "full")]
741 fn visit_trait_item_type(&mut self, i: &'ast TraitItemType) {
742 visit_trait_item_type(self, i)
743 }
744 #[cfg(feature = "full")]
745 fn visit_trait_item_verbatim(&mut self, i: &'ast TraitItemVerbatim) {
746 visit_trait_item_verbatim(self, i)
747 }
748 #[cfg(any(feature = "full", feature = "derive"))]
749 fn visit_type(&mut self, i: &'ast Type) {
750 visit_type(self, i)
751 }
752 #[cfg(any(feature = "full", feature = "derive"))]
753 fn visit_type_array(&mut self, i: &'ast TypeArray) {
754 visit_type_array(self, i)
755 }
756 #[cfg(any(feature = "full", feature = "derive"))]
757 fn visit_type_bare_fn(&mut self, i: &'ast TypeBareFn) {
758 visit_type_bare_fn(self, i)
759 }
760 #[cfg(any(feature = "full", feature = "derive"))]
761 fn visit_type_group(&mut self, i: &'ast TypeGroup) {
762 visit_type_group(self, i)
763 }
764 #[cfg(any(feature = "full", feature = "derive"))]
765 fn visit_type_impl_trait(&mut self, i: &'ast TypeImplTrait) {
766 visit_type_impl_trait(self, i)
767 }
768 #[cfg(any(feature = "full", feature = "derive"))]
769 fn visit_type_infer(&mut self, i: &'ast TypeInfer) {
770 visit_type_infer(self, i)
771 }
772 #[cfg(any(feature = "full", feature = "derive"))]
773 fn visit_type_macro(&mut self, i: &'ast TypeMacro) {
774 visit_type_macro(self, i)
775 }
776 #[cfg(any(feature = "full", feature = "derive"))]
777 fn visit_type_never(&mut self, i: &'ast TypeNever) {
778 visit_type_never(self, i)
779 }
780 #[cfg(any(feature = "full", feature = "derive"))]
781 fn visit_type_param(&mut self, i: &'ast TypeParam) {
782 visit_type_param(self, i)
783 }
784 #[cfg(any(feature = "full", feature = "derive"))]
785 fn visit_type_param_bound(&mut self, i: &'ast TypeParamBound) {
786 visit_type_param_bound(self, i)
787 }
788 #[cfg(any(feature = "full", feature = "derive"))]
789 fn visit_type_paren(&mut self, i: &'ast TypeParen) {
790 visit_type_paren(self, i)
791 }
792 #[cfg(any(feature = "full", feature = "derive"))]
793 fn visit_type_path(&mut self, i: &'ast TypePath) {
794 visit_type_path(self, i)
795 }
796 #[cfg(any(feature = "full", feature = "derive"))]
797 fn visit_type_ptr(&mut self, i: &'ast TypePtr) {
798 visit_type_ptr(self, i)
799 }
800 #[cfg(any(feature = "full", feature = "derive"))]
801 fn visit_type_reference(&mut self, i: &'ast TypeReference) {
802 visit_type_reference(self, i)
803 }
804 #[cfg(any(feature = "full", feature = "derive"))]
805 fn visit_type_slice(&mut self, i: &'ast TypeSlice) {
806 visit_type_slice(self, i)
807 }
808 #[cfg(any(feature = "full", feature = "derive"))]
809 fn visit_type_trait_object(&mut self, i: &'ast TypeTraitObject) {
810 visit_type_trait_object(self, i)
811 }
812 #[cfg(any(feature = "full", feature = "derive"))]
813 fn visit_type_tuple(&mut self, i: &'ast TypeTuple) {
814 visit_type_tuple(self, i)
815 }
816 #[cfg(any(feature = "full", feature = "derive"))]
817 fn visit_type_verbatim(&mut self, i: &'ast TypeVerbatim) {
818 visit_type_verbatim(self, i)
819 }
820 #[cfg(any(feature = "full", feature = "derive"))]
821 fn visit_un_op(&mut self, i: &'ast UnOp) {
822 visit_un_op(self, i)
823 }
824 #[cfg(feature = "full")]
825 fn visit_use_glob(&mut self, i: &'ast UseGlob) {
826 visit_use_glob(self, i)
827 }
828 #[cfg(feature = "full")]
829 fn visit_use_group(&mut self, i: &'ast UseGroup) {
830 visit_use_group(self, i)
831 }
832 #[cfg(feature = "full")]
833 fn visit_use_name(&mut self, i: &'ast UseName) {
834 visit_use_name(self, i)
835 }
836 #[cfg(feature = "full")]
837 fn visit_use_path(&mut self, i: &'ast UsePath) {
838 visit_use_path(self, i)
839 }
840 #[cfg(feature = "full")]
841 fn visit_use_rename(&mut self, i: &'ast UseRename) {
842 visit_use_rename(self, i)
843 }
844 #[cfg(feature = "full")]
845 fn visit_use_tree(&mut self, i: &'ast UseTree) {
846 visit_use_tree(self, i)
847 }
848 #[cfg(any(feature = "full", feature = "derive"))]
849 fn visit_variant(&mut self, i: &'ast Variant) {
850 visit_variant(self, i)
851 }
852 #[cfg(any(feature = "full", feature = "derive"))]
853 fn visit_vis_crate(&mut self, i: &'ast VisCrate) {
854 visit_vis_crate(self, i)
855 }
856 #[cfg(any(feature = "full", feature = "derive"))]
857 fn visit_vis_public(&mut self, i: &'ast VisPublic) {
858 visit_vis_public(self, i)
859 }
860 #[cfg(any(feature = "full", feature = "derive"))]
861 fn visit_vis_restricted(&mut self, i: &'ast VisRestricted) {
862 visit_vis_restricted(self, i)
863 }
864 #[cfg(any(feature = "full", feature = "derive"))]
865 fn visit_visibility(&mut self, i: &'ast Visibility) {
866 visit_visibility(self, i)
867 }
868 #[cfg(any(feature = "full", feature = "derive"))]
869 fn visit_where_clause(&mut self, i: &'ast WhereClause) {
870 visit_where_clause(self, i)
871 }
872 #[cfg(any(feature = "full", feature = "derive"))]
873 fn visit_where_predicate(&mut self, i: &'ast WherePredicate) {
874 visit_where_predicate(self, i)
875 }
Nika Layzell27726662017-10-24 23:16:35 -0400876}
David Tolnay8c81f622018-07-31 23:34:35 -0700877#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800878pub fn visit_abi<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Abi) {
David Tolnay7ac699c2018-08-24 14:00:58 -0400879 tokens_helper(_visitor, &_i.extern_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -0700880 if let Some(ref it) = _i.name {
881 _visitor.visit_lit_str(it)
882 };
Nika Layzell27726662017-10-24 23:16:35 -0400883}
David Tolnay8c81f622018-07-31 23:34:35 -0700884#[cfg(any(feature = "full", feature = "derive"))]
885pub fn visit_angle_bracketed_generic_arguments<'ast, V: Visit<'ast> + ?Sized>(
886 _visitor: &mut V,
887 _i: &'ast AngleBracketedGenericArguments,
888) {
889 if let Some(ref it) = _i.colon2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -0400890 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -0700891 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400892 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700893 for el in Punctuated::pairs(&_i.args) {
894 let it = el.value();
895 _visitor.visit_generic_argument(it)
896 }
David Tolnay7ac699c2018-08-24 14:00:58 -0400897 tokens_helper(_visitor, &_i.gt_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400898}
David Tolnay8c81f622018-07-31 23:34:35 -0700899#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800900pub fn visit_arg_captured<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ArgCaptured) {
David Tolnay8c81f622018-07-31 23:34:35 -0700901 _visitor.visit_pat(&_i.pat);
David Tolnay7ac699c2018-08-24 14:00:58 -0400902 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700903 _visitor.visit_type(&_i.ty);
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<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ArgSelf) {
David Tolnay8c81f622018-07-31 23:34:35 -0700907 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -0400908 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -0700909 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400910 tokens_helper(_visitor, &_i.self_token.span);
Nika Layzell27726662017-10-24 23:16:35 -0400911}
David Tolnay8c81f622018-07-31 23:34:35 -0700912#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800913pub fn visit_arg_self_ref<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ArgSelfRef) {
David Tolnay7ac699c2018-08-24 14:00:58 -0400914 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700915 if let Some(ref it) = _i.lifetime {
916 _visitor.visit_lifetime(it)
917 };
918 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -0400919 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -0700920 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400921 tokens_helper(_visitor, &_i.self_token.span);
Nika Layzell27726662017-10-24 23:16:35 -0400922}
David Tolnay8c81f622018-07-31 23:34:35 -0700923#[cfg(any(feature = "full", feature = "derive"))]
924#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800925pub fn visit_arm<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Arm) {
David Tolnay8c81f622018-07-31 23:34:35 -0700926 for it in &_i.attrs {
927 _visitor.visit_attribute(it)
928 }
929 if let Some(ref it) = _i.leading_vert {
David Tolnay7ac699c2018-08-24 14:00:58 -0400930 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -0700931 };
932 for el in Punctuated::pairs(&_i.pats) {
933 let it = el.value();
934 _visitor.visit_pat(it)
935 }
936 if let Some(ref it) = _i.guard {
David Tolnay7ac699c2018-08-24 14:00:58 -0400937 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -0700938 _visitor.visit_expr(&*(it).1);
939 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400940 tokens_helper(_visitor, &_i.fat_arrow_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700941 _visitor.visit_expr(&*_i.body);
942 if let Some(ref it) = _i.comma {
David Tolnay7ac699c2018-08-24 14:00:58 -0400943 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -0700944 };
Nika Layzell27726662017-10-24 23:16:35 -0400945}
David Tolnay8c81f622018-07-31 23:34:35 -0700946#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800947pub fn visit_attr_style<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast AttrStyle) {
Nika Layzell27726662017-10-24 23:16:35 -0400948 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -0700949 AttrStyle::Outer => {}
950 AttrStyle::Inner(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400951 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400952 }
953 }
954}
David Tolnay8c81f622018-07-31 23:34:35 -0700955#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800956pub fn visit_attribute<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Attribute) {
David Tolnay7ac699c2018-08-24 14:00:58 -0400957 tokens_helper(_visitor, &_i.pound_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700958 _visitor.visit_attr_style(&_i.style);
David Tolnay7ac699c2018-08-24 14:00:58 -0400959 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -0700960 _visitor.visit_path(&_i.path);
David Tolnay6af48992018-08-01 11:16:28 -0700961 skip!(_i.tts);
Nika Layzell27726662017-10-24 23:16:35 -0400962}
David Tolnay8c81f622018-07-31 23:34:35 -0700963#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800964pub fn visit_bare_fn_arg<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast BareFnArg) {
David Tolnay8c81f622018-07-31 23:34:35 -0700965 if let Some(ref it) = _i.name {
966 _visitor.visit_bare_fn_arg_name(&(it).0);
David Tolnay7ac699c2018-08-24 14:00:58 -0400967 tokens_helper(_visitor, &(it).1.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700968 };
969 _visitor.visit_type(&_i.ty);
Nika Layzell27726662017-10-24 23:16:35 -0400970}
David Tolnay8c81f622018-07-31 23:34:35 -0700971#[cfg(any(feature = "full", feature = "derive"))]
972pub fn visit_bare_fn_arg_name<'ast, V: Visit<'ast> + ?Sized>(
973 _visitor: &mut V,
974 _i: &'ast BareFnArgName,
975) {
Nika Layzell27726662017-10-24 23:16:35 -0400976 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -0700977 BareFnArgName::Named(ref _binding_0) => {
Alex Crichtond261d092018-05-18 13:47:35 -0700978 _visitor.visit_ident(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -0400979 }
David Tolnay8c81f622018-07-31 23:34:35 -0700980 BareFnArgName::Wild(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400981 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400982 }
983 }
984}
David Tolnay8c81f622018-07-31 23:34:35 -0700985#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800986pub fn visit_bin_op<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast BinOp) {
Nika Layzell27726662017-10-24 23:16:35 -0400987 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -0700988 BinOp::Add(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400989 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400990 }
David Tolnay8c81f622018-07-31 23:34:35 -0700991 BinOp::Sub(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400992 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400993 }
David Tolnay8c81f622018-07-31 23:34:35 -0700994 BinOp::Mul(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400995 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400996 }
David Tolnay8c81f622018-07-31 23:34:35 -0700997 BinOp::Div(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400998 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400999 }
David Tolnay8c81f622018-07-31 23:34:35 -07001000 BinOp::Rem(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001001 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001002 }
David Tolnay8c81f622018-07-31 23:34:35 -07001003 BinOp::And(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001004 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001005 }
David Tolnay8c81f622018-07-31 23:34:35 -07001006 BinOp::Or(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001007 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001008 }
David Tolnay8c81f622018-07-31 23:34:35 -07001009 BinOp::BitXor(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001010 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001011 }
David Tolnay8c81f622018-07-31 23:34:35 -07001012 BinOp::BitAnd(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001013 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001014 }
David Tolnay8c81f622018-07-31 23:34:35 -07001015 BinOp::BitOr(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001016 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001017 }
David Tolnay8c81f622018-07-31 23:34:35 -07001018 BinOp::Shl(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001019 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001020 }
David Tolnay8c81f622018-07-31 23:34:35 -07001021 BinOp::Shr(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001022 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001023 }
David Tolnay8c81f622018-07-31 23:34:35 -07001024 BinOp::Eq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001025 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001026 }
David Tolnay8c81f622018-07-31 23:34:35 -07001027 BinOp::Lt(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001028 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001029 }
David Tolnay8c81f622018-07-31 23:34:35 -07001030 BinOp::Le(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001031 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001032 }
David Tolnay8c81f622018-07-31 23:34:35 -07001033 BinOp::Ne(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001034 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001035 }
David Tolnay8c81f622018-07-31 23:34:35 -07001036 BinOp::Ge(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001037 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001038 }
David Tolnay8c81f622018-07-31 23:34:35 -07001039 BinOp::Gt(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001040 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001041 }
David Tolnay8c81f622018-07-31 23:34:35 -07001042 BinOp::AddEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001043 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001044 }
David Tolnay8c81f622018-07-31 23:34:35 -07001045 BinOp::SubEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001046 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001047 }
David Tolnay8c81f622018-07-31 23:34:35 -07001048 BinOp::MulEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001049 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001050 }
David Tolnay8c81f622018-07-31 23:34:35 -07001051 BinOp::DivEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001052 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001053 }
David Tolnay8c81f622018-07-31 23:34:35 -07001054 BinOp::RemEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001055 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001056 }
David Tolnay8c81f622018-07-31 23:34:35 -07001057 BinOp::BitXorEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001058 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001059 }
David Tolnay8c81f622018-07-31 23:34:35 -07001060 BinOp::BitAndEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001061 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001062 }
David Tolnay8c81f622018-07-31 23:34:35 -07001063 BinOp::BitOrEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001064 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001065 }
David Tolnay8c81f622018-07-31 23:34:35 -07001066 BinOp::ShlEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001067 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001068 }
David Tolnay8c81f622018-07-31 23:34:35 -07001069 BinOp::ShrEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001070 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001071 }
1072 }
1073}
David Tolnay8c81f622018-07-31 23:34:35 -07001074#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001075pub fn visit_binding<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Binding) {
David Tolnay8c81f622018-07-31 23:34:35 -07001076 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001077 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001078 _visitor.visit_type(&_i.ty);
David Tolnay506e43a2017-12-29 11:34:36 -05001079}
David Tolnay8c81f622018-07-31 23:34:35 -07001080#[cfg(any(feature = "full", feature = "derive"))]
1081#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001082pub fn visit_block<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Block) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001083 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001084 for it in &_i.stmts {
1085 _visitor.visit_stmt(it)
1086 }
Nika Layzell27726662017-10-24 23:16:35 -04001087}
David Tolnay8c81f622018-07-31 23:34:35 -07001088#[cfg(any(feature = "full", feature = "derive"))]
1089pub fn visit_bound_lifetimes<'ast, V: Visit<'ast> + ?Sized>(
1090 _visitor: &mut V,
1091 _i: &'ast BoundLifetimes,
1092) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001093 tokens_helper(_visitor, &_i.for_token.span);
1094 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001095 for el in Punctuated::pairs(&_i.lifetimes) {
1096 let it = el.value();
1097 _visitor.visit_lifetime_def(it)
1098 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001099 tokens_helper(_visitor, &_i.gt_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001100}
David Tolnay8c81f622018-07-31 23:34:35 -07001101#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001102pub fn visit_const_param<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ConstParam) {
David Tolnay8c81f622018-07-31 23:34:35 -07001103 for it in &_i.attrs {
1104 _visitor.visit_attribute(it)
1105 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001106 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001107 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001108 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001109 _visitor.visit_type(&_i.ty);
1110 if let Some(ref it) = _i.eq_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001111 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001112 };
1113 if let Some(ref it) = _i.default {
1114 _visitor.visit_expr(it)
1115 };
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001116}
David Tolnay9d0882a2018-09-01 19:49:14 -07001117#[cfg(any(feature = "full", feature = "derive"))]
1118pub fn visit_constraint<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Constraint) {
1119 _visitor.visit_ident(&_i.ident);
1120 tokens_helper(_visitor, &_i.colon_token.spans);
1121 for el in Punctuated::pairs(&_i.bounds) {
1122 let it = el.value();
1123 _visitor.visit_type_param_bound(it)
1124 }
1125}
David Tolnay8c81f622018-07-31 23:34:35 -07001126#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001127pub fn visit_data<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Data) {
David Tolnaye3d41b72017-12-31 15:24:00 -05001128 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001129 Data::Struct(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05001130 _visitor.visit_data_struct(_binding_0);
1131 }
David Tolnay8c81f622018-07-31 23:34:35 -07001132 Data::Enum(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05001133 _visitor.visit_data_enum(_binding_0);
1134 }
David Tolnay8c81f622018-07-31 23:34:35 -07001135 Data::Union(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05001136 _visitor.visit_data_union(_binding_0);
1137 }
1138 }
1139}
David Tolnay8c81f622018-07-31 23:34:35 -07001140#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001141pub fn visit_data_enum<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataEnum) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001142 tokens_helper(_visitor, &_i.enum_token.span);
1143 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001144 for el in Punctuated::pairs(&_i.variants) {
1145 let it = el.value();
1146 _visitor.visit_variant(it)
1147 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001148}
David Tolnay8c81f622018-07-31 23:34:35 -07001149#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001150pub fn visit_data_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataStruct) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001151 tokens_helper(_visitor, &_i.struct_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001152 _visitor.visit_fields(&_i.fields);
1153 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001154 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001155 };
David Tolnaye3d41b72017-12-31 15:24:00 -05001156}
David Tolnay8c81f622018-07-31 23:34:35 -07001157#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001158pub fn visit_data_union<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataUnion) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001159 tokens_helper(_visitor, &_i.union_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001160 _visitor.visit_fields_named(&_i.fields);
David Tolnaye3d41b72017-12-31 15:24:00 -05001161}
David Tolnay8c81f622018-07-31 23:34:35 -07001162#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001163pub fn visit_derive_input<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DeriveInput) {
David Tolnay8c81f622018-07-31 23:34:35 -07001164 for it in &_i.attrs {
1165 _visitor.visit_attribute(it)
1166 }
1167 _visitor.visit_visibility(&_i.vis);
1168 _visitor.visit_ident(&_i.ident);
1169 _visitor.visit_generics(&_i.generics);
1170 _visitor.visit_data(&_i.data);
Nika Layzell27726662017-10-24 23:16:35 -04001171}
David Tolnay8c81f622018-07-31 23:34:35 -07001172#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001173pub fn visit_expr<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Expr) {
Nika Layzell27726662017-10-24 23:16:35 -04001174 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001175 Expr::Box(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001176 full!(_visitor.visit_expr_box(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001177 }
David Tolnay8c81f622018-07-31 23:34:35 -07001178 Expr::InPlace(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001179 full!(_visitor.visit_expr_in_place(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001180 }
David Tolnay8c81f622018-07-31 23:34:35 -07001181 Expr::Array(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001182 full!(_visitor.visit_expr_array(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001183 }
David Tolnay8c81f622018-07-31 23:34:35 -07001184 Expr::Call(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001185 _visitor.visit_expr_call(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001186 }
David Tolnay8c81f622018-07-31 23:34:35 -07001187 Expr::MethodCall(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001188 full!(_visitor.visit_expr_method_call(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001189 }
David Tolnay8c81f622018-07-31 23:34:35 -07001190 Expr::Tuple(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001191 full!(_visitor.visit_expr_tuple(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001192 }
David Tolnay8c81f622018-07-31 23:34:35 -07001193 Expr::Binary(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001194 _visitor.visit_expr_binary(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001195 }
David Tolnay8c81f622018-07-31 23:34:35 -07001196 Expr::Unary(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001197 _visitor.visit_expr_unary(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001198 }
David Tolnay8c81f622018-07-31 23:34:35 -07001199 Expr::Lit(ref _binding_0) => {
David Tolnay8c91b882017-12-28 23:04:32 -05001200 _visitor.visit_expr_lit(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001201 }
David Tolnay8c81f622018-07-31 23:34:35 -07001202 Expr::Cast(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001203 _visitor.visit_expr_cast(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001204 }
David Tolnay8c81f622018-07-31 23:34:35 -07001205 Expr::Type(ref _binding_0) => {
David Tolnay0cf94f22017-12-28 23:46:26 -05001206 full!(_visitor.visit_expr_type(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001207 }
David Tolnay9c119122018-09-01 18:47:02 -07001208 Expr::Let(ref _binding_0) => {
1209 full!(_visitor.visit_expr_let(_binding_0));
1210 }
David Tolnay8c81f622018-07-31 23:34:35 -07001211 Expr::If(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001212 full!(_visitor.visit_expr_if(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001213 }
David Tolnay8c81f622018-07-31 23:34:35 -07001214 Expr::While(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001215 full!(_visitor.visit_expr_while(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001216 }
David Tolnay8c81f622018-07-31 23:34:35 -07001217 Expr::ForLoop(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001218 full!(_visitor.visit_expr_for_loop(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001219 }
David Tolnay8c81f622018-07-31 23:34:35 -07001220 Expr::Loop(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001221 full!(_visitor.visit_expr_loop(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001222 }
David Tolnay8c81f622018-07-31 23:34:35 -07001223 Expr::Match(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001224 full!(_visitor.visit_expr_match(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001225 }
David Tolnay8c81f622018-07-31 23:34:35 -07001226 Expr::Closure(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001227 full!(_visitor.visit_expr_closure(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001228 }
David Tolnay8c81f622018-07-31 23:34:35 -07001229 Expr::Unsafe(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001230 full!(_visitor.visit_expr_unsafe(_binding_0));
Nika Layzell640832a2017-12-04 13:37:09 -05001231 }
David Tolnay8c81f622018-07-31 23:34:35 -07001232 Expr::Block(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001233 full!(_visitor.visit_expr_block(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001234 }
David Tolnay8c81f622018-07-31 23:34:35 -07001235 Expr::Assign(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001236 full!(_visitor.visit_expr_assign(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001237 }
David Tolnay8c81f622018-07-31 23:34:35 -07001238 Expr::AssignOp(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001239 full!(_visitor.visit_expr_assign_op(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001240 }
David Tolnay8c81f622018-07-31 23:34:35 -07001241 Expr::Field(ref _binding_0) => {
David Tolnayd093fa92018-06-30 10:23:25 -07001242 _visitor.visit_expr_field(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001243 }
David Tolnay8c81f622018-07-31 23:34:35 -07001244 Expr::Index(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001245 _visitor.visit_expr_index(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001246 }
David Tolnay8c81f622018-07-31 23:34:35 -07001247 Expr::Range(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001248 full!(_visitor.visit_expr_range(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001249 }
David Tolnay8c81f622018-07-31 23:34:35 -07001250 Expr::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001251 _visitor.visit_expr_path(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001252 }
David Tolnay8c81f622018-07-31 23:34:35 -07001253 Expr::Reference(ref _binding_0) => {
David Tolnay00674ba2018-03-31 18:14:11 +02001254 full!(_visitor.visit_expr_reference(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001255 }
David Tolnay8c81f622018-07-31 23:34:35 -07001256 Expr::Break(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001257 full!(_visitor.visit_expr_break(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001258 }
David Tolnay8c81f622018-07-31 23:34:35 -07001259 Expr::Continue(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001260 full!(_visitor.visit_expr_continue(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001261 }
David Tolnay8c81f622018-07-31 23:34:35 -07001262 Expr::Return(ref _binding_0) => {
David Tolnayc246cd32017-12-28 23:14:32 -05001263 full!(_visitor.visit_expr_return(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001264 }
David Tolnay8c81f622018-07-31 23:34:35 -07001265 Expr::Macro(ref _binding_0) => {
David Tolnay8c91b882017-12-28 23:04:32 -05001266 full!(_visitor.visit_expr_macro(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001267 }
David Tolnay8c81f622018-07-31 23:34:35 -07001268 Expr::Struct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001269 full!(_visitor.visit_expr_struct(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001270 }
David Tolnay8c81f622018-07-31 23:34:35 -07001271 Expr::Repeat(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001272 full!(_visitor.visit_expr_repeat(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001273 }
David Tolnay8c81f622018-07-31 23:34:35 -07001274 Expr::Paren(ref _binding_0) => {
David Tolnay81ab4f62018-01-27 19:02:51 -08001275 _visitor.visit_expr_paren(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001276 }
David Tolnay8c81f622018-07-31 23:34:35 -07001277 Expr::Group(ref _binding_0) => {
David Tolnaye98775f2017-12-28 23:17:00 -05001278 full!(_visitor.visit_expr_group(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001279 }
David Tolnay8c81f622018-07-31 23:34:35 -07001280 Expr::Try(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001281 full!(_visitor.visit_expr_try(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001282 }
David Tolnay02a9c6f2018-08-24 18:58:45 -04001283 Expr::Async(ref _binding_0) => {
1284 full!(_visitor.visit_expr_async(_binding_0));
1285 }
David Tolnayfb2dd4b2018-08-24 16:45:34 -04001286 Expr::TryBlock(ref _binding_0) => {
1287 full!(_visitor.visit_expr_try_block(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001288 }
David Tolnay8c81f622018-07-31 23:34:35 -07001289 Expr::Yield(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001290 full!(_visitor.visit_expr_yield(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001291 }
David Tolnay8c81f622018-07-31 23:34:35 -07001292 Expr::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05001293 _visitor.visit_expr_verbatim(_binding_0);
1294 }
Nika Layzell27726662017-10-24 23:16:35 -04001295 }
1296}
David Tolnay8c81f622018-07-31 23:34:35 -07001297#[cfg(feature = "full")]
1298#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001299pub fn visit_expr_array<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprArray) {
David Tolnay8c81f622018-07-31 23:34:35 -07001300 for it in &_i.attrs {
1301 _visitor.visit_attribute(it)
1302 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001303 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001304 for el in Punctuated::pairs(&_i.elems) {
1305 let it = el.value();
1306 _visitor.visit_expr(it)
David Tolnaye3d41b72017-12-31 15:24:00 -05001307 }
1308}
David Tolnay8c81f622018-07-31 23:34:35 -07001309#[cfg(feature = "full")]
1310#[cfg(any(feature = "full", feature = "derive"))]
1311pub fn visit_expr_assign<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprAssign) {
1312 for it in &_i.attrs {
1313 _visitor.visit_attribute(it)
1314 }
1315 _visitor.visit_expr(&*_i.left);
David Tolnay7ac699c2018-08-24 14:00:58 -04001316 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001317 _visitor.visit_expr(&*_i.right);
1318}
1319#[cfg(feature = "full")]
1320#[cfg(any(feature = "full", feature = "derive"))]
1321pub fn visit_expr_assign_op<'ast, V: Visit<'ast> + ?Sized>(
1322 _visitor: &mut V,
1323 _i: &'ast ExprAssignOp,
1324) {
1325 for it in &_i.attrs {
1326 _visitor.visit_attribute(it)
1327 }
1328 _visitor.visit_expr(&*_i.left);
1329 _visitor.visit_bin_op(&_i.op);
1330 _visitor.visit_expr(&*_i.right);
1331}
David Tolnay02a9c6f2018-08-24 18:58:45 -04001332#[cfg(feature = "full")]
1333#[cfg(any(feature = "full", feature = "derive"))]
1334pub fn visit_expr_async<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprAsync) {
1335 for it in &_i.attrs {
1336 _visitor.visit_attribute(it)
1337 }
1338 tokens_helper(_visitor, &_i.async_token.span);
1339 if let Some(ref it) = _i.capture {
1340 tokens_helper(_visitor, &it.span)
1341 };
1342 _visitor.visit_block(&_i.block);
1343}
David Tolnay8c81f622018-07-31 23:34:35 -07001344#[cfg(any(feature = "full", feature = "derive"))]
1345pub fn visit_expr_binary<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBinary) {
1346 for it in &_i.attrs {
1347 _visitor.visit_attribute(it)
1348 }
1349 _visitor.visit_expr(&*_i.left);
1350 _visitor.visit_bin_op(&_i.op);
1351 _visitor.visit_expr(&*_i.right);
1352}
1353#[cfg(feature = "full")]
1354#[cfg(any(feature = "full", feature = "derive"))]
1355pub fn visit_expr_block<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBlock) {
1356 for it in &_i.attrs {
1357 _visitor.visit_attribute(it)
1358 }
David Tolnay1d8e9962018-08-24 19:04:20 -04001359 if let Some(ref it) = _i.label {
1360 _visitor.visit_label(it)
1361 };
David Tolnay8c81f622018-07-31 23:34:35 -07001362 _visitor.visit_block(&_i.block);
1363}
1364#[cfg(feature = "full")]
1365#[cfg(any(feature = "full", feature = "derive"))]
1366pub fn visit_expr_box<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBox) {
1367 for it in &_i.attrs {
1368 _visitor.visit_attribute(it)
1369 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001370 tokens_helper(_visitor, &_i.box_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001371 _visitor.visit_expr(&*_i.expr);
1372}
1373#[cfg(feature = "full")]
1374#[cfg(any(feature = "full", feature = "derive"))]
1375pub fn visit_expr_break<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBreak) {
1376 for it in &_i.attrs {
1377 _visitor.visit_attribute(it)
1378 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001379 tokens_helper(_visitor, &_i.break_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001380 if let Some(ref it) = _i.label {
1381 _visitor.visit_lifetime(it)
1382 };
1383 if let Some(ref it) = _i.expr {
1384 _visitor.visit_expr(&**it)
1385 };
1386}
1387#[cfg(any(feature = "full", feature = "derive"))]
1388pub fn visit_expr_call<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprCall) {
1389 for it in &_i.attrs {
1390 _visitor.visit_attribute(it)
1391 }
1392 _visitor.visit_expr(&*_i.func);
David Tolnay7ac699c2018-08-24 14:00:58 -04001393 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001394 for el in Punctuated::pairs(&_i.args) {
1395 let it = el.value();
1396 _visitor.visit_expr(it)
1397 }
1398}
1399#[cfg(any(feature = "full", feature = "derive"))]
1400pub fn visit_expr_cast<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprCast) {
1401 for it in &_i.attrs {
1402 _visitor.visit_attribute(it)
1403 }
1404 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001405 tokens_helper(_visitor, &_i.as_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001406 _visitor.visit_type(&*_i.ty);
1407}
1408#[cfg(feature = "full")]
1409#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001410pub fn visit_expr_closure<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprClosure) {
1411 for it in &_i.attrs {
1412 _visitor.visit_attribute(it)
1413 }
Yusuke Sasaki4e5d9662018-07-21 02:49:47 +09001414 if let Some(ref it) = _i.asyncness {
1415 tokens_helper(_visitor, &it.span)
1416 };
David Tolnay8c81f622018-07-31 23:34:35 -07001417 if let Some(ref it) = _i.movability {
David Tolnay7ac699c2018-08-24 14:00:58 -04001418 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001419 };
1420 if let Some(ref it) = _i.capture {
David Tolnay7ac699c2018-08-24 14:00:58 -04001421 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001422 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001423 tokens_helper(_visitor, &_i.or1_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001424 for el in Punctuated::pairs(&_i.inputs) {
1425 let it = el.value();
1426 _visitor.visit_fn_arg(it)
1427 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001428 tokens_helper(_visitor, &_i.or2_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001429 _visitor.visit_return_type(&_i.output);
1430 _visitor.visit_expr(&*_i.body);
1431}
1432#[cfg(feature = "full")]
1433#[cfg(any(feature = "full", feature = "derive"))]
1434pub fn visit_expr_continue<'ast, V: Visit<'ast> + ?Sized>(
1435 _visitor: &mut V,
1436 _i: &'ast ExprContinue,
1437) {
1438 for it in &_i.attrs {
1439 _visitor.visit_attribute(it)
1440 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001441 tokens_helper(_visitor, &_i.continue_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001442 if let Some(ref it) = _i.label {
1443 _visitor.visit_lifetime(it)
1444 };
1445}
1446#[cfg(any(feature = "full", feature = "derive"))]
1447pub fn visit_expr_field<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprField) {
1448 for it in &_i.attrs {
1449 _visitor.visit_attribute(it)
1450 }
1451 _visitor.visit_expr(&*_i.base);
David Tolnay7ac699c2018-08-24 14:00:58 -04001452 tokens_helper(_visitor, &_i.dot_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001453 _visitor.visit_member(&_i.member);
1454}
1455#[cfg(feature = "full")]
1456#[cfg(any(feature = "full", feature = "derive"))]
1457pub fn visit_expr_for_loop<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprForLoop) {
1458 for it in &_i.attrs {
1459 _visitor.visit_attribute(it)
1460 }
1461 if let Some(ref it) = _i.label {
1462 _visitor.visit_label(it)
1463 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001464 tokens_helper(_visitor, &_i.for_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001465 _visitor.visit_pat(&*_i.pat);
David Tolnay7ac699c2018-08-24 14:00:58 -04001466 tokens_helper(_visitor, &_i.in_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001467 _visitor.visit_expr(&*_i.expr);
1468 _visitor.visit_block(&_i.body);
1469}
1470#[cfg(feature = "full")]
1471#[cfg(any(feature = "full", feature = "derive"))]
1472pub fn visit_expr_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprGroup) {
1473 for it in &_i.attrs {
1474 _visitor.visit_attribute(it)
1475 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001476 tokens_helper(_visitor, &_i.group_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001477 _visitor.visit_expr(&*_i.expr);
1478}
1479#[cfg(feature = "full")]
1480#[cfg(any(feature = "full", feature = "derive"))]
1481pub fn visit_expr_if<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprIf) {
1482 for it in &_i.attrs {
1483 _visitor.visit_attribute(it)
1484 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001485 tokens_helper(_visitor, &_i.if_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001486 _visitor.visit_expr(&*_i.cond);
1487 _visitor.visit_block(&_i.then_branch);
1488 if let Some(ref it) = _i.else_branch {
David Tolnay7ac699c2018-08-24 14:00:58 -04001489 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001490 _visitor.visit_expr(&*(it).1);
1491 };
1492}
1493#[cfg(feature = "full")]
1494#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001495pub fn visit_expr_in_place<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprInPlace) {
1496 for it in &_i.attrs {
1497 _visitor.visit_attribute(it)
1498 }
1499 _visitor.visit_expr(&*_i.place);
David Tolnay7ac699c2018-08-24 14:00:58 -04001500 tokens_helper(_visitor, &_i.arrow_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001501 _visitor.visit_expr(&*_i.value);
1502}
1503#[cfg(any(feature = "full", feature = "derive"))]
1504pub fn visit_expr_index<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprIndex) {
1505 for it in &_i.attrs {
1506 _visitor.visit_attribute(it)
1507 }
1508 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001509 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001510 _visitor.visit_expr(&*_i.index);
1511}
David Tolnay9c119122018-09-01 18:47:02 -07001512#[cfg(feature = "full")]
1513#[cfg(any(feature = "full", feature = "derive"))]
1514pub fn visit_expr_let<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprLet) {
1515 for it in &_i.attrs {
1516 _visitor.visit_attribute(it)
1517 }
1518 tokens_helper(_visitor, &_i.let_token.span);
1519 for el in Punctuated::pairs(&_i.pats) {
1520 let it = el.value();
1521 _visitor.visit_pat(it)
1522 }
1523 tokens_helper(_visitor, &_i.eq_token.spans);
1524 _visitor.visit_expr(&*_i.expr);
1525}
David Tolnay8c81f622018-07-31 23:34:35 -07001526#[cfg(any(feature = "full", feature = "derive"))]
1527pub fn visit_expr_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprLit) {
1528 for it in &_i.attrs {
1529 _visitor.visit_attribute(it)
1530 }
1531 _visitor.visit_lit(&_i.lit);
1532}
1533#[cfg(feature = "full")]
1534#[cfg(any(feature = "full", feature = "derive"))]
1535pub fn visit_expr_loop<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprLoop) {
1536 for it in &_i.attrs {
1537 _visitor.visit_attribute(it)
1538 }
1539 if let Some(ref it) = _i.label {
1540 _visitor.visit_label(it)
1541 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001542 tokens_helper(_visitor, &_i.loop_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001543 _visitor.visit_block(&_i.body);
1544}
1545#[cfg(feature = "full")]
1546#[cfg(any(feature = "full", feature = "derive"))]
1547pub fn visit_expr_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprMacro) {
1548 for it in &_i.attrs {
1549 _visitor.visit_attribute(it)
1550 }
1551 _visitor.visit_macro(&_i.mac);
1552}
1553#[cfg(feature = "full")]
1554#[cfg(any(feature = "full", feature = "derive"))]
1555pub fn visit_expr_match<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprMatch) {
1556 for it in &_i.attrs {
1557 _visitor.visit_attribute(it)
1558 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001559 tokens_helper(_visitor, &_i.match_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001560 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001561 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001562 for it in &_i.arms {
1563 _visitor.visit_arm(it)
1564 }
1565}
1566#[cfg(feature = "full")]
1567#[cfg(any(feature = "full", feature = "derive"))]
1568pub fn visit_expr_method_call<'ast, V: Visit<'ast> + ?Sized>(
1569 _visitor: &mut V,
1570 _i: &'ast ExprMethodCall,
1571) {
1572 for it in &_i.attrs {
1573 _visitor.visit_attribute(it)
1574 }
1575 _visitor.visit_expr(&*_i.receiver);
David Tolnay7ac699c2018-08-24 14:00:58 -04001576 tokens_helper(_visitor, &_i.dot_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001577 _visitor.visit_ident(&_i.method);
1578 if let Some(ref it) = _i.turbofish {
1579 _visitor.visit_method_turbofish(it)
1580 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001581 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001582 for el in Punctuated::pairs(&_i.args) {
1583 let it = el.value();
1584 _visitor.visit_expr(it)
1585 }
1586}
1587#[cfg(any(feature = "full", feature = "derive"))]
1588pub fn visit_expr_paren<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprParen) {
1589 for it in &_i.attrs {
1590 _visitor.visit_attribute(it)
1591 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001592 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001593 _visitor.visit_expr(&*_i.expr);
1594}
1595#[cfg(any(feature = "full", feature = "derive"))]
1596pub fn visit_expr_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprPath) {
1597 for it in &_i.attrs {
1598 _visitor.visit_attribute(it)
1599 }
1600 if let Some(ref it) = _i.qself {
1601 _visitor.visit_qself(it)
1602 };
1603 _visitor.visit_path(&_i.path);
1604}
1605#[cfg(feature = "full")]
1606#[cfg(any(feature = "full", feature = "derive"))]
1607pub fn visit_expr_range<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprRange) {
1608 for it in &_i.attrs {
1609 _visitor.visit_attribute(it)
1610 }
1611 if let Some(ref it) = _i.from {
1612 _visitor.visit_expr(&**it)
1613 };
1614 _visitor.visit_range_limits(&_i.limits);
1615 if let Some(ref it) = _i.to {
1616 _visitor.visit_expr(&**it)
1617 };
1618}
1619#[cfg(feature = "full")]
1620#[cfg(any(feature = "full", feature = "derive"))]
1621pub fn visit_expr_reference<'ast, V: Visit<'ast> + ?Sized>(
1622 _visitor: &mut V,
1623 _i: &'ast ExprReference,
1624) {
1625 for it in &_i.attrs {
1626 _visitor.visit_attribute(it)
1627 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001628 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001629 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04001630 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001631 };
1632 _visitor.visit_expr(&*_i.expr);
1633}
1634#[cfg(feature = "full")]
1635#[cfg(any(feature = "full", feature = "derive"))]
1636pub fn visit_expr_repeat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprRepeat) {
1637 for it in &_i.attrs {
1638 _visitor.visit_attribute(it)
1639 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001640 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001641 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001642 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001643 _visitor.visit_expr(&*_i.len);
1644}
1645#[cfg(feature = "full")]
1646#[cfg(any(feature = "full", feature = "derive"))]
1647pub fn visit_expr_return<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprReturn) {
1648 for it in &_i.attrs {
1649 _visitor.visit_attribute(it)
1650 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001651 tokens_helper(_visitor, &_i.return_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001652 if let Some(ref it) = _i.expr {
1653 _visitor.visit_expr(&**it)
1654 };
1655}
1656#[cfg(feature = "full")]
1657#[cfg(any(feature = "full", feature = "derive"))]
1658pub fn visit_expr_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprStruct) {
1659 for it in &_i.attrs {
1660 _visitor.visit_attribute(it)
1661 }
1662 _visitor.visit_path(&_i.path);
David Tolnay7ac699c2018-08-24 14:00:58 -04001663 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001664 for el in Punctuated::pairs(&_i.fields) {
1665 let it = el.value();
1666 _visitor.visit_field_value(it)
1667 }
1668 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001669 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001670 };
1671 if let Some(ref it) = _i.rest {
1672 _visitor.visit_expr(&**it)
1673 };
1674}
1675#[cfg(feature = "full")]
1676#[cfg(any(feature = "full", feature = "derive"))]
1677pub fn visit_expr_try<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprTry) {
1678 for it in &_i.attrs {
1679 _visitor.visit_attribute(it)
1680 }
1681 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001682 tokens_helper(_visitor, &_i.question_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001683}
1684#[cfg(feature = "full")]
1685#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayfb2dd4b2018-08-24 16:45:34 -04001686pub fn visit_expr_try_block<'ast, V: Visit<'ast> + ?Sized>(
1687 _visitor: &mut V,
1688 _i: &'ast ExprTryBlock,
1689) {
1690 for it in &_i.attrs {
1691 _visitor.visit_attribute(it)
1692 }
1693 tokens_helper(_visitor, &_i.try_token.span);
1694 _visitor.visit_block(&_i.block);
1695}
1696#[cfg(feature = "full")]
1697#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001698pub fn visit_expr_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprTuple) {
1699 for it in &_i.attrs {
1700 _visitor.visit_attribute(it)
1701 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001702 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001703 for el in Punctuated::pairs(&_i.elems) {
1704 let it = el.value();
1705 _visitor.visit_expr(it)
1706 }
1707}
1708#[cfg(feature = "full")]
1709#[cfg(any(feature = "full", feature = "derive"))]
1710pub fn visit_expr_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprType) {
1711 for it in &_i.attrs {
1712 _visitor.visit_attribute(it)
1713 }
1714 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001715 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001716 _visitor.visit_type(&*_i.ty);
1717}
1718#[cfg(any(feature = "full", feature = "derive"))]
1719pub fn visit_expr_unary<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprUnary) {
1720 for it in &_i.attrs {
1721 _visitor.visit_attribute(it)
1722 }
1723 _visitor.visit_un_op(&_i.op);
1724 _visitor.visit_expr(&*_i.expr);
1725}
1726#[cfg(feature = "full")]
1727#[cfg(any(feature = "full", feature = "derive"))]
1728pub fn visit_expr_unsafe<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprUnsafe) {
1729 for it in &_i.attrs {
1730 _visitor.visit_attribute(it)
1731 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001732 tokens_helper(_visitor, &_i.unsafe_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001733 _visitor.visit_block(&_i.block);
1734}
1735#[cfg(any(feature = "full", feature = "derive"))]
1736pub fn visit_expr_verbatim<'ast, V: Visit<'ast> + ?Sized>(
1737 _visitor: &mut V,
1738 _i: &'ast ExprVerbatim,
1739) {
David Tolnay6af48992018-08-01 11:16:28 -07001740 skip!(_i.tts);
David Tolnay8c81f622018-07-31 23:34:35 -07001741}
1742#[cfg(feature = "full")]
1743#[cfg(any(feature = "full", feature = "derive"))]
1744pub fn visit_expr_while<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprWhile) {
1745 for it in &_i.attrs {
1746 _visitor.visit_attribute(it)
1747 }
1748 if let Some(ref it) = _i.label {
1749 _visitor.visit_label(it)
1750 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001751 tokens_helper(_visitor, &_i.while_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001752 _visitor.visit_expr(&*_i.cond);
1753 _visitor.visit_block(&_i.body);
1754}
1755#[cfg(feature = "full")]
1756#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001757pub fn visit_expr_yield<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprYield) {
1758 for it in &_i.attrs {
1759 _visitor.visit_attribute(it)
1760 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001761 tokens_helper(_visitor, &_i.yield_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001762 if let Some(ref it) = _i.expr {
1763 _visitor.visit_expr(&**it)
1764 };
1765}
1766#[cfg(any(feature = "full", feature = "derive"))]
1767pub fn visit_field<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Field) {
1768 for it in &_i.attrs {
1769 _visitor.visit_attribute(it)
1770 }
1771 _visitor.visit_visibility(&_i.vis);
1772 if let Some(ref it) = _i.ident {
1773 _visitor.visit_ident(it)
1774 };
1775 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001776 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001777 };
1778 _visitor.visit_type(&_i.ty);
1779}
1780#[cfg(any(feature = "full", feature = "derive"))]
1781#[cfg(feature = "full")]
1782pub fn visit_field_pat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldPat) {
1783 for it in &_i.attrs {
1784 _visitor.visit_attribute(it)
1785 }
1786 _visitor.visit_member(&_i.member);
1787 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001788 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001789 };
1790 _visitor.visit_pat(&*_i.pat);
1791}
1792#[cfg(any(feature = "full", feature = "derive"))]
1793#[cfg(feature = "full")]
1794pub fn visit_field_value<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldValue) {
1795 for it in &_i.attrs {
1796 _visitor.visit_attribute(it)
1797 }
1798 _visitor.visit_member(&_i.member);
1799 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001800 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001801 };
1802 _visitor.visit_expr(&_i.expr);
1803}
1804#[cfg(any(feature = "full", feature = "derive"))]
1805pub fn visit_fields<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Fields) {
1806 match *_i {
1807 Fields::Named(ref _binding_0) => {
1808 _visitor.visit_fields_named(_binding_0);
1809 }
1810 Fields::Unnamed(ref _binding_0) => {
1811 _visitor.visit_fields_unnamed(_binding_0);
1812 }
1813 Fields::Unit => {}
1814 }
1815}
1816#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001817pub fn visit_fields_named<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldsNamed) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001818 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001819 for el in Punctuated::pairs(&_i.named) {
1820 let it = el.value();
1821 _visitor.visit_field(it)
1822 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001823}
David Tolnay8c81f622018-07-31 23:34:35 -07001824#[cfg(any(feature = "full", feature = "derive"))]
1825pub fn visit_fields_unnamed<'ast, V: Visit<'ast> + ?Sized>(
1826 _visitor: &mut V,
1827 _i: &'ast FieldsUnnamed,
1828) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001829 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001830 for el in Punctuated::pairs(&_i.unnamed) {
1831 let it = el.value();
1832 _visitor.visit_field(it)
1833 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001834}
David Tolnay8c81f622018-07-31 23:34:35 -07001835#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001836pub fn visit_file<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast File) {
David Tolnay6af48992018-08-01 11:16:28 -07001837 skip!(_i.shebang);
David Tolnay8c81f622018-07-31 23:34:35 -07001838 for it in &_i.attrs {
1839 _visitor.visit_attribute(it)
1840 }
1841 for it in &_i.items {
1842 _visitor.visit_item(it)
1843 }
Nika Layzell27726662017-10-24 23:16:35 -04001844}
David Tolnay8c81f622018-07-31 23:34:35 -07001845#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001846pub fn visit_fn_arg<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FnArg) {
Nika Layzell27726662017-10-24 23:16:35 -04001847 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001848 FnArg::SelfRef(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001849 _visitor.visit_arg_self_ref(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001850 }
David Tolnay8c81f622018-07-31 23:34:35 -07001851 FnArg::SelfValue(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001852 _visitor.visit_arg_self(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001853 }
David Tolnay8c81f622018-07-31 23:34:35 -07001854 FnArg::Captured(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001855 _visitor.visit_arg_captured(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001856 }
David Tolnay8c81f622018-07-31 23:34:35 -07001857 FnArg::Inferred(ref _binding_0) => {
David Tolnay80ed55f2017-12-27 22:54:40 -05001858 _visitor.visit_pat(_binding_0);
1859 }
David Tolnay8c81f622018-07-31 23:34:35 -07001860 FnArg::Ignored(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001861 _visitor.visit_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001862 }
1863 }
1864}
David Tolnay8c81f622018-07-31 23:34:35 -07001865#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001866pub fn visit_fn_decl<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FnDecl) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001867 tokens_helper(_visitor, &_i.fn_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001868 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04001869 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001870 for el in Punctuated::pairs(&_i.inputs) {
1871 let it = el.value();
1872 _visitor.visit_fn_arg(it)
1873 }
1874 if let Some(ref it) = _i.variadic {
David Tolnay7ac699c2018-08-24 14:00:58 -04001875 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001876 };
1877 _visitor.visit_return_type(&_i.output);
Nika Layzell27726662017-10-24 23:16:35 -04001878}
David Tolnay8c81f622018-07-31 23:34:35 -07001879#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001880pub fn visit_foreign_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ForeignItem) {
Nika Layzell27726662017-10-24 23:16:35 -04001881 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001882 ForeignItem::Fn(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001883 _visitor.visit_foreign_item_fn(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001884 }
David Tolnay8c81f622018-07-31 23:34:35 -07001885 ForeignItem::Static(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001886 _visitor.visit_foreign_item_static(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001887 }
David Tolnay8c81f622018-07-31 23:34:35 -07001888 ForeignItem::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001889 _visitor.visit_foreign_item_type(_binding_0);
David Tolnay199bcbb2017-11-12 10:33:52 -08001890 }
David Tolnay435c1782018-08-24 16:15:44 -04001891 ForeignItem::Macro(ref _binding_0) => {
1892 _visitor.visit_foreign_item_macro(_binding_0);
1893 }
David Tolnay8c81f622018-07-31 23:34:35 -07001894 ForeignItem::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05001895 _visitor.visit_foreign_item_verbatim(_binding_0);
1896 }
Nika Layzell27726662017-10-24 23:16:35 -04001897 }
1898}
David Tolnay8c81f622018-07-31 23:34:35 -07001899#[cfg(feature = "full")]
1900pub fn visit_foreign_item_fn<'ast, V: Visit<'ast> + ?Sized>(
1901 _visitor: &mut V,
1902 _i: &'ast ForeignItemFn,
1903) {
1904 for it in &_i.attrs {
1905 _visitor.visit_attribute(it)
1906 }
1907 _visitor.visit_visibility(&_i.vis);
1908 _visitor.visit_ident(&_i.ident);
1909 _visitor.visit_fn_decl(&*_i.decl);
David Tolnay7ac699c2018-08-24 14:00:58 -04001910 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay8894f602017-11-11 12:11:04 -08001911}
David Tolnay8c81f622018-07-31 23:34:35 -07001912#[cfg(feature = "full")]
David Tolnay435c1782018-08-24 16:15:44 -04001913pub fn visit_foreign_item_macro<'ast, V: Visit<'ast> + ?Sized>(
1914 _visitor: &mut V,
1915 _i: &'ast ForeignItemMacro,
1916) {
1917 for it in &_i.attrs {
1918 _visitor.visit_attribute(it)
1919 }
1920 _visitor.visit_macro(&_i.mac);
1921 if let Some(ref it) = _i.semi_token {
1922 tokens_helper(_visitor, &it.spans)
1923 };
1924}
1925#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001926pub fn visit_foreign_item_static<'ast, V: Visit<'ast> + ?Sized>(
1927 _visitor: &mut V,
1928 _i: &'ast ForeignItemStatic,
1929) {
1930 for it in &_i.attrs {
1931 _visitor.visit_attribute(it)
1932 }
1933 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04001934 tokens_helper(_visitor, &_i.static_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001935 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04001936 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001937 };
1938 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001939 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001940 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04001941 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001942}
David Tolnay8c81f622018-07-31 23:34:35 -07001943#[cfg(feature = "full")]
1944pub fn visit_foreign_item_type<'ast, V: Visit<'ast> + ?Sized>(
1945 _visitor: &mut V,
1946 _i: &'ast ForeignItemType,
1947) {
1948 for it in &_i.attrs {
1949 _visitor.visit_attribute(it)
1950 }
1951 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04001952 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001953 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001954 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay199bcbb2017-11-12 10:33:52 -08001955}
David Tolnay8c81f622018-07-31 23:34:35 -07001956#[cfg(feature = "full")]
1957pub fn visit_foreign_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
1958 _visitor: &mut V,
1959 _i: &'ast ForeignItemVerbatim,
1960) {
David Tolnay6af48992018-08-01 11:16:28 -07001961 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05001962}
David Tolnay8c81f622018-07-31 23:34:35 -07001963#[cfg(any(feature = "full", feature = "derive"))]
1964pub fn visit_generic_argument<'ast, V: Visit<'ast> + ?Sized>(
1965 _visitor: &mut V,
1966 _i: &'ast GenericArgument,
1967) {
Nika Layzell357885a2017-12-04 15:47:07 -05001968 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001969 GenericArgument::Lifetime(ref _binding_0) => {
David Tolnay4ba63a02017-12-28 15:53:05 -05001970 _visitor.visit_lifetime(_binding_0);
Nika Layzell357885a2017-12-04 15:47:07 -05001971 }
David Tolnay8c81f622018-07-31 23:34:35 -07001972 GenericArgument::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001973 _visitor.visit_type(_binding_0);
Nika Layzell357885a2017-12-04 15:47:07 -05001974 }
David Tolnay8c81f622018-07-31 23:34:35 -07001975 GenericArgument::Binding(ref _binding_0) => {
David Tolnay506e43a2017-12-29 11:34:36 -05001976 _visitor.visit_binding(_binding_0);
Nika Layzell357885a2017-12-04 15:47:07 -05001977 }
David Tolnay9d0882a2018-09-01 19:49:14 -07001978 GenericArgument::Constraint(ref _binding_0) => {
1979 _visitor.visit_constraint(_binding_0);
1980 }
David Tolnay8c81f622018-07-31 23:34:35 -07001981 GenericArgument::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001982 _visitor.visit_expr(_binding_0);
Nika Layzellc680e612017-12-04 19:07:20 -05001983 }
Nika Layzell357885a2017-12-04 15:47:07 -05001984 }
1985}
David Tolnay8c81f622018-07-31 23:34:35 -07001986#[cfg(any(feature = "full", feature = "derive"))]
1987#[cfg(feature = "full")]
1988pub fn visit_generic_method_argument<'ast, V: Visit<'ast> + ?Sized>(
1989 _visitor: &mut V,
1990 _i: &'ast GenericMethodArgument,
1991) {
David Tolnayd60cfec2017-12-29 00:21:38 -05001992 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001993 GenericMethodArgument::Type(ref _binding_0) => {
David Tolnayd60cfec2017-12-29 00:21:38 -05001994 _visitor.visit_type(_binding_0);
1995 }
David Tolnay8c81f622018-07-31 23:34:35 -07001996 GenericMethodArgument::Const(ref _binding_0) => {
David Tolnayd60cfec2017-12-29 00:21:38 -05001997 _visitor.visit_expr(_binding_0);
1998 }
1999 }
2000}
David Tolnay8c81f622018-07-31 23:34:35 -07002001#[cfg(any(feature = "full", feature = "derive"))]
2002pub fn visit_generic_param<'ast, V: Visit<'ast> + ?Sized>(
2003 _visitor: &mut V,
2004 _i: &'ast GenericParam,
2005) {
David Tolnayc2f1aba2017-11-12 20:29:22 -08002006 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002007 GenericParam::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002008 _visitor.visit_type_param(_binding_0);
David Tolnayc2f1aba2017-11-12 20:29:22 -08002009 }
David Tolnay8c81f622018-07-31 23:34:35 -07002010 GenericParam::Lifetime(ref _binding_0) => {
David Tolnay517f3692018-01-01 20:17:23 -08002011 _visitor.visit_lifetime_def(_binding_0);
2012 }
David Tolnay8c81f622018-07-31 23:34:35 -07002013 GenericParam::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002014 _visitor.visit_const_param(_binding_0);
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05002015 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08002016 }
2017}
David Tolnay8c81f622018-07-31 23:34:35 -07002018#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002019pub fn visit_generics<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Generics) {
David Tolnay8c81f622018-07-31 23:34:35 -07002020 if let Some(ref it) = _i.lt_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002021 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002022 };
2023 for el in Punctuated::pairs(&_i.params) {
2024 let it = el.value();
2025 _visitor.visit_generic_param(it)
2026 }
2027 if let Some(ref it) = _i.gt_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002028 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002029 };
2030 if let Some(ref it) = _i.where_clause {
2031 _visitor.visit_where_clause(it)
2032 };
Nika Layzell27726662017-10-24 23:16:35 -04002033}
David Tolnay8c81f622018-07-31 23:34:35 -07002034pub fn visit_ident<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Ident) {}
2035#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002036pub fn visit_impl_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ImplItem) {
Nika Layzell27726662017-10-24 23:16:35 -04002037 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002038 ImplItem::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002039 _visitor.visit_impl_item_const(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002040 }
David Tolnay8c81f622018-07-31 23:34:35 -07002041 ImplItem::Method(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002042 _visitor.visit_impl_item_method(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002043 }
David Tolnay8c81f622018-07-31 23:34:35 -07002044 ImplItem::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002045 _visitor.visit_impl_item_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002046 }
David Tolnaybb82ef02018-08-24 20:15:45 -04002047 ImplItem::Existential(ref _binding_0) => {
2048 _visitor.visit_impl_item_existential(_binding_0);
2049 }
David Tolnay8c81f622018-07-31 23:34:35 -07002050 ImplItem::Macro(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002051 _visitor.visit_impl_item_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002052 }
David Tolnay8c81f622018-07-31 23:34:35 -07002053 ImplItem::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002054 _visitor.visit_impl_item_verbatim(_binding_0);
2055 }
Nika Layzell27726662017-10-24 23:16:35 -04002056 }
2057}
David Tolnay8c81f622018-07-31 23:34:35 -07002058#[cfg(feature = "full")]
2059pub fn visit_impl_item_const<'ast, V: Visit<'ast> + ?Sized>(
2060 _visitor: &mut V,
2061 _i: &'ast ImplItemConst,
2062) {
2063 for it in &_i.attrs {
2064 _visitor.visit_attribute(it)
2065 }
2066 _visitor.visit_visibility(&_i.vis);
2067 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002068 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002069 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002070 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002071 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002072 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002073 _visitor.visit_type(&_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002074 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002075 _visitor.visit_expr(&_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04002076 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay857628c2017-11-11 12:25:31 -08002077}
David Tolnay8c81f622018-07-31 23:34:35 -07002078#[cfg(feature = "full")]
David Tolnaybb82ef02018-08-24 20:15:45 -04002079pub fn visit_impl_item_existential<'ast, V: Visit<'ast> + ?Sized>(
2080 _visitor: &mut V,
2081 _i: &'ast ImplItemExistential,
2082) {
2083 for it in &_i.attrs {
2084 _visitor.visit_attribute(it)
2085 }
2086 tokens_helper(_visitor, &_i.existential_token.span);
2087 tokens_helper(_visitor, &_i.type_token.span);
2088 _visitor.visit_ident(&_i.ident);
2089 _visitor.visit_generics(&_i.generics);
2090 if let Some(ref it) = _i.colon_token {
2091 tokens_helper(_visitor, &it.spans)
2092 };
2093 for el in Punctuated::pairs(&_i.bounds) {
2094 let it = el.value();
2095 _visitor.visit_type_param_bound(it)
2096 }
2097 tokens_helper(_visitor, &_i.semi_token.spans);
2098}
2099#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07002100pub fn visit_impl_item_macro<'ast, V: Visit<'ast> + ?Sized>(
2101 _visitor: &mut V,
2102 _i: &'ast ImplItemMacro,
2103) {
2104 for it in &_i.attrs {
2105 _visitor.visit_attribute(it)
2106 }
2107 _visitor.visit_macro(&_i.mac);
2108 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002109 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002110 };
David Tolnay857628c2017-11-11 12:25:31 -08002111}
David Tolnay8c81f622018-07-31 23:34:35 -07002112#[cfg(feature = "full")]
2113pub fn visit_impl_item_method<'ast, V: Visit<'ast> + ?Sized>(
2114 _visitor: &mut V,
2115 _i: &'ast ImplItemMethod,
2116) {
2117 for it in &_i.attrs {
2118 _visitor.visit_attribute(it)
2119 }
2120 _visitor.visit_visibility(&_i.vis);
2121 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002122 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002123 };
2124 _visitor.visit_method_sig(&_i.sig);
2125 _visitor.visit_block(&_i.block);
Nika Layzell27726662017-10-24 23:16:35 -04002126}
David Tolnay8c81f622018-07-31 23:34:35 -07002127#[cfg(feature = "full")]
2128pub fn visit_impl_item_type<'ast, V: Visit<'ast> + ?Sized>(
2129 _visitor: &mut V,
2130 _i: &'ast ImplItemType,
2131) {
2132 for it in &_i.attrs {
2133 _visitor.visit_attribute(it)
2134 }
2135 _visitor.visit_visibility(&_i.vis);
2136 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002137 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002138 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002139 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002140 _visitor.visit_ident(&_i.ident);
2141 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04002142 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002143 _visitor.visit_type(&_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002144 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002145}
David Tolnay8c81f622018-07-31 23:34:35 -07002146#[cfg(feature = "full")]
2147pub fn visit_impl_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
2148 _visitor: &mut V,
2149 _i: &'ast ImplItemVerbatim,
2150) {
David Tolnay6af48992018-08-01 11:16:28 -07002151 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05002152}
David Tolnay8c81f622018-07-31 23:34:35 -07002153#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002154pub fn visit_index<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Index) {
David Tolnay6af48992018-08-01 11:16:28 -07002155 skip!(_i.index);
David Tolnay8c81f622018-07-31 23:34:35 -07002156 _visitor.visit_span(&_i.span);
David Tolnay85b69a42017-12-27 20:43:10 -05002157}
David Tolnay8c81f622018-07-31 23:34:35 -07002158#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002159pub fn visit_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Item) {
Nika Layzell27726662017-10-24 23:16:35 -04002160 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002161 Item::ExternCrate(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002162 _visitor.visit_item_extern_crate(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002163 }
David Tolnay8c81f622018-07-31 23:34:35 -07002164 Item::Use(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002165 _visitor.visit_item_use(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002166 }
David Tolnay8c81f622018-07-31 23:34:35 -07002167 Item::Static(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002168 _visitor.visit_item_static(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002169 }
David Tolnay8c81f622018-07-31 23:34:35 -07002170 Item::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002171 _visitor.visit_item_const(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002172 }
David Tolnay8c81f622018-07-31 23:34:35 -07002173 Item::Fn(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002174 _visitor.visit_item_fn(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002175 }
David Tolnay8c81f622018-07-31 23:34:35 -07002176 Item::Mod(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002177 _visitor.visit_item_mod(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002178 }
David Tolnay8c81f622018-07-31 23:34:35 -07002179 Item::ForeignMod(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002180 _visitor.visit_item_foreign_mod(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002181 }
David Tolnay8c81f622018-07-31 23:34:35 -07002182 Item::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002183 _visitor.visit_item_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002184 }
David Tolnaybb82ef02018-08-24 20:15:45 -04002185 Item::Existential(ref _binding_0) => {
2186 _visitor.visit_item_existential(_binding_0);
2187 }
David Tolnay8c81f622018-07-31 23:34:35 -07002188 Item::Struct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002189 _visitor.visit_item_struct(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002190 }
David Tolnay8c81f622018-07-31 23:34:35 -07002191 Item::Enum(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05002192 _visitor.visit_item_enum(_binding_0);
2193 }
David Tolnay8c81f622018-07-31 23:34:35 -07002194 Item::Union(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002195 _visitor.visit_item_union(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002196 }
David Tolnay8c81f622018-07-31 23:34:35 -07002197 Item::Trait(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002198 _visitor.visit_item_trait(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002199 }
David Tolnayc6b04dd2018-08-30 23:22:51 -07002200 Item::TraitAlias(ref _binding_0) => {
2201 _visitor.visit_item_trait_alias(_binding_0);
2202 }
David Tolnay8c81f622018-07-31 23:34:35 -07002203 Item::Impl(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002204 _visitor.visit_item_impl(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002205 }
David Tolnay8c81f622018-07-31 23:34:35 -07002206 Item::Macro(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002207 _visitor.visit_item_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002208 }
David Tolnay8c81f622018-07-31 23:34:35 -07002209 Item::Macro2(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002210 _visitor.visit_item_macro2(_binding_0);
David Tolnay500d8322017-12-18 00:32:51 -08002211 }
David Tolnay8c81f622018-07-31 23:34:35 -07002212 Item::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002213 _visitor.visit_item_verbatim(_binding_0);
2214 }
Nika Layzell27726662017-10-24 23:16:35 -04002215 }
2216}
David Tolnay8c81f622018-07-31 23:34:35 -07002217#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002218pub fn visit_item_const<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemConst) {
David Tolnay8c81f622018-07-31 23:34:35 -07002219 for it in &_i.attrs {
2220 _visitor.visit_attribute(it)
2221 }
2222 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002223 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002224 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002225 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002226 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002227 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002228 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04002229 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnayc6b55bc2017-11-09 22:48:38 -08002230}
David Tolnay8c81f622018-07-31 23:34:35 -07002231#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002232pub fn visit_item_enum<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemEnum) {
David Tolnay8c81f622018-07-31 23:34:35 -07002233 for it in &_i.attrs {
2234 _visitor.visit_attribute(it)
2235 }
2236 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002237 tokens_helper(_visitor, &_i.enum_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002238 _visitor.visit_ident(&_i.ident);
2239 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04002240 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002241 for el in Punctuated::pairs(&_i.variants) {
2242 let it = el.value();
2243 _visitor.visit_variant(it)
2244 }
David Tolnayc6b55bc2017-11-09 22:48:38 -08002245}
David Tolnay8c81f622018-07-31 23:34:35 -07002246#[cfg(feature = "full")]
David Tolnaybb82ef02018-08-24 20:15:45 -04002247pub fn visit_item_existential<'ast, V: Visit<'ast> + ?Sized>(
2248 _visitor: &mut V,
2249 _i: &'ast ItemExistential,
2250) {
2251 for it in &_i.attrs {
2252 _visitor.visit_attribute(it)
2253 }
2254 _visitor.visit_visibility(&_i.vis);
2255 tokens_helper(_visitor, &_i.existential_token.span);
2256 tokens_helper(_visitor, &_i.type_token.span);
2257 _visitor.visit_ident(&_i.ident);
2258 _visitor.visit_generics(&_i.generics);
2259 if let Some(ref it) = _i.colon_token {
2260 tokens_helper(_visitor, &it.spans)
2261 };
2262 for el in Punctuated::pairs(&_i.bounds) {
2263 let it = el.value();
2264 _visitor.visit_type_param_bound(it)
2265 }
2266 tokens_helper(_visitor, &_i.semi_token.spans);
2267}
2268#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07002269pub fn visit_item_extern_crate<'ast, V: Visit<'ast> + ?Sized>(
2270 _visitor: &mut V,
2271 _i: &'ast ItemExternCrate,
2272) {
2273 for it in &_i.attrs {
2274 _visitor.visit_attribute(it)
2275 }
2276 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002277 tokens_helper(_visitor, &_i.extern_token.span);
2278 tokens_helper(_visitor, &_i.crate_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002279 _visitor.visit_ident(&_i.ident);
2280 if let Some(ref it) = _i.rename {
David Tolnay7ac699c2018-08-24 14:00:58 -04002281 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002282 _visitor.visit_ident(&(it).1);
2283 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002284 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnayc6b55bc2017-11-09 22:48:38 -08002285}
David Tolnay8c81f622018-07-31 23:34:35 -07002286#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002287pub fn visit_item_fn<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemFn) {
David Tolnay8c81f622018-07-31 23:34:35 -07002288 for it in &_i.attrs {
2289 _visitor.visit_attribute(it)
2290 }
2291 _visitor.visit_visibility(&_i.vis);
2292 if let Some(ref it) = _i.constness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002293 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002294 };
2295 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002296 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002297 };
Yusuke Sasakif00a3ef2018-07-20 22:08:42 +09002298 if let Some(ref it) = _i.asyncness {
2299 tokens_helper(_visitor, &it.span)
2300 };
David Tolnay8c81f622018-07-31 23:34:35 -07002301 if let Some(ref it) = _i.abi {
2302 _visitor.visit_abi(it)
2303 };
2304 _visitor.visit_ident(&_i.ident);
2305 _visitor.visit_fn_decl(&*_i.decl);
2306 _visitor.visit_block(&*_i.block);
David Tolnayc6b55bc2017-11-09 22:48:38 -08002307}
David Tolnay8c81f622018-07-31 23:34:35 -07002308#[cfg(feature = "full")]
2309pub fn visit_item_foreign_mod<'ast, V: Visit<'ast> + ?Sized>(
2310 _visitor: &mut V,
2311 _i: &'ast ItemForeignMod,
2312) {
2313 for it in &_i.attrs {
2314 _visitor.visit_attribute(it)
2315 }
2316 _visitor.visit_abi(&_i.abi);
David Tolnay7ac699c2018-08-24 14:00:58 -04002317 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002318 for it in &_i.items {
2319 _visitor.visit_foreign_item(it)
2320 }
David Tolnayc6b55bc2017-11-09 22:48:38 -08002321}
David Tolnay8c81f622018-07-31 23:34:35 -07002322#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002323pub fn visit_item_impl<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemImpl) {
David Tolnay8c81f622018-07-31 23:34:35 -07002324 for it in &_i.attrs {
2325 _visitor.visit_attribute(it)
2326 }
2327 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002328 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002329 };
2330 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002331 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002332 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002333 tokens_helper(_visitor, &_i.impl_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002334 _visitor.visit_generics(&_i.generics);
2335 if let Some(ref it) = _i.trait_ {
2336 if let Some(ref it) = (it).0 {
David Tolnay7ac699c2018-08-24 14:00:58 -04002337 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002338 };
2339 _visitor.visit_path(&(it).1);
David Tolnay7ac699c2018-08-24 14:00:58 -04002340 tokens_helper(_visitor, &(it).2.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002341 };
2342 _visitor.visit_type(&*_i.self_ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002343 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002344 for it in &_i.items {
2345 _visitor.visit_impl_item(it)
2346 }
David Tolnayc6b55bc2017-11-09 22:48:38 -08002347}
David Tolnay8c81f622018-07-31 23:34:35 -07002348#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002349pub fn visit_item_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemMacro) {
David Tolnay8c81f622018-07-31 23:34:35 -07002350 for it in &_i.attrs {
2351 _visitor.visit_attribute(it)
2352 }
2353 if let Some(ref it) = _i.ident {
2354 _visitor.visit_ident(it)
2355 };
2356 _visitor.visit_macro(&_i.mac);
2357 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002358 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002359 };
David Tolnayc6b55bc2017-11-09 22:48:38 -08002360}
David Tolnay8c81f622018-07-31 23:34:35 -07002361#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002362pub fn visit_item_macro2<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemMacro2) {
David Tolnay8c81f622018-07-31 23:34:35 -07002363 for it in &_i.attrs {
2364 _visitor.visit_attribute(it)
2365 }
2366 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002367 tokens_helper(_visitor, &_i.macro_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002368 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002369 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay6af48992018-08-01 11:16:28 -07002370 skip!(_i.args);
David Tolnay7ac699c2018-08-24 14:00:58 -04002371 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay6af48992018-08-01 11:16:28 -07002372 skip!(_i.body);
David Tolnay500d8322017-12-18 00:32:51 -08002373}
David Tolnay8c81f622018-07-31 23:34:35 -07002374#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002375pub fn visit_item_mod<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemMod) {
David Tolnay8c81f622018-07-31 23:34:35 -07002376 for it in &_i.attrs {
2377 _visitor.visit_attribute(it)
2378 }
2379 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002380 tokens_helper(_visitor, &_i.mod_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002381 _visitor.visit_ident(&_i.ident);
2382 if let Some(ref it) = _i.content {
David Tolnay7ac699c2018-08-24 14:00:58 -04002383 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002384 for it in &(it).1 {
2385 _visitor.visit_item(it)
2386 }
2387 };
2388 if let Some(ref it) = _i.semi {
David Tolnay7ac699c2018-08-24 14:00:58 -04002389 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002390 };
Nika Layzell27726662017-10-24 23:16:35 -04002391}
David Tolnay8c81f622018-07-31 23:34:35 -07002392#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002393pub fn visit_item_static<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemStatic) {
David Tolnay8c81f622018-07-31 23:34:35 -07002394 for it in &_i.attrs {
2395 _visitor.visit_attribute(it)
2396 }
2397 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002398 tokens_helper(_visitor, &_i.static_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002399 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04002400 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002401 };
2402 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002403 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002404 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002405 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002406 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04002407 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002408}
David Tolnay8c81f622018-07-31 23:34:35 -07002409#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002410pub fn visit_item_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemStruct) {
David Tolnay8c81f622018-07-31 23:34:35 -07002411 for it in &_i.attrs {
2412 _visitor.visit_attribute(it)
2413 }
2414 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002415 tokens_helper(_visitor, &_i.struct_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002416 _visitor.visit_ident(&_i.ident);
2417 _visitor.visit_generics(&_i.generics);
2418 _visitor.visit_fields(&_i.fields);
2419 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002420 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002421 };
Nika Layzell27726662017-10-24 23:16:35 -04002422}
David Tolnay8c81f622018-07-31 23:34:35 -07002423#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002424pub fn visit_item_trait<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemTrait) {
David Tolnay8c81f622018-07-31 23:34:35 -07002425 for it in &_i.attrs {
2426 _visitor.visit_attribute(it)
2427 }
2428 _visitor.visit_visibility(&_i.vis);
2429 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002430 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002431 };
2432 if let Some(ref it) = _i.auto_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002433 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002434 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002435 tokens_helper(_visitor, &_i.trait_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002436 _visitor.visit_ident(&_i.ident);
2437 _visitor.visit_generics(&_i.generics);
2438 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002439 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002440 };
2441 for el in Punctuated::pairs(&_i.supertraits) {
2442 let it = el.value();
2443 _visitor.visit_type_param_bound(it)
2444 }
David Tolnay7ac699c2018-08-24 14:00:58 -04002445 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002446 for it in &_i.items {
2447 _visitor.visit_trait_item(it)
2448 }
Nika Layzell27726662017-10-24 23:16:35 -04002449}
David Tolnay8c81f622018-07-31 23:34:35 -07002450#[cfg(feature = "full")]
David Tolnayc6b04dd2018-08-30 23:22:51 -07002451pub fn visit_item_trait_alias<'ast, V: Visit<'ast> + ?Sized>(
2452 _visitor: &mut V,
2453 _i: &'ast ItemTraitAlias,
2454) {
2455 for it in &_i.attrs {
2456 _visitor.visit_attribute(it)
2457 }
2458 _visitor.visit_visibility(&_i.vis);
2459 tokens_helper(_visitor, &_i.trait_token.span);
2460 _visitor.visit_ident(&_i.ident);
2461 _visitor.visit_generics(&_i.generics);
2462 tokens_helper(_visitor, &_i.eq_token.spans);
2463 for el in Punctuated::pairs(&_i.bounds) {
2464 let it = el.value();
2465 _visitor.visit_type_param_bound(it)
2466 }
2467 tokens_helper(_visitor, &_i.semi_token.spans);
2468}
2469#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002470pub fn visit_item_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemType) {
David Tolnay8c81f622018-07-31 23:34:35 -07002471 for it in &_i.attrs {
2472 _visitor.visit_attribute(it)
2473 }
2474 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002475 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002476 _visitor.visit_ident(&_i.ident);
2477 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04002478 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002479 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002480 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002481}
David Tolnay8c81f622018-07-31 23:34:35 -07002482#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002483pub fn visit_item_union<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemUnion) {
David Tolnay8c81f622018-07-31 23:34:35 -07002484 for it in &_i.attrs {
2485 _visitor.visit_attribute(it)
2486 }
2487 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002488 tokens_helper(_visitor, &_i.union_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002489 _visitor.visit_ident(&_i.ident);
2490 _visitor.visit_generics(&_i.generics);
2491 _visitor.visit_fields_named(&_i.fields);
Nika Layzell27726662017-10-24 23:16:35 -04002492}
David Tolnay8c81f622018-07-31 23:34:35 -07002493#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002494pub fn visit_item_use<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemUse) {
David Tolnay8c81f622018-07-31 23:34:35 -07002495 for it in &_i.attrs {
2496 _visitor.visit_attribute(it)
2497 }
2498 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002499 tokens_helper(_visitor, &_i.use_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002500 if let Some(ref it) = _i.leading_colon {
David Tolnay7ac699c2018-08-24 14:00:58 -04002501 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002502 };
2503 _visitor.visit_use_tree(&_i.tree);
David Tolnay7ac699c2018-08-24 14:00:58 -04002504 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002505}
David Tolnay8c81f622018-07-31 23:34:35 -07002506#[cfg(feature = "full")]
2507pub fn visit_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
2508 _visitor: &mut V,
2509 _i: &'ast ItemVerbatim,
2510) {
David Tolnay6af48992018-08-01 11:16:28 -07002511 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05002512}
David Tolnay8c81f622018-07-31 23:34:35 -07002513#[cfg(any(feature = "full", feature = "derive"))]
2514#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002515pub fn visit_label<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Label) {
David Tolnay8c81f622018-07-31 23:34:35 -07002516 _visitor.visit_lifetime(&_i.name);
David Tolnay7ac699c2018-08-24 14:00:58 -04002517 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnaybcd498f2017-12-29 12:02:33 -05002518}
David Tolnay4b4c4b62018-01-06 13:48:05 -08002519pub fn visit_lifetime<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Lifetime) {
David Tolnay17f63892018-08-31 10:36:32 -07002520 _visitor.visit_span(&_i.apostrophe);
David Tolnay8c81f622018-07-31 23:34:35 -07002521 _visitor.visit_ident(&_i.ident);
David Tolnay4ba63a02017-12-28 15:53:05 -05002522}
David Tolnay8c81f622018-07-31 23:34:35 -07002523#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002524pub fn visit_lifetime_def<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LifetimeDef) {
David Tolnay8c81f622018-07-31 23:34:35 -07002525 for it in &_i.attrs {
2526 _visitor.visit_attribute(it)
2527 }
2528 _visitor.visit_lifetime(&_i.lifetime);
2529 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002530 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002531 };
2532 for el in Punctuated::pairs(&_i.bounds) {
2533 let it = el.value();
2534 _visitor.visit_lifetime(it)
2535 }
David Tolnay4ba63a02017-12-28 15:53:05 -05002536}
David Tolnay8c81f622018-07-31 23:34:35 -07002537#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002538pub fn visit_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Lit) {
David Tolnay360efd22018-01-04 23:35:26 -08002539 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002540 Lit::Str(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002541 _visitor.visit_lit_str(_binding_0);
2542 }
David Tolnay8c81f622018-07-31 23:34:35 -07002543 Lit::ByteStr(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002544 _visitor.visit_lit_byte_str(_binding_0);
2545 }
David Tolnay8c81f622018-07-31 23:34:35 -07002546 Lit::Byte(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002547 _visitor.visit_lit_byte(_binding_0);
2548 }
David Tolnay8c81f622018-07-31 23:34:35 -07002549 Lit::Char(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002550 _visitor.visit_lit_char(_binding_0);
2551 }
David Tolnay8c81f622018-07-31 23:34:35 -07002552 Lit::Int(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002553 _visitor.visit_lit_int(_binding_0);
2554 }
David Tolnay8c81f622018-07-31 23:34:35 -07002555 Lit::Float(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002556 _visitor.visit_lit_float(_binding_0);
2557 }
David Tolnay8c81f622018-07-31 23:34:35 -07002558 Lit::Bool(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002559 _visitor.visit_lit_bool(_binding_0);
2560 }
David Tolnay8c81f622018-07-31 23:34:35 -07002561 Lit::Verbatim(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002562 _visitor.visit_lit_verbatim(_binding_0);
2563 }
2564 }
2565}
David Tolnay8c81f622018-07-31 23:34:35 -07002566#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002567pub fn visit_lit_bool<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitBool) {
David Tolnay6af48992018-08-01 11:16:28 -07002568 skip!(_i.value);
David Tolnay8c81f622018-07-31 23:34:35 -07002569 _visitor.visit_span(&_i.span);
Nika Layzell27726662017-10-24 23:16:35 -04002570}
David Tolnay8c81f622018-07-31 23:34:35 -07002571#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002572pub fn visit_lit_byte<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitByte) {
David Tolnay6af48992018-08-01 11:16:28 -07002573 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002574}
David Tolnay8c81f622018-07-31 23:34:35 -07002575#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002576pub fn visit_lit_byte_str<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitByteStr) {
David Tolnay6af48992018-08-01 11:16:28 -07002577 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002578}
David Tolnay8c81f622018-07-31 23:34:35 -07002579#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002580pub fn visit_lit_char<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitChar) {
David Tolnay6af48992018-08-01 11:16:28 -07002581 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002582}
David Tolnay8c81f622018-07-31 23:34:35 -07002583#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002584pub fn visit_lit_float<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitFloat) {
David Tolnay6af48992018-08-01 11:16:28 -07002585 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002586}
David Tolnay8c81f622018-07-31 23:34:35 -07002587#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002588pub fn visit_lit_int<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitInt) {
David Tolnay6af48992018-08-01 11:16:28 -07002589 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002590}
David Tolnay8c81f622018-07-31 23:34:35 -07002591#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002592pub fn visit_lit_str<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitStr) {
David Tolnay6af48992018-08-01 11:16:28 -07002593 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002594}
David Tolnay8c81f622018-07-31 23:34:35 -07002595#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002596pub fn visit_lit_verbatim<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitVerbatim) {
David Tolnay6af48992018-08-01 11:16:28 -07002597 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002598}
David Tolnay8c81f622018-07-31 23:34:35 -07002599#[cfg(any(feature = "full", feature = "derive"))]
2600#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002601pub fn visit_local<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Local) {
David Tolnay8c81f622018-07-31 23:34:35 -07002602 for it in &_i.attrs {
2603 _visitor.visit_attribute(it)
2604 }
David Tolnay7ac699c2018-08-24 14:00:58 -04002605 tokens_helper(_visitor, &_i.let_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002606 for el in Punctuated::pairs(&_i.pats) {
2607 let it = el.value();
2608 _visitor.visit_pat(it)
2609 }
2610 if let Some(ref it) = _i.ty {
David Tolnay7ac699c2018-08-24 14:00:58 -04002611 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002612 _visitor.visit_type(&*(it).1);
2613 };
2614 if let Some(ref it) = _i.init {
David Tolnay7ac699c2018-08-24 14:00:58 -04002615 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002616 _visitor.visit_expr(&*(it).1);
2617 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002618 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002619}
David Tolnay8c81f622018-07-31 23:34:35 -07002620#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002621pub fn visit_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Macro) {
David Tolnay8c81f622018-07-31 23:34:35 -07002622 _visitor.visit_path(&_i.path);
David Tolnay7ac699c2018-08-24 14:00:58 -04002623 tokens_helper(_visitor, &_i.bang_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002624 _visitor.visit_macro_delimiter(&_i.delimiter);
David Tolnay6af48992018-08-01 11:16:28 -07002625 skip!(_i.tts);
David Tolnayab919512017-12-30 23:31:51 -05002626}
David Tolnay8c81f622018-07-31 23:34:35 -07002627#[cfg(any(feature = "full", feature = "derive"))]
2628pub fn visit_macro_delimiter<'ast, V: Visit<'ast> + ?Sized>(
2629 _visitor: &mut V,
2630 _i: &'ast MacroDelimiter,
2631) {
David Tolnayab919512017-12-30 23:31:51 -05002632 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002633 MacroDelimiter::Paren(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002634 tokens_helper(_visitor, &_binding_0.span);
David Tolnayab919512017-12-30 23:31:51 -05002635 }
David Tolnay8c81f622018-07-31 23:34:35 -07002636 MacroDelimiter::Brace(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002637 tokens_helper(_visitor, &_binding_0.span);
David Tolnayab919512017-12-30 23:31:51 -05002638 }
David Tolnay8c81f622018-07-31 23:34:35 -07002639 MacroDelimiter::Bracket(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002640 tokens_helper(_visitor, &_binding_0.span);
David Tolnayab919512017-12-30 23:31:51 -05002641 }
2642 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002643}
David Tolnay8c81f622018-07-31 23:34:35 -07002644#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002645pub fn visit_member<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Member) {
David Tolnay85b69a42017-12-27 20:43:10 -05002646 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002647 Member::Named(ref _binding_0) => {
Alex Crichtond261d092018-05-18 13:47:35 -07002648 _visitor.visit_ident(_binding_0);
David Tolnay85b69a42017-12-27 20:43:10 -05002649 }
David Tolnay8c81f622018-07-31 23:34:35 -07002650 Member::Unnamed(ref _binding_0) => {
David Tolnay85b69a42017-12-27 20:43:10 -05002651 _visitor.visit_index(_binding_0);
2652 }
2653 }
2654}
David Tolnay8c81f622018-07-31 23:34:35 -07002655#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayaaadd782018-01-06 22:58:13 -08002656pub fn visit_meta<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Meta) {
Nika Layzell27726662017-10-24 23:16:35 -04002657 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002658 Meta::Word(ref _binding_0) => {
Alex Crichtond261d092018-05-18 13:47:35 -07002659 _visitor.visit_ident(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002660 }
David Tolnay8c81f622018-07-31 23:34:35 -07002661 Meta::List(ref _binding_0) => {
David Tolnayaaadd782018-01-06 22:58:13 -08002662 _visitor.visit_meta_list(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002663 }
David Tolnay8c81f622018-07-31 23:34:35 -07002664 Meta::NameValue(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002665 _visitor.visit_meta_name_value(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002666 }
2667 }
2668}
David Tolnay8c81f622018-07-31 23:34:35 -07002669#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayaaadd782018-01-06 22:58:13 -08002670pub fn visit_meta_list<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast MetaList) {
David Tolnay8c81f622018-07-31 23:34:35 -07002671 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002672 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002673 for el in Punctuated::pairs(&_i.nested) {
2674 let it = el.value();
2675 _visitor.visit_nested_meta(it)
2676 }
Nika Layzell27726662017-10-24 23:16:35 -04002677}
David Tolnay8c81f622018-07-31 23:34:35 -07002678#[cfg(any(feature = "full", feature = "derive"))]
2679pub fn visit_meta_name_value<'ast, V: Visit<'ast> + ?Sized>(
2680 _visitor: &mut V,
2681 _i: &'ast MetaNameValue,
2682) {
2683 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002684 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002685 _visitor.visit_lit(&_i.lit);
Nika Layzell27726662017-10-24 23:16:35 -04002686}
David Tolnay8c81f622018-07-31 23:34:35 -07002687#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002688pub fn visit_method_sig<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast MethodSig) {
David Tolnay8c81f622018-07-31 23:34:35 -07002689 if let Some(ref it) = _i.constness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002690 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002691 };
2692 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002693 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002694 };
Yusuke Sasakif00a3ef2018-07-20 22:08:42 +09002695 if let Some(ref it) = _i.asyncness {
2696 tokens_helper(_visitor, &it.span)
2697 };
David Tolnay8c81f622018-07-31 23:34:35 -07002698 if let Some(ref it) = _i.abi {
2699 _visitor.visit_abi(it)
2700 };
2701 _visitor.visit_ident(&_i.ident);
2702 _visitor.visit_fn_decl(&_i.decl);
Nika Layzell27726662017-10-24 23:16:35 -04002703}
David Tolnay8c81f622018-07-31 23:34:35 -07002704#[cfg(any(feature = "full", feature = "derive"))]
2705#[cfg(feature = "full")]
2706pub fn visit_method_turbofish<'ast, V: Visit<'ast> + ?Sized>(
2707 _visitor: &mut V,
2708 _i: &'ast MethodTurbofish,
2709) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002710 tokens_helper(_visitor, &_i.colon2_token.spans);
2711 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002712 for el in Punctuated::pairs(&_i.args) {
2713 let it = el.value();
2714 _visitor.visit_generic_method_argument(it)
2715 }
David Tolnay7ac699c2018-08-24 14:00:58 -04002716 tokens_helper(_visitor, &_i.gt_token.spans);
David Tolnayd60cfec2017-12-29 00:21:38 -05002717}
David Tolnay8c81f622018-07-31 23:34:35 -07002718#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayaaadd782018-01-06 22:58:13 -08002719pub fn visit_nested_meta<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast NestedMeta) {
Nika Layzell27726662017-10-24 23:16:35 -04002720 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002721 NestedMeta::Meta(ref _binding_0) => {
David Tolnayaaadd782018-01-06 22:58:13 -08002722 _visitor.visit_meta(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002723 }
David Tolnay8c81f622018-07-31 23:34:35 -07002724 NestedMeta::Literal(ref _binding_0) => {
David Tolnay4ba63a02017-12-28 15:53:05 -05002725 _visitor.visit_lit(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002726 }
2727 }
2728}
David Tolnay8c81f622018-07-31 23:34:35 -07002729#[cfg(any(feature = "full", feature = "derive"))]
2730pub fn visit_parenthesized_generic_arguments<'ast, V: Visit<'ast> + ?Sized>(
2731 _visitor: &mut V,
2732 _i: &'ast ParenthesizedGenericArguments,
2733) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002734 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002735 for el in Punctuated::pairs(&_i.inputs) {
2736 let it = el.value();
2737 _visitor.visit_type(it)
2738 }
2739 _visitor.visit_return_type(&_i.output);
Nika Layzell27726662017-10-24 23:16:35 -04002740}
David Tolnay8c81f622018-07-31 23:34:35 -07002741#[cfg(any(feature = "full", feature = "derive"))]
2742#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002743pub fn visit_pat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Pat) {
Nika Layzell27726662017-10-24 23:16:35 -04002744 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002745 Pat::Wild(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002746 _visitor.visit_pat_wild(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002747 }
David Tolnay8c81f622018-07-31 23:34:35 -07002748 Pat::Ident(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002749 _visitor.visit_pat_ident(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002750 }
David Tolnay8c81f622018-07-31 23:34:35 -07002751 Pat::Struct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002752 _visitor.visit_pat_struct(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002753 }
David Tolnay8c81f622018-07-31 23:34:35 -07002754 Pat::TupleStruct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002755 _visitor.visit_pat_tuple_struct(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002756 }
David Tolnay8c81f622018-07-31 23:34:35 -07002757 Pat::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002758 _visitor.visit_pat_path(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002759 }
David Tolnay8c81f622018-07-31 23:34:35 -07002760 Pat::Tuple(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002761 _visitor.visit_pat_tuple(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002762 }
David Tolnay8c81f622018-07-31 23:34:35 -07002763 Pat::Box(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002764 _visitor.visit_pat_box(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002765 }
David Tolnay8c81f622018-07-31 23:34:35 -07002766 Pat::Ref(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002767 _visitor.visit_pat_ref(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002768 }
David Tolnay8c81f622018-07-31 23:34:35 -07002769 Pat::Lit(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002770 _visitor.visit_pat_lit(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002771 }
David Tolnay8c81f622018-07-31 23:34:35 -07002772 Pat::Range(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002773 _visitor.visit_pat_range(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002774 }
David Tolnay8c81f622018-07-31 23:34:35 -07002775 Pat::Slice(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002776 _visitor.visit_pat_slice(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002777 }
David Tolnay8c81f622018-07-31 23:34:35 -07002778 Pat::Macro(ref _binding_0) => {
David Tolnay323279a2017-12-29 11:26:32 -05002779 _visitor.visit_pat_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002780 }
David Tolnay8c81f622018-07-31 23:34:35 -07002781 Pat::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002782 _visitor.visit_pat_verbatim(_binding_0);
2783 }
Nika Layzell27726662017-10-24 23:16:35 -04002784 }
2785}
David Tolnay8c81f622018-07-31 23:34:35 -07002786#[cfg(any(feature = "full", feature = "derive"))]
2787#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002788pub fn visit_pat_box<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatBox) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002789 tokens_helper(_visitor, &_i.box_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002790 _visitor.visit_pat(&*_i.pat);
Nika Layzell27726662017-10-24 23:16:35 -04002791}
David Tolnay8c81f622018-07-31 23:34:35 -07002792#[cfg(any(feature = "full", feature = "derive"))]
2793#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002794pub fn visit_pat_ident<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatIdent) {
David Tolnay8c81f622018-07-31 23:34:35 -07002795 if let Some(ref it) = _i.by_ref {
David Tolnay7ac699c2018-08-24 14:00:58 -04002796 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002797 };
2798 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04002799 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002800 };
2801 _visitor.visit_ident(&_i.ident);
2802 if let Some(ref it) = _i.subpat {
David Tolnay7ac699c2018-08-24 14:00:58 -04002803 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002804 _visitor.visit_pat(&*(it).1);
2805 };
Nika Layzell27726662017-10-24 23:16:35 -04002806}
David Tolnay8c81f622018-07-31 23:34:35 -07002807#[cfg(any(feature = "full", feature = "derive"))]
2808#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002809pub fn visit_pat_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatLit) {
David Tolnay8c81f622018-07-31 23:34:35 -07002810 _visitor.visit_expr(&*_i.expr);
Nika Layzell27726662017-10-24 23:16:35 -04002811}
David Tolnay8c81f622018-07-31 23:34:35 -07002812#[cfg(any(feature = "full", feature = "derive"))]
2813#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002814pub fn visit_pat_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatMacro) {
David Tolnay8c81f622018-07-31 23:34:35 -07002815 _visitor.visit_macro(&_i.mac);
David Tolnay323279a2017-12-29 11:26:32 -05002816}
David Tolnay8c81f622018-07-31 23:34:35 -07002817#[cfg(any(feature = "full", feature = "derive"))]
2818#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002819pub fn visit_pat_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatPath) {
David Tolnay8c81f622018-07-31 23:34:35 -07002820 if let Some(ref it) = _i.qself {
2821 _visitor.visit_qself(it)
2822 };
2823 _visitor.visit_path(&_i.path);
Nika Layzell27726662017-10-24 23:16:35 -04002824}
David Tolnay8c81f622018-07-31 23:34:35 -07002825#[cfg(any(feature = "full", feature = "derive"))]
2826#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002827pub fn visit_pat_range<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatRange) {
David Tolnay8c81f622018-07-31 23:34:35 -07002828 _visitor.visit_expr(&*_i.lo);
2829 _visitor.visit_range_limits(&_i.limits);
2830 _visitor.visit_expr(&*_i.hi);
Nika Layzell27726662017-10-24 23:16:35 -04002831}
David Tolnay8c81f622018-07-31 23:34:35 -07002832#[cfg(any(feature = "full", feature = "derive"))]
2833#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002834pub fn visit_pat_ref<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatRef) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002835 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002836 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04002837 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002838 };
2839 _visitor.visit_pat(&*_i.pat);
Nika Layzell27726662017-10-24 23:16:35 -04002840}
David Tolnay8c81f622018-07-31 23:34:35 -07002841#[cfg(any(feature = "full", feature = "derive"))]
2842#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002843pub fn visit_pat_slice<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatSlice) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002844 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002845 for el in Punctuated::pairs(&_i.front) {
2846 let it = el.value();
2847 _visitor.visit_pat(it)
2848 }
2849 if let Some(ref it) = _i.middle {
2850 _visitor.visit_pat(&**it)
2851 };
2852 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002853 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002854 };
2855 if let Some(ref it) = _i.comma_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002856 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002857 };
2858 for el in Punctuated::pairs(&_i.back) {
2859 let it = el.value();
2860 _visitor.visit_pat(it)
2861 }
Nika Layzell27726662017-10-24 23:16:35 -04002862}
David Tolnay8c81f622018-07-31 23:34:35 -07002863#[cfg(any(feature = "full", feature = "derive"))]
2864#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002865pub fn visit_pat_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatStruct) {
David Tolnay8c81f622018-07-31 23:34:35 -07002866 _visitor.visit_path(&_i.path);
David Tolnay7ac699c2018-08-24 14:00:58 -04002867 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002868 for el in Punctuated::pairs(&_i.fields) {
2869 let it = el.value();
2870 _visitor.visit_field_pat(it)
2871 }
2872 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002873 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002874 };
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")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002878pub fn visit_pat_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatTuple) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002879 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002880 for el in Punctuated::pairs(&_i.front) {
2881 let it = el.value();
2882 _visitor.visit_pat(it)
2883 }
2884 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002885 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002886 };
2887 if let Some(ref it) = _i.comma_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002888 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002889 };
2890 for el in Punctuated::pairs(&_i.back) {
2891 let it = el.value();
2892 _visitor.visit_pat(it)
2893 }
Nika Layzell27726662017-10-24 23:16:35 -04002894}
David Tolnay8c81f622018-07-31 23:34:35 -07002895#[cfg(any(feature = "full", feature = "derive"))]
2896#[cfg(feature = "full")]
2897pub fn visit_pat_tuple_struct<'ast, V: Visit<'ast> + ?Sized>(
2898 _visitor: &mut V,
2899 _i: &'ast PatTupleStruct,
2900) {
2901 _visitor.visit_path(&_i.path);
2902 _visitor.visit_pat_tuple(&_i.pat);
Nika Layzell27726662017-10-24 23:16:35 -04002903}
David Tolnay8c81f622018-07-31 23:34:35 -07002904#[cfg(any(feature = "full", feature = "derive"))]
2905#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002906pub fn visit_pat_verbatim<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatVerbatim) {
David Tolnay6af48992018-08-01 11:16:28 -07002907 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05002908}
David Tolnay8c81f622018-07-31 23:34:35 -07002909#[cfg(any(feature = "full", feature = "derive"))]
2910#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002911pub fn visit_pat_wild<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatWild) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002912 tokens_helper(_visitor, &_i.underscore_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002913}
David Tolnay8c81f622018-07-31 23:34:35 -07002914#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002915pub fn visit_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Path) {
David Tolnay8c81f622018-07-31 23:34:35 -07002916 if let Some(ref it) = _i.leading_colon {
David Tolnay7ac699c2018-08-24 14:00:58 -04002917 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002918 };
2919 for el in Punctuated::pairs(&_i.segments) {
2920 let it = el.value();
2921 _visitor.visit_path_segment(it)
2922 }
Nika Layzell27726662017-10-24 23:16:35 -04002923}
David Tolnay8c81f622018-07-31 23:34:35 -07002924#[cfg(any(feature = "full", feature = "derive"))]
2925pub fn visit_path_arguments<'ast, V: Visit<'ast> + ?Sized>(
2926 _visitor: &mut V,
2927 _i: &'ast PathArguments,
2928) {
Nika Layzellc08227a2017-12-04 16:30:17 -05002929 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002930 PathArguments::None => {}
2931 PathArguments::AngleBracketed(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002932 _visitor.visit_angle_bracketed_generic_arguments(_binding_0);
Nika Layzellc08227a2017-12-04 16:30:17 -05002933 }
David Tolnay8c81f622018-07-31 23:34:35 -07002934 PathArguments::Parenthesized(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002935 _visitor.visit_parenthesized_generic_arguments(_binding_0);
Nika Layzellc08227a2017-12-04 16:30:17 -05002936 }
2937 }
2938}
David Tolnay8c81f622018-07-31 23:34:35 -07002939#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002940pub fn visit_path_segment<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PathSegment) {
David Tolnay8c81f622018-07-31 23:34:35 -07002941 _visitor.visit_ident(&_i.ident);
2942 _visitor.visit_path_arguments(&_i.arguments);
Nika Layzell27726662017-10-24 23:16:35 -04002943}
David Tolnay8c81f622018-07-31 23:34:35 -07002944#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002945pub fn visit_predicate_eq<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PredicateEq) {
David Tolnay8c81f622018-07-31 23:34:35 -07002946 _visitor.visit_type(&_i.lhs_ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002947 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002948 _visitor.visit_type(&_i.rhs_ty);
David Tolnayd4add852018-01-01 20:13:24 -08002949}
David Tolnay8c81f622018-07-31 23:34:35 -07002950#[cfg(any(feature = "full", feature = "derive"))]
2951pub fn visit_predicate_lifetime<'ast, V: Visit<'ast> + ?Sized>(
2952 _visitor: &mut V,
2953 _i: &'ast PredicateLifetime,
2954) {
2955 _visitor.visit_lifetime(&_i.lifetime);
David Tolnay1b8e2852018-08-26 08:25:18 -04002956 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002957 for el in Punctuated::pairs(&_i.bounds) {
2958 let it = el.value();
2959 _visitor.visit_lifetime(it)
2960 }
David Tolnayd4add852018-01-01 20:13:24 -08002961}
David Tolnay8c81f622018-07-31 23:34:35 -07002962#[cfg(any(feature = "full", feature = "derive"))]
2963pub fn visit_predicate_type<'ast, V: Visit<'ast> + ?Sized>(
2964 _visitor: &mut V,
2965 _i: &'ast PredicateType,
2966) {
2967 if let Some(ref it) = _i.lifetimes {
2968 _visitor.visit_bound_lifetimes(it)
2969 };
2970 _visitor.visit_type(&_i.bounded_ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002971 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002972 for el in Punctuated::pairs(&_i.bounds) {
2973 let it = el.value();
2974 _visitor.visit_type_param_bound(it)
2975 }
David Tolnayd4add852018-01-01 20:13:24 -08002976}
David Tolnay8c81f622018-07-31 23:34:35 -07002977#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002978pub fn visit_qself<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast QSelf) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002979 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002980 _visitor.visit_type(&*_i.ty);
David Tolnay6af48992018-08-01 11:16:28 -07002981 skip!(_i.position);
David Tolnay8c81f622018-07-31 23:34:35 -07002982 if let Some(ref it) = _i.as_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002983 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002984 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002985 tokens_helper(_visitor, &_i.gt_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002986}
David Tolnay8c81f622018-07-31 23:34:35 -07002987#[cfg(any(feature = "full", feature = "derive"))]
2988#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002989pub fn visit_range_limits<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast RangeLimits) {
Nika Layzell27726662017-10-24 23:16:35 -04002990 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002991 RangeLimits::HalfOpen(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002992 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002993 }
David Tolnay8c81f622018-07-31 23:34:35 -07002994 RangeLimits::Closed(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002995 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002996 }
2997 }
2998}
David Tolnay8c81f622018-07-31 23:34:35 -07002999#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003000pub fn visit_return_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ReturnType) {
David Tolnayf93b90d2017-11-11 19:21:26 -08003001 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003002 ReturnType::Default => {}
3003 ReturnType::Type(ref _binding_0, ref _binding_1) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003004 tokens_helper(_visitor, &_binding_0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003005 _visitor.visit_type(&**_binding_1);
David Tolnayf93b90d2017-11-11 19:21:26 -08003006 }
3007 }
3008}
David Tolnay8c81f622018-07-31 23:34:35 -07003009pub fn visit_span<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Span) {}
3010#[cfg(any(feature = "full", feature = "derive"))]
3011#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003012pub fn visit_stmt<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Stmt) {
Nika Layzell27726662017-10-24 23:16:35 -04003013 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003014 Stmt::Local(ref _binding_0) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08003015 _visitor.visit_local(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003016 }
David Tolnay8c81f622018-07-31 23:34:35 -07003017 Stmt::Item(ref _binding_0) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08003018 _visitor.visit_item(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003019 }
David Tolnay8c81f622018-07-31 23:34:35 -07003020 Stmt::Expr(ref _binding_0) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08003021 _visitor.visit_expr(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003022 }
David Tolnay8c81f622018-07-31 23:34:35 -07003023 Stmt::Semi(ref _binding_0, ref _binding_1) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08003024 _visitor.visit_expr(_binding_0);
David Tolnay7ac699c2018-08-24 14:00:58 -04003025 tokens_helper(_visitor, &_binding_1.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003026 }
Nika Layzell27726662017-10-24 23:16:35 -04003027 }
3028}
David Tolnay8c81f622018-07-31 23:34:35 -07003029#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003030pub fn visit_trait_bound<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TraitBound) {
David Tolnay8c81f622018-07-31 23:34:35 -07003031 if let Some(ref it) = _i.paren_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003032 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003033 };
3034 _visitor.visit_trait_bound_modifier(&_i.modifier);
3035 if let Some(ref it) = _i.lifetimes {
3036 _visitor.visit_bound_lifetimes(it)
3037 };
3038 _visitor.visit_path(&_i.path);
David Tolnay40fb8ce2018-01-02 10:53:46 -08003039}
David Tolnay8c81f622018-07-31 23:34:35 -07003040#[cfg(any(feature = "full", feature = "derive"))]
3041pub fn visit_trait_bound_modifier<'ast, V: Visit<'ast> + ?Sized>(
3042 _visitor: &mut V,
3043 _i: &'ast TraitBoundModifier,
3044) {
Nika Layzell27726662017-10-24 23:16:35 -04003045 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003046 TraitBoundModifier::None => {}
3047 TraitBoundModifier::Maybe(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003048 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003049 }
3050 }
3051}
David Tolnay8c81f622018-07-31 23:34:35 -07003052#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003053pub fn visit_trait_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TraitItem) {
Nika Layzell27726662017-10-24 23:16:35 -04003054 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003055 TraitItem::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003056 _visitor.visit_trait_item_const(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003057 }
David Tolnay8c81f622018-07-31 23:34:35 -07003058 TraitItem::Method(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003059 _visitor.visit_trait_item_method(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003060 }
David Tolnay8c81f622018-07-31 23:34:35 -07003061 TraitItem::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003062 _visitor.visit_trait_item_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003063 }
David Tolnay8c81f622018-07-31 23:34:35 -07003064 TraitItem::Macro(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003065 _visitor.visit_trait_item_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003066 }
David Tolnay8c81f622018-07-31 23:34:35 -07003067 TraitItem::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05003068 _visitor.visit_trait_item_verbatim(_binding_0);
3069 }
Nika Layzell27726662017-10-24 23:16:35 -04003070 }
3071}
David Tolnay8c81f622018-07-31 23:34:35 -07003072#[cfg(feature = "full")]
3073pub fn visit_trait_item_const<'ast, V: Visit<'ast> + ?Sized>(
3074 _visitor: &mut V,
3075 _i: &'ast TraitItemConst,
3076) {
3077 for it in &_i.attrs {
3078 _visitor.visit_attribute(it)
3079 }
David Tolnay7ac699c2018-08-24 14:00:58 -04003080 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003081 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04003082 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003083 _visitor.visit_type(&_i.ty);
3084 if let Some(ref it) = _i.default {
David Tolnay7ac699c2018-08-24 14:00:58 -04003085 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003086 _visitor.visit_expr(&(it).1);
3087 };
David Tolnay7ac699c2018-08-24 14:00:58 -04003088 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnayda705bd2017-11-10 21:58:05 -08003089}
David Tolnay8c81f622018-07-31 23:34:35 -07003090#[cfg(feature = "full")]
3091pub fn visit_trait_item_macro<'ast, V: Visit<'ast> + ?Sized>(
3092 _visitor: &mut V,
3093 _i: &'ast TraitItemMacro,
3094) {
3095 for it in &_i.attrs {
3096 _visitor.visit_attribute(it)
3097 }
3098 _visitor.visit_macro(&_i.mac);
3099 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003100 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003101 };
David Tolnayda705bd2017-11-10 21:58:05 -08003102}
David Tolnay8c81f622018-07-31 23:34:35 -07003103#[cfg(feature = "full")]
3104pub fn visit_trait_item_method<'ast, V: Visit<'ast> + ?Sized>(
3105 _visitor: &mut V,
3106 _i: &'ast TraitItemMethod,
3107) {
3108 for it in &_i.attrs {
3109 _visitor.visit_attribute(it)
3110 }
3111 _visitor.visit_method_sig(&_i.sig);
3112 if let Some(ref it) = _i.default {
3113 _visitor.visit_block(it)
3114 };
3115 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003116 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003117 };
Nika Layzell27726662017-10-24 23:16:35 -04003118}
David Tolnay8c81f622018-07-31 23:34:35 -07003119#[cfg(feature = "full")]
3120pub fn visit_trait_item_type<'ast, V: Visit<'ast> + ?Sized>(
3121 _visitor: &mut V,
3122 _i: &'ast TraitItemType,
3123) {
3124 for it in &_i.attrs {
3125 _visitor.visit_attribute(it)
3126 }
David Tolnay7ac699c2018-08-24 14:00:58 -04003127 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003128 _visitor.visit_ident(&_i.ident);
3129 _visitor.visit_generics(&_i.generics);
3130 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003131 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003132 };
3133 for el in Punctuated::pairs(&_i.bounds) {
3134 let it = el.value();
3135 _visitor.visit_type_param_bound(it)
3136 }
3137 if let Some(ref it) = _i.default {
David Tolnay7ac699c2018-08-24 14:00:58 -04003138 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003139 _visitor.visit_type(&(it).1);
3140 };
David Tolnay7ac699c2018-08-24 14:00:58 -04003141 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003142}
David Tolnay8c81f622018-07-31 23:34:35 -07003143#[cfg(feature = "full")]
3144pub fn visit_trait_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
3145 _visitor: &mut V,
3146 _i: &'ast TraitItemVerbatim,
3147) {
David Tolnay6af48992018-08-01 11:16:28 -07003148 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05003149}
David Tolnay8c81f622018-07-31 23:34:35 -07003150#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003151pub fn visit_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Type) {
Nika Layzell27726662017-10-24 23:16:35 -04003152 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003153 Type::Slice(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003154 _visitor.visit_type_slice(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003155 }
David Tolnay8c81f622018-07-31 23:34:35 -07003156 Type::Array(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003157 _visitor.visit_type_array(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003158 }
David Tolnay8c81f622018-07-31 23:34:35 -07003159 Type::Ptr(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003160 _visitor.visit_type_ptr(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003161 }
David Tolnay8c81f622018-07-31 23:34:35 -07003162 Type::Reference(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003163 _visitor.visit_type_reference(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003164 }
David Tolnay8c81f622018-07-31 23:34:35 -07003165 Type::BareFn(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003166 _visitor.visit_type_bare_fn(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003167 }
David Tolnay8c81f622018-07-31 23:34:35 -07003168 Type::Never(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003169 _visitor.visit_type_never(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003170 }
David Tolnay8c81f622018-07-31 23:34:35 -07003171 Type::Tuple(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003172 _visitor.visit_type_tuple(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003173 }
David Tolnay8c81f622018-07-31 23:34:35 -07003174 Type::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003175 _visitor.visit_type_path(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003176 }
David Tolnay8c81f622018-07-31 23:34:35 -07003177 Type::TraitObject(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003178 _visitor.visit_type_trait_object(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003179 }
David Tolnay8c81f622018-07-31 23:34:35 -07003180 Type::ImplTrait(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003181 _visitor.visit_type_impl_trait(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003182 }
David Tolnay8c81f622018-07-31 23:34:35 -07003183 Type::Paren(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003184 _visitor.visit_type_paren(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003185 }
David Tolnay8c81f622018-07-31 23:34:35 -07003186 Type::Group(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003187 _visitor.visit_type_group(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003188 }
David Tolnay8c81f622018-07-31 23:34:35 -07003189 Type::Infer(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003190 _visitor.visit_type_infer(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003191 }
David Tolnay8c81f622018-07-31 23:34:35 -07003192 Type::Macro(ref _binding_0) => {
David Tolnay323279a2017-12-29 11:26:32 -05003193 _visitor.visit_type_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003194 }
David Tolnay8c81f622018-07-31 23:34:35 -07003195 Type::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05003196 _visitor.visit_type_verbatim(_binding_0);
3197 }
Nika Layzell27726662017-10-24 23:16:35 -04003198 }
3199}
David Tolnay8c81f622018-07-31 23:34:35 -07003200#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003201pub fn visit_type_array<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeArray) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003202 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003203 _visitor.visit_type(&*_i.elem);
David Tolnay7ac699c2018-08-24 14:00:58 -04003204 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003205 _visitor.visit_expr(&_i.len);
Nika Layzell27726662017-10-24 23:16:35 -04003206}
David Tolnay8c81f622018-07-31 23:34:35 -07003207#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003208pub fn visit_type_bare_fn<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeBareFn) {
David Tolnay3779bb72018-08-26 18:46:07 -07003209 if let Some(ref it) = _i.lifetimes {
3210 _visitor.visit_bound_lifetimes(it)
3211 };
David Tolnay8c81f622018-07-31 23:34:35 -07003212 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04003213 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003214 };
3215 if let Some(ref it) = _i.abi {
3216 _visitor.visit_abi(it)
3217 };
David Tolnay7ac699c2018-08-24 14:00:58 -04003218 tokens_helper(_visitor, &_i.fn_token.span);
David Tolnay7ac699c2018-08-24 14:00:58 -04003219 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003220 for el in Punctuated::pairs(&_i.inputs) {
3221 let it = el.value();
3222 _visitor.visit_bare_fn_arg(it)
3223 }
3224 if let Some(ref it) = _i.variadic {
David Tolnay7ac699c2018-08-24 14:00:58 -04003225 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003226 };
3227 _visitor.visit_return_type(&_i.output);
Nika Layzell27726662017-10-24 23:16:35 -04003228}
David Tolnay8c81f622018-07-31 23:34:35 -07003229#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003230pub fn visit_type_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeGroup) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003231 tokens_helper(_visitor, &_i.group_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003232 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003233}
David Tolnay8c81f622018-07-31 23:34:35 -07003234#[cfg(any(feature = "full", feature = "derive"))]
3235pub fn visit_type_impl_trait<'ast, V: Visit<'ast> + ?Sized>(
3236 _visitor: &mut V,
3237 _i: &'ast TypeImplTrait,
3238) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003239 tokens_helper(_visitor, &_i.impl_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003240 for el in Punctuated::pairs(&_i.bounds) {
3241 let it = el.value();
3242 _visitor.visit_type_param_bound(it)
3243 }
Nika Layzell27726662017-10-24 23:16:35 -04003244}
David Tolnay8c81f622018-07-31 23:34:35 -07003245#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003246pub fn visit_type_infer<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeInfer) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003247 tokens_helper(_visitor, &_i.underscore_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003248}
David Tolnay8c81f622018-07-31 23:34:35 -07003249#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003250pub fn visit_type_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeMacro) {
David Tolnay8c81f622018-07-31 23:34:35 -07003251 _visitor.visit_macro(&_i.mac);
David Tolnay323279a2017-12-29 11:26:32 -05003252}
David Tolnay8c81f622018-07-31 23:34:35 -07003253#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003254pub fn visit_type_never<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeNever) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003255 tokens_helper(_visitor, &_i.bang_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003256}
David Tolnay8c81f622018-07-31 23:34:35 -07003257#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003258pub fn visit_type_param<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeParam) {
David Tolnay8c81f622018-07-31 23:34:35 -07003259 for it in &_i.attrs {
3260 _visitor.visit_attribute(it)
3261 }
3262 _visitor.visit_ident(&_i.ident);
3263 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003264 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003265 };
3266 for el in Punctuated::pairs(&_i.bounds) {
3267 let it = el.value();
3268 _visitor.visit_type_param_bound(it)
3269 }
3270 if let Some(ref it) = _i.eq_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003271 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003272 };
3273 if let Some(ref it) = _i.default {
3274 _visitor.visit_type(it)
3275 };
Nika Layzell27726662017-10-24 23:16:35 -04003276}
David Tolnay8c81f622018-07-31 23:34:35 -07003277#[cfg(any(feature = "full", feature = "derive"))]
3278pub fn visit_type_param_bound<'ast, V: Visit<'ast> + ?Sized>(
3279 _visitor: &mut V,
3280 _i: &'ast TypeParamBound,
3281) {
Nika Layzell27726662017-10-24 23:16:35 -04003282 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003283 TypeParamBound::Trait(ref _binding_0) => {
David Tolnay40fb8ce2018-01-02 10:53:46 -08003284 _visitor.visit_trait_bound(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003285 }
David Tolnay8c81f622018-07-31 23:34:35 -07003286 TypeParamBound::Lifetime(ref _binding_0) => {
David Tolnay4ba63a02017-12-28 15:53:05 -05003287 _visitor.visit_lifetime(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003288 }
3289 }
3290}
David Tolnay8c81f622018-07-31 23:34:35 -07003291#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003292pub fn visit_type_paren<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeParen) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003293 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003294 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003295}
David Tolnay8c81f622018-07-31 23:34:35 -07003296#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003297pub fn visit_type_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypePath) {
David Tolnay8c81f622018-07-31 23:34:35 -07003298 if let Some(ref it) = _i.qself {
3299 _visitor.visit_qself(it)
3300 };
3301 _visitor.visit_path(&_i.path);
Nika Layzell27726662017-10-24 23:16:35 -04003302}
David Tolnay8c81f622018-07-31 23:34:35 -07003303#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003304pub fn visit_type_ptr<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypePtr) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003305 tokens_helper(_visitor, &_i.star_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003306 if let Some(ref it) = _i.const_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003307 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003308 };
3309 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04003310 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003311 };
3312 _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_reference<'ast, V: Visit<'ast> + ?Sized>(
3316 _visitor: &mut V,
3317 _i: &'ast TypeReference,
3318) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003319 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003320 if let Some(ref it) = _i.lifetime {
3321 _visitor.visit_lifetime(it)
3322 };
3323 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04003324 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003325 };
3326 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003327}
David Tolnay8c81f622018-07-31 23:34:35 -07003328#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003329pub fn visit_type_slice<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeSlice) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003330 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003331 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003332}
David Tolnay8c81f622018-07-31 23:34:35 -07003333#[cfg(any(feature = "full", feature = "derive"))]
3334pub fn visit_type_trait_object<'ast, V: Visit<'ast> + ?Sized>(
3335 _visitor: &mut V,
3336 _i: &'ast TypeTraitObject,
3337) {
3338 if let Some(ref it) = _i.dyn_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003339 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003340 };
3341 for el in Punctuated::pairs(&_i.bounds) {
3342 let it = el.value();
3343 _visitor.visit_type_param_bound(it)
3344 }
Nika Layzell27726662017-10-24 23:16:35 -04003345}
David Tolnay8c81f622018-07-31 23:34:35 -07003346#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003347pub fn visit_type_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeTuple) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003348 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003349 for el in Punctuated::pairs(&_i.elems) {
3350 let it = el.value();
3351 _visitor.visit_type(it)
3352 }
Nika Layzell27726662017-10-24 23:16:35 -04003353}
David Tolnay8c81f622018-07-31 23:34:35 -07003354#[cfg(any(feature = "full", feature = "derive"))]
3355pub fn visit_type_verbatim<'ast, V: Visit<'ast> + ?Sized>(
3356 _visitor: &mut V,
3357 _i: &'ast TypeVerbatim,
3358) {
David Tolnay6af48992018-08-01 11:16:28 -07003359 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05003360}
David Tolnay8c81f622018-07-31 23:34:35 -07003361#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003362pub fn visit_un_op<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UnOp) {
Nika Layzell27726662017-10-24 23:16:35 -04003363 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003364 UnOp::Deref(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003365 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003366 }
David Tolnay8c81f622018-07-31 23:34:35 -07003367 UnOp::Not(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003368 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003369 }
David Tolnay8c81f622018-07-31 23:34:35 -07003370 UnOp::Neg(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003371 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003372 }
3373 }
3374}
David Tolnay8c81f622018-07-31 23:34:35 -07003375#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003376pub fn visit_use_glob<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseGlob) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003377 tokens_helper(_visitor, &_i.star_token.spans);
David Tolnay5f332a92017-12-26 00:42:45 -05003378}
David Tolnay8c81f622018-07-31 23:34:35 -07003379#[cfg(feature = "full")]
David Tolnayd97a7d22018-03-31 19:17:01 +02003380pub fn visit_use_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseGroup) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003381 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003382 for el in Punctuated::pairs(&_i.items) {
3383 let it = el.value();
3384 _visitor.visit_use_tree(it)
3385 }
David Tolnay5f332a92017-12-26 00:42:45 -05003386}
David Tolnay8c81f622018-07-31 23:34:35 -07003387#[cfg(feature = "full")]
David Tolnayd97a7d22018-03-31 19:17:01 +02003388pub fn visit_use_name<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseName) {
David Tolnay8c81f622018-07-31 23:34:35 -07003389 _visitor.visit_ident(&_i.ident);
David Tolnayd97a7d22018-03-31 19:17:01 +02003390}
David Tolnay8c81f622018-07-31 23:34:35 -07003391#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003392pub fn visit_use_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UsePath) {
David Tolnay8c81f622018-07-31 23:34:35 -07003393 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04003394 tokens_helper(_visitor, &_i.colon2_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003395 _visitor.visit_use_tree(&*_i.tree);
David Tolnayd97a7d22018-03-31 19:17:01 +02003396}
David Tolnay8c81f622018-07-31 23:34:35 -07003397#[cfg(feature = "full")]
David Tolnayd97a7d22018-03-31 19:17:01 +02003398pub fn visit_use_rename<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseRename) {
David Tolnay8c81f622018-07-31 23:34:35 -07003399 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04003400 tokens_helper(_visitor, &_i.as_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003401 _visitor.visit_ident(&_i.rename);
David Tolnay5f332a92017-12-26 00:42:45 -05003402}
David Tolnay8c81f622018-07-31 23:34:35 -07003403#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003404pub fn visit_use_tree<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseTree) {
David Tolnay5f332a92017-12-26 00:42:45 -05003405 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003406 UseTree::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003407 _visitor.visit_use_path(_binding_0);
David Tolnay5f332a92017-12-26 00:42:45 -05003408 }
David Tolnay8c81f622018-07-31 23:34:35 -07003409 UseTree::Name(ref _binding_0) => {
David Tolnayd97a7d22018-03-31 19:17:01 +02003410 _visitor.visit_use_name(_binding_0);
3411 }
David Tolnay8c81f622018-07-31 23:34:35 -07003412 UseTree::Rename(ref _binding_0) => {
David Tolnayd97a7d22018-03-31 19:17:01 +02003413 _visitor.visit_use_rename(_binding_0);
3414 }
David Tolnay8c81f622018-07-31 23:34:35 -07003415 UseTree::Glob(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003416 _visitor.visit_use_glob(_binding_0);
David Tolnay5f332a92017-12-26 00:42:45 -05003417 }
David Tolnay8c81f622018-07-31 23:34:35 -07003418 UseTree::Group(ref _binding_0) => {
David Tolnayd97a7d22018-03-31 19:17:01 +02003419 _visitor.visit_use_group(_binding_0);
David Tolnay5f332a92017-12-26 00:42:45 -05003420 }
3421 }
3422}
David Tolnay8c81f622018-07-31 23:34:35 -07003423#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003424pub fn visit_variant<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Variant) {
David Tolnay8c81f622018-07-31 23:34:35 -07003425 for it in &_i.attrs {
3426 _visitor.visit_attribute(it)
3427 }
3428 _visitor.visit_ident(&_i.ident);
3429 _visitor.visit_fields(&_i.fields);
3430 if let Some(ref it) = _i.discriminant {
David Tolnay7ac699c2018-08-24 14:00:58 -04003431 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003432 _visitor.visit_expr(&(it).1);
3433 };
Nika Layzell27726662017-10-24 23:16:35 -04003434}
David Tolnay8c81f622018-07-31 23:34:35 -07003435#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003436pub fn visit_vis_crate<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast VisCrate) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003437 tokens_helper(_visitor, &_i.crate_token.span);
Nika Layzell27726662017-10-24 23:16:35 -04003438}
David Tolnay8c81f622018-07-31 23:34:35 -07003439#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003440pub fn visit_vis_public<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast VisPublic) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003441 tokens_helper(_visitor, &_i.pub_token.span);
Nika Layzell27726662017-10-24 23:16:35 -04003442}
David Tolnay8c81f622018-07-31 23:34:35 -07003443#[cfg(any(feature = "full", feature = "derive"))]
3444pub fn visit_vis_restricted<'ast, V: Visit<'ast> + ?Sized>(
3445 _visitor: &mut V,
3446 _i: &'ast VisRestricted,
3447) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003448 tokens_helper(_visitor, &_i.pub_token.span);
3449 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003450 if let Some(ref it) = _i.in_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003451 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003452 };
3453 _visitor.visit_path(&*_i.path);
Nika Layzell27726662017-10-24 23:16:35 -04003454}
David Tolnay8c81f622018-07-31 23:34:35 -07003455#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003456pub fn visit_visibility<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Visibility) {
Nika Layzell27726662017-10-24 23:16:35 -04003457 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003458 Visibility::Public(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003459 _visitor.visit_vis_public(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003460 }
David Tolnay8c81f622018-07-31 23:34:35 -07003461 Visibility::Crate(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003462 _visitor.visit_vis_crate(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003463 }
David Tolnay8c81f622018-07-31 23:34:35 -07003464 Visibility::Restricted(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003465 _visitor.visit_vis_restricted(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003466 }
David Tolnay8c81f622018-07-31 23:34:35 -07003467 Visibility::Inherited => {}
Nika Layzell27726662017-10-24 23:16:35 -04003468 }
3469}
David Tolnay8c81f622018-07-31 23:34:35 -07003470#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003471pub fn visit_where_clause<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast WhereClause) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003472 tokens_helper(_visitor, &_i.where_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003473 for el in Punctuated::pairs(&_i.predicates) {
3474 let it = el.value();
3475 _visitor.visit_where_predicate(it)
3476 }
Nika Layzell27726662017-10-24 23:16:35 -04003477}
David Tolnay8c81f622018-07-31 23:34:35 -07003478#[cfg(any(feature = "full", feature = "derive"))]
3479pub fn visit_where_predicate<'ast, V: Visit<'ast> + ?Sized>(
3480 _visitor: &mut V,
3481 _i: &'ast WherePredicate,
3482) {
Nika Layzell27726662017-10-24 23:16:35 -04003483 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003484 WherePredicate::Type(ref _binding_0) => {
David Tolnayd4add852018-01-01 20:13:24 -08003485 _visitor.visit_predicate_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003486 }
David Tolnay8c81f622018-07-31 23:34:35 -07003487 WherePredicate::Lifetime(ref _binding_0) => {
David Tolnayd4add852018-01-01 20:13:24 -08003488 _visitor.visit_predicate_lifetime(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003489 }
David Tolnay8c81f622018-07-31 23:34:35 -07003490 WherePredicate::Eq(ref _binding_0) => {
David Tolnayd4add852018-01-01 20:13:24 -08003491 _visitor.visit_predicate_eq(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003492 }
3493 }
3494}