blob: 6bf7a68b77300f165d7d126f4f2017e96b924043 [file] [log] [blame]
Nika Layzell27726662017-10-24 23:16:35 -04001// THIS FILE IS AUTOMATICALLY GENERATED; DO NOT EDIT
2
David Tolnayf0d63bf2017-12-26 12:29:47 -05003#![cfg_attr(feature = "cargo-clippy", allow(match_same_arms))]
David Tolnay0a0d78c2018-01-05 15:24:01 -08004#[cfg(any(feature = "full", feature = "derive"))]
David Tolnaycc0f0372017-12-28 19:11:04 -05005use gen::helper::visit::*;
David Tolnay8c81f622018-07-31 23:34:35 -07006use proc_macro2::Span;
7#[cfg(any(feature = "full", feature = "derive"))]
8use punctuated::Punctuated;
9use *;
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040010#[cfg(feature = "full")]
11macro_rules! full {
David Tolnay280202f2018-08-02 00:29:54 -070012 ($e:expr) => {
David Tolnay8c81f622018-07-31 23:34:35 -070013 $e
14 };
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040015}
David Tolnay0a0d78c2018-01-05 15:24:01 -080016#[cfg(all(feature = "derive", not(feature = "full")))]
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040017macro_rules! full {
David Tolnay280202f2018-08-02 00:29:54 -070018 ($e:expr) => {
David Tolnay8c81f622018-07-31 23:34:35 -070019 unreachable!()
20 };
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040021}
David Tolnay6af48992018-08-01 11:16:28 -070022#[cfg(any(feature = "full", feature = "derive"))]
23macro_rules! skip {
David Tolnay280202f2018-08-02 00:29:54 -070024 ($($tt:tt)*) => {};
David Tolnay6af48992018-08-01 11:16:28 -070025}
26#[doc = r" Syntax tree traversal to walk a shared borrow of a syntax tree."]
27#[doc = r""]
28#[doc = r" See the [module documentation] for details."]
29#[doc = r""]
30#[doc = r" [module documentation]: index.html"]
31#[doc = r""]
32#[doc = r#" *This trait is available if Syn is built with the `"visit"` feature.*"#]
David Tolnay4b4c4b62018-01-06 13:48:05 -080033pub trait Visit<'ast> {
David Tolnay8c81f622018-07-31 23:34:35 -070034 #[cfg(any(feature = "full", feature = "derive"))]
35 fn visit_abi(&mut self, i: &'ast Abi) {
36 visit_abi(self, i)
37 }
38 #[cfg(any(feature = "full", feature = "derive"))]
39 fn visit_angle_bracketed_generic_arguments(&mut self, i: &'ast AngleBracketedGenericArguments) {
40 visit_angle_bracketed_generic_arguments(self, i)
41 }
42 #[cfg(feature = "full")]
43 fn visit_arg_captured(&mut self, i: &'ast ArgCaptured) {
44 visit_arg_captured(self, i)
45 }
46 #[cfg(feature = "full")]
47 fn visit_arg_self(&mut self, i: &'ast ArgSelf) {
48 visit_arg_self(self, i)
49 }
50 #[cfg(feature = "full")]
51 fn visit_arg_self_ref(&mut self, i: &'ast ArgSelfRef) {
52 visit_arg_self_ref(self, i)
53 }
54 #[cfg(any(feature = "full", feature = "derive"))]
55 #[cfg(feature = "full")]
56 fn visit_arm(&mut self, i: &'ast Arm) {
57 visit_arm(self, i)
58 }
59 #[cfg(any(feature = "full", feature = "derive"))]
60 fn visit_attr_style(&mut self, i: &'ast AttrStyle) {
61 visit_attr_style(self, i)
62 }
63 #[cfg(any(feature = "full", feature = "derive"))]
64 fn visit_attribute(&mut self, i: &'ast Attribute) {
65 visit_attribute(self, i)
66 }
67 #[cfg(any(feature = "full", feature = "derive"))]
68 fn visit_bare_fn_arg(&mut self, i: &'ast BareFnArg) {
69 visit_bare_fn_arg(self, i)
70 }
71 #[cfg(any(feature = "full", feature = "derive"))]
72 fn visit_bare_fn_arg_name(&mut self, i: &'ast BareFnArgName) {
73 visit_bare_fn_arg_name(self, i)
74 }
75 #[cfg(any(feature = "full", feature = "derive"))]
76 fn visit_bin_op(&mut self, i: &'ast BinOp) {
77 visit_bin_op(self, i)
78 }
79 #[cfg(any(feature = "full", feature = "derive"))]
80 fn visit_binding(&mut self, i: &'ast Binding) {
81 visit_binding(self, i)
82 }
83 #[cfg(any(feature = "full", feature = "derive"))]
84 #[cfg(feature = "full")]
85 fn visit_block(&mut self, i: &'ast Block) {
86 visit_block(self, i)
87 }
88 #[cfg(any(feature = "full", feature = "derive"))]
89 fn visit_bound_lifetimes(&mut self, i: &'ast BoundLifetimes) {
90 visit_bound_lifetimes(self, i)
91 }
92 #[cfg(any(feature = "full", feature = "derive"))]
93 fn visit_const_param(&mut self, i: &'ast ConstParam) {
94 visit_const_param(self, i)
95 }
96 #[cfg(feature = "derive")]
97 fn visit_data(&mut self, i: &'ast Data) {
98 visit_data(self, i)
99 }
100 #[cfg(feature = "derive")]
101 fn visit_data_enum(&mut self, i: &'ast DataEnum) {
102 visit_data_enum(self, i)
103 }
104 #[cfg(feature = "derive")]
105 fn visit_data_struct(&mut self, i: &'ast DataStruct) {
106 visit_data_struct(self, i)
107 }
108 #[cfg(feature = "derive")]
109 fn visit_data_union(&mut self, i: &'ast DataUnion) {
110 visit_data_union(self, i)
111 }
112 #[cfg(feature = "derive")]
113 fn visit_derive_input(&mut self, i: &'ast DeriveInput) {
114 visit_derive_input(self, i)
115 }
116 #[cfg(any(feature = "full", feature = "derive"))]
117 fn visit_expr(&mut self, i: &'ast Expr) {
118 visit_expr(self, i)
119 }
120 #[cfg(feature = "full")]
121 #[cfg(any(feature = "full", feature = "derive"))]
122 fn visit_expr_array(&mut self, i: &'ast ExprArray) {
123 visit_expr_array(self, i)
124 }
125 #[cfg(feature = "full")]
126 #[cfg(any(feature = "full", feature = "derive"))]
127 fn visit_expr_assign(&mut self, i: &'ast ExprAssign) {
128 visit_expr_assign(self, i)
129 }
130 #[cfg(feature = "full")]
131 #[cfg(any(feature = "full", feature = "derive"))]
132 fn visit_expr_assign_op(&mut self, i: &'ast ExprAssignOp) {
133 visit_expr_assign_op(self, i)
134 }
David Tolnay02a9c6f2018-08-24 18:58:45 -0400135 #[cfg(feature = "full")]
136 #[cfg(any(feature = "full", feature = "derive"))]
137 fn visit_expr_async(&mut self, i: &'ast ExprAsync) {
138 visit_expr_async(self, i)
139 }
David Tolnay8c81f622018-07-31 23:34:35 -0700140 #[cfg(any(feature = "full", feature = "derive"))]
141 fn visit_expr_binary(&mut self, i: &'ast ExprBinary) {
142 visit_expr_binary(self, i)
143 }
144 #[cfg(feature = "full")]
145 #[cfg(any(feature = "full", feature = "derive"))]
146 fn visit_expr_block(&mut self, i: &'ast ExprBlock) {
147 visit_expr_block(self, i)
148 }
149 #[cfg(feature = "full")]
150 #[cfg(any(feature = "full", feature = "derive"))]
151 fn visit_expr_box(&mut self, i: &'ast ExprBox) {
152 visit_expr_box(self, i)
153 }
154 #[cfg(feature = "full")]
155 #[cfg(any(feature = "full", feature = "derive"))]
156 fn visit_expr_break(&mut self, i: &'ast ExprBreak) {
157 visit_expr_break(self, i)
158 }
159 #[cfg(any(feature = "full", feature = "derive"))]
160 fn visit_expr_call(&mut self, i: &'ast ExprCall) {
161 visit_expr_call(self, i)
162 }
163 #[cfg(any(feature = "full", feature = "derive"))]
164 fn visit_expr_cast(&mut self, i: &'ast ExprCast) {
165 visit_expr_cast(self, i)
166 }
167 #[cfg(feature = "full")]
168 #[cfg(any(feature = "full", feature = "derive"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700169 fn visit_expr_closure(&mut self, i: &'ast ExprClosure) {
170 visit_expr_closure(self, i)
171 }
172 #[cfg(feature = "full")]
173 #[cfg(any(feature = "full", feature = "derive"))]
174 fn visit_expr_continue(&mut self, i: &'ast ExprContinue) {
175 visit_expr_continue(self, i)
176 }
177 #[cfg(any(feature = "full", feature = "derive"))]
178 fn visit_expr_field(&mut self, i: &'ast ExprField) {
179 visit_expr_field(self, i)
180 }
181 #[cfg(feature = "full")]
182 #[cfg(any(feature = "full", feature = "derive"))]
183 fn visit_expr_for_loop(&mut self, i: &'ast ExprForLoop) {
184 visit_expr_for_loop(self, i)
185 }
186 #[cfg(feature = "full")]
187 #[cfg(any(feature = "full", feature = "derive"))]
188 fn visit_expr_group(&mut self, i: &'ast ExprGroup) {
189 visit_expr_group(self, i)
190 }
191 #[cfg(feature = "full")]
192 #[cfg(any(feature = "full", feature = "derive"))]
193 fn visit_expr_if(&mut self, i: &'ast ExprIf) {
194 visit_expr_if(self, i)
195 }
196 #[cfg(feature = "full")]
197 #[cfg(any(feature = "full", feature = "derive"))]
198 fn visit_expr_if_let(&mut self, i: &'ast ExprIfLet) {
199 visit_expr_if_let(self, i)
200 }
201 #[cfg(feature = "full")]
202 #[cfg(any(feature = "full", feature = "derive"))]
203 fn visit_expr_in_place(&mut self, i: &'ast ExprInPlace) {
204 visit_expr_in_place(self, i)
205 }
206 #[cfg(any(feature = "full", feature = "derive"))]
207 fn visit_expr_index(&mut self, i: &'ast ExprIndex) {
208 visit_expr_index(self, i)
209 }
210 #[cfg(any(feature = "full", feature = "derive"))]
211 fn visit_expr_lit(&mut self, i: &'ast ExprLit) {
212 visit_expr_lit(self, i)
213 }
214 #[cfg(feature = "full")]
215 #[cfg(any(feature = "full", feature = "derive"))]
216 fn visit_expr_loop(&mut self, i: &'ast ExprLoop) {
217 visit_expr_loop(self, i)
218 }
219 #[cfg(feature = "full")]
220 #[cfg(any(feature = "full", feature = "derive"))]
221 fn visit_expr_macro(&mut self, i: &'ast ExprMacro) {
222 visit_expr_macro(self, i)
223 }
224 #[cfg(feature = "full")]
225 #[cfg(any(feature = "full", feature = "derive"))]
226 fn visit_expr_match(&mut self, i: &'ast ExprMatch) {
227 visit_expr_match(self, i)
228 }
229 #[cfg(feature = "full")]
230 #[cfg(any(feature = "full", feature = "derive"))]
231 fn visit_expr_method_call(&mut self, i: &'ast ExprMethodCall) {
232 visit_expr_method_call(self, i)
233 }
234 #[cfg(any(feature = "full", feature = "derive"))]
235 fn visit_expr_paren(&mut self, i: &'ast ExprParen) {
236 visit_expr_paren(self, i)
237 }
238 #[cfg(any(feature = "full", feature = "derive"))]
239 fn visit_expr_path(&mut self, i: &'ast ExprPath) {
240 visit_expr_path(self, i)
241 }
242 #[cfg(feature = "full")]
243 #[cfg(any(feature = "full", feature = "derive"))]
244 fn visit_expr_range(&mut self, i: &'ast ExprRange) {
245 visit_expr_range(self, i)
246 }
247 #[cfg(feature = "full")]
248 #[cfg(any(feature = "full", feature = "derive"))]
249 fn visit_expr_reference(&mut self, i: &'ast ExprReference) {
250 visit_expr_reference(self, i)
251 }
252 #[cfg(feature = "full")]
253 #[cfg(any(feature = "full", feature = "derive"))]
254 fn visit_expr_repeat(&mut self, i: &'ast ExprRepeat) {
255 visit_expr_repeat(self, i)
256 }
257 #[cfg(feature = "full")]
258 #[cfg(any(feature = "full", feature = "derive"))]
259 fn visit_expr_return(&mut self, i: &'ast ExprReturn) {
260 visit_expr_return(self, i)
261 }
262 #[cfg(feature = "full")]
263 #[cfg(any(feature = "full", feature = "derive"))]
264 fn visit_expr_struct(&mut self, i: &'ast ExprStruct) {
265 visit_expr_struct(self, i)
266 }
267 #[cfg(feature = "full")]
268 #[cfg(any(feature = "full", feature = "derive"))]
269 fn visit_expr_try(&mut self, i: &'ast ExprTry) {
270 visit_expr_try(self, i)
271 }
272 #[cfg(feature = "full")]
273 #[cfg(any(feature = "full", feature = "derive"))]
David Tolnayfb2dd4b2018-08-24 16:45:34 -0400274 fn visit_expr_try_block(&mut self, i: &'ast ExprTryBlock) {
275 visit_expr_try_block(self, i)
276 }
277 #[cfg(feature = "full")]
278 #[cfg(any(feature = "full", feature = "derive"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700279 fn visit_expr_tuple(&mut self, i: &'ast ExprTuple) {
280 visit_expr_tuple(self, i)
281 }
282 #[cfg(feature = "full")]
283 #[cfg(any(feature = "full", feature = "derive"))]
284 fn visit_expr_type(&mut self, i: &'ast ExprType) {
285 visit_expr_type(self, i)
286 }
287 #[cfg(any(feature = "full", feature = "derive"))]
288 fn visit_expr_unary(&mut self, i: &'ast ExprUnary) {
289 visit_expr_unary(self, i)
290 }
291 #[cfg(feature = "full")]
292 #[cfg(any(feature = "full", feature = "derive"))]
293 fn visit_expr_unsafe(&mut self, i: &'ast ExprUnsafe) {
294 visit_expr_unsafe(self, i)
295 }
296 #[cfg(any(feature = "full", feature = "derive"))]
297 fn visit_expr_verbatim(&mut self, i: &'ast ExprVerbatim) {
298 visit_expr_verbatim(self, i)
299 }
300 #[cfg(feature = "full")]
301 #[cfg(any(feature = "full", feature = "derive"))]
302 fn visit_expr_while(&mut self, i: &'ast ExprWhile) {
303 visit_expr_while(self, i)
304 }
305 #[cfg(feature = "full")]
306 #[cfg(any(feature = "full", feature = "derive"))]
307 fn visit_expr_while_let(&mut self, i: &'ast ExprWhileLet) {
308 visit_expr_while_let(self, i)
309 }
310 #[cfg(feature = "full")]
311 #[cfg(any(feature = "full", feature = "derive"))]
312 fn visit_expr_yield(&mut self, i: &'ast ExprYield) {
313 visit_expr_yield(self, i)
314 }
315 #[cfg(any(feature = "full", feature = "derive"))]
316 fn visit_field(&mut self, i: &'ast Field) {
317 visit_field(self, i)
318 }
319 #[cfg(any(feature = "full", feature = "derive"))]
320 #[cfg(feature = "full")]
321 fn visit_field_pat(&mut self, i: &'ast FieldPat) {
322 visit_field_pat(self, i)
323 }
324 #[cfg(any(feature = "full", feature = "derive"))]
325 #[cfg(feature = "full")]
326 fn visit_field_value(&mut self, i: &'ast FieldValue) {
327 visit_field_value(self, i)
328 }
329 #[cfg(any(feature = "full", feature = "derive"))]
330 fn visit_fields(&mut self, i: &'ast Fields) {
331 visit_fields(self, i)
332 }
333 #[cfg(any(feature = "full", feature = "derive"))]
334 fn visit_fields_named(&mut self, i: &'ast FieldsNamed) {
335 visit_fields_named(self, i)
336 }
337 #[cfg(any(feature = "full", feature = "derive"))]
338 fn visit_fields_unnamed(&mut self, i: &'ast FieldsUnnamed) {
339 visit_fields_unnamed(self, i)
340 }
341 #[cfg(feature = "full")]
342 fn visit_file(&mut self, i: &'ast File) {
343 visit_file(self, i)
344 }
345 #[cfg(feature = "full")]
346 fn visit_fn_arg(&mut self, i: &'ast FnArg) {
347 visit_fn_arg(self, i)
348 }
349 #[cfg(feature = "full")]
350 fn visit_fn_decl(&mut self, i: &'ast FnDecl) {
351 visit_fn_decl(self, i)
352 }
353 #[cfg(feature = "full")]
354 fn visit_foreign_item(&mut self, i: &'ast ForeignItem) {
355 visit_foreign_item(self, i)
356 }
357 #[cfg(feature = "full")]
358 fn visit_foreign_item_fn(&mut self, i: &'ast ForeignItemFn) {
359 visit_foreign_item_fn(self, i)
360 }
361 #[cfg(feature = "full")]
David Tolnay435c1782018-08-24 16:15:44 -0400362 fn visit_foreign_item_macro(&mut self, i: &'ast ForeignItemMacro) {
363 visit_foreign_item_macro(self, i)
364 }
365 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700366 fn visit_foreign_item_static(&mut self, i: &'ast ForeignItemStatic) {
367 visit_foreign_item_static(self, i)
368 }
369 #[cfg(feature = "full")]
370 fn visit_foreign_item_type(&mut self, i: &'ast ForeignItemType) {
371 visit_foreign_item_type(self, i)
372 }
373 #[cfg(feature = "full")]
374 fn visit_foreign_item_verbatim(&mut self, i: &'ast ForeignItemVerbatim) {
375 visit_foreign_item_verbatim(self, i)
376 }
377 #[cfg(any(feature = "full", feature = "derive"))]
378 fn visit_generic_argument(&mut self, i: &'ast GenericArgument) {
379 visit_generic_argument(self, i)
380 }
381 #[cfg(any(feature = "full", feature = "derive"))]
382 #[cfg(feature = "full")]
383 fn visit_generic_method_argument(&mut self, i: &'ast GenericMethodArgument) {
384 visit_generic_method_argument(self, i)
385 }
386 #[cfg(any(feature = "full", feature = "derive"))]
387 fn visit_generic_param(&mut self, i: &'ast GenericParam) {
388 visit_generic_param(self, i)
389 }
390 #[cfg(any(feature = "full", feature = "derive"))]
391 fn visit_generics(&mut self, i: &'ast Generics) {
392 visit_generics(self, i)
393 }
David Tolnay8c81f622018-07-31 23:34:35 -0700394 fn visit_ident(&mut self, i: &'ast Ident) {
395 visit_ident(self, i)
396 }
397 #[cfg(feature = "full")]
398 fn visit_impl_item(&mut self, i: &'ast ImplItem) {
399 visit_impl_item(self, i)
400 }
401 #[cfg(feature = "full")]
402 fn visit_impl_item_const(&mut self, i: &'ast ImplItemConst) {
403 visit_impl_item_const(self, i)
404 }
405 #[cfg(feature = "full")]
David Tolnaybb82ef02018-08-24 20:15:45 -0400406 fn visit_impl_item_existential(&mut self, i: &'ast ImplItemExistential) {
407 visit_impl_item_existential(self, i)
408 }
409 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700410 fn visit_impl_item_macro(&mut self, i: &'ast ImplItemMacro) {
411 visit_impl_item_macro(self, i)
412 }
413 #[cfg(feature = "full")]
414 fn visit_impl_item_method(&mut self, i: &'ast ImplItemMethod) {
415 visit_impl_item_method(self, i)
416 }
417 #[cfg(feature = "full")]
418 fn visit_impl_item_type(&mut self, i: &'ast ImplItemType) {
419 visit_impl_item_type(self, i)
420 }
421 #[cfg(feature = "full")]
422 fn visit_impl_item_verbatim(&mut self, i: &'ast ImplItemVerbatim) {
423 visit_impl_item_verbatim(self, i)
424 }
425 #[cfg(any(feature = "full", feature = "derive"))]
426 fn visit_index(&mut self, i: &'ast Index) {
427 visit_index(self, i)
428 }
429 #[cfg(feature = "full")]
430 fn visit_item(&mut self, i: &'ast Item) {
431 visit_item(self, i)
432 }
433 #[cfg(feature = "full")]
434 fn visit_item_const(&mut self, i: &'ast ItemConst) {
435 visit_item_const(self, i)
436 }
437 #[cfg(feature = "full")]
438 fn visit_item_enum(&mut self, i: &'ast ItemEnum) {
439 visit_item_enum(self, i)
440 }
441 #[cfg(feature = "full")]
David Tolnaybb82ef02018-08-24 20:15:45 -0400442 fn visit_item_existential(&mut self, i: &'ast ItemExistential) {
443 visit_item_existential(self, i)
444 }
445 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700446 fn visit_item_extern_crate(&mut self, i: &'ast ItemExternCrate) {
447 visit_item_extern_crate(self, i)
448 }
449 #[cfg(feature = "full")]
450 fn visit_item_fn(&mut self, i: &'ast ItemFn) {
451 visit_item_fn(self, i)
452 }
453 #[cfg(feature = "full")]
454 fn visit_item_foreign_mod(&mut self, i: &'ast ItemForeignMod) {
455 visit_item_foreign_mod(self, i)
456 }
457 #[cfg(feature = "full")]
458 fn visit_item_impl(&mut self, i: &'ast ItemImpl) {
459 visit_item_impl(self, i)
460 }
461 #[cfg(feature = "full")]
462 fn visit_item_macro(&mut self, i: &'ast ItemMacro) {
463 visit_item_macro(self, i)
464 }
465 #[cfg(feature = "full")]
466 fn visit_item_macro2(&mut self, i: &'ast ItemMacro2) {
467 visit_item_macro2(self, i)
468 }
469 #[cfg(feature = "full")]
470 fn visit_item_mod(&mut self, i: &'ast ItemMod) {
471 visit_item_mod(self, i)
472 }
473 #[cfg(feature = "full")]
474 fn visit_item_static(&mut self, i: &'ast ItemStatic) {
475 visit_item_static(self, i)
476 }
477 #[cfg(feature = "full")]
478 fn visit_item_struct(&mut self, i: &'ast ItemStruct) {
479 visit_item_struct(self, i)
480 }
481 #[cfg(feature = "full")]
482 fn visit_item_trait(&mut self, i: &'ast ItemTrait) {
483 visit_item_trait(self, i)
484 }
485 #[cfg(feature = "full")]
486 fn visit_item_type(&mut self, i: &'ast ItemType) {
487 visit_item_type(self, i)
488 }
489 #[cfg(feature = "full")]
490 fn visit_item_union(&mut self, i: &'ast ItemUnion) {
491 visit_item_union(self, i)
492 }
493 #[cfg(feature = "full")]
494 fn visit_item_use(&mut self, i: &'ast ItemUse) {
495 visit_item_use(self, i)
496 }
497 #[cfg(feature = "full")]
498 fn visit_item_verbatim(&mut self, i: &'ast ItemVerbatim) {
499 visit_item_verbatim(self, i)
500 }
501 #[cfg(any(feature = "full", feature = "derive"))]
502 #[cfg(feature = "full")]
503 fn visit_label(&mut self, i: &'ast Label) {
504 visit_label(self, i)
505 }
506 #[cfg(any(feature = "full", feature = "derive"))]
507 fn visit_lifetime(&mut self, i: &'ast Lifetime) {
508 visit_lifetime(self, i)
509 }
510 #[cfg(any(feature = "full", feature = "derive"))]
511 fn visit_lifetime_def(&mut self, i: &'ast LifetimeDef) {
512 visit_lifetime_def(self, i)
513 }
514 #[cfg(any(feature = "full", feature = "derive"))]
515 fn visit_lit(&mut self, i: &'ast Lit) {
516 visit_lit(self, i)
517 }
518 #[cfg(any(feature = "full", feature = "derive"))]
519 fn visit_lit_bool(&mut self, i: &'ast LitBool) {
520 visit_lit_bool(self, i)
521 }
522 #[cfg(any(feature = "full", feature = "derive"))]
523 fn visit_lit_byte(&mut self, i: &'ast LitByte) {
524 visit_lit_byte(self, i)
525 }
526 #[cfg(any(feature = "full", feature = "derive"))]
527 fn visit_lit_byte_str(&mut self, i: &'ast LitByteStr) {
528 visit_lit_byte_str(self, i)
529 }
530 #[cfg(any(feature = "full", feature = "derive"))]
531 fn visit_lit_char(&mut self, i: &'ast LitChar) {
532 visit_lit_char(self, i)
533 }
534 #[cfg(any(feature = "full", feature = "derive"))]
535 fn visit_lit_float(&mut self, i: &'ast LitFloat) {
536 visit_lit_float(self, i)
537 }
538 #[cfg(any(feature = "full", feature = "derive"))]
539 fn visit_lit_int(&mut self, i: &'ast LitInt) {
540 visit_lit_int(self, i)
541 }
542 #[cfg(any(feature = "full", feature = "derive"))]
543 fn visit_lit_str(&mut self, i: &'ast LitStr) {
544 visit_lit_str(self, i)
545 }
546 #[cfg(any(feature = "full", feature = "derive"))]
547 fn visit_lit_verbatim(&mut self, i: &'ast LitVerbatim) {
548 visit_lit_verbatim(self, i)
549 }
550 #[cfg(any(feature = "full", feature = "derive"))]
551 #[cfg(feature = "full")]
552 fn visit_local(&mut self, i: &'ast Local) {
553 visit_local(self, i)
554 }
555 #[cfg(any(feature = "full", feature = "derive"))]
556 fn visit_macro(&mut self, i: &'ast Macro) {
557 visit_macro(self, i)
558 }
559 #[cfg(any(feature = "full", feature = "derive"))]
560 fn visit_macro_delimiter(&mut self, i: &'ast MacroDelimiter) {
561 visit_macro_delimiter(self, i)
562 }
563 #[cfg(any(feature = "full", feature = "derive"))]
564 fn visit_member(&mut self, i: &'ast Member) {
565 visit_member(self, i)
566 }
567 #[cfg(any(feature = "full", feature = "derive"))]
568 fn visit_meta(&mut self, i: &'ast Meta) {
569 visit_meta(self, i)
570 }
571 #[cfg(any(feature = "full", feature = "derive"))]
572 fn visit_meta_list(&mut self, i: &'ast MetaList) {
573 visit_meta_list(self, i)
574 }
575 #[cfg(any(feature = "full", feature = "derive"))]
576 fn visit_meta_name_value(&mut self, i: &'ast MetaNameValue) {
577 visit_meta_name_value(self, i)
578 }
579 #[cfg(feature = "full")]
580 fn visit_method_sig(&mut self, i: &'ast MethodSig) {
581 visit_method_sig(self, i)
582 }
583 #[cfg(any(feature = "full", feature = "derive"))]
584 #[cfg(feature = "full")]
585 fn visit_method_turbofish(&mut self, i: &'ast MethodTurbofish) {
586 visit_method_turbofish(self, i)
587 }
588 #[cfg(any(feature = "full", feature = "derive"))]
589 fn visit_nested_meta(&mut self, i: &'ast NestedMeta) {
590 visit_nested_meta(self, i)
591 }
592 #[cfg(any(feature = "full", feature = "derive"))]
593 fn visit_parenthesized_generic_arguments(&mut self, i: &'ast ParenthesizedGenericArguments) {
594 visit_parenthesized_generic_arguments(self, i)
595 }
596 #[cfg(any(feature = "full", feature = "derive"))]
597 #[cfg(feature = "full")]
598 fn visit_pat(&mut self, i: &'ast Pat) {
599 visit_pat(self, i)
600 }
601 #[cfg(any(feature = "full", feature = "derive"))]
602 #[cfg(feature = "full")]
603 fn visit_pat_box(&mut self, i: &'ast PatBox) {
604 visit_pat_box(self, i)
605 }
606 #[cfg(any(feature = "full", feature = "derive"))]
607 #[cfg(feature = "full")]
608 fn visit_pat_ident(&mut self, i: &'ast PatIdent) {
609 visit_pat_ident(self, i)
610 }
611 #[cfg(any(feature = "full", feature = "derive"))]
612 #[cfg(feature = "full")]
613 fn visit_pat_lit(&mut self, i: &'ast PatLit) {
614 visit_pat_lit(self, i)
615 }
616 #[cfg(any(feature = "full", feature = "derive"))]
617 #[cfg(feature = "full")]
618 fn visit_pat_macro(&mut self, i: &'ast PatMacro) {
619 visit_pat_macro(self, i)
620 }
621 #[cfg(any(feature = "full", feature = "derive"))]
622 #[cfg(feature = "full")]
623 fn visit_pat_path(&mut self, i: &'ast PatPath) {
624 visit_pat_path(self, i)
625 }
626 #[cfg(any(feature = "full", feature = "derive"))]
627 #[cfg(feature = "full")]
628 fn visit_pat_range(&mut self, i: &'ast PatRange) {
629 visit_pat_range(self, i)
630 }
631 #[cfg(any(feature = "full", feature = "derive"))]
632 #[cfg(feature = "full")]
633 fn visit_pat_ref(&mut self, i: &'ast PatRef) {
634 visit_pat_ref(self, i)
635 }
636 #[cfg(any(feature = "full", feature = "derive"))]
637 #[cfg(feature = "full")]
638 fn visit_pat_slice(&mut self, i: &'ast PatSlice) {
639 visit_pat_slice(self, i)
640 }
641 #[cfg(any(feature = "full", feature = "derive"))]
642 #[cfg(feature = "full")]
643 fn visit_pat_struct(&mut self, i: &'ast PatStruct) {
644 visit_pat_struct(self, i)
645 }
646 #[cfg(any(feature = "full", feature = "derive"))]
647 #[cfg(feature = "full")]
648 fn visit_pat_tuple(&mut self, i: &'ast PatTuple) {
649 visit_pat_tuple(self, i)
650 }
651 #[cfg(any(feature = "full", feature = "derive"))]
652 #[cfg(feature = "full")]
653 fn visit_pat_tuple_struct(&mut self, i: &'ast PatTupleStruct) {
654 visit_pat_tuple_struct(self, i)
655 }
656 #[cfg(any(feature = "full", feature = "derive"))]
657 #[cfg(feature = "full")]
658 fn visit_pat_verbatim(&mut self, i: &'ast PatVerbatim) {
659 visit_pat_verbatim(self, i)
660 }
661 #[cfg(any(feature = "full", feature = "derive"))]
662 #[cfg(feature = "full")]
663 fn visit_pat_wild(&mut self, i: &'ast PatWild) {
664 visit_pat_wild(self, i)
665 }
666 #[cfg(any(feature = "full", feature = "derive"))]
667 fn visit_path(&mut self, i: &'ast Path) {
668 visit_path(self, i)
669 }
670 #[cfg(any(feature = "full", feature = "derive"))]
671 fn visit_path_arguments(&mut self, i: &'ast PathArguments) {
672 visit_path_arguments(self, i)
673 }
674 #[cfg(any(feature = "full", feature = "derive"))]
675 fn visit_path_segment(&mut self, i: &'ast PathSegment) {
676 visit_path_segment(self, i)
677 }
678 #[cfg(any(feature = "full", feature = "derive"))]
679 fn visit_predicate_eq(&mut self, i: &'ast PredicateEq) {
680 visit_predicate_eq(self, i)
681 }
682 #[cfg(any(feature = "full", feature = "derive"))]
683 fn visit_predicate_lifetime(&mut self, i: &'ast PredicateLifetime) {
684 visit_predicate_lifetime(self, i)
685 }
686 #[cfg(any(feature = "full", feature = "derive"))]
687 fn visit_predicate_type(&mut self, i: &'ast PredicateType) {
688 visit_predicate_type(self, i)
689 }
690 #[cfg(any(feature = "full", feature = "derive"))]
691 fn visit_qself(&mut self, i: &'ast QSelf) {
692 visit_qself(self, i)
693 }
694 #[cfg(any(feature = "full", feature = "derive"))]
695 #[cfg(feature = "full")]
696 fn visit_range_limits(&mut self, i: &'ast RangeLimits) {
697 visit_range_limits(self, i)
698 }
699 #[cfg(any(feature = "full", feature = "derive"))]
700 fn visit_return_type(&mut self, i: &'ast ReturnType) {
701 visit_return_type(self, i)
702 }
David Tolnay8c81f622018-07-31 23:34:35 -0700703 fn visit_span(&mut self, i: &'ast Span) {
704 visit_span(self, i)
705 }
706 #[cfg(any(feature = "full", feature = "derive"))]
707 #[cfg(feature = "full")]
708 fn visit_stmt(&mut self, i: &'ast Stmt) {
709 visit_stmt(self, i)
710 }
711 #[cfg(any(feature = "full", feature = "derive"))]
712 fn visit_trait_bound(&mut self, i: &'ast TraitBound) {
713 visit_trait_bound(self, i)
714 }
715 #[cfg(any(feature = "full", feature = "derive"))]
716 fn visit_trait_bound_modifier(&mut self, i: &'ast TraitBoundModifier) {
717 visit_trait_bound_modifier(self, i)
718 }
719 #[cfg(feature = "full")]
720 fn visit_trait_item(&mut self, i: &'ast TraitItem) {
721 visit_trait_item(self, i)
722 }
723 #[cfg(feature = "full")]
724 fn visit_trait_item_const(&mut self, i: &'ast TraitItemConst) {
725 visit_trait_item_const(self, i)
726 }
727 #[cfg(feature = "full")]
728 fn visit_trait_item_macro(&mut self, i: &'ast TraitItemMacro) {
729 visit_trait_item_macro(self, i)
730 }
731 #[cfg(feature = "full")]
732 fn visit_trait_item_method(&mut self, i: &'ast TraitItemMethod) {
733 visit_trait_item_method(self, i)
734 }
735 #[cfg(feature = "full")]
736 fn visit_trait_item_type(&mut self, i: &'ast TraitItemType) {
737 visit_trait_item_type(self, i)
738 }
739 #[cfg(feature = "full")]
740 fn visit_trait_item_verbatim(&mut self, i: &'ast TraitItemVerbatim) {
741 visit_trait_item_verbatim(self, i)
742 }
743 #[cfg(any(feature = "full", feature = "derive"))]
744 fn visit_type(&mut self, i: &'ast Type) {
745 visit_type(self, i)
746 }
747 #[cfg(any(feature = "full", feature = "derive"))]
748 fn visit_type_array(&mut self, i: &'ast TypeArray) {
749 visit_type_array(self, i)
750 }
751 #[cfg(any(feature = "full", feature = "derive"))]
752 fn visit_type_bare_fn(&mut self, i: &'ast TypeBareFn) {
753 visit_type_bare_fn(self, i)
754 }
755 #[cfg(any(feature = "full", feature = "derive"))]
756 fn visit_type_group(&mut self, i: &'ast TypeGroup) {
757 visit_type_group(self, i)
758 }
759 #[cfg(any(feature = "full", feature = "derive"))]
760 fn visit_type_impl_trait(&mut self, i: &'ast TypeImplTrait) {
761 visit_type_impl_trait(self, i)
762 }
763 #[cfg(any(feature = "full", feature = "derive"))]
764 fn visit_type_infer(&mut self, i: &'ast TypeInfer) {
765 visit_type_infer(self, i)
766 }
767 #[cfg(any(feature = "full", feature = "derive"))]
768 fn visit_type_macro(&mut self, i: &'ast TypeMacro) {
769 visit_type_macro(self, i)
770 }
771 #[cfg(any(feature = "full", feature = "derive"))]
772 fn visit_type_never(&mut self, i: &'ast TypeNever) {
773 visit_type_never(self, i)
774 }
775 #[cfg(any(feature = "full", feature = "derive"))]
776 fn visit_type_param(&mut self, i: &'ast TypeParam) {
777 visit_type_param(self, i)
778 }
779 #[cfg(any(feature = "full", feature = "derive"))]
780 fn visit_type_param_bound(&mut self, i: &'ast TypeParamBound) {
781 visit_type_param_bound(self, i)
782 }
783 #[cfg(any(feature = "full", feature = "derive"))]
784 fn visit_type_paren(&mut self, i: &'ast TypeParen) {
785 visit_type_paren(self, i)
786 }
787 #[cfg(any(feature = "full", feature = "derive"))]
788 fn visit_type_path(&mut self, i: &'ast TypePath) {
789 visit_type_path(self, i)
790 }
791 #[cfg(any(feature = "full", feature = "derive"))]
792 fn visit_type_ptr(&mut self, i: &'ast TypePtr) {
793 visit_type_ptr(self, i)
794 }
795 #[cfg(any(feature = "full", feature = "derive"))]
796 fn visit_type_reference(&mut self, i: &'ast TypeReference) {
797 visit_type_reference(self, i)
798 }
799 #[cfg(any(feature = "full", feature = "derive"))]
800 fn visit_type_slice(&mut self, i: &'ast TypeSlice) {
801 visit_type_slice(self, i)
802 }
803 #[cfg(any(feature = "full", feature = "derive"))]
804 fn visit_type_trait_object(&mut self, i: &'ast TypeTraitObject) {
805 visit_type_trait_object(self, i)
806 }
807 #[cfg(any(feature = "full", feature = "derive"))]
808 fn visit_type_tuple(&mut self, i: &'ast TypeTuple) {
809 visit_type_tuple(self, i)
810 }
811 #[cfg(any(feature = "full", feature = "derive"))]
812 fn visit_type_verbatim(&mut self, i: &'ast TypeVerbatim) {
813 visit_type_verbatim(self, i)
814 }
815 #[cfg(any(feature = "full", feature = "derive"))]
816 fn visit_un_op(&mut self, i: &'ast UnOp) {
817 visit_un_op(self, i)
818 }
819 #[cfg(feature = "full")]
820 fn visit_use_glob(&mut self, i: &'ast UseGlob) {
821 visit_use_glob(self, i)
822 }
823 #[cfg(feature = "full")]
824 fn visit_use_group(&mut self, i: &'ast UseGroup) {
825 visit_use_group(self, i)
826 }
827 #[cfg(feature = "full")]
828 fn visit_use_name(&mut self, i: &'ast UseName) {
829 visit_use_name(self, i)
830 }
831 #[cfg(feature = "full")]
832 fn visit_use_path(&mut self, i: &'ast UsePath) {
833 visit_use_path(self, i)
834 }
835 #[cfg(feature = "full")]
836 fn visit_use_rename(&mut self, i: &'ast UseRename) {
837 visit_use_rename(self, i)
838 }
839 #[cfg(feature = "full")]
840 fn visit_use_tree(&mut self, i: &'ast UseTree) {
841 visit_use_tree(self, i)
842 }
843 #[cfg(any(feature = "full", feature = "derive"))]
844 fn visit_variant(&mut self, i: &'ast Variant) {
845 visit_variant(self, i)
846 }
847 #[cfg(any(feature = "full", feature = "derive"))]
848 fn visit_vis_crate(&mut self, i: &'ast VisCrate) {
849 visit_vis_crate(self, i)
850 }
851 #[cfg(any(feature = "full", feature = "derive"))]
852 fn visit_vis_public(&mut self, i: &'ast VisPublic) {
853 visit_vis_public(self, i)
854 }
855 #[cfg(any(feature = "full", feature = "derive"))]
856 fn visit_vis_restricted(&mut self, i: &'ast VisRestricted) {
857 visit_vis_restricted(self, i)
858 }
859 #[cfg(any(feature = "full", feature = "derive"))]
860 fn visit_visibility(&mut self, i: &'ast Visibility) {
861 visit_visibility(self, i)
862 }
863 #[cfg(any(feature = "full", feature = "derive"))]
864 fn visit_where_clause(&mut self, i: &'ast WhereClause) {
865 visit_where_clause(self, i)
866 }
867 #[cfg(any(feature = "full", feature = "derive"))]
868 fn visit_where_predicate(&mut self, i: &'ast WherePredicate) {
869 visit_where_predicate(self, i)
870 }
Nika Layzell27726662017-10-24 23:16:35 -0400871}
David Tolnay8c81f622018-07-31 23:34:35 -0700872#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800873pub fn visit_abi<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Abi) {
David Tolnay7ac699c2018-08-24 14:00:58 -0400874 tokens_helper(_visitor, &_i.extern_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -0700875 if let Some(ref it) = _i.name {
876 _visitor.visit_lit_str(it)
877 };
Nika Layzell27726662017-10-24 23:16:35 -0400878}
David Tolnay8c81f622018-07-31 23:34:35 -0700879#[cfg(any(feature = "full", feature = "derive"))]
880pub fn visit_angle_bracketed_generic_arguments<'ast, V: Visit<'ast> + ?Sized>(
881 _visitor: &mut V,
882 _i: &'ast AngleBracketedGenericArguments,
883) {
884 if let Some(ref it) = _i.colon2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -0400885 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -0700886 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400887 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700888 for el in Punctuated::pairs(&_i.args) {
889 let it = el.value();
890 _visitor.visit_generic_argument(it)
891 }
David Tolnay7ac699c2018-08-24 14:00:58 -0400892 tokens_helper(_visitor, &_i.gt_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400893}
David Tolnay8c81f622018-07-31 23:34:35 -0700894#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800895pub fn visit_arg_captured<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ArgCaptured) {
David Tolnay8c81f622018-07-31 23:34:35 -0700896 _visitor.visit_pat(&_i.pat);
David Tolnay7ac699c2018-08-24 14:00:58 -0400897 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700898 _visitor.visit_type(&_i.ty);
Nika Layzell27726662017-10-24 23:16:35 -0400899}
David Tolnay8c81f622018-07-31 23:34:35 -0700900#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800901pub fn visit_arg_self<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ArgSelf) {
David Tolnay8c81f622018-07-31 23:34:35 -0700902 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -0400903 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -0700904 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400905 tokens_helper(_visitor, &_i.self_token.span);
Nika Layzell27726662017-10-24 23:16:35 -0400906}
David Tolnay8c81f622018-07-31 23:34:35 -0700907#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800908pub fn visit_arg_self_ref<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ArgSelfRef) {
David Tolnay7ac699c2018-08-24 14:00:58 -0400909 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700910 if let Some(ref it) = _i.lifetime {
911 _visitor.visit_lifetime(it)
912 };
913 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -0400914 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -0700915 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400916 tokens_helper(_visitor, &_i.self_token.span);
Nika Layzell27726662017-10-24 23:16:35 -0400917}
David Tolnay8c81f622018-07-31 23:34:35 -0700918#[cfg(any(feature = "full", feature = "derive"))]
919#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800920pub fn visit_arm<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Arm) {
David Tolnay8c81f622018-07-31 23:34:35 -0700921 for it in &_i.attrs {
922 _visitor.visit_attribute(it)
923 }
924 if let Some(ref it) = _i.leading_vert {
David Tolnay7ac699c2018-08-24 14:00:58 -0400925 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -0700926 };
927 for el in Punctuated::pairs(&_i.pats) {
928 let it = el.value();
929 _visitor.visit_pat(it)
930 }
931 if let Some(ref it) = _i.guard {
David Tolnay7ac699c2018-08-24 14:00:58 -0400932 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -0700933 _visitor.visit_expr(&*(it).1);
934 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400935 tokens_helper(_visitor, &_i.fat_arrow_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700936 _visitor.visit_expr(&*_i.body);
937 if let Some(ref it) = _i.comma {
David Tolnay7ac699c2018-08-24 14:00:58 -0400938 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -0700939 };
Nika Layzell27726662017-10-24 23:16:35 -0400940}
David Tolnay8c81f622018-07-31 23:34:35 -0700941#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800942pub fn visit_attr_style<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast AttrStyle) {
Nika Layzell27726662017-10-24 23:16:35 -0400943 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -0700944 AttrStyle::Outer => {}
945 AttrStyle::Inner(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400946 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400947 }
948 }
949}
David Tolnay8c81f622018-07-31 23:34:35 -0700950#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800951pub fn visit_attribute<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Attribute) {
David Tolnay7ac699c2018-08-24 14:00:58 -0400952 tokens_helper(_visitor, &_i.pound_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700953 _visitor.visit_attr_style(&_i.style);
David Tolnay7ac699c2018-08-24 14:00:58 -0400954 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -0700955 _visitor.visit_path(&_i.path);
David Tolnay6af48992018-08-01 11:16:28 -0700956 skip!(_i.tts);
Nika Layzell27726662017-10-24 23:16:35 -0400957}
David Tolnay8c81f622018-07-31 23:34:35 -0700958#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800959pub fn visit_bare_fn_arg<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast BareFnArg) {
David Tolnay8c81f622018-07-31 23:34:35 -0700960 if let Some(ref it) = _i.name {
961 _visitor.visit_bare_fn_arg_name(&(it).0);
David Tolnay7ac699c2018-08-24 14:00:58 -0400962 tokens_helper(_visitor, &(it).1.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700963 };
964 _visitor.visit_type(&_i.ty);
Nika Layzell27726662017-10-24 23:16:35 -0400965}
David Tolnay8c81f622018-07-31 23:34:35 -0700966#[cfg(any(feature = "full", feature = "derive"))]
967pub fn visit_bare_fn_arg_name<'ast, V: Visit<'ast> + ?Sized>(
968 _visitor: &mut V,
969 _i: &'ast BareFnArgName,
970) {
Nika Layzell27726662017-10-24 23:16:35 -0400971 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -0700972 BareFnArgName::Named(ref _binding_0) => {
Alex Crichtond261d092018-05-18 13:47:35 -0700973 _visitor.visit_ident(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -0400974 }
David Tolnay8c81f622018-07-31 23:34:35 -0700975 BareFnArgName::Wild(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400976 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400977 }
978 }
979}
David Tolnay8c81f622018-07-31 23:34:35 -0700980#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800981pub fn visit_bin_op<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast BinOp) {
Nika Layzell27726662017-10-24 23:16:35 -0400982 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -0700983 BinOp::Add(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400984 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400985 }
David Tolnay8c81f622018-07-31 23:34:35 -0700986 BinOp::Sub(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400987 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400988 }
David Tolnay8c81f622018-07-31 23:34:35 -0700989 BinOp::Mul(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400990 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400991 }
David Tolnay8c81f622018-07-31 23:34:35 -0700992 BinOp::Div(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400993 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400994 }
David Tolnay8c81f622018-07-31 23:34:35 -0700995 BinOp::Rem(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400996 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400997 }
David Tolnay8c81f622018-07-31 23:34:35 -0700998 BinOp::And(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400999 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001000 }
David Tolnay8c81f622018-07-31 23:34:35 -07001001 BinOp::Or(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001002 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001003 }
David Tolnay8c81f622018-07-31 23:34:35 -07001004 BinOp::BitXor(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001005 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001006 }
David Tolnay8c81f622018-07-31 23:34:35 -07001007 BinOp::BitAnd(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001008 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001009 }
David Tolnay8c81f622018-07-31 23:34:35 -07001010 BinOp::BitOr(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001011 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001012 }
David Tolnay8c81f622018-07-31 23:34:35 -07001013 BinOp::Shl(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001014 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001015 }
David Tolnay8c81f622018-07-31 23:34:35 -07001016 BinOp::Shr(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001017 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001018 }
David Tolnay8c81f622018-07-31 23:34:35 -07001019 BinOp::Eq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001020 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001021 }
David Tolnay8c81f622018-07-31 23:34:35 -07001022 BinOp::Lt(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001023 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001024 }
David Tolnay8c81f622018-07-31 23:34:35 -07001025 BinOp::Le(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001026 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001027 }
David Tolnay8c81f622018-07-31 23:34:35 -07001028 BinOp::Ne(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001029 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001030 }
David Tolnay8c81f622018-07-31 23:34:35 -07001031 BinOp::Ge(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001032 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001033 }
David Tolnay8c81f622018-07-31 23:34:35 -07001034 BinOp::Gt(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001035 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001036 }
David Tolnay8c81f622018-07-31 23:34:35 -07001037 BinOp::AddEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001038 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001039 }
David Tolnay8c81f622018-07-31 23:34:35 -07001040 BinOp::SubEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001041 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001042 }
David Tolnay8c81f622018-07-31 23:34:35 -07001043 BinOp::MulEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001044 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001045 }
David Tolnay8c81f622018-07-31 23:34:35 -07001046 BinOp::DivEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001047 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001048 }
David Tolnay8c81f622018-07-31 23:34:35 -07001049 BinOp::RemEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001050 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001051 }
David Tolnay8c81f622018-07-31 23:34:35 -07001052 BinOp::BitXorEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001053 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001054 }
David Tolnay8c81f622018-07-31 23:34:35 -07001055 BinOp::BitAndEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001056 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001057 }
David Tolnay8c81f622018-07-31 23:34:35 -07001058 BinOp::BitOrEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001059 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001060 }
David Tolnay8c81f622018-07-31 23:34:35 -07001061 BinOp::ShlEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001062 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001063 }
David Tolnay8c81f622018-07-31 23:34:35 -07001064 BinOp::ShrEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001065 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001066 }
1067 }
1068}
David Tolnay8c81f622018-07-31 23:34:35 -07001069#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001070pub fn visit_binding<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Binding) {
David Tolnay8c81f622018-07-31 23:34:35 -07001071 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001072 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001073 _visitor.visit_type(&_i.ty);
David Tolnay506e43a2017-12-29 11:34:36 -05001074}
David Tolnay8c81f622018-07-31 23:34:35 -07001075#[cfg(any(feature = "full", feature = "derive"))]
1076#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001077pub fn visit_block<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Block) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001078 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001079 for it in &_i.stmts {
1080 _visitor.visit_stmt(it)
1081 }
Nika Layzell27726662017-10-24 23:16:35 -04001082}
David Tolnay8c81f622018-07-31 23:34:35 -07001083#[cfg(any(feature = "full", feature = "derive"))]
1084pub fn visit_bound_lifetimes<'ast, V: Visit<'ast> + ?Sized>(
1085 _visitor: &mut V,
1086 _i: &'ast BoundLifetimes,
1087) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001088 tokens_helper(_visitor, &_i.for_token.span);
1089 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001090 for el in Punctuated::pairs(&_i.lifetimes) {
1091 let it = el.value();
1092 _visitor.visit_lifetime_def(it)
1093 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001094 tokens_helper(_visitor, &_i.gt_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001095}
David Tolnay8c81f622018-07-31 23:34:35 -07001096#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001097pub fn visit_const_param<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ConstParam) {
David Tolnay8c81f622018-07-31 23:34:35 -07001098 for it in &_i.attrs {
1099 _visitor.visit_attribute(it)
1100 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001101 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001102 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001103 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001104 _visitor.visit_type(&_i.ty);
1105 if let Some(ref it) = _i.eq_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001106 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001107 };
1108 if let Some(ref it) = _i.default {
1109 _visitor.visit_expr(it)
1110 };
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001111}
David Tolnay8c81f622018-07-31 23:34:35 -07001112#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001113pub fn visit_data<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Data) {
David Tolnaye3d41b72017-12-31 15:24:00 -05001114 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001115 Data::Struct(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05001116 _visitor.visit_data_struct(_binding_0);
1117 }
David Tolnay8c81f622018-07-31 23:34:35 -07001118 Data::Enum(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05001119 _visitor.visit_data_enum(_binding_0);
1120 }
David Tolnay8c81f622018-07-31 23:34:35 -07001121 Data::Union(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05001122 _visitor.visit_data_union(_binding_0);
1123 }
1124 }
1125}
David Tolnay8c81f622018-07-31 23:34:35 -07001126#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001127pub fn visit_data_enum<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataEnum) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001128 tokens_helper(_visitor, &_i.enum_token.span);
1129 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001130 for el in Punctuated::pairs(&_i.variants) {
1131 let it = el.value();
1132 _visitor.visit_variant(it)
1133 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001134}
David Tolnay8c81f622018-07-31 23:34:35 -07001135#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001136pub fn visit_data_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataStruct) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001137 tokens_helper(_visitor, &_i.struct_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001138 _visitor.visit_fields(&_i.fields);
1139 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001140 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001141 };
David Tolnaye3d41b72017-12-31 15:24:00 -05001142}
David Tolnay8c81f622018-07-31 23:34:35 -07001143#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001144pub fn visit_data_union<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataUnion) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001145 tokens_helper(_visitor, &_i.union_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001146 _visitor.visit_fields_named(&_i.fields);
David Tolnaye3d41b72017-12-31 15:24:00 -05001147}
David Tolnay8c81f622018-07-31 23:34:35 -07001148#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001149pub fn visit_derive_input<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DeriveInput) {
David Tolnay8c81f622018-07-31 23:34:35 -07001150 for it in &_i.attrs {
1151 _visitor.visit_attribute(it)
1152 }
1153 _visitor.visit_visibility(&_i.vis);
1154 _visitor.visit_ident(&_i.ident);
1155 _visitor.visit_generics(&_i.generics);
1156 _visitor.visit_data(&_i.data);
Nika Layzell27726662017-10-24 23:16:35 -04001157}
David Tolnay8c81f622018-07-31 23:34:35 -07001158#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001159pub fn visit_expr<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Expr) {
Nika Layzell27726662017-10-24 23:16:35 -04001160 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001161 Expr::Box(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001162 full!(_visitor.visit_expr_box(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001163 }
David Tolnay8c81f622018-07-31 23:34:35 -07001164 Expr::InPlace(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001165 full!(_visitor.visit_expr_in_place(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001166 }
David Tolnay8c81f622018-07-31 23:34:35 -07001167 Expr::Array(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001168 full!(_visitor.visit_expr_array(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001169 }
David Tolnay8c81f622018-07-31 23:34:35 -07001170 Expr::Call(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001171 _visitor.visit_expr_call(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001172 }
David Tolnay8c81f622018-07-31 23:34:35 -07001173 Expr::MethodCall(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001174 full!(_visitor.visit_expr_method_call(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001175 }
David Tolnay8c81f622018-07-31 23:34:35 -07001176 Expr::Tuple(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001177 full!(_visitor.visit_expr_tuple(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001178 }
David Tolnay8c81f622018-07-31 23:34:35 -07001179 Expr::Binary(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001180 _visitor.visit_expr_binary(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001181 }
David Tolnay8c81f622018-07-31 23:34:35 -07001182 Expr::Unary(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001183 _visitor.visit_expr_unary(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001184 }
David Tolnay8c81f622018-07-31 23:34:35 -07001185 Expr::Lit(ref _binding_0) => {
David Tolnay8c91b882017-12-28 23:04:32 -05001186 _visitor.visit_expr_lit(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001187 }
David Tolnay8c81f622018-07-31 23:34:35 -07001188 Expr::Cast(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001189 _visitor.visit_expr_cast(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001190 }
David Tolnay8c81f622018-07-31 23:34:35 -07001191 Expr::Type(ref _binding_0) => {
David Tolnay0cf94f22017-12-28 23:46:26 -05001192 full!(_visitor.visit_expr_type(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001193 }
David Tolnay8c81f622018-07-31 23:34:35 -07001194 Expr::If(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001195 full!(_visitor.visit_expr_if(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001196 }
David Tolnay8c81f622018-07-31 23:34:35 -07001197 Expr::IfLet(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001198 full!(_visitor.visit_expr_if_let(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001199 }
David Tolnay8c81f622018-07-31 23:34:35 -07001200 Expr::While(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001201 full!(_visitor.visit_expr_while(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001202 }
David Tolnay8c81f622018-07-31 23:34:35 -07001203 Expr::WhileLet(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001204 full!(_visitor.visit_expr_while_let(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001205 }
David Tolnay8c81f622018-07-31 23:34:35 -07001206 Expr::ForLoop(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001207 full!(_visitor.visit_expr_for_loop(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001208 }
David Tolnay8c81f622018-07-31 23:34:35 -07001209 Expr::Loop(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001210 full!(_visitor.visit_expr_loop(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001211 }
David Tolnay8c81f622018-07-31 23:34:35 -07001212 Expr::Match(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001213 full!(_visitor.visit_expr_match(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001214 }
David Tolnay8c81f622018-07-31 23:34:35 -07001215 Expr::Closure(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001216 full!(_visitor.visit_expr_closure(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001217 }
David Tolnay8c81f622018-07-31 23:34:35 -07001218 Expr::Unsafe(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001219 full!(_visitor.visit_expr_unsafe(_binding_0));
Nika Layzell640832a2017-12-04 13:37:09 -05001220 }
David Tolnay8c81f622018-07-31 23:34:35 -07001221 Expr::Block(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001222 full!(_visitor.visit_expr_block(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001223 }
David Tolnay8c81f622018-07-31 23:34:35 -07001224 Expr::Assign(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001225 full!(_visitor.visit_expr_assign(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001226 }
David Tolnay8c81f622018-07-31 23:34:35 -07001227 Expr::AssignOp(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001228 full!(_visitor.visit_expr_assign_op(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001229 }
David Tolnay8c81f622018-07-31 23:34:35 -07001230 Expr::Field(ref _binding_0) => {
David Tolnayd093fa92018-06-30 10:23:25 -07001231 _visitor.visit_expr_field(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001232 }
David Tolnay8c81f622018-07-31 23:34:35 -07001233 Expr::Index(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001234 _visitor.visit_expr_index(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001235 }
David Tolnay8c81f622018-07-31 23:34:35 -07001236 Expr::Range(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001237 full!(_visitor.visit_expr_range(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001238 }
David Tolnay8c81f622018-07-31 23:34:35 -07001239 Expr::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001240 _visitor.visit_expr_path(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001241 }
David Tolnay8c81f622018-07-31 23:34:35 -07001242 Expr::Reference(ref _binding_0) => {
David Tolnay00674ba2018-03-31 18:14:11 +02001243 full!(_visitor.visit_expr_reference(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001244 }
David Tolnay8c81f622018-07-31 23:34:35 -07001245 Expr::Break(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001246 full!(_visitor.visit_expr_break(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001247 }
David Tolnay8c81f622018-07-31 23:34:35 -07001248 Expr::Continue(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001249 full!(_visitor.visit_expr_continue(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001250 }
David Tolnay8c81f622018-07-31 23:34:35 -07001251 Expr::Return(ref _binding_0) => {
David Tolnayc246cd32017-12-28 23:14:32 -05001252 full!(_visitor.visit_expr_return(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001253 }
David Tolnay8c81f622018-07-31 23:34:35 -07001254 Expr::Macro(ref _binding_0) => {
David Tolnay8c91b882017-12-28 23:04:32 -05001255 full!(_visitor.visit_expr_macro(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001256 }
David Tolnay8c81f622018-07-31 23:34:35 -07001257 Expr::Struct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001258 full!(_visitor.visit_expr_struct(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001259 }
David Tolnay8c81f622018-07-31 23:34:35 -07001260 Expr::Repeat(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001261 full!(_visitor.visit_expr_repeat(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001262 }
David Tolnay8c81f622018-07-31 23:34:35 -07001263 Expr::Paren(ref _binding_0) => {
David Tolnay81ab4f62018-01-27 19:02:51 -08001264 _visitor.visit_expr_paren(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001265 }
David Tolnay8c81f622018-07-31 23:34:35 -07001266 Expr::Group(ref _binding_0) => {
David Tolnaye98775f2017-12-28 23:17:00 -05001267 full!(_visitor.visit_expr_group(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001268 }
David Tolnay8c81f622018-07-31 23:34:35 -07001269 Expr::Try(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001270 full!(_visitor.visit_expr_try(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001271 }
David Tolnay02a9c6f2018-08-24 18:58:45 -04001272 Expr::Async(ref _binding_0) => {
1273 full!(_visitor.visit_expr_async(_binding_0));
1274 }
David Tolnayfb2dd4b2018-08-24 16:45:34 -04001275 Expr::TryBlock(ref _binding_0) => {
1276 full!(_visitor.visit_expr_try_block(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001277 }
David Tolnay8c81f622018-07-31 23:34:35 -07001278 Expr::Yield(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001279 full!(_visitor.visit_expr_yield(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001280 }
David Tolnay8c81f622018-07-31 23:34:35 -07001281 Expr::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05001282 _visitor.visit_expr_verbatim(_binding_0);
1283 }
Nika Layzell27726662017-10-24 23:16:35 -04001284 }
1285}
David Tolnay8c81f622018-07-31 23:34:35 -07001286#[cfg(feature = "full")]
1287#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001288pub fn visit_expr_array<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprArray) {
David Tolnay8c81f622018-07-31 23:34:35 -07001289 for it in &_i.attrs {
1290 _visitor.visit_attribute(it)
1291 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001292 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001293 for el in Punctuated::pairs(&_i.elems) {
1294 let it = el.value();
1295 _visitor.visit_expr(it)
David Tolnaye3d41b72017-12-31 15:24:00 -05001296 }
1297}
David Tolnay8c81f622018-07-31 23:34:35 -07001298#[cfg(feature = "full")]
1299#[cfg(any(feature = "full", feature = "derive"))]
1300pub fn visit_expr_assign<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprAssign) {
1301 for it in &_i.attrs {
1302 _visitor.visit_attribute(it)
1303 }
1304 _visitor.visit_expr(&*_i.left);
David Tolnay7ac699c2018-08-24 14:00:58 -04001305 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001306 _visitor.visit_expr(&*_i.right);
1307}
1308#[cfg(feature = "full")]
1309#[cfg(any(feature = "full", feature = "derive"))]
1310pub fn visit_expr_assign_op<'ast, V: Visit<'ast> + ?Sized>(
1311 _visitor: &mut V,
1312 _i: &'ast ExprAssignOp,
1313) {
1314 for it in &_i.attrs {
1315 _visitor.visit_attribute(it)
1316 }
1317 _visitor.visit_expr(&*_i.left);
1318 _visitor.visit_bin_op(&_i.op);
1319 _visitor.visit_expr(&*_i.right);
1320}
David Tolnay02a9c6f2018-08-24 18:58:45 -04001321#[cfg(feature = "full")]
1322#[cfg(any(feature = "full", feature = "derive"))]
1323pub fn visit_expr_async<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprAsync) {
1324 for it in &_i.attrs {
1325 _visitor.visit_attribute(it)
1326 }
1327 tokens_helper(_visitor, &_i.async_token.span);
1328 if let Some(ref it) = _i.capture {
1329 tokens_helper(_visitor, &it.span)
1330 };
1331 _visitor.visit_block(&_i.block);
1332}
David Tolnay8c81f622018-07-31 23:34:35 -07001333#[cfg(any(feature = "full", feature = "derive"))]
1334pub fn visit_expr_binary<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBinary) {
1335 for it in &_i.attrs {
1336 _visitor.visit_attribute(it)
1337 }
1338 _visitor.visit_expr(&*_i.left);
1339 _visitor.visit_bin_op(&_i.op);
1340 _visitor.visit_expr(&*_i.right);
1341}
1342#[cfg(feature = "full")]
1343#[cfg(any(feature = "full", feature = "derive"))]
1344pub fn visit_expr_block<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBlock) {
1345 for it in &_i.attrs {
1346 _visitor.visit_attribute(it)
1347 }
David Tolnay1d8e9962018-08-24 19:04:20 -04001348 if let Some(ref it) = _i.label {
1349 _visitor.visit_label(it)
1350 };
David Tolnay8c81f622018-07-31 23:34:35 -07001351 _visitor.visit_block(&_i.block);
1352}
1353#[cfg(feature = "full")]
1354#[cfg(any(feature = "full", feature = "derive"))]
1355pub fn visit_expr_box<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBox) {
1356 for it in &_i.attrs {
1357 _visitor.visit_attribute(it)
1358 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001359 tokens_helper(_visitor, &_i.box_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001360 _visitor.visit_expr(&*_i.expr);
1361}
1362#[cfg(feature = "full")]
1363#[cfg(any(feature = "full", feature = "derive"))]
1364pub fn visit_expr_break<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBreak) {
1365 for it in &_i.attrs {
1366 _visitor.visit_attribute(it)
1367 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001368 tokens_helper(_visitor, &_i.break_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001369 if let Some(ref it) = _i.label {
1370 _visitor.visit_lifetime(it)
1371 };
1372 if let Some(ref it) = _i.expr {
1373 _visitor.visit_expr(&**it)
1374 };
1375}
1376#[cfg(any(feature = "full", feature = "derive"))]
1377pub fn visit_expr_call<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprCall) {
1378 for it in &_i.attrs {
1379 _visitor.visit_attribute(it)
1380 }
1381 _visitor.visit_expr(&*_i.func);
David Tolnay7ac699c2018-08-24 14:00:58 -04001382 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001383 for el in Punctuated::pairs(&_i.args) {
1384 let it = el.value();
1385 _visitor.visit_expr(it)
1386 }
1387}
1388#[cfg(any(feature = "full", feature = "derive"))]
1389pub fn visit_expr_cast<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprCast) {
1390 for it in &_i.attrs {
1391 _visitor.visit_attribute(it)
1392 }
1393 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001394 tokens_helper(_visitor, &_i.as_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001395 _visitor.visit_type(&*_i.ty);
1396}
1397#[cfg(feature = "full")]
1398#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001399pub fn visit_expr_closure<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprClosure) {
1400 for it in &_i.attrs {
1401 _visitor.visit_attribute(it)
1402 }
Yusuke Sasaki4e5d9662018-07-21 02:49:47 +09001403 if let Some(ref it) = _i.asyncness {
1404 tokens_helper(_visitor, &it.span)
1405 };
David Tolnay8c81f622018-07-31 23:34:35 -07001406 if let Some(ref it) = _i.movability {
David Tolnay7ac699c2018-08-24 14:00:58 -04001407 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001408 };
1409 if let Some(ref it) = _i.capture {
David Tolnay7ac699c2018-08-24 14:00:58 -04001410 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001411 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001412 tokens_helper(_visitor, &_i.or1_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001413 for el in Punctuated::pairs(&_i.inputs) {
1414 let it = el.value();
1415 _visitor.visit_fn_arg(it)
1416 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001417 tokens_helper(_visitor, &_i.or2_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001418 _visitor.visit_return_type(&_i.output);
1419 _visitor.visit_expr(&*_i.body);
1420}
1421#[cfg(feature = "full")]
1422#[cfg(any(feature = "full", feature = "derive"))]
1423pub fn visit_expr_continue<'ast, V: Visit<'ast> + ?Sized>(
1424 _visitor: &mut V,
1425 _i: &'ast ExprContinue,
1426) {
1427 for it in &_i.attrs {
1428 _visitor.visit_attribute(it)
1429 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001430 tokens_helper(_visitor, &_i.continue_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001431 if let Some(ref it) = _i.label {
1432 _visitor.visit_lifetime(it)
1433 };
1434}
1435#[cfg(any(feature = "full", feature = "derive"))]
1436pub fn visit_expr_field<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprField) {
1437 for it in &_i.attrs {
1438 _visitor.visit_attribute(it)
1439 }
1440 _visitor.visit_expr(&*_i.base);
David Tolnay7ac699c2018-08-24 14:00:58 -04001441 tokens_helper(_visitor, &_i.dot_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001442 _visitor.visit_member(&_i.member);
1443}
1444#[cfg(feature = "full")]
1445#[cfg(any(feature = "full", feature = "derive"))]
1446pub fn visit_expr_for_loop<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprForLoop) {
1447 for it in &_i.attrs {
1448 _visitor.visit_attribute(it)
1449 }
1450 if let Some(ref it) = _i.label {
1451 _visitor.visit_label(it)
1452 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001453 tokens_helper(_visitor, &_i.for_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001454 _visitor.visit_pat(&*_i.pat);
David Tolnay7ac699c2018-08-24 14:00:58 -04001455 tokens_helper(_visitor, &_i.in_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001456 _visitor.visit_expr(&*_i.expr);
1457 _visitor.visit_block(&_i.body);
1458}
1459#[cfg(feature = "full")]
1460#[cfg(any(feature = "full", feature = "derive"))]
1461pub fn visit_expr_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprGroup) {
1462 for it in &_i.attrs {
1463 _visitor.visit_attribute(it)
1464 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001465 tokens_helper(_visitor, &_i.group_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001466 _visitor.visit_expr(&*_i.expr);
1467}
1468#[cfg(feature = "full")]
1469#[cfg(any(feature = "full", feature = "derive"))]
1470pub fn visit_expr_if<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprIf) {
1471 for it in &_i.attrs {
1472 _visitor.visit_attribute(it)
1473 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001474 tokens_helper(_visitor, &_i.if_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001475 _visitor.visit_expr(&*_i.cond);
1476 _visitor.visit_block(&_i.then_branch);
1477 if let Some(ref it) = _i.else_branch {
David Tolnay7ac699c2018-08-24 14:00:58 -04001478 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001479 _visitor.visit_expr(&*(it).1);
1480 };
1481}
1482#[cfg(feature = "full")]
1483#[cfg(any(feature = "full", feature = "derive"))]
1484pub fn visit_expr_if_let<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprIfLet) {
1485 for it in &_i.attrs {
1486 _visitor.visit_attribute(it)
1487 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001488 tokens_helper(_visitor, &_i.if_token.span);
1489 tokens_helper(_visitor, &_i.let_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001490 for el in Punctuated::pairs(&_i.pats) {
1491 let it = el.value();
1492 _visitor.visit_pat(it)
1493 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001494 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001495 _visitor.visit_expr(&*_i.expr);
1496 _visitor.visit_block(&_i.then_branch);
1497 if let Some(ref it) = _i.else_branch {
David Tolnay7ac699c2018-08-24 14:00:58 -04001498 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001499 _visitor.visit_expr(&*(it).1);
1500 };
1501}
1502#[cfg(feature = "full")]
1503#[cfg(any(feature = "full", feature = "derive"))]
1504pub fn visit_expr_in_place<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprInPlace) {
1505 for it in &_i.attrs {
1506 _visitor.visit_attribute(it)
1507 }
1508 _visitor.visit_expr(&*_i.place);
David Tolnay7ac699c2018-08-24 14:00:58 -04001509 tokens_helper(_visitor, &_i.arrow_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001510 _visitor.visit_expr(&*_i.value);
1511}
1512#[cfg(any(feature = "full", feature = "derive"))]
1513pub fn visit_expr_index<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprIndex) {
1514 for it in &_i.attrs {
1515 _visitor.visit_attribute(it)
1516 }
1517 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001518 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001519 _visitor.visit_expr(&*_i.index);
1520}
1521#[cfg(any(feature = "full", feature = "derive"))]
1522pub fn visit_expr_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprLit) {
1523 for it in &_i.attrs {
1524 _visitor.visit_attribute(it)
1525 }
1526 _visitor.visit_lit(&_i.lit);
1527}
1528#[cfg(feature = "full")]
1529#[cfg(any(feature = "full", feature = "derive"))]
1530pub fn visit_expr_loop<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprLoop) {
1531 for it in &_i.attrs {
1532 _visitor.visit_attribute(it)
1533 }
1534 if let Some(ref it) = _i.label {
1535 _visitor.visit_label(it)
1536 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001537 tokens_helper(_visitor, &_i.loop_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001538 _visitor.visit_block(&_i.body);
1539}
1540#[cfg(feature = "full")]
1541#[cfg(any(feature = "full", feature = "derive"))]
1542pub fn visit_expr_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprMacro) {
1543 for it in &_i.attrs {
1544 _visitor.visit_attribute(it)
1545 }
1546 _visitor.visit_macro(&_i.mac);
1547}
1548#[cfg(feature = "full")]
1549#[cfg(any(feature = "full", feature = "derive"))]
1550pub fn visit_expr_match<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprMatch) {
1551 for it in &_i.attrs {
1552 _visitor.visit_attribute(it)
1553 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001554 tokens_helper(_visitor, &_i.match_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001555 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001556 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001557 for it in &_i.arms {
1558 _visitor.visit_arm(it)
1559 }
1560}
1561#[cfg(feature = "full")]
1562#[cfg(any(feature = "full", feature = "derive"))]
1563pub fn visit_expr_method_call<'ast, V: Visit<'ast> + ?Sized>(
1564 _visitor: &mut V,
1565 _i: &'ast ExprMethodCall,
1566) {
1567 for it in &_i.attrs {
1568 _visitor.visit_attribute(it)
1569 }
1570 _visitor.visit_expr(&*_i.receiver);
David Tolnay7ac699c2018-08-24 14:00:58 -04001571 tokens_helper(_visitor, &_i.dot_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001572 _visitor.visit_ident(&_i.method);
1573 if let Some(ref it) = _i.turbofish {
1574 _visitor.visit_method_turbofish(it)
1575 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001576 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001577 for el in Punctuated::pairs(&_i.args) {
1578 let it = el.value();
1579 _visitor.visit_expr(it)
1580 }
1581}
1582#[cfg(any(feature = "full", feature = "derive"))]
1583pub fn visit_expr_paren<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprParen) {
1584 for it in &_i.attrs {
1585 _visitor.visit_attribute(it)
1586 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001587 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001588 _visitor.visit_expr(&*_i.expr);
1589}
1590#[cfg(any(feature = "full", feature = "derive"))]
1591pub fn visit_expr_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprPath) {
1592 for it in &_i.attrs {
1593 _visitor.visit_attribute(it)
1594 }
1595 if let Some(ref it) = _i.qself {
1596 _visitor.visit_qself(it)
1597 };
1598 _visitor.visit_path(&_i.path);
1599}
1600#[cfg(feature = "full")]
1601#[cfg(any(feature = "full", feature = "derive"))]
1602pub fn visit_expr_range<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprRange) {
1603 for it in &_i.attrs {
1604 _visitor.visit_attribute(it)
1605 }
1606 if let Some(ref it) = _i.from {
1607 _visitor.visit_expr(&**it)
1608 };
1609 _visitor.visit_range_limits(&_i.limits);
1610 if let Some(ref it) = _i.to {
1611 _visitor.visit_expr(&**it)
1612 };
1613}
1614#[cfg(feature = "full")]
1615#[cfg(any(feature = "full", feature = "derive"))]
1616pub fn visit_expr_reference<'ast, V: Visit<'ast> + ?Sized>(
1617 _visitor: &mut V,
1618 _i: &'ast ExprReference,
1619) {
1620 for it in &_i.attrs {
1621 _visitor.visit_attribute(it)
1622 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001623 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001624 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04001625 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001626 };
1627 _visitor.visit_expr(&*_i.expr);
1628}
1629#[cfg(feature = "full")]
1630#[cfg(any(feature = "full", feature = "derive"))]
1631pub fn visit_expr_repeat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprRepeat) {
1632 for it in &_i.attrs {
1633 _visitor.visit_attribute(it)
1634 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001635 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001636 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001637 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001638 _visitor.visit_expr(&*_i.len);
1639}
1640#[cfg(feature = "full")]
1641#[cfg(any(feature = "full", feature = "derive"))]
1642pub fn visit_expr_return<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprReturn) {
1643 for it in &_i.attrs {
1644 _visitor.visit_attribute(it)
1645 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001646 tokens_helper(_visitor, &_i.return_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001647 if let Some(ref it) = _i.expr {
1648 _visitor.visit_expr(&**it)
1649 };
1650}
1651#[cfg(feature = "full")]
1652#[cfg(any(feature = "full", feature = "derive"))]
1653pub fn visit_expr_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprStruct) {
1654 for it in &_i.attrs {
1655 _visitor.visit_attribute(it)
1656 }
1657 _visitor.visit_path(&_i.path);
David Tolnay7ac699c2018-08-24 14:00:58 -04001658 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001659 for el in Punctuated::pairs(&_i.fields) {
1660 let it = el.value();
1661 _visitor.visit_field_value(it)
1662 }
1663 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001664 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001665 };
1666 if let Some(ref it) = _i.rest {
1667 _visitor.visit_expr(&**it)
1668 };
1669}
1670#[cfg(feature = "full")]
1671#[cfg(any(feature = "full", feature = "derive"))]
1672pub fn visit_expr_try<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprTry) {
1673 for it in &_i.attrs {
1674 _visitor.visit_attribute(it)
1675 }
1676 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001677 tokens_helper(_visitor, &_i.question_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001678}
1679#[cfg(feature = "full")]
1680#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayfb2dd4b2018-08-24 16:45:34 -04001681pub fn visit_expr_try_block<'ast, V: Visit<'ast> + ?Sized>(
1682 _visitor: &mut V,
1683 _i: &'ast ExprTryBlock,
1684) {
1685 for it in &_i.attrs {
1686 _visitor.visit_attribute(it)
1687 }
1688 tokens_helper(_visitor, &_i.try_token.span);
1689 _visitor.visit_block(&_i.block);
1690}
1691#[cfg(feature = "full")]
1692#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001693pub fn visit_expr_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprTuple) {
1694 for it in &_i.attrs {
1695 _visitor.visit_attribute(it)
1696 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001697 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001698 for el in Punctuated::pairs(&_i.elems) {
1699 let it = el.value();
1700 _visitor.visit_expr(it)
1701 }
1702}
1703#[cfg(feature = "full")]
1704#[cfg(any(feature = "full", feature = "derive"))]
1705pub fn visit_expr_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprType) {
1706 for it in &_i.attrs {
1707 _visitor.visit_attribute(it)
1708 }
1709 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001710 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001711 _visitor.visit_type(&*_i.ty);
1712}
1713#[cfg(any(feature = "full", feature = "derive"))]
1714pub fn visit_expr_unary<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprUnary) {
1715 for it in &_i.attrs {
1716 _visitor.visit_attribute(it)
1717 }
1718 _visitor.visit_un_op(&_i.op);
1719 _visitor.visit_expr(&*_i.expr);
1720}
1721#[cfg(feature = "full")]
1722#[cfg(any(feature = "full", feature = "derive"))]
1723pub fn visit_expr_unsafe<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprUnsafe) {
1724 for it in &_i.attrs {
1725 _visitor.visit_attribute(it)
1726 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001727 tokens_helper(_visitor, &_i.unsafe_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001728 _visitor.visit_block(&_i.block);
1729}
1730#[cfg(any(feature = "full", feature = "derive"))]
1731pub fn visit_expr_verbatim<'ast, V: Visit<'ast> + ?Sized>(
1732 _visitor: &mut V,
1733 _i: &'ast ExprVerbatim,
1734) {
David Tolnay6af48992018-08-01 11:16:28 -07001735 skip!(_i.tts);
David Tolnay8c81f622018-07-31 23:34:35 -07001736}
1737#[cfg(feature = "full")]
1738#[cfg(any(feature = "full", feature = "derive"))]
1739pub fn visit_expr_while<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprWhile) {
1740 for it in &_i.attrs {
1741 _visitor.visit_attribute(it)
1742 }
1743 if let Some(ref it) = _i.label {
1744 _visitor.visit_label(it)
1745 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001746 tokens_helper(_visitor, &_i.while_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001747 _visitor.visit_expr(&*_i.cond);
1748 _visitor.visit_block(&_i.body);
1749}
1750#[cfg(feature = "full")]
1751#[cfg(any(feature = "full", feature = "derive"))]
1752pub fn visit_expr_while_let<'ast, V: Visit<'ast> + ?Sized>(
1753 _visitor: &mut V,
1754 _i: &'ast ExprWhileLet,
1755) {
1756 for it in &_i.attrs {
1757 _visitor.visit_attribute(it)
1758 }
1759 if let Some(ref it) = _i.label {
1760 _visitor.visit_label(it)
1761 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001762 tokens_helper(_visitor, &_i.while_token.span);
1763 tokens_helper(_visitor, &_i.let_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001764 for el in Punctuated::pairs(&_i.pats) {
1765 let it = el.value();
1766 _visitor.visit_pat(it)
1767 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001768 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001769 _visitor.visit_expr(&*_i.expr);
1770 _visitor.visit_block(&_i.body);
1771}
1772#[cfg(feature = "full")]
1773#[cfg(any(feature = "full", feature = "derive"))]
1774pub fn visit_expr_yield<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprYield) {
1775 for it in &_i.attrs {
1776 _visitor.visit_attribute(it)
1777 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001778 tokens_helper(_visitor, &_i.yield_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001779 if let Some(ref it) = _i.expr {
1780 _visitor.visit_expr(&**it)
1781 };
1782}
1783#[cfg(any(feature = "full", feature = "derive"))]
1784pub fn visit_field<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Field) {
1785 for it in &_i.attrs {
1786 _visitor.visit_attribute(it)
1787 }
1788 _visitor.visit_visibility(&_i.vis);
1789 if let Some(ref it) = _i.ident {
1790 _visitor.visit_ident(it)
1791 };
1792 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001793 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001794 };
1795 _visitor.visit_type(&_i.ty);
1796}
1797#[cfg(any(feature = "full", feature = "derive"))]
1798#[cfg(feature = "full")]
1799pub fn visit_field_pat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldPat) {
1800 for it in &_i.attrs {
1801 _visitor.visit_attribute(it)
1802 }
1803 _visitor.visit_member(&_i.member);
1804 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001805 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001806 };
1807 _visitor.visit_pat(&*_i.pat);
1808}
1809#[cfg(any(feature = "full", feature = "derive"))]
1810#[cfg(feature = "full")]
1811pub fn visit_field_value<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldValue) {
1812 for it in &_i.attrs {
1813 _visitor.visit_attribute(it)
1814 }
1815 _visitor.visit_member(&_i.member);
1816 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001817 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001818 };
1819 _visitor.visit_expr(&_i.expr);
1820}
1821#[cfg(any(feature = "full", feature = "derive"))]
1822pub fn visit_fields<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Fields) {
1823 match *_i {
1824 Fields::Named(ref _binding_0) => {
1825 _visitor.visit_fields_named(_binding_0);
1826 }
1827 Fields::Unnamed(ref _binding_0) => {
1828 _visitor.visit_fields_unnamed(_binding_0);
1829 }
1830 Fields::Unit => {}
1831 }
1832}
1833#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001834pub fn visit_fields_named<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldsNamed) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001835 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001836 for el in Punctuated::pairs(&_i.named) {
1837 let it = el.value();
1838 _visitor.visit_field(it)
1839 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001840}
David Tolnay8c81f622018-07-31 23:34:35 -07001841#[cfg(any(feature = "full", feature = "derive"))]
1842pub fn visit_fields_unnamed<'ast, V: Visit<'ast> + ?Sized>(
1843 _visitor: &mut V,
1844 _i: &'ast FieldsUnnamed,
1845) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001846 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001847 for el in Punctuated::pairs(&_i.unnamed) {
1848 let it = el.value();
1849 _visitor.visit_field(it)
1850 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001851}
David Tolnay8c81f622018-07-31 23:34:35 -07001852#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001853pub fn visit_file<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast File) {
David Tolnay6af48992018-08-01 11:16:28 -07001854 skip!(_i.shebang);
David Tolnay8c81f622018-07-31 23:34:35 -07001855 for it in &_i.attrs {
1856 _visitor.visit_attribute(it)
1857 }
1858 for it in &_i.items {
1859 _visitor.visit_item(it)
1860 }
Nika Layzell27726662017-10-24 23:16:35 -04001861}
David Tolnay8c81f622018-07-31 23:34:35 -07001862#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001863pub fn visit_fn_arg<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FnArg) {
Nika Layzell27726662017-10-24 23:16:35 -04001864 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001865 FnArg::SelfRef(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001866 _visitor.visit_arg_self_ref(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001867 }
David Tolnay8c81f622018-07-31 23:34:35 -07001868 FnArg::SelfValue(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001869 _visitor.visit_arg_self(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001870 }
David Tolnay8c81f622018-07-31 23:34:35 -07001871 FnArg::Captured(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001872 _visitor.visit_arg_captured(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001873 }
David Tolnay8c81f622018-07-31 23:34:35 -07001874 FnArg::Inferred(ref _binding_0) => {
David Tolnay80ed55f2017-12-27 22:54:40 -05001875 _visitor.visit_pat(_binding_0);
1876 }
David Tolnay8c81f622018-07-31 23:34:35 -07001877 FnArg::Ignored(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001878 _visitor.visit_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001879 }
1880 }
1881}
David Tolnay8c81f622018-07-31 23:34:35 -07001882#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001883pub fn visit_fn_decl<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FnDecl) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001884 tokens_helper(_visitor, &_i.fn_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001885 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04001886 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001887 for el in Punctuated::pairs(&_i.inputs) {
1888 let it = el.value();
1889 _visitor.visit_fn_arg(it)
1890 }
1891 if let Some(ref it) = _i.variadic {
David Tolnay7ac699c2018-08-24 14:00:58 -04001892 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001893 };
1894 _visitor.visit_return_type(&_i.output);
Nika Layzell27726662017-10-24 23:16:35 -04001895}
David Tolnay8c81f622018-07-31 23:34:35 -07001896#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001897pub fn visit_foreign_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ForeignItem) {
Nika Layzell27726662017-10-24 23:16:35 -04001898 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001899 ForeignItem::Fn(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001900 _visitor.visit_foreign_item_fn(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001901 }
David Tolnay8c81f622018-07-31 23:34:35 -07001902 ForeignItem::Static(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001903 _visitor.visit_foreign_item_static(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001904 }
David Tolnay8c81f622018-07-31 23:34:35 -07001905 ForeignItem::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001906 _visitor.visit_foreign_item_type(_binding_0);
David Tolnay199bcbb2017-11-12 10:33:52 -08001907 }
David Tolnay435c1782018-08-24 16:15:44 -04001908 ForeignItem::Macro(ref _binding_0) => {
1909 _visitor.visit_foreign_item_macro(_binding_0);
1910 }
David Tolnay8c81f622018-07-31 23:34:35 -07001911 ForeignItem::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05001912 _visitor.visit_foreign_item_verbatim(_binding_0);
1913 }
Nika Layzell27726662017-10-24 23:16:35 -04001914 }
1915}
David Tolnay8c81f622018-07-31 23:34:35 -07001916#[cfg(feature = "full")]
1917pub fn visit_foreign_item_fn<'ast, V: Visit<'ast> + ?Sized>(
1918 _visitor: &mut V,
1919 _i: &'ast ForeignItemFn,
1920) {
1921 for it in &_i.attrs {
1922 _visitor.visit_attribute(it)
1923 }
1924 _visitor.visit_visibility(&_i.vis);
1925 _visitor.visit_ident(&_i.ident);
1926 _visitor.visit_fn_decl(&*_i.decl);
David Tolnay7ac699c2018-08-24 14:00:58 -04001927 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay8894f602017-11-11 12:11:04 -08001928}
David Tolnay8c81f622018-07-31 23:34:35 -07001929#[cfg(feature = "full")]
David Tolnay435c1782018-08-24 16:15:44 -04001930pub fn visit_foreign_item_macro<'ast, V: Visit<'ast> + ?Sized>(
1931 _visitor: &mut V,
1932 _i: &'ast ForeignItemMacro,
1933) {
1934 for it in &_i.attrs {
1935 _visitor.visit_attribute(it)
1936 }
1937 _visitor.visit_macro(&_i.mac);
1938 if let Some(ref it) = _i.semi_token {
1939 tokens_helper(_visitor, &it.spans)
1940 };
1941}
1942#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001943pub fn visit_foreign_item_static<'ast, V: Visit<'ast> + ?Sized>(
1944 _visitor: &mut V,
1945 _i: &'ast ForeignItemStatic,
1946) {
1947 for it in &_i.attrs {
1948 _visitor.visit_attribute(it)
1949 }
1950 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04001951 tokens_helper(_visitor, &_i.static_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001952 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04001953 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001954 };
1955 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001956 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001957 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04001958 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001959}
David Tolnay8c81f622018-07-31 23:34:35 -07001960#[cfg(feature = "full")]
1961pub fn visit_foreign_item_type<'ast, V: Visit<'ast> + ?Sized>(
1962 _visitor: &mut V,
1963 _i: &'ast ForeignItemType,
1964) {
1965 for it in &_i.attrs {
1966 _visitor.visit_attribute(it)
1967 }
1968 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04001969 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001970 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001971 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay199bcbb2017-11-12 10:33:52 -08001972}
David Tolnay8c81f622018-07-31 23:34:35 -07001973#[cfg(feature = "full")]
1974pub fn visit_foreign_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
1975 _visitor: &mut V,
1976 _i: &'ast ForeignItemVerbatim,
1977) {
David Tolnay6af48992018-08-01 11:16:28 -07001978 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05001979}
David Tolnay8c81f622018-07-31 23:34:35 -07001980#[cfg(any(feature = "full", feature = "derive"))]
1981pub fn visit_generic_argument<'ast, V: Visit<'ast> + ?Sized>(
1982 _visitor: &mut V,
1983 _i: &'ast GenericArgument,
1984) {
Nika Layzell357885a2017-12-04 15:47:07 -05001985 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001986 GenericArgument::Lifetime(ref _binding_0) => {
David Tolnay4ba63a02017-12-28 15:53:05 -05001987 _visitor.visit_lifetime(_binding_0);
Nika Layzell357885a2017-12-04 15:47:07 -05001988 }
David Tolnay8c81f622018-07-31 23:34:35 -07001989 GenericArgument::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001990 _visitor.visit_type(_binding_0);
Nika Layzell357885a2017-12-04 15:47:07 -05001991 }
David Tolnay8c81f622018-07-31 23:34:35 -07001992 GenericArgument::Binding(ref _binding_0) => {
David Tolnay506e43a2017-12-29 11:34:36 -05001993 _visitor.visit_binding(_binding_0);
Nika Layzell357885a2017-12-04 15:47:07 -05001994 }
David Tolnay8c81f622018-07-31 23:34:35 -07001995 GenericArgument::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001996 _visitor.visit_expr(_binding_0);
Nika Layzellc680e612017-12-04 19:07:20 -05001997 }
Nika Layzell357885a2017-12-04 15:47:07 -05001998 }
1999}
David Tolnay8c81f622018-07-31 23:34:35 -07002000#[cfg(any(feature = "full", feature = "derive"))]
2001#[cfg(feature = "full")]
2002pub fn visit_generic_method_argument<'ast, V: Visit<'ast> + ?Sized>(
2003 _visitor: &mut V,
2004 _i: &'ast GenericMethodArgument,
2005) {
David Tolnayd60cfec2017-12-29 00:21:38 -05002006 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002007 GenericMethodArgument::Type(ref _binding_0) => {
David Tolnayd60cfec2017-12-29 00:21:38 -05002008 _visitor.visit_type(_binding_0);
2009 }
David Tolnay8c81f622018-07-31 23:34:35 -07002010 GenericMethodArgument::Const(ref _binding_0) => {
David Tolnayd60cfec2017-12-29 00:21:38 -05002011 _visitor.visit_expr(_binding_0);
2012 }
2013 }
2014}
David Tolnay8c81f622018-07-31 23:34:35 -07002015#[cfg(any(feature = "full", feature = "derive"))]
2016pub fn visit_generic_param<'ast, V: Visit<'ast> + ?Sized>(
2017 _visitor: &mut V,
2018 _i: &'ast GenericParam,
2019) {
David Tolnayc2f1aba2017-11-12 20:29:22 -08002020 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002021 GenericParam::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002022 _visitor.visit_type_param(_binding_0);
David Tolnayc2f1aba2017-11-12 20:29:22 -08002023 }
David Tolnay8c81f622018-07-31 23:34:35 -07002024 GenericParam::Lifetime(ref _binding_0) => {
David Tolnay517f3692018-01-01 20:17:23 -08002025 _visitor.visit_lifetime_def(_binding_0);
2026 }
David Tolnay8c81f622018-07-31 23:34:35 -07002027 GenericParam::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002028 _visitor.visit_const_param(_binding_0);
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05002029 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08002030 }
2031}
David Tolnay8c81f622018-07-31 23:34:35 -07002032#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002033pub fn visit_generics<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Generics) {
David Tolnay8c81f622018-07-31 23:34:35 -07002034 if let Some(ref it) = _i.lt_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002035 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002036 };
2037 for el in Punctuated::pairs(&_i.params) {
2038 let it = el.value();
2039 _visitor.visit_generic_param(it)
2040 }
2041 if let Some(ref it) = _i.gt_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002042 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002043 };
2044 if let Some(ref it) = _i.where_clause {
2045 _visitor.visit_where_clause(it)
2046 };
Nika Layzell27726662017-10-24 23:16:35 -04002047}
David Tolnay8c81f622018-07-31 23:34:35 -07002048pub fn visit_ident<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Ident) {}
2049#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002050pub fn visit_impl_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ImplItem) {
Nika Layzell27726662017-10-24 23:16:35 -04002051 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002052 ImplItem::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002053 _visitor.visit_impl_item_const(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002054 }
David Tolnay8c81f622018-07-31 23:34:35 -07002055 ImplItem::Method(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002056 _visitor.visit_impl_item_method(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002057 }
David Tolnay8c81f622018-07-31 23:34:35 -07002058 ImplItem::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002059 _visitor.visit_impl_item_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002060 }
David Tolnaybb82ef02018-08-24 20:15:45 -04002061 ImplItem::Existential(ref _binding_0) => {
2062 _visitor.visit_impl_item_existential(_binding_0);
2063 }
David Tolnay8c81f622018-07-31 23:34:35 -07002064 ImplItem::Macro(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002065 _visitor.visit_impl_item_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002066 }
David Tolnay8c81f622018-07-31 23:34:35 -07002067 ImplItem::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002068 _visitor.visit_impl_item_verbatim(_binding_0);
2069 }
Nika Layzell27726662017-10-24 23:16:35 -04002070 }
2071}
David Tolnay8c81f622018-07-31 23:34:35 -07002072#[cfg(feature = "full")]
2073pub fn visit_impl_item_const<'ast, V: Visit<'ast> + ?Sized>(
2074 _visitor: &mut V,
2075 _i: &'ast ImplItemConst,
2076) {
2077 for it in &_i.attrs {
2078 _visitor.visit_attribute(it)
2079 }
2080 _visitor.visit_visibility(&_i.vis);
2081 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002082 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002083 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002084 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002085 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002086 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002087 _visitor.visit_type(&_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002088 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002089 _visitor.visit_expr(&_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04002090 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay857628c2017-11-11 12:25:31 -08002091}
David Tolnay8c81f622018-07-31 23:34:35 -07002092#[cfg(feature = "full")]
David Tolnaybb82ef02018-08-24 20:15:45 -04002093pub fn visit_impl_item_existential<'ast, V: Visit<'ast> + ?Sized>(
2094 _visitor: &mut V,
2095 _i: &'ast ImplItemExistential,
2096) {
2097 for it in &_i.attrs {
2098 _visitor.visit_attribute(it)
2099 }
2100 tokens_helper(_visitor, &_i.existential_token.span);
2101 tokens_helper(_visitor, &_i.type_token.span);
2102 _visitor.visit_ident(&_i.ident);
2103 _visitor.visit_generics(&_i.generics);
2104 if let Some(ref it) = _i.colon_token {
2105 tokens_helper(_visitor, &it.spans)
2106 };
2107 for el in Punctuated::pairs(&_i.bounds) {
2108 let it = el.value();
2109 _visitor.visit_type_param_bound(it)
2110 }
2111 tokens_helper(_visitor, &_i.semi_token.spans);
2112}
2113#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07002114pub fn visit_impl_item_macro<'ast, V: Visit<'ast> + ?Sized>(
2115 _visitor: &mut V,
2116 _i: &'ast ImplItemMacro,
2117) {
2118 for it in &_i.attrs {
2119 _visitor.visit_attribute(it)
2120 }
2121 _visitor.visit_macro(&_i.mac);
2122 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002123 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002124 };
David Tolnay857628c2017-11-11 12:25:31 -08002125}
David Tolnay8c81f622018-07-31 23:34:35 -07002126#[cfg(feature = "full")]
2127pub fn visit_impl_item_method<'ast, V: Visit<'ast> + ?Sized>(
2128 _visitor: &mut V,
2129 _i: &'ast ImplItemMethod,
2130) {
2131 for it in &_i.attrs {
2132 _visitor.visit_attribute(it)
2133 }
2134 _visitor.visit_visibility(&_i.vis);
2135 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002136 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002137 };
2138 _visitor.visit_method_sig(&_i.sig);
2139 _visitor.visit_block(&_i.block);
Nika Layzell27726662017-10-24 23:16:35 -04002140}
David Tolnay8c81f622018-07-31 23:34:35 -07002141#[cfg(feature = "full")]
2142pub fn visit_impl_item_type<'ast, V: Visit<'ast> + ?Sized>(
2143 _visitor: &mut V,
2144 _i: &'ast ImplItemType,
2145) {
2146 for it in &_i.attrs {
2147 _visitor.visit_attribute(it)
2148 }
2149 _visitor.visit_visibility(&_i.vis);
2150 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002151 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002152 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002153 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002154 _visitor.visit_ident(&_i.ident);
2155 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04002156 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002157 _visitor.visit_type(&_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002158 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002159}
David Tolnay8c81f622018-07-31 23:34:35 -07002160#[cfg(feature = "full")]
2161pub fn visit_impl_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
2162 _visitor: &mut V,
2163 _i: &'ast ImplItemVerbatim,
2164) {
David Tolnay6af48992018-08-01 11:16:28 -07002165 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05002166}
David Tolnay8c81f622018-07-31 23:34:35 -07002167#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002168pub fn visit_index<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Index) {
David Tolnay6af48992018-08-01 11:16:28 -07002169 skip!(_i.index);
David Tolnay8c81f622018-07-31 23:34:35 -07002170 _visitor.visit_span(&_i.span);
David Tolnay85b69a42017-12-27 20:43:10 -05002171}
David Tolnay8c81f622018-07-31 23:34:35 -07002172#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002173pub fn visit_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Item) {
Nika Layzell27726662017-10-24 23:16:35 -04002174 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002175 Item::ExternCrate(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002176 _visitor.visit_item_extern_crate(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002177 }
David Tolnay8c81f622018-07-31 23:34:35 -07002178 Item::Use(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002179 _visitor.visit_item_use(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002180 }
David Tolnay8c81f622018-07-31 23:34:35 -07002181 Item::Static(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002182 _visitor.visit_item_static(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002183 }
David Tolnay8c81f622018-07-31 23:34:35 -07002184 Item::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002185 _visitor.visit_item_const(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002186 }
David Tolnay8c81f622018-07-31 23:34:35 -07002187 Item::Fn(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002188 _visitor.visit_item_fn(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002189 }
David Tolnay8c81f622018-07-31 23:34:35 -07002190 Item::Mod(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002191 _visitor.visit_item_mod(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002192 }
David Tolnay8c81f622018-07-31 23:34:35 -07002193 Item::ForeignMod(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002194 _visitor.visit_item_foreign_mod(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002195 }
David Tolnay8c81f622018-07-31 23:34:35 -07002196 Item::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002197 _visitor.visit_item_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002198 }
David Tolnaybb82ef02018-08-24 20:15:45 -04002199 Item::Existential(ref _binding_0) => {
2200 _visitor.visit_item_existential(_binding_0);
2201 }
David Tolnay8c81f622018-07-31 23:34:35 -07002202 Item::Struct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002203 _visitor.visit_item_struct(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002204 }
David Tolnay8c81f622018-07-31 23:34:35 -07002205 Item::Enum(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05002206 _visitor.visit_item_enum(_binding_0);
2207 }
David Tolnay8c81f622018-07-31 23:34:35 -07002208 Item::Union(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002209 _visitor.visit_item_union(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002210 }
David Tolnay8c81f622018-07-31 23:34:35 -07002211 Item::Trait(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002212 _visitor.visit_item_trait(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002213 }
David Tolnay8c81f622018-07-31 23:34:35 -07002214 Item::Impl(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002215 _visitor.visit_item_impl(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002216 }
David Tolnay8c81f622018-07-31 23:34:35 -07002217 Item::Macro(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002218 _visitor.visit_item_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002219 }
David Tolnay8c81f622018-07-31 23:34:35 -07002220 Item::Macro2(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002221 _visitor.visit_item_macro2(_binding_0);
David Tolnay500d8322017-12-18 00:32:51 -08002222 }
David Tolnay8c81f622018-07-31 23:34:35 -07002223 Item::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002224 _visitor.visit_item_verbatim(_binding_0);
2225 }
Nika Layzell27726662017-10-24 23:16:35 -04002226 }
2227}
David Tolnay8c81f622018-07-31 23:34:35 -07002228#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002229pub fn visit_item_const<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemConst) {
David Tolnay8c81f622018-07-31 23:34:35 -07002230 for it in &_i.attrs {
2231 _visitor.visit_attribute(it)
2232 }
2233 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002234 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002235 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002236 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002237 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002238 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002239 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04002240 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnayc6b55bc2017-11-09 22:48:38 -08002241}
David Tolnay8c81f622018-07-31 23:34:35 -07002242#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002243pub fn visit_item_enum<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemEnum) {
David Tolnay8c81f622018-07-31 23:34:35 -07002244 for it in &_i.attrs {
2245 _visitor.visit_attribute(it)
2246 }
2247 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002248 tokens_helper(_visitor, &_i.enum_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002249 _visitor.visit_ident(&_i.ident);
2250 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04002251 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002252 for el in Punctuated::pairs(&_i.variants) {
2253 let it = el.value();
2254 _visitor.visit_variant(it)
2255 }
David Tolnayc6b55bc2017-11-09 22:48:38 -08002256}
David Tolnay8c81f622018-07-31 23:34:35 -07002257#[cfg(feature = "full")]
David Tolnaybb82ef02018-08-24 20:15:45 -04002258pub fn visit_item_existential<'ast, V: Visit<'ast> + ?Sized>(
2259 _visitor: &mut V,
2260 _i: &'ast ItemExistential,
2261) {
2262 for it in &_i.attrs {
2263 _visitor.visit_attribute(it)
2264 }
2265 _visitor.visit_visibility(&_i.vis);
2266 tokens_helper(_visitor, &_i.existential_token.span);
2267 tokens_helper(_visitor, &_i.type_token.span);
2268 _visitor.visit_ident(&_i.ident);
2269 _visitor.visit_generics(&_i.generics);
2270 if let Some(ref it) = _i.colon_token {
2271 tokens_helper(_visitor, &it.spans)
2272 };
2273 for el in Punctuated::pairs(&_i.bounds) {
2274 let it = el.value();
2275 _visitor.visit_type_param_bound(it)
2276 }
2277 tokens_helper(_visitor, &_i.semi_token.spans);
2278}
2279#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07002280pub fn visit_item_extern_crate<'ast, V: Visit<'ast> + ?Sized>(
2281 _visitor: &mut V,
2282 _i: &'ast ItemExternCrate,
2283) {
2284 for it in &_i.attrs {
2285 _visitor.visit_attribute(it)
2286 }
2287 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002288 tokens_helper(_visitor, &_i.extern_token.span);
2289 tokens_helper(_visitor, &_i.crate_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002290 _visitor.visit_ident(&_i.ident);
2291 if let Some(ref it) = _i.rename {
David Tolnay7ac699c2018-08-24 14:00:58 -04002292 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002293 _visitor.visit_ident(&(it).1);
2294 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002295 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnayc6b55bc2017-11-09 22:48:38 -08002296}
David Tolnay8c81f622018-07-31 23:34:35 -07002297#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002298pub fn visit_item_fn<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemFn) {
David Tolnay8c81f622018-07-31 23:34:35 -07002299 for it in &_i.attrs {
2300 _visitor.visit_attribute(it)
2301 }
2302 _visitor.visit_visibility(&_i.vis);
2303 if let Some(ref it) = _i.constness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002304 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002305 };
2306 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002307 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002308 };
Yusuke Sasakif00a3ef2018-07-20 22:08:42 +09002309 if let Some(ref it) = _i.asyncness {
2310 tokens_helper(_visitor, &it.span)
2311 };
David Tolnay8c81f622018-07-31 23:34:35 -07002312 if let Some(ref it) = _i.abi {
2313 _visitor.visit_abi(it)
2314 };
2315 _visitor.visit_ident(&_i.ident);
2316 _visitor.visit_fn_decl(&*_i.decl);
2317 _visitor.visit_block(&*_i.block);
David Tolnayc6b55bc2017-11-09 22:48:38 -08002318}
David Tolnay8c81f622018-07-31 23:34:35 -07002319#[cfg(feature = "full")]
2320pub fn visit_item_foreign_mod<'ast, V: Visit<'ast> + ?Sized>(
2321 _visitor: &mut V,
2322 _i: &'ast ItemForeignMod,
2323) {
2324 for it in &_i.attrs {
2325 _visitor.visit_attribute(it)
2326 }
2327 _visitor.visit_abi(&_i.abi);
David Tolnay7ac699c2018-08-24 14:00:58 -04002328 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002329 for it in &_i.items {
2330 _visitor.visit_foreign_item(it)
2331 }
David Tolnayc6b55bc2017-11-09 22:48:38 -08002332}
David Tolnay8c81f622018-07-31 23:34:35 -07002333#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002334pub fn visit_item_impl<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemImpl) {
David Tolnay8c81f622018-07-31 23:34:35 -07002335 for it in &_i.attrs {
2336 _visitor.visit_attribute(it)
2337 }
2338 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002339 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002340 };
2341 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002342 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002343 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002344 tokens_helper(_visitor, &_i.impl_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002345 _visitor.visit_generics(&_i.generics);
2346 if let Some(ref it) = _i.trait_ {
2347 if let Some(ref it) = (it).0 {
David Tolnay7ac699c2018-08-24 14:00:58 -04002348 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002349 };
2350 _visitor.visit_path(&(it).1);
David Tolnay7ac699c2018-08-24 14:00:58 -04002351 tokens_helper(_visitor, &(it).2.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002352 };
2353 _visitor.visit_type(&*_i.self_ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002354 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002355 for it in &_i.items {
2356 _visitor.visit_impl_item(it)
2357 }
David Tolnayc6b55bc2017-11-09 22:48:38 -08002358}
David Tolnay8c81f622018-07-31 23:34:35 -07002359#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002360pub fn visit_item_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemMacro) {
David Tolnay8c81f622018-07-31 23:34:35 -07002361 for it in &_i.attrs {
2362 _visitor.visit_attribute(it)
2363 }
2364 if let Some(ref it) = _i.ident {
2365 _visitor.visit_ident(it)
2366 };
2367 _visitor.visit_macro(&_i.mac);
2368 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002369 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002370 };
David Tolnayc6b55bc2017-11-09 22:48:38 -08002371}
David Tolnay8c81f622018-07-31 23:34:35 -07002372#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002373pub fn visit_item_macro2<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemMacro2) {
David Tolnay8c81f622018-07-31 23:34:35 -07002374 for it in &_i.attrs {
2375 _visitor.visit_attribute(it)
2376 }
2377 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002378 tokens_helper(_visitor, &_i.macro_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002379 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002380 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay6af48992018-08-01 11:16:28 -07002381 skip!(_i.args);
David Tolnay7ac699c2018-08-24 14:00:58 -04002382 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay6af48992018-08-01 11:16:28 -07002383 skip!(_i.body);
David Tolnay500d8322017-12-18 00:32:51 -08002384}
David Tolnay8c81f622018-07-31 23:34:35 -07002385#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002386pub fn visit_item_mod<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemMod) {
David Tolnay8c81f622018-07-31 23:34:35 -07002387 for it in &_i.attrs {
2388 _visitor.visit_attribute(it)
2389 }
2390 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002391 tokens_helper(_visitor, &_i.mod_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002392 _visitor.visit_ident(&_i.ident);
2393 if let Some(ref it) = _i.content {
David Tolnay7ac699c2018-08-24 14:00:58 -04002394 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002395 for it in &(it).1 {
2396 _visitor.visit_item(it)
2397 }
2398 };
2399 if let Some(ref it) = _i.semi {
David Tolnay7ac699c2018-08-24 14:00:58 -04002400 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002401 };
Nika Layzell27726662017-10-24 23:16:35 -04002402}
David Tolnay8c81f622018-07-31 23:34:35 -07002403#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002404pub fn visit_item_static<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemStatic) {
David Tolnay8c81f622018-07-31 23:34:35 -07002405 for it in &_i.attrs {
2406 _visitor.visit_attribute(it)
2407 }
2408 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002409 tokens_helper(_visitor, &_i.static_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002410 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04002411 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002412 };
2413 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002414 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002415 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002416 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002417 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04002418 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002419}
David Tolnay8c81f622018-07-31 23:34:35 -07002420#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002421pub fn visit_item_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemStruct) {
David Tolnay8c81f622018-07-31 23:34:35 -07002422 for it in &_i.attrs {
2423 _visitor.visit_attribute(it)
2424 }
2425 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002426 tokens_helper(_visitor, &_i.struct_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002427 _visitor.visit_ident(&_i.ident);
2428 _visitor.visit_generics(&_i.generics);
2429 _visitor.visit_fields(&_i.fields);
2430 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002431 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002432 };
Nika Layzell27726662017-10-24 23:16:35 -04002433}
David Tolnay8c81f622018-07-31 23:34:35 -07002434#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002435pub fn visit_item_trait<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemTrait) {
David Tolnay8c81f622018-07-31 23:34:35 -07002436 for it in &_i.attrs {
2437 _visitor.visit_attribute(it)
2438 }
2439 _visitor.visit_visibility(&_i.vis);
2440 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002441 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002442 };
2443 if let Some(ref it) = _i.auto_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002444 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002445 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002446 tokens_helper(_visitor, &_i.trait_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002447 _visitor.visit_ident(&_i.ident);
2448 _visitor.visit_generics(&_i.generics);
2449 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002450 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002451 };
2452 for el in Punctuated::pairs(&_i.supertraits) {
2453 let it = el.value();
2454 _visitor.visit_type_param_bound(it)
2455 }
David Tolnay7ac699c2018-08-24 14:00:58 -04002456 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002457 for it in &_i.items {
2458 _visitor.visit_trait_item(it)
2459 }
Nika Layzell27726662017-10-24 23:16:35 -04002460}
David Tolnay8c81f622018-07-31 23:34:35 -07002461#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002462pub fn visit_item_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemType) {
David Tolnay8c81f622018-07-31 23:34:35 -07002463 for it in &_i.attrs {
2464 _visitor.visit_attribute(it)
2465 }
2466 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002467 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002468 _visitor.visit_ident(&_i.ident);
2469 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04002470 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002471 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002472 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002473}
David Tolnay8c81f622018-07-31 23:34:35 -07002474#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002475pub fn visit_item_union<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemUnion) {
David Tolnay8c81f622018-07-31 23:34:35 -07002476 for it in &_i.attrs {
2477 _visitor.visit_attribute(it)
2478 }
2479 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002480 tokens_helper(_visitor, &_i.union_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002481 _visitor.visit_ident(&_i.ident);
2482 _visitor.visit_generics(&_i.generics);
2483 _visitor.visit_fields_named(&_i.fields);
Nika Layzell27726662017-10-24 23:16:35 -04002484}
David Tolnay8c81f622018-07-31 23:34:35 -07002485#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002486pub fn visit_item_use<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemUse) {
David Tolnay8c81f622018-07-31 23:34:35 -07002487 for it in &_i.attrs {
2488 _visitor.visit_attribute(it)
2489 }
2490 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002491 tokens_helper(_visitor, &_i.use_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002492 if let Some(ref it) = _i.leading_colon {
David Tolnay7ac699c2018-08-24 14:00:58 -04002493 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002494 };
2495 _visitor.visit_use_tree(&_i.tree);
David Tolnay7ac699c2018-08-24 14:00:58 -04002496 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002497}
David Tolnay8c81f622018-07-31 23:34:35 -07002498#[cfg(feature = "full")]
2499pub fn visit_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
2500 _visitor: &mut V,
2501 _i: &'ast ItemVerbatim,
2502) {
David Tolnay6af48992018-08-01 11:16:28 -07002503 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05002504}
David Tolnay8c81f622018-07-31 23:34:35 -07002505#[cfg(any(feature = "full", feature = "derive"))]
2506#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002507pub fn visit_label<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Label) {
David Tolnay8c81f622018-07-31 23:34:35 -07002508 _visitor.visit_lifetime(&_i.name);
David Tolnay7ac699c2018-08-24 14:00:58 -04002509 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnaybcd498f2017-12-29 12:02:33 -05002510}
David Tolnay8c81f622018-07-31 23:34:35 -07002511#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002512pub fn visit_lifetime<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Lifetime) {
David Tolnay6af48992018-08-01 11:16:28 -07002513 skip!(_i.apostrophe);
David Tolnay8c81f622018-07-31 23:34:35 -07002514 _visitor.visit_ident(&_i.ident);
David Tolnay4ba63a02017-12-28 15:53:05 -05002515}
David Tolnay8c81f622018-07-31 23:34:35 -07002516#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002517pub fn visit_lifetime_def<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LifetimeDef) {
David Tolnay8c81f622018-07-31 23:34:35 -07002518 for it in &_i.attrs {
2519 _visitor.visit_attribute(it)
2520 }
2521 _visitor.visit_lifetime(&_i.lifetime);
2522 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002523 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002524 };
2525 for el in Punctuated::pairs(&_i.bounds) {
2526 let it = el.value();
2527 _visitor.visit_lifetime(it)
2528 }
David Tolnay4ba63a02017-12-28 15:53:05 -05002529}
David Tolnay8c81f622018-07-31 23:34:35 -07002530#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002531pub fn visit_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Lit) {
David Tolnay360efd22018-01-04 23:35:26 -08002532 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002533 Lit::Str(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002534 _visitor.visit_lit_str(_binding_0);
2535 }
David Tolnay8c81f622018-07-31 23:34:35 -07002536 Lit::ByteStr(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002537 _visitor.visit_lit_byte_str(_binding_0);
2538 }
David Tolnay8c81f622018-07-31 23:34:35 -07002539 Lit::Byte(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002540 _visitor.visit_lit_byte(_binding_0);
2541 }
David Tolnay8c81f622018-07-31 23:34:35 -07002542 Lit::Char(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002543 _visitor.visit_lit_char(_binding_0);
2544 }
David Tolnay8c81f622018-07-31 23:34:35 -07002545 Lit::Int(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002546 _visitor.visit_lit_int(_binding_0);
2547 }
David Tolnay8c81f622018-07-31 23:34:35 -07002548 Lit::Float(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002549 _visitor.visit_lit_float(_binding_0);
2550 }
David Tolnay8c81f622018-07-31 23:34:35 -07002551 Lit::Bool(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002552 _visitor.visit_lit_bool(_binding_0);
2553 }
David Tolnay8c81f622018-07-31 23:34:35 -07002554 Lit::Verbatim(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002555 _visitor.visit_lit_verbatim(_binding_0);
2556 }
2557 }
2558}
David Tolnay8c81f622018-07-31 23:34:35 -07002559#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002560pub fn visit_lit_bool<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitBool) {
David Tolnay6af48992018-08-01 11:16:28 -07002561 skip!(_i.value);
David Tolnay8c81f622018-07-31 23:34:35 -07002562 _visitor.visit_span(&_i.span);
Nika Layzell27726662017-10-24 23:16:35 -04002563}
David Tolnay8c81f622018-07-31 23:34:35 -07002564#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002565pub fn visit_lit_byte<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitByte) {
David Tolnay6af48992018-08-01 11:16:28 -07002566 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002567}
David Tolnay8c81f622018-07-31 23:34:35 -07002568#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002569pub fn visit_lit_byte_str<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitByteStr) {
David Tolnay6af48992018-08-01 11:16:28 -07002570 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002571}
David Tolnay8c81f622018-07-31 23:34:35 -07002572#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002573pub fn visit_lit_char<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitChar) {
David Tolnay6af48992018-08-01 11:16:28 -07002574 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002575}
David Tolnay8c81f622018-07-31 23:34:35 -07002576#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002577pub fn visit_lit_float<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitFloat) {
David Tolnay6af48992018-08-01 11:16:28 -07002578 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002579}
David Tolnay8c81f622018-07-31 23:34:35 -07002580#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002581pub fn visit_lit_int<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitInt) {
David Tolnay6af48992018-08-01 11:16:28 -07002582 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002583}
David Tolnay8c81f622018-07-31 23:34:35 -07002584#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002585pub fn visit_lit_str<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitStr) {
David Tolnay6af48992018-08-01 11:16:28 -07002586 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002587}
David Tolnay8c81f622018-07-31 23:34:35 -07002588#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002589pub fn visit_lit_verbatim<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitVerbatim) {
David Tolnay6af48992018-08-01 11:16:28 -07002590 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002591}
David Tolnay8c81f622018-07-31 23:34:35 -07002592#[cfg(any(feature = "full", feature = "derive"))]
2593#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002594pub fn visit_local<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Local) {
David Tolnay8c81f622018-07-31 23:34:35 -07002595 for it in &_i.attrs {
2596 _visitor.visit_attribute(it)
2597 }
David Tolnay7ac699c2018-08-24 14:00:58 -04002598 tokens_helper(_visitor, &_i.let_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002599 for el in Punctuated::pairs(&_i.pats) {
2600 let it = el.value();
2601 _visitor.visit_pat(it)
2602 }
2603 if let Some(ref it) = _i.ty {
David Tolnay7ac699c2018-08-24 14:00:58 -04002604 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002605 _visitor.visit_type(&*(it).1);
2606 };
2607 if let Some(ref it) = _i.init {
David Tolnay7ac699c2018-08-24 14:00:58 -04002608 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002609 _visitor.visit_expr(&*(it).1);
2610 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002611 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002612}
David Tolnay8c81f622018-07-31 23:34:35 -07002613#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002614pub fn visit_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Macro) {
David Tolnay8c81f622018-07-31 23:34:35 -07002615 _visitor.visit_path(&_i.path);
David Tolnay7ac699c2018-08-24 14:00:58 -04002616 tokens_helper(_visitor, &_i.bang_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002617 _visitor.visit_macro_delimiter(&_i.delimiter);
David Tolnay6af48992018-08-01 11:16:28 -07002618 skip!(_i.tts);
David Tolnayab919512017-12-30 23:31:51 -05002619}
David Tolnay8c81f622018-07-31 23:34:35 -07002620#[cfg(any(feature = "full", feature = "derive"))]
2621pub fn visit_macro_delimiter<'ast, V: Visit<'ast> + ?Sized>(
2622 _visitor: &mut V,
2623 _i: &'ast MacroDelimiter,
2624) {
David Tolnayab919512017-12-30 23:31:51 -05002625 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002626 MacroDelimiter::Paren(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002627 tokens_helper(_visitor, &_binding_0.span);
David Tolnayab919512017-12-30 23:31:51 -05002628 }
David Tolnay8c81f622018-07-31 23:34:35 -07002629 MacroDelimiter::Brace(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002630 tokens_helper(_visitor, &_binding_0.span);
David Tolnayab919512017-12-30 23:31:51 -05002631 }
David Tolnay8c81f622018-07-31 23:34:35 -07002632 MacroDelimiter::Bracket(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002633 tokens_helper(_visitor, &_binding_0.span);
David Tolnayab919512017-12-30 23:31:51 -05002634 }
2635 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002636}
David Tolnay8c81f622018-07-31 23:34:35 -07002637#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002638pub fn visit_member<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Member) {
David Tolnay85b69a42017-12-27 20:43:10 -05002639 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002640 Member::Named(ref _binding_0) => {
Alex Crichtond261d092018-05-18 13:47:35 -07002641 _visitor.visit_ident(_binding_0);
David Tolnay85b69a42017-12-27 20:43:10 -05002642 }
David Tolnay8c81f622018-07-31 23:34:35 -07002643 Member::Unnamed(ref _binding_0) => {
David Tolnay85b69a42017-12-27 20:43:10 -05002644 _visitor.visit_index(_binding_0);
2645 }
2646 }
2647}
David Tolnay8c81f622018-07-31 23:34:35 -07002648#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayaaadd782018-01-06 22:58:13 -08002649pub fn visit_meta<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Meta) {
Nika Layzell27726662017-10-24 23:16:35 -04002650 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002651 Meta::Word(ref _binding_0) => {
Alex Crichtond261d092018-05-18 13:47:35 -07002652 _visitor.visit_ident(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002653 }
David Tolnay8c81f622018-07-31 23:34:35 -07002654 Meta::List(ref _binding_0) => {
David Tolnayaaadd782018-01-06 22:58:13 -08002655 _visitor.visit_meta_list(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002656 }
David Tolnay8c81f622018-07-31 23:34:35 -07002657 Meta::NameValue(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002658 _visitor.visit_meta_name_value(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002659 }
2660 }
2661}
David Tolnay8c81f622018-07-31 23:34:35 -07002662#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayaaadd782018-01-06 22:58:13 -08002663pub fn visit_meta_list<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast MetaList) {
David Tolnay8c81f622018-07-31 23:34:35 -07002664 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002665 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002666 for el in Punctuated::pairs(&_i.nested) {
2667 let it = el.value();
2668 _visitor.visit_nested_meta(it)
2669 }
Nika Layzell27726662017-10-24 23:16:35 -04002670}
David Tolnay8c81f622018-07-31 23:34:35 -07002671#[cfg(any(feature = "full", feature = "derive"))]
2672pub fn visit_meta_name_value<'ast, V: Visit<'ast> + ?Sized>(
2673 _visitor: &mut V,
2674 _i: &'ast MetaNameValue,
2675) {
2676 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002677 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002678 _visitor.visit_lit(&_i.lit);
Nika Layzell27726662017-10-24 23:16:35 -04002679}
David Tolnay8c81f622018-07-31 23:34:35 -07002680#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002681pub fn visit_method_sig<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast MethodSig) {
David Tolnay8c81f622018-07-31 23:34:35 -07002682 if let Some(ref it) = _i.constness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002683 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002684 };
2685 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002686 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002687 };
Yusuke Sasakif00a3ef2018-07-20 22:08:42 +09002688 if let Some(ref it) = _i.asyncness {
2689 tokens_helper(_visitor, &it.span)
2690 };
David Tolnay8c81f622018-07-31 23:34:35 -07002691 if let Some(ref it) = _i.abi {
2692 _visitor.visit_abi(it)
2693 };
2694 _visitor.visit_ident(&_i.ident);
2695 _visitor.visit_fn_decl(&_i.decl);
Nika Layzell27726662017-10-24 23:16:35 -04002696}
David Tolnay8c81f622018-07-31 23:34:35 -07002697#[cfg(any(feature = "full", feature = "derive"))]
2698#[cfg(feature = "full")]
2699pub fn visit_method_turbofish<'ast, V: Visit<'ast> + ?Sized>(
2700 _visitor: &mut V,
2701 _i: &'ast MethodTurbofish,
2702) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002703 tokens_helper(_visitor, &_i.colon2_token.spans);
2704 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002705 for el in Punctuated::pairs(&_i.args) {
2706 let it = el.value();
2707 _visitor.visit_generic_method_argument(it)
2708 }
David Tolnay7ac699c2018-08-24 14:00:58 -04002709 tokens_helper(_visitor, &_i.gt_token.spans);
David Tolnayd60cfec2017-12-29 00:21:38 -05002710}
David Tolnay8c81f622018-07-31 23:34:35 -07002711#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayaaadd782018-01-06 22:58:13 -08002712pub fn visit_nested_meta<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast NestedMeta) {
Nika Layzell27726662017-10-24 23:16:35 -04002713 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002714 NestedMeta::Meta(ref _binding_0) => {
David Tolnayaaadd782018-01-06 22:58:13 -08002715 _visitor.visit_meta(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002716 }
David Tolnay8c81f622018-07-31 23:34:35 -07002717 NestedMeta::Literal(ref _binding_0) => {
David Tolnay4ba63a02017-12-28 15:53:05 -05002718 _visitor.visit_lit(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002719 }
2720 }
2721}
David Tolnay8c81f622018-07-31 23:34:35 -07002722#[cfg(any(feature = "full", feature = "derive"))]
2723pub fn visit_parenthesized_generic_arguments<'ast, V: Visit<'ast> + ?Sized>(
2724 _visitor: &mut V,
2725 _i: &'ast ParenthesizedGenericArguments,
2726) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002727 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002728 for el in Punctuated::pairs(&_i.inputs) {
2729 let it = el.value();
2730 _visitor.visit_type(it)
2731 }
2732 _visitor.visit_return_type(&_i.output);
Nika Layzell27726662017-10-24 23:16:35 -04002733}
David Tolnay8c81f622018-07-31 23:34:35 -07002734#[cfg(any(feature = "full", feature = "derive"))]
2735#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002736pub fn visit_pat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Pat) {
Nika Layzell27726662017-10-24 23:16:35 -04002737 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002738 Pat::Wild(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002739 _visitor.visit_pat_wild(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002740 }
David Tolnay8c81f622018-07-31 23:34:35 -07002741 Pat::Ident(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002742 _visitor.visit_pat_ident(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002743 }
David Tolnay8c81f622018-07-31 23:34:35 -07002744 Pat::Struct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002745 _visitor.visit_pat_struct(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002746 }
David Tolnay8c81f622018-07-31 23:34:35 -07002747 Pat::TupleStruct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002748 _visitor.visit_pat_tuple_struct(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002749 }
David Tolnay8c81f622018-07-31 23:34:35 -07002750 Pat::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002751 _visitor.visit_pat_path(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002752 }
David Tolnay8c81f622018-07-31 23:34:35 -07002753 Pat::Tuple(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002754 _visitor.visit_pat_tuple(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002755 }
David Tolnay8c81f622018-07-31 23:34:35 -07002756 Pat::Box(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002757 _visitor.visit_pat_box(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002758 }
David Tolnay8c81f622018-07-31 23:34:35 -07002759 Pat::Ref(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002760 _visitor.visit_pat_ref(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002761 }
David Tolnay8c81f622018-07-31 23:34:35 -07002762 Pat::Lit(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002763 _visitor.visit_pat_lit(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002764 }
David Tolnay8c81f622018-07-31 23:34:35 -07002765 Pat::Range(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002766 _visitor.visit_pat_range(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002767 }
David Tolnay8c81f622018-07-31 23:34:35 -07002768 Pat::Slice(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002769 _visitor.visit_pat_slice(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002770 }
David Tolnay8c81f622018-07-31 23:34:35 -07002771 Pat::Macro(ref _binding_0) => {
David Tolnay323279a2017-12-29 11:26:32 -05002772 _visitor.visit_pat_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002773 }
David Tolnay8c81f622018-07-31 23:34:35 -07002774 Pat::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002775 _visitor.visit_pat_verbatim(_binding_0);
2776 }
Nika Layzell27726662017-10-24 23:16:35 -04002777 }
2778}
David Tolnay8c81f622018-07-31 23:34:35 -07002779#[cfg(any(feature = "full", feature = "derive"))]
2780#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002781pub fn visit_pat_box<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatBox) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002782 tokens_helper(_visitor, &_i.box_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002783 _visitor.visit_pat(&*_i.pat);
Nika Layzell27726662017-10-24 23:16:35 -04002784}
David Tolnay8c81f622018-07-31 23:34:35 -07002785#[cfg(any(feature = "full", feature = "derive"))]
2786#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002787pub fn visit_pat_ident<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatIdent) {
David Tolnay8c81f622018-07-31 23:34:35 -07002788 if let Some(ref it) = _i.by_ref {
David Tolnay7ac699c2018-08-24 14:00:58 -04002789 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002790 };
2791 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04002792 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002793 };
2794 _visitor.visit_ident(&_i.ident);
2795 if let Some(ref it) = _i.subpat {
David Tolnay7ac699c2018-08-24 14:00:58 -04002796 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002797 _visitor.visit_pat(&*(it).1);
2798 };
Nika Layzell27726662017-10-24 23:16:35 -04002799}
David Tolnay8c81f622018-07-31 23:34:35 -07002800#[cfg(any(feature = "full", feature = "derive"))]
2801#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002802pub fn visit_pat_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatLit) {
David Tolnay8c81f622018-07-31 23:34:35 -07002803 _visitor.visit_expr(&*_i.expr);
Nika Layzell27726662017-10-24 23:16:35 -04002804}
David Tolnay8c81f622018-07-31 23:34:35 -07002805#[cfg(any(feature = "full", feature = "derive"))]
2806#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002807pub fn visit_pat_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatMacro) {
David Tolnay8c81f622018-07-31 23:34:35 -07002808 _visitor.visit_macro(&_i.mac);
David Tolnay323279a2017-12-29 11:26:32 -05002809}
David Tolnay8c81f622018-07-31 23:34:35 -07002810#[cfg(any(feature = "full", feature = "derive"))]
2811#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002812pub fn visit_pat_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatPath) {
David Tolnay8c81f622018-07-31 23:34:35 -07002813 if let Some(ref it) = _i.qself {
2814 _visitor.visit_qself(it)
2815 };
2816 _visitor.visit_path(&_i.path);
Nika Layzell27726662017-10-24 23:16:35 -04002817}
David Tolnay8c81f622018-07-31 23:34:35 -07002818#[cfg(any(feature = "full", feature = "derive"))]
2819#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002820pub fn visit_pat_range<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatRange) {
David Tolnay8c81f622018-07-31 23:34:35 -07002821 _visitor.visit_expr(&*_i.lo);
2822 _visitor.visit_range_limits(&_i.limits);
2823 _visitor.visit_expr(&*_i.hi);
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_ref<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatRef) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002828 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002829 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04002830 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002831 };
2832 _visitor.visit_pat(&*_i.pat);
Nika Layzell27726662017-10-24 23:16:35 -04002833}
David Tolnay8c81f622018-07-31 23:34:35 -07002834#[cfg(any(feature = "full", feature = "derive"))]
2835#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002836pub fn visit_pat_slice<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatSlice) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002837 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002838 for el in Punctuated::pairs(&_i.front) {
2839 let it = el.value();
2840 _visitor.visit_pat(it)
2841 }
2842 if let Some(ref it) = _i.middle {
2843 _visitor.visit_pat(&**it)
2844 };
2845 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002846 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002847 };
2848 if let Some(ref it) = _i.comma_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002849 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002850 };
2851 for el in Punctuated::pairs(&_i.back) {
2852 let it = el.value();
2853 _visitor.visit_pat(it)
2854 }
Nika Layzell27726662017-10-24 23:16:35 -04002855}
David Tolnay8c81f622018-07-31 23:34:35 -07002856#[cfg(any(feature = "full", feature = "derive"))]
2857#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002858pub fn visit_pat_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatStruct) {
David Tolnay8c81f622018-07-31 23:34:35 -07002859 _visitor.visit_path(&_i.path);
David Tolnay7ac699c2018-08-24 14:00:58 -04002860 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002861 for el in Punctuated::pairs(&_i.fields) {
2862 let it = el.value();
2863 _visitor.visit_field_pat(it)
2864 }
2865 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002866 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002867 };
Nika Layzell27726662017-10-24 23:16:35 -04002868}
David Tolnay8c81f622018-07-31 23:34:35 -07002869#[cfg(any(feature = "full", feature = "derive"))]
2870#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002871pub fn visit_pat_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatTuple) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002872 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002873 for el in Punctuated::pairs(&_i.front) {
2874 let it = el.value();
2875 _visitor.visit_pat(it)
2876 }
2877 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002878 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002879 };
2880 if let Some(ref it) = _i.comma_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002881 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002882 };
2883 for el in Punctuated::pairs(&_i.back) {
2884 let it = el.value();
2885 _visitor.visit_pat(it)
2886 }
Nika Layzell27726662017-10-24 23:16:35 -04002887}
David Tolnay8c81f622018-07-31 23:34:35 -07002888#[cfg(any(feature = "full", feature = "derive"))]
2889#[cfg(feature = "full")]
2890pub fn visit_pat_tuple_struct<'ast, V: Visit<'ast> + ?Sized>(
2891 _visitor: &mut V,
2892 _i: &'ast PatTupleStruct,
2893) {
2894 _visitor.visit_path(&_i.path);
2895 _visitor.visit_pat_tuple(&_i.pat);
Nika Layzell27726662017-10-24 23:16:35 -04002896}
David Tolnay8c81f622018-07-31 23:34:35 -07002897#[cfg(any(feature = "full", feature = "derive"))]
2898#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002899pub fn visit_pat_verbatim<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatVerbatim) {
David Tolnay6af48992018-08-01 11:16:28 -07002900 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05002901}
David Tolnay8c81f622018-07-31 23:34:35 -07002902#[cfg(any(feature = "full", feature = "derive"))]
2903#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002904pub fn visit_pat_wild<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatWild) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002905 tokens_helper(_visitor, &_i.underscore_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002906}
David Tolnay8c81f622018-07-31 23:34:35 -07002907#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002908pub fn visit_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Path) {
David Tolnay8c81f622018-07-31 23:34:35 -07002909 if let Some(ref it) = _i.leading_colon {
David Tolnay7ac699c2018-08-24 14:00:58 -04002910 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002911 };
2912 for el in Punctuated::pairs(&_i.segments) {
2913 let it = el.value();
2914 _visitor.visit_path_segment(it)
2915 }
Nika Layzell27726662017-10-24 23:16:35 -04002916}
David Tolnay8c81f622018-07-31 23:34:35 -07002917#[cfg(any(feature = "full", feature = "derive"))]
2918pub fn visit_path_arguments<'ast, V: Visit<'ast> + ?Sized>(
2919 _visitor: &mut V,
2920 _i: &'ast PathArguments,
2921) {
Nika Layzellc08227a2017-12-04 16:30:17 -05002922 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002923 PathArguments::None => {}
2924 PathArguments::AngleBracketed(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002925 _visitor.visit_angle_bracketed_generic_arguments(_binding_0);
Nika Layzellc08227a2017-12-04 16:30:17 -05002926 }
David Tolnay8c81f622018-07-31 23:34:35 -07002927 PathArguments::Parenthesized(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002928 _visitor.visit_parenthesized_generic_arguments(_binding_0);
Nika Layzellc08227a2017-12-04 16:30:17 -05002929 }
2930 }
2931}
David Tolnay8c81f622018-07-31 23:34:35 -07002932#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002933pub fn visit_path_segment<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PathSegment) {
David Tolnay8c81f622018-07-31 23:34:35 -07002934 _visitor.visit_ident(&_i.ident);
2935 _visitor.visit_path_arguments(&_i.arguments);
Nika Layzell27726662017-10-24 23:16:35 -04002936}
David Tolnay8c81f622018-07-31 23:34:35 -07002937#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002938pub fn visit_predicate_eq<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PredicateEq) {
David Tolnay8c81f622018-07-31 23:34:35 -07002939 _visitor.visit_type(&_i.lhs_ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002940 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002941 _visitor.visit_type(&_i.rhs_ty);
David Tolnayd4add852018-01-01 20:13:24 -08002942}
David Tolnay8c81f622018-07-31 23:34:35 -07002943#[cfg(any(feature = "full", feature = "derive"))]
2944pub fn visit_predicate_lifetime<'ast, V: Visit<'ast> + ?Sized>(
2945 _visitor: &mut V,
2946 _i: &'ast PredicateLifetime,
2947) {
2948 _visitor.visit_lifetime(&_i.lifetime);
David Tolnay1b8e2852018-08-26 08:25:18 -04002949 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002950 for el in Punctuated::pairs(&_i.bounds) {
2951 let it = el.value();
2952 _visitor.visit_lifetime(it)
2953 }
David Tolnayd4add852018-01-01 20:13:24 -08002954}
David Tolnay8c81f622018-07-31 23:34:35 -07002955#[cfg(any(feature = "full", feature = "derive"))]
2956pub fn visit_predicate_type<'ast, V: Visit<'ast> + ?Sized>(
2957 _visitor: &mut V,
2958 _i: &'ast PredicateType,
2959) {
2960 if let Some(ref it) = _i.lifetimes {
2961 _visitor.visit_bound_lifetimes(it)
2962 };
2963 _visitor.visit_type(&_i.bounded_ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002964 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002965 for el in Punctuated::pairs(&_i.bounds) {
2966 let it = el.value();
2967 _visitor.visit_type_param_bound(it)
2968 }
David Tolnayd4add852018-01-01 20:13:24 -08002969}
David Tolnay8c81f622018-07-31 23:34:35 -07002970#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002971pub fn visit_qself<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast QSelf) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002972 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002973 _visitor.visit_type(&*_i.ty);
David Tolnay6af48992018-08-01 11:16:28 -07002974 skip!(_i.position);
David Tolnay8c81f622018-07-31 23:34:35 -07002975 if let Some(ref it) = _i.as_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002976 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002977 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002978 tokens_helper(_visitor, &_i.gt_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002979}
David Tolnay8c81f622018-07-31 23:34:35 -07002980#[cfg(any(feature = "full", feature = "derive"))]
2981#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002982pub fn visit_range_limits<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast RangeLimits) {
Nika Layzell27726662017-10-24 23:16:35 -04002983 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002984 RangeLimits::HalfOpen(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002985 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002986 }
David Tolnay8c81f622018-07-31 23:34:35 -07002987 RangeLimits::Closed(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002988 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002989 }
2990 }
2991}
David Tolnay8c81f622018-07-31 23:34:35 -07002992#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002993pub fn visit_return_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ReturnType) {
David Tolnayf93b90d2017-11-11 19:21:26 -08002994 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002995 ReturnType::Default => {}
2996 ReturnType::Type(ref _binding_0, ref _binding_1) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002997 tokens_helper(_visitor, &_binding_0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002998 _visitor.visit_type(&**_binding_1);
David Tolnayf93b90d2017-11-11 19:21:26 -08002999 }
3000 }
3001}
David Tolnay8c81f622018-07-31 23:34:35 -07003002pub fn visit_span<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Span) {}
3003#[cfg(any(feature = "full", feature = "derive"))]
3004#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003005pub fn visit_stmt<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Stmt) {
Nika Layzell27726662017-10-24 23:16:35 -04003006 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003007 Stmt::Local(ref _binding_0) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08003008 _visitor.visit_local(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003009 }
David Tolnay8c81f622018-07-31 23:34:35 -07003010 Stmt::Item(ref _binding_0) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08003011 _visitor.visit_item(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003012 }
David Tolnay8c81f622018-07-31 23:34:35 -07003013 Stmt::Expr(ref _binding_0) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08003014 _visitor.visit_expr(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003015 }
David Tolnay8c81f622018-07-31 23:34:35 -07003016 Stmt::Semi(ref _binding_0, ref _binding_1) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08003017 _visitor.visit_expr(_binding_0);
David Tolnay7ac699c2018-08-24 14:00:58 -04003018 tokens_helper(_visitor, &_binding_1.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003019 }
Nika Layzell27726662017-10-24 23:16:35 -04003020 }
3021}
David Tolnay8c81f622018-07-31 23:34:35 -07003022#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003023pub fn visit_trait_bound<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TraitBound) {
David Tolnay8c81f622018-07-31 23:34:35 -07003024 if let Some(ref it) = _i.paren_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003025 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003026 };
3027 _visitor.visit_trait_bound_modifier(&_i.modifier);
3028 if let Some(ref it) = _i.lifetimes {
3029 _visitor.visit_bound_lifetimes(it)
3030 };
3031 _visitor.visit_path(&_i.path);
David Tolnay40fb8ce2018-01-02 10:53:46 -08003032}
David Tolnay8c81f622018-07-31 23:34:35 -07003033#[cfg(any(feature = "full", feature = "derive"))]
3034pub fn visit_trait_bound_modifier<'ast, V: Visit<'ast> + ?Sized>(
3035 _visitor: &mut V,
3036 _i: &'ast TraitBoundModifier,
3037) {
Nika Layzell27726662017-10-24 23:16:35 -04003038 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003039 TraitBoundModifier::None => {}
3040 TraitBoundModifier::Maybe(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003041 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003042 }
3043 }
3044}
David Tolnay8c81f622018-07-31 23:34:35 -07003045#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003046pub fn visit_trait_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TraitItem) {
Nika Layzell27726662017-10-24 23:16:35 -04003047 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003048 TraitItem::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003049 _visitor.visit_trait_item_const(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003050 }
David Tolnay8c81f622018-07-31 23:34:35 -07003051 TraitItem::Method(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003052 _visitor.visit_trait_item_method(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003053 }
David Tolnay8c81f622018-07-31 23:34:35 -07003054 TraitItem::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003055 _visitor.visit_trait_item_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003056 }
David Tolnay8c81f622018-07-31 23:34:35 -07003057 TraitItem::Macro(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003058 _visitor.visit_trait_item_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003059 }
David Tolnay8c81f622018-07-31 23:34:35 -07003060 TraitItem::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05003061 _visitor.visit_trait_item_verbatim(_binding_0);
3062 }
Nika Layzell27726662017-10-24 23:16:35 -04003063 }
3064}
David Tolnay8c81f622018-07-31 23:34:35 -07003065#[cfg(feature = "full")]
3066pub fn visit_trait_item_const<'ast, V: Visit<'ast> + ?Sized>(
3067 _visitor: &mut V,
3068 _i: &'ast TraitItemConst,
3069) {
3070 for it in &_i.attrs {
3071 _visitor.visit_attribute(it)
3072 }
David Tolnay7ac699c2018-08-24 14:00:58 -04003073 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003074 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04003075 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003076 _visitor.visit_type(&_i.ty);
3077 if let Some(ref it) = _i.default {
David Tolnay7ac699c2018-08-24 14:00:58 -04003078 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003079 _visitor.visit_expr(&(it).1);
3080 };
David Tolnay7ac699c2018-08-24 14:00:58 -04003081 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnayda705bd2017-11-10 21:58:05 -08003082}
David Tolnay8c81f622018-07-31 23:34:35 -07003083#[cfg(feature = "full")]
3084pub fn visit_trait_item_macro<'ast, V: Visit<'ast> + ?Sized>(
3085 _visitor: &mut V,
3086 _i: &'ast TraitItemMacro,
3087) {
3088 for it in &_i.attrs {
3089 _visitor.visit_attribute(it)
3090 }
3091 _visitor.visit_macro(&_i.mac);
3092 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003093 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003094 };
David Tolnayda705bd2017-11-10 21:58:05 -08003095}
David Tolnay8c81f622018-07-31 23:34:35 -07003096#[cfg(feature = "full")]
3097pub fn visit_trait_item_method<'ast, V: Visit<'ast> + ?Sized>(
3098 _visitor: &mut V,
3099 _i: &'ast TraitItemMethod,
3100) {
3101 for it in &_i.attrs {
3102 _visitor.visit_attribute(it)
3103 }
3104 _visitor.visit_method_sig(&_i.sig);
3105 if let Some(ref it) = _i.default {
3106 _visitor.visit_block(it)
3107 };
3108 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003109 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003110 };
Nika Layzell27726662017-10-24 23:16:35 -04003111}
David Tolnay8c81f622018-07-31 23:34:35 -07003112#[cfg(feature = "full")]
3113pub fn visit_trait_item_type<'ast, V: Visit<'ast> + ?Sized>(
3114 _visitor: &mut V,
3115 _i: &'ast TraitItemType,
3116) {
3117 for it in &_i.attrs {
3118 _visitor.visit_attribute(it)
3119 }
David Tolnay7ac699c2018-08-24 14:00:58 -04003120 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003121 _visitor.visit_ident(&_i.ident);
3122 _visitor.visit_generics(&_i.generics);
3123 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003124 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003125 };
3126 for el in Punctuated::pairs(&_i.bounds) {
3127 let it = el.value();
3128 _visitor.visit_type_param_bound(it)
3129 }
3130 if let Some(ref it) = _i.default {
David Tolnay7ac699c2018-08-24 14:00:58 -04003131 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003132 _visitor.visit_type(&(it).1);
3133 };
David Tolnay7ac699c2018-08-24 14:00:58 -04003134 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003135}
David Tolnay8c81f622018-07-31 23:34:35 -07003136#[cfg(feature = "full")]
3137pub fn visit_trait_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
3138 _visitor: &mut V,
3139 _i: &'ast TraitItemVerbatim,
3140) {
David Tolnay6af48992018-08-01 11:16:28 -07003141 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05003142}
David Tolnay8c81f622018-07-31 23:34:35 -07003143#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003144pub fn visit_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Type) {
Nika Layzell27726662017-10-24 23:16:35 -04003145 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003146 Type::Slice(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003147 _visitor.visit_type_slice(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003148 }
David Tolnay8c81f622018-07-31 23:34:35 -07003149 Type::Array(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003150 _visitor.visit_type_array(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003151 }
David Tolnay8c81f622018-07-31 23:34:35 -07003152 Type::Ptr(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003153 _visitor.visit_type_ptr(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003154 }
David Tolnay8c81f622018-07-31 23:34:35 -07003155 Type::Reference(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003156 _visitor.visit_type_reference(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003157 }
David Tolnay8c81f622018-07-31 23:34:35 -07003158 Type::BareFn(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003159 _visitor.visit_type_bare_fn(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003160 }
David Tolnay8c81f622018-07-31 23:34:35 -07003161 Type::Never(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003162 _visitor.visit_type_never(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003163 }
David Tolnay8c81f622018-07-31 23:34:35 -07003164 Type::Tuple(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003165 _visitor.visit_type_tuple(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003166 }
David Tolnay8c81f622018-07-31 23:34:35 -07003167 Type::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003168 _visitor.visit_type_path(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003169 }
David Tolnay8c81f622018-07-31 23:34:35 -07003170 Type::TraitObject(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003171 _visitor.visit_type_trait_object(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003172 }
David Tolnay8c81f622018-07-31 23:34:35 -07003173 Type::ImplTrait(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003174 _visitor.visit_type_impl_trait(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003175 }
David Tolnay8c81f622018-07-31 23:34:35 -07003176 Type::Paren(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003177 _visitor.visit_type_paren(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003178 }
David Tolnay8c81f622018-07-31 23:34:35 -07003179 Type::Group(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003180 _visitor.visit_type_group(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003181 }
David Tolnay8c81f622018-07-31 23:34:35 -07003182 Type::Infer(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003183 _visitor.visit_type_infer(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003184 }
David Tolnay8c81f622018-07-31 23:34:35 -07003185 Type::Macro(ref _binding_0) => {
David Tolnay323279a2017-12-29 11:26:32 -05003186 _visitor.visit_type_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003187 }
David Tolnay8c81f622018-07-31 23:34:35 -07003188 Type::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05003189 _visitor.visit_type_verbatim(_binding_0);
3190 }
Nika Layzell27726662017-10-24 23:16:35 -04003191 }
3192}
David Tolnay8c81f622018-07-31 23:34:35 -07003193#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003194pub fn visit_type_array<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeArray) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003195 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003196 _visitor.visit_type(&*_i.elem);
David Tolnay7ac699c2018-08-24 14:00:58 -04003197 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003198 _visitor.visit_expr(&_i.len);
Nika Layzell27726662017-10-24 23:16:35 -04003199}
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_bare_fn<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeBareFn) {
David Tolnay3779bb72018-08-26 18:46:07 -07003202 if let Some(ref it) = _i.lifetimes {
3203 _visitor.visit_bound_lifetimes(it)
3204 };
David Tolnay8c81f622018-07-31 23:34:35 -07003205 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04003206 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003207 };
3208 if let Some(ref it) = _i.abi {
3209 _visitor.visit_abi(it)
3210 };
David Tolnay7ac699c2018-08-24 14:00:58 -04003211 tokens_helper(_visitor, &_i.fn_token.span);
David Tolnay7ac699c2018-08-24 14:00:58 -04003212 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003213 for el in Punctuated::pairs(&_i.inputs) {
3214 let it = el.value();
3215 _visitor.visit_bare_fn_arg(it)
3216 }
3217 if let Some(ref it) = _i.variadic {
David Tolnay7ac699c2018-08-24 14:00:58 -04003218 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003219 };
3220 _visitor.visit_return_type(&_i.output);
Nika Layzell27726662017-10-24 23:16:35 -04003221}
David Tolnay8c81f622018-07-31 23:34:35 -07003222#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003223pub fn visit_type_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeGroup) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003224 tokens_helper(_visitor, &_i.group_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003225 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003226}
David Tolnay8c81f622018-07-31 23:34:35 -07003227#[cfg(any(feature = "full", feature = "derive"))]
3228pub fn visit_type_impl_trait<'ast, V: Visit<'ast> + ?Sized>(
3229 _visitor: &mut V,
3230 _i: &'ast TypeImplTrait,
3231) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003232 tokens_helper(_visitor, &_i.impl_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003233 for el in Punctuated::pairs(&_i.bounds) {
3234 let it = el.value();
3235 _visitor.visit_type_param_bound(it)
3236 }
Nika Layzell27726662017-10-24 23:16:35 -04003237}
David Tolnay8c81f622018-07-31 23:34:35 -07003238#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003239pub fn visit_type_infer<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeInfer) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003240 tokens_helper(_visitor, &_i.underscore_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003241}
David Tolnay8c81f622018-07-31 23:34:35 -07003242#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003243pub fn visit_type_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeMacro) {
David Tolnay8c81f622018-07-31 23:34:35 -07003244 _visitor.visit_macro(&_i.mac);
David Tolnay323279a2017-12-29 11:26:32 -05003245}
David Tolnay8c81f622018-07-31 23:34:35 -07003246#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003247pub fn visit_type_never<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeNever) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003248 tokens_helper(_visitor, &_i.bang_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003249}
David Tolnay8c81f622018-07-31 23:34:35 -07003250#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003251pub fn visit_type_param<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeParam) {
David Tolnay8c81f622018-07-31 23:34:35 -07003252 for it in &_i.attrs {
3253 _visitor.visit_attribute(it)
3254 }
3255 _visitor.visit_ident(&_i.ident);
3256 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003257 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003258 };
3259 for el in Punctuated::pairs(&_i.bounds) {
3260 let it = el.value();
3261 _visitor.visit_type_param_bound(it)
3262 }
3263 if let Some(ref it) = _i.eq_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003264 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003265 };
3266 if let Some(ref it) = _i.default {
3267 _visitor.visit_type(it)
3268 };
Nika Layzell27726662017-10-24 23:16:35 -04003269}
David Tolnay8c81f622018-07-31 23:34:35 -07003270#[cfg(any(feature = "full", feature = "derive"))]
3271pub fn visit_type_param_bound<'ast, V: Visit<'ast> + ?Sized>(
3272 _visitor: &mut V,
3273 _i: &'ast TypeParamBound,
3274) {
Nika Layzell27726662017-10-24 23:16:35 -04003275 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003276 TypeParamBound::Trait(ref _binding_0) => {
David Tolnay40fb8ce2018-01-02 10:53:46 -08003277 _visitor.visit_trait_bound(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003278 }
David Tolnay8c81f622018-07-31 23:34:35 -07003279 TypeParamBound::Lifetime(ref _binding_0) => {
David Tolnay4ba63a02017-12-28 15:53:05 -05003280 _visitor.visit_lifetime(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003281 }
3282 }
3283}
David Tolnay8c81f622018-07-31 23:34:35 -07003284#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003285pub fn visit_type_paren<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeParen) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003286 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003287 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003288}
David Tolnay8c81f622018-07-31 23:34:35 -07003289#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003290pub fn visit_type_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypePath) {
David Tolnay8c81f622018-07-31 23:34:35 -07003291 if let Some(ref it) = _i.qself {
3292 _visitor.visit_qself(it)
3293 };
3294 _visitor.visit_path(&_i.path);
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_ptr<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypePtr) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003298 tokens_helper(_visitor, &_i.star_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003299 if let Some(ref it) = _i.const_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003300 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003301 };
3302 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04003303 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003304 };
3305 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003306}
David Tolnay8c81f622018-07-31 23:34:35 -07003307#[cfg(any(feature = "full", feature = "derive"))]
3308pub fn visit_type_reference<'ast, V: Visit<'ast> + ?Sized>(
3309 _visitor: &mut V,
3310 _i: &'ast TypeReference,
3311) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003312 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003313 if let Some(ref it) = _i.lifetime {
3314 _visitor.visit_lifetime(it)
3315 };
3316 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04003317 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003318 };
3319 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003320}
David Tolnay8c81f622018-07-31 23:34:35 -07003321#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003322pub fn visit_type_slice<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeSlice) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003323 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003324 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003325}
David Tolnay8c81f622018-07-31 23:34:35 -07003326#[cfg(any(feature = "full", feature = "derive"))]
3327pub fn visit_type_trait_object<'ast, V: Visit<'ast> + ?Sized>(
3328 _visitor: &mut V,
3329 _i: &'ast TypeTraitObject,
3330) {
3331 if let Some(ref it) = _i.dyn_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003332 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003333 };
3334 for el in Punctuated::pairs(&_i.bounds) {
3335 let it = el.value();
3336 _visitor.visit_type_param_bound(it)
3337 }
Nika Layzell27726662017-10-24 23:16:35 -04003338}
David Tolnay8c81f622018-07-31 23:34:35 -07003339#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003340pub fn visit_type_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeTuple) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003341 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003342 for el in Punctuated::pairs(&_i.elems) {
3343 let it = el.value();
3344 _visitor.visit_type(it)
3345 }
Nika Layzell27726662017-10-24 23:16:35 -04003346}
David Tolnay8c81f622018-07-31 23:34:35 -07003347#[cfg(any(feature = "full", feature = "derive"))]
3348pub fn visit_type_verbatim<'ast, V: Visit<'ast> + ?Sized>(
3349 _visitor: &mut V,
3350 _i: &'ast TypeVerbatim,
3351) {
David Tolnay6af48992018-08-01 11:16:28 -07003352 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05003353}
David Tolnay8c81f622018-07-31 23:34:35 -07003354#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003355pub fn visit_un_op<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UnOp) {
Nika Layzell27726662017-10-24 23:16:35 -04003356 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003357 UnOp::Deref(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003358 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003359 }
David Tolnay8c81f622018-07-31 23:34:35 -07003360 UnOp::Not(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003361 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003362 }
David Tolnay8c81f622018-07-31 23:34:35 -07003363 UnOp::Neg(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003364 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003365 }
3366 }
3367}
David Tolnay8c81f622018-07-31 23:34:35 -07003368#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003369pub fn visit_use_glob<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseGlob) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003370 tokens_helper(_visitor, &_i.star_token.spans);
David Tolnay5f332a92017-12-26 00:42:45 -05003371}
David Tolnay8c81f622018-07-31 23:34:35 -07003372#[cfg(feature = "full")]
David Tolnayd97a7d22018-03-31 19:17:01 +02003373pub fn visit_use_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseGroup) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003374 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003375 for el in Punctuated::pairs(&_i.items) {
3376 let it = el.value();
3377 _visitor.visit_use_tree(it)
3378 }
David Tolnay5f332a92017-12-26 00:42:45 -05003379}
David Tolnay8c81f622018-07-31 23:34:35 -07003380#[cfg(feature = "full")]
David Tolnayd97a7d22018-03-31 19:17:01 +02003381pub fn visit_use_name<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseName) {
David Tolnay8c81f622018-07-31 23:34:35 -07003382 _visitor.visit_ident(&_i.ident);
David Tolnayd97a7d22018-03-31 19:17:01 +02003383}
David Tolnay8c81f622018-07-31 23:34:35 -07003384#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003385pub fn visit_use_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UsePath) {
David Tolnay8c81f622018-07-31 23:34:35 -07003386 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04003387 tokens_helper(_visitor, &_i.colon2_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003388 _visitor.visit_use_tree(&*_i.tree);
David Tolnayd97a7d22018-03-31 19:17:01 +02003389}
David Tolnay8c81f622018-07-31 23:34:35 -07003390#[cfg(feature = "full")]
David Tolnayd97a7d22018-03-31 19:17:01 +02003391pub fn visit_use_rename<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseRename) {
David Tolnay8c81f622018-07-31 23:34:35 -07003392 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04003393 tokens_helper(_visitor, &_i.as_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003394 _visitor.visit_ident(&_i.rename);
David Tolnay5f332a92017-12-26 00:42:45 -05003395}
David Tolnay8c81f622018-07-31 23:34:35 -07003396#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003397pub fn visit_use_tree<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseTree) {
David Tolnay5f332a92017-12-26 00:42:45 -05003398 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003399 UseTree::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003400 _visitor.visit_use_path(_binding_0);
David Tolnay5f332a92017-12-26 00:42:45 -05003401 }
David Tolnay8c81f622018-07-31 23:34:35 -07003402 UseTree::Name(ref _binding_0) => {
David Tolnayd97a7d22018-03-31 19:17:01 +02003403 _visitor.visit_use_name(_binding_0);
3404 }
David Tolnay8c81f622018-07-31 23:34:35 -07003405 UseTree::Rename(ref _binding_0) => {
David Tolnayd97a7d22018-03-31 19:17:01 +02003406 _visitor.visit_use_rename(_binding_0);
3407 }
David Tolnay8c81f622018-07-31 23:34:35 -07003408 UseTree::Glob(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003409 _visitor.visit_use_glob(_binding_0);
David Tolnay5f332a92017-12-26 00:42:45 -05003410 }
David Tolnay8c81f622018-07-31 23:34:35 -07003411 UseTree::Group(ref _binding_0) => {
David Tolnayd97a7d22018-03-31 19:17:01 +02003412 _visitor.visit_use_group(_binding_0);
David Tolnay5f332a92017-12-26 00:42:45 -05003413 }
3414 }
3415}
David Tolnay8c81f622018-07-31 23:34:35 -07003416#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003417pub fn visit_variant<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Variant) {
David Tolnay8c81f622018-07-31 23:34:35 -07003418 for it in &_i.attrs {
3419 _visitor.visit_attribute(it)
3420 }
3421 _visitor.visit_ident(&_i.ident);
3422 _visitor.visit_fields(&_i.fields);
3423 if let Some(ref it) = _i.discriminant {
David Tolnay7ac699c2018-08-24 14:00:58 -04003424 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003425 _visitor.visit_expr(&(it).1);
3426 };
Nika Layzell27726662017-10-24 23:16:35 -04003427}
David Tolnay8c81f622018-07-31 23:34:35 -07003428#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003429pub fn visit_vis_crate<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast VisCrate) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003430 tokens_helper(_visitor, &_i.crate_token.span);
Nika Layzell27726662017-10-24 23:16:35 -04003431}
David Tolnay8c81f622018-07-31 23:34:35 -07003432#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003433pub fn visit_vis_public<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast VisPublic) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003434 tokens_helper(_visitor, &_i.pub_token.span);
Nika Layzell27726662017-10-24 23:16:35 -04003435}
David Tolnay8c81f622018-07-31 23:34:35 -07003436#[cfg(any(feature = "full", feature = "derive"))]
3437pub fn visit_vis_restricted<'ast, V: Visit<'ast> + ?Sized>(
3438 _visitor: &mut V,
3439 _i: &'ast VisRestricted,
3440) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003441 tokens_helper(_visitor, &_i.pub_token.span);
3442 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003443 if let Some(ref it) = _i.in_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003444 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003445 };
3446 _visitor.visit_path(&*_i.path);
Nika Layzell27726662017-10-24 23:16:35 -04003447}
David Tolnay8c81f622018-07-31 23:34:35 -07003448#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003449pub fn visit_visibility<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Visibility) {
Nika Layzell27726662017-10-24 23:16:35 -04003450 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003451 Visibility::Public(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003452 _visitor.visit_vis_public(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003453 }
David Tolnay8c81f622018-07-31 23:34:35 -07003454 Visibility::Crate(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003455 _visitor.visit_vis_crate(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003456 }
David Tolnay8c81f622018-07-31 23:34:35 -07003457 Visibility::Restricted(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003458 _visitor.visit_vis_restricted(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003459 }
David Tolnay8c81f622018-07-31 23:34:35 -07003460 Visibility::Inherited => {}
Nika Layzell27726662017-10-24 23:16:35 -04003461 }
3462}
David Tolnay8c81f622018-07-31 23:34:35 -07003463#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003464pub fn visit_where_clause<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast WhereClause) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003465 tokens_helper(_visitor, &_i.where_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003466 for el in Punctuated::pairs(&_i.predicates) {
3467 let it = el.value();
3468 _visitor.visit_where_predicate(it)
3469 }
Nika Layzell27726662017-10-24 23:16:35 -04003470}
David Tolnay8c81f622018-07-31 23:34:35 -07003471#[cfg(any(feature = "full", feature = "derive"))]
3472pub fn visit_where_predicate<'ast, V: Visit<'ast> + ?Sized>(
3473 _visitor: &mut V,
3474 _i: &'ast WherePredicate,
3475) {
Nika Layzell27726662017-10-24 23:16:35 -04003476 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003477 WherePredicate::Type(ref _binding_0) => {
David Tolnayd4add852018-01-01 20:13:24 -08003478 _visitor.visit_predicate_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003479 }
David Tolnay8c81f622018-07-31 23:34:35 -07003480 WherePredicate::Lifetime(ref _binding_0) => {
David Tolnayd4add852018-01-01 20:13:24 -08003481 _visitor.visit_predicate_lifetime(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003482 }
David Tolnay8c81f622018-07-31 23:34:35 -07003483 WherePredicate::Eq(ref _binding_0) => {
David Tolnayd4add852018-01-01 20:13:24 -08003484 _visitor.visit_predicate_eq(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003485 }
3486 }
3487}