blob: 91455910b1dbf3aca69a12db5ac8684433852808 [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")]
406 fn visit_impl_item_macro(&mut self, i: &'ast ImplItemMacro) {
407 visit_impl_item_macro(self, i)
408 }
409 #[cfg(feature = "full")]
410 fn visit_impl_item_method(&mut self, i: &'ast ImplItemMethod) {
411 visit_impl_item_method(self, i)
412 }
413 #[cfg(feature = "full")]
414 fn visit_impl_item_type(&mut self, i: &'ast ImplItemType) {
415 visit_impl_item_type(self, i)
416 }
417 #[cfg(feature = "full")]
418 fn visit_impl_item_verbatim(&mut self, i: &'ast ImplItemVerbatim) {
419 visit_impl_item_verbatim(self, i)
420 }
421 #[cfg(any(feature = "full", feature = "derive"))]
422 fn visit_index(&mut self, i: &'ast Index) {
423 visit_index(self, i)
424 }
425 #[cfg(feature = "full")]
426 fn visit_item(&mut self, i: &'ast Item) {
427 visit_item(self, i)
428 }
429 #[cfg(feature = "full")]
430 fn visit_item_const(&mut self, i: &'ast ItemConst) {
431 visit_item_const(self, i)
432 }
433 #[cfg(feature = "full")]
434 fn visit_item_enum(&mut self, i: &'ast ItemEnum) {
435 visit_item_enum(self, i)
436 }
437 #[cfg(feature = "full")]
438 fn visit_item_extern_crate(&mut self, i: &'ast ItemExternCrate) {
439 visit_item_extern_crate(self, i)
440 }
441 #[cfg(feature = "full")]
442 fn visit_item_fn(&mut self, i: &'ast ItemFn) {
443 visit_item_fn(self, i)
444 }
445 #[cfg(feature = "full")]
446 fn visit_item_foreign_mod(&mut self, i: &'ast ItemForeignMod) {
447 visit_item_foreign_mod(self, i)
448 }
449 #[cfg(feature = "full")]
450 fn visit_item_impl(&mut self, i: &'ast ItemImpl) {
451 visit_item_impl(self, i)
452 }
453 #[cfg(feature = "full")]
454 fn visit_item_macro(&mut self, i: &'ast ItemMacro) {
455 visit_item_macro(self, i)
456 }
457 #[cfg(feature = "full")]
458 fn visit_item_macro2(&mut self, i: &'ast ItemMacro2) {
459 visit_item_macro2(self, i)
460 }
461 #[cfg(feature = "full")]
462 fn visit_item_mod(&mut self, i: &'ast ItemMod) {
463 visit_item_mod(self, i)
464 }
465 #[cfg(feature = "full")]
466 fn visit_item_static(&mut self, i: &'ast ItemStatic) {
467 visit_item_static(self, i)
468 }
469 #[cfg(feature = "full")]
470 fn visit_item_struct(&mut self, i: &'ast ItemStruct) {
471 visit_item_struct(self, i)
472 }
473 #[cfg(feature = "full")]
474 fn visit_item_trait(&mut self, i: &'ast ItemTrait) {
475 visit_item_trait(self, i)
476 }
477 #[cfg(feature = "full")]
478 fn visit_item_type(&mut self, i: &'ast ItemType) {
479 visit_item_type(self, i)
480 }
481 #[cfg(feature = "full")]
482 fn visit_item_union(&mut self, i: &'ast ItemUnion) {
483 visit_item_union(self, i)
484 }
485 #[cfg(feature = "full")]
486 fn visit_item_use(&mut self, i: &'ast ItemUse) {
487 visit_item_use(self, i)
488 }
489 #[cfg(feature = "full")]
490 fn visit_item_verbatim(&mut self, i: &'ast ItemVerbatim) {
491 visit_item_verbatim(self, i)
492 }
493 #[cfg(any(feature = "full", feature = "derive"))]
494 #[cfg(feature = "full")]
495 fn visit_label(&mut self, i: &'ast Label) {
496 visit_label(self, i)
497 }
498 #[cfg(any(feature = "full", feature = "derive"))]
499 fn visit_lifetime(&mut self, i: &'ast Lifetime) {
500 visit_lifetime(self, i)
501 }
502 #[cfg(any(feature = "full", feature = "derive"))]
503 fn visit_lifetime_def(&mut self, i: &'ast LifetimeDef) {
504 visit_lifetime_def(self, i)
505 }
506 #[cfg(any(feature = "full", feature = "derive"))]
507 fn visit_lit(&mut self, i: &'ast Lit) {
508 visit_lit(self, i)
509 }
510 #[cfg(any(feature = "full", feature = "derive"))]
511 fn visit_lit_bool(&mut self, i: &'ast LitBool) {
512 visit_lit_bool(self, i)
513 }
514 #[cfg(any(feature = "full", feature = "derive"))]
515 fn visit_lit_byte(&mut self, i: &'ast LitByte) {
516 visit_lit_byte(self, i)
517 }
518 #[cfg(any(feature = "full", feature = "derive"))]
519 fn visit_lit_byte_str(&mut self, i: &'ast LitByteStr) {
520 visit_lit_byte_str(self, i)
521 }
522 #[cfg(any(feature = "full", feature = "derive"))]
523 fn visit_lit_char(&mut self, i: &'ast LitChar) {
524 visit_lit_char(self, i)
525 }
526 #[cfg(any(feature = "full", feature = "derive"))]
527 fn visit_lit_float(&mut self, i: &'ast LitFloat) {
528 visit_lit_float(self, i)
529 }
530 #[cfg(any(feature = "full", feature = "derive"))]
531 fn visit_lit_int(&mut self, i: &'ast LitInt) {
532 visit_lit_int(self, i)
533 }
534 #[cfg(any(feature = "full", feature = "derive"))]
535 fn visit_lit_str(&mut self, i: &'ast LitStr) {
536 visit_lit_str(self, i)
537 }
538 #[cfg(any(feature = "full", feature = "derive"))]
539 fn visit_lit_verbatim(&mut self, i: &'ast LitVerbatim) {
540 visit_lit_verbatim(self, i)
541 }
542 #[cfg(any(feature = "full", feature = "derive"))]
543 #[cfg(feature = "full")]
544 fn visit_local(&mut self, i: &'ast Local) {
545 visit_local(self, i)
546 }
547 #[cfg(any(feature = "full", feature = "derive"))]
548 fn visit_macro(&mut self, i: &'ast Macro) {
549 visit_macro(self, i)
550 }
551 #[cfg(any(feature = "full", feature = "derive"))]
552 fn visit_macro_delimiter(&mut self, i: &'ast MacroDelimiter) {
553 visit_macro_delimiter(self, i)
554 }
555 #[cfg(any(feature = "full", feature = "derive"))]
556 fn visit_member(&mut self, i: &'ast Member) {
557 visit_member(self, i)
558 }
559 #[cfg(any(feature = "full", feature = "derive"))]
560 fn visit_meta(&mut self, i: &'ast Meta) {
561 visit_meta(self, i)
562 }
563 #[cfg(any(feature = "full", feature = "derive"))]
564 fn visit_meta_list(&mut self, i: &'ast MetaList) {
565 visit_meta_list(self, i)
566 }
567 #[cfg(any(feature = "full", feature = "derive"))]
568 fn visit_meta_name_value(&mut self, i: &'ast MetaNameValue) {
569 visit_meta_name_value(self, i)
570 }
571 #[cfg(feature = "full")]
572 fn visit_method_sig(&mut self, i: &'ast MethodSig) {
573 visit_method_sig(self, i)
574 }
575 #[cfg(any(feature = "full", feature = "derive"))]
576 #[cfg(feature = "full")]
577 fn visit_method_turbofish(&mut self, i: &'ast MethodTurbofish) {
578 visit_method_turbofish(self, i)
579 }
580 #[cfg(any(feature = "full", feature = "derive"))]
581 fn visit_nested_meta(&mut self, i: &'ast NestedMeta) {
582 visit_nested_meta(self, i)
583 }
584 #[cfg(any(feature = "full", feature = "derive"))]
585 fn visit_parenthesized_generic_arguments(&mut self, i: &'ast ParenthesizedGenericArguments) {
586 visit_parenthesized_generic_arguments(self, i)
587 }
588 #[cfg(any(feature = "full", feature = "derive"))]
589 #[cfg(feature = "full")]
590 fn visit_pat(&mut self, i: &'ast Pat) {
591 visit_pat(self, i)
592 }
593 #[cfg(any(feature = "full", feature = "derive"))]
594 #[cfg(feature = "full")]
595 fn visit_pat_box(&mut self, i: &'ast PatBox) {
596 visit_pat_box(self, i)
597 }
598 #[cfg(any(feature = "full", feature = "derive"))]
599 #[cfg(feature = "full")]
600 fn visit_pat_ident(&mut self, i: &'ast PatIdent) {
601 visit_pat_ident(self, i)
602 }
603 #[cfg(any(feature = "full", feature = "derive"))]
604 #[cfg(feature = "full")]
605 fn visit_pat_lit(&mut self, i: &'ast PatLit) {
606 visit_pat_lit(self, i)
607 }
608 #[cfg(any(feature = "full", feature = "derive"))]
609 #[cfg(feature = "full")]
610 fn visit_pat_macro(&mut self, i: &'ast PatMacro) {
611 visit_pat_macro(self, i)
612 }
613 #[cfg(any(feature = "full", feature = "derive"))]
614 #[cfg(feature = "full")]
615 fn visit_pat_path(&mut self, i: &'ast PatPath) {
616 visit_pat_path(self, i)
617 }
618 #[cfg(any(feature = "full", feature = "derive"))]
619 #[cfg(feature = "full")]
620 fn visit_pat_range(&mut self, i: &'ast PatRange) {
621 visit_pat_range(self, i)
622 }
623 #[cfg(any(feature = "full", feature = "derive"))]
624 #[cfg(feature = "full")]
625 fn visit_pat_ref(&mut self, i: &'ast PatRef) {
626 visit_pat_ref(self, i)
627 }
628 #[cfg(any(feature = "full", feature = "derive"))]
629 #[cfg(feature = "full")]
630 fn visit_pat_slice(&mut self, i: &'ast PatSlice) {
631 visit_pat_slice(self, i)
632 }
633 #[cfg(any(feature = "full", feature = "derive"))]
634 #[cfg(feature = "full")]
635 fn visit_pat_struct(&mut self, i: &'ast PatStruct) {
636 visit_pat_struct(self, i)
637 }
638 #[cfg(any(feature = "full", feature = "derive"))]
639 #[cfg(feature = "full")]
640 fn visit_pat_tuple(&mut self, i: &'ast PatTuple) {
641 visit_pat_tuple(self, i)
642 }
643 #[cfg(any(feature = "full", feature = "derive"))]
644 #[cfg(feature = "full")]
645 fn visit_pat_tuple_struct(&mut self, i: &'ast PatTupleStruct) {
646 visit_pat_tuple_struct(self, i)
647 }
648 #[cfg(any(feature = "full", feature = "derive"))]
649 #[cfg(feature = "full")]
650 fn visit_pat_verbatim(&mut self, i: &'ast PatVerbatim) {
651 visit_pat_verbatim(self, i)
652 }
653 #[cfg(any(feature = "full", feature = "derive"))]
654 #[cfg(feature = "full")]
655 fn visit_pat_wild(&mut self, i: &'ast PatWild) {
656 visit_pat_wild(self, i)
657 }
658 #[cfg(any(feature = "full", feature = "derive"))]
659 fn visit_path(&mut self, i: &'ast Path) {
660 visit_path(self, i)
661 }
662 #[cfg(any(feature = "full", feature = "derive"))]
663 fn visit_path_arguments(&mut self, i: &'ast PathArguments) {
664 visit_path_arguments(self, i)
665 }
666 #[cfg(any(feature = "full", feature = "derive"))]
667 fn visit_path_segment(&mut self, i: &'ast PathSegment) {
668 visit_path_segment(self, i)
669 }
670 #[cfg(any(feature = "full", feature = "derive"))]
671 fn visit_predicate_eq(&mut self, i: &'ast PredicateEq) {
672 visit_predicate_eq(self, i)
673 }
674 #[cfg(any(feature = "full", feature = "derive"))]
675 fn visit_predicate_lifetime(&mut self, i: &'ast PredicateLifetime) {
676 visit_predicate_lifetime(self, i)
677 }
678 #[cfg(any(feature = "full", feature = "derive"))]
679 fn visit_predicate_type(&mut self, i: &'ast PredicateType) {
680 visit_predicate_type(self, i)
681 }
682 #[cfg(any(feature = "full", feature = "derive"))]
683 fn visit_qself(&mut self, i: &'ast QSelf) {
684 visit_qself(self, i)
685 }
686 #[cfg(any(feature = "full", feature = "derive"))]
687 #[cfg(feature = "full")]
688 fn visit_range_limits(&mut self, i: &'ast RangeLimits) {
689 visit_range_limits(self, i)
690 }
691 #[cfg(any(feature = "full", feature = "derive"))]
692 fn visit_return_type(&mut self, i: &'ast ReturnType) {
693 visit_return_type(self, i)
694 }
David Tolnay8c81f622018-07-31 23:34:35 -0700695 fn visit_span(&mut self, i: &'ast Span) {
696 visit_span(self, i)
697 }
698 #[cfg(any(feature = "full", feature = "derive"))]
699 #[cfg(feature = "full")]
700 fn visit_stmt(&mut self, i: &'ast Stmt) {
701 visit_stmt(self, i)
702 }
703 #[cfg(any(feature = "full", feature = "derive"))]
704 fn visit_trait_bound(&mut self, i: &'ast TraitBound) {
705 visit_trait_bound(self, i)
706 }
707 #[cfg(any(feature = "full", feature = "derive"))]
708 fn visit_trait_bound_modifier(&mut self, i: &'ast TraitBoundModifier) {
709 visit_trait_bound_modifier(self, i)
710 }
711 #[cfg(feature = "full")]
712 fn visit_trait_item(&mut self, i: &'ast TraitItem) {
713 visit_trait_item(self, i)
714 }
715 #[cfg(feature = "full")]
716 fn visit_trait_item_const(&mut self, i: &'ast TraitItemConst) {
717 visit_trait_item_const(self, i)
718 }
719 #[cfg(feature = "full")]
720 fn visit_trait_item_macro(&mut self, i: &'ast TraitItemMacro) {
721 visit_trait_item_macro(self, i)
722 }
723 #[cfg(feature = "full")]
724 fn visit_trait_item_method(&mut self, i: &'ast TraitItemMethod) {
725 visit_trait_item_method(self, i)
726 }
727 #[cfg(feature = "full")]
728 fn visit_trait_item_type(&mut self, i: &'ast TraitItemType) {
729 visit_trait_item_type(self, i)
730 }
731 #[cfg(feature = "full")]
732 fn visit_trait_item_verbatim(&mut self, i: &'ast TraitItemVerbatim) {
733 visit_trait_item_verbatim(self, i)
734 }
735 #[cfg(any(feature = "full", feature = "derive"))]
736 fn visit_type(&mut self, i: &'ast Type) {
737 visit_type(self, i)
738 }
739 #[cfg(any(feature = "full", feature = "derive"))]
740 fn visit_type_array(&mut self, i: &'ast TypeArray) {
741 visit_type_array(self, i)
742 }
743 #[cfg(any(feature = "full", feature = "derive"))]
744 fn visit_type_bare_fn(&mut self, i: &'ast TypeBareFn) {
745 visit_type_bare_fn(self, i)
746 }
747 #[cfg(any(feature = "full", feature = "derive"))]
748 fn visit_type_group(&mut self, i: &'ast TypeGroup) {
749 visit_type_group(self, i)
750 }
751 #[cfg(any(feature = "full", feature = "derive"))]
752 fn visit_type_impl_trait(&mut self, i: &'ast TypeImplTrait) {
753 visit_type_impl_trait(self, i)
754 }
755 #[cfg(any(feature = "full", feature = "derive"))]
756 fn visit_type_infer(&mut self, i: &'ast TypeInfer) {
757 visit_type_infer(self, i)
758 }
759 #[cfg(any(feature = "full", feature = "derive"))]
760 fn visit_type_macro(&mut self, i: &'ast TypeMacro) {
761 visit_type_macro(self, i)
762 }
763 #[cfg(any(feature = "full", feature = "derive"))]
764 fn visit_type_never(&mut self, i: &'ast TypeNever) {
765 visit_type_never(self, i)
766 }
767 #[cfg(any(feature = "full", feature = "derive"))]
768 fn visit_type_param(&mut self, i: &'ast TypeParam) {
769 visit_type_param(self, i)
770 }
771 #[cfg(any(feature = "full", feature = "derive"))]
772 fn visit_type_param_bound(&mut self, i: &'ast TypeParamBound) {
773 visit_type_param_bound(self, i)
774 }
775 #[cfg(any(feature = "full", feature = "derive"))]
776 fn visit_type_paren(&mut self, i: &'ast TypeParen) {
777 visit_type_paren(self, i)
778 }
779 #[cfg(any(feature = "full", feature = "derive"))]
780 fn visit_type_path(&mut self, i: &'ast TypePath) {
781 visit_type_path(self, i)
782 }
783 #[cfg(any(feature = "full", feature = "derive"))]
784 fn visit_type_ptr(&mut self, i: &'ast TypePtr) {
785 visit_type_ptr(self, i)
786 }
787 #[cfg(any(feature = "full", feature = "derive"))]
788 fn visit_type_reference(&mut self, i: &'ast TypeReference) {
789 visit_type_reference(self, i)
790 }
791 #[cfg(any(feature = "full", feature = "derive"))]
792 fn visit_type_slice(&mut self, i: &'ast TypeSlice) {
793 visit_type_slice(self, i)
794 }
795 #[cfg(any(feature = "full", feature = "derive"))]
796 fn visit_type_trait_object(&mut self, i: &'ast TypeTraitObject) {
797 visit_type_trait_object(self, i)
798 }
799 #[cfg(any(feature = "full", feature = "derive"))]
800 fn visit_type_tuple(&mut self, i: &'ast TypeTuple) {
801 visit_type_tuple(self, i)
802 }
803 #[cfg(any(feature = "full", feature = "derive"))]
804 fn visit_type_verbatim(&mut self, i: &'ast TypeVerbatim) {
805 visit_type_verbatim(self, i)
806 }
807 #[cfg(any(feature = "full", feature = "derive"))]
808 fn visit_un_op(&mut self, i: &'ast UnOp) {
809 visit_un_op(self, i)
810 }
811 #[cfg(feature = "full")]
812 fn visit_use_glob(&mut self, i: &'ast UseGlob) {
813 visit_use_glob(self, i)
814 }
815 #[cfg(feature = "full")]
816 fn visit_use_group(&mut self, i: &'ast UseGroup) {
817 visit_use_group(self, i)
818 }
819 #[cfg(feature = "full")]
820 fn visit_use_name(&mut self, i: &'ast UseName) {
821 visit_use_name(self, i)
822 }
823 #[cfg(feature = "full")]
824 fn visit_use_path(&mut self, i: &'ast UsePath) {
825 visit_use_path(self, i)
826 }
827 #[cfg(feature = "full")]
828 fn visit_use_rename(&mut self, i: &'ast UseRename) {
829 visit_use_rename(self, i)
830 }
831 #[cfg(feature = "full")]
832 fn visit_use_tree(&mut self, i: &'ast UseTree) {
833 visit_use_tree(self, i)
834 }
835 #[cfg(any(feature = "full", feature = "derive"))]
836 fn visit_variant(&mut self, i: &'ast Variant) {
837 visit_variant(self, i)
838 }
839 #[cfg(any(feature = "full", feature = "derive"))]
840 fn visit_vis_crate(&mut self, i: &'ast VisCrate) {
841 visit_vis_crate(self, i)
842 }
843 #[cfg(any(feature = "full", feature = "derive"))]
844 fn visit_vis_public(&mut self, i: &'ast VisPublic) {
845 visit_vis_public(self, i)
846 }
847 #[cfg(any(feature = "full", feature = "derive"))]
848 fn visit_vis_restricted(&mut self, i: &'ast VisRestricted) {
849 visit_vis_restricted(self, i)
850 }
851 #[cfg(any(feature = "full", feature = "derive"))]
852 fn visit_visibility(&mut self, i: &'ast Visibility) {
853 visit_visibility(self, i)
854 }
855 #[cfg(any(feature = "full", feature = "derive"))]
856 fn visit_where_clause(&mut self, i: &'ast WhereClause) {
857 visit_where_clause(self, i)
858 }
859 #[cfg(any(feature = "full", feature = "derive"))]
860 fn visit_where_predicate(&mut self, i: &'ast WherePredicate) {
861 visit_where_predicate(self, i)
862 }
Nika Layzell27726662017-10-24 23:16:35 -0400863}
David Tolnay8c81f622018-07-31 23:34:35 -0700864#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800865pub fn visit_abi<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Abi) {
David Tolnay7ac699c2018-08-24 14:00:58 -0400866 tokens_helper(_visitor, &_i.extern_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -0700867 if let Some(ref it) = _i.name {
868 _visitor.visit_lit_str(it)
869 };
Nika Layzell27726662017-10-24 23:16:35 -0400870}
David Tolnay8c81f622018-07-31 23:34:35 -0700871#[cfg(any(feature = "full", feature = "derive"))]
872pub fn visit_angle_bracketed_generic_arguments<'ast, V: Visit<'ast> + ?Sized>(
873 _visitor: &mut V,
874 _i: &'ast AngleBracketedGenericArguments,
875) {
876 if let Some(ref it) = _i.colon2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -0400877 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -0700878 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400879 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700880 for el in Punctuated::pairs(&_i.args) {
881 let it = el.value();
882 _visitor.visit_generic_argument(it)
883 }
David Tolnay7ac699c2018-08-24 14:00:58 -0400884 tokens_helper(_visitor, &_i.gt_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400885}
David Tolnay8c81f622018-07-31 23:34:35 -0700886#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800887pub fn visit_arg_captured<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ArgCaptured) {
David Tolnay8c81f622018-07-31 23:34:35 -0700888 _visitor.visit_pat(&_i.pat);
David Tolnay7ac699c2018-08-24 14:00:58 -0400889 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700890 _visitor.visit_type(&_i.ty);
Nika Layzell27726662017-10-24 23:16:35 -0400891}
David Tolnay8c81f622018-07-31 23:34:35 -0700892#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800893pub fn visit_arg_self<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ArgSelf) {
David Tolnay8c81f622018-07-31 23:34:35 -0700894 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -0400895 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -0700896 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400897 tokens_helper(_visitor, &_i.self_token.span);
Nika Layzell27726662017-10-24 23:16:35 -0400898}
David Tolnay8c81f622018-07-31 23:34:35 -0700899#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800900pub fn visit_arg_self_ref<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ArgSelfRef) {
David Tolnay7ac699c2018-08-24 14:00:58 -0400901 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700902 if let Some(ref it) = _i.lifetime {
903 _visitor.visit_lifetime(it)
904 };
905 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -0400906 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -0700907 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400908 tokens_helper(_visitor, &_i.self_token.span);
Nika Layzell27726662017-10-24 23:16:35 -0400909}
David Tolnay8c81f622018-07-31 23:34:35 -0700910#[cfg(any(feature = "full", feature = "derive"))]
911#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800912pub fn visit_arm<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Arm) {
David Tolnay8c81f622018-07-31 23:34:35 -0700913 for it in &_i.attrs {
914 _visitor.visit_attribute(it)
915 }
916 if let Some(ref it) = _i.leading_vert {
David Tolnay7ac699c2018-08-24 14:00:58 -0400917 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -0700918 };
919 for el in Punctuated::pairs(&_i.pats) {
920 let it = el.value();
921 _visitor.visit_pat(it)
922 }
923 if let Some(ref it) = _i.guard {
David Tolnay7ac699c2018-08-24 14:00:58 -0400924 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -0700925 _visitor.visit_expr(&*(it).1);
926 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400927 tokens_helper(_visitor, &_i.fat_arrow_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700928 _visitor.visit_expr(&*_i.body);
929 if let Some(ref it) = _i.comma {
David Tolnay7ac699c2018-08-24 14:00:58 -0400930 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -0700931 };
Nika Layzell27726662017-10-24 23:16:35 -0400932}
David Tolnay8c81f622018-07-31 23:34:35 -0700933#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800934pub fn visit_attr_style<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast AttrStyle) {
Nika Layzell27726662017-10-24 23:16:35 -0400935 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -0700936 AttrStyle::Outer => {}
937 AttrStyle::Inner(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400938 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400939 }
940 }
941}
David Tolnay8c81f622018-07-31 23:34:35 -0700942#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800943pub fn visit_attribute<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Attribute) {
David Tolnay7ac699c2018-08-24 14:00:58 -0400944 tokens_helper(_visitor, &_i.pound_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700945 _visitor.visit_attr_style(&_i.style);
David Tolnay7ac699c2018-08-24 14:00:58 -0400946 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -0700947 _visitor.visit_path(&_i.path);
David Tolnay6af48992018-08-01 11:16:28 -0700948 skip!(_i.tts);
Nika Layzell27726662017-10-24 23:16:35 -0400949}
David Tolnay8c81f622018-07-31 23:34:35 -0700950#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800951pub fn visit_bare_fn_arg<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast BareFnArg) {
David Tolnay8c81f622018-07-31 23:34:35 -0700952 if let Some(ref it) = _i.name {
953 _visitor.visit_bare_fn_arg_name(&(it).0);
David Tolnay7ac699c2018-08-24 14:00:58 -0400954 tokens_helper(_visitor, &(it).1.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700955 };
956 _visitor.visit_type(&_i.ty);
Nika Layzell27726662017-10-24 23:16:35 -0400957}
David Tolnay8c81f622018-07-31 23:34:35 -0700958#[cfg(any(feature = "full", feature = "derive"))]
959pub fn visit_bare_fn_arg_name<'ast, V: Visit<'ast> + ?Sized>(
960 _visitor: &mut V,
961 _i: &'ast BareFnArgName,
962) {
Nika Layzell27726662017-10-24 23:16:35 -0400963 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -0700964 BareFnArgName::Named(ref _binding_0) => {
Alex Crichtond261d092018-05-18 13:47:35 -0700965 _visitor.visit_ident(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -0400966 }
David Tolnay8c81f622018-07-31 23:34:35 -0700967 BareFnArgName::Wild(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400968 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400969 }
970 }
971}
David Tolnay8c81f622018-07-31 23:34:35 -0700972#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800973pub fn visit_bin_op<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast BinOp) {
Nika Layzell27726662017-10-24 23:16:35 -0400974 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -0700975 BinOp::Add(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 }
David Tolnay8c81f622018-07-31 23:34:35 -0700978 BinOp::Sub(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400979 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400980 }
David Tolnay8c81f622018-07-31 23:34:35 -0700981 BinOp::Mul(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400982 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400983 }
David Tolnay8c81f622018-07-31 23:34:35 -0700984 BinOp::Div(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400985 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400986 }
David Tolnay8c81f622018-07-31 23:34:35 -0700987 BinOp::Rem(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400988 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400989 }
David Tolnay8c81f622018-07-31 23:34:35 -0700990 BinOp::And(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400991 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400992 }
David Tolnay8c81f622018-07-31 23:34:35 -0700993 BinOp::Or(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400994 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400995 }
David Tolnay8c81f622018-07-31 23:34:35 -0700996 BinOp::BitXor(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400997 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400998 }
David Tolnay8c81f622018-07-31 23:34:35 -0700999 BinOp::BitAnd(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001000 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001001 }
David Tolnay8c81f622018-07-31 23:34:35 -07001002 BinOp::BitOr(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001003 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001004 }
David Tolnay8c81f622018-07-31 23:34:35 -07001005 BinOp::Shl(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001006 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001007 }
David Tolnay8c81f622018-07-31 23:34:35 -07001008 BinOp::Shr(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001009 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001010 }
David Tolnay8c81f622018-07-31 23:34:35 -07001011 BinOp::Eq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001012 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001013 }
David Tolnay8c81f622018-07-31 23:34:35 -07001014 BinOp::Lt(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001015 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001016 }
David Tolnay8c81f622018-07-31 23:34:35 -07001017 BinOp::Le(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001018 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001019 }
David Tolnay8c81f622018-07-31 23:34:35 -07001020 BinOp::Ne(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001021 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001022 }
David Tolnay8c81f622018-07-31 23:34:35 -07001023 BinOp::Ge(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001024 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001025 }
David Tolnay8c81f622018-07-31 23:34:35 -07001026 BinOp::Gt(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001027 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001028 }
David Tolnay8c81f622018-07-31 23:34:35 -07001029 BinOp::AddEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001030 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001031 }
David Tolnay8c81f622018-07-31 23:34:35 -07001032 BinOp::SubEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001033 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001034 }
David Tolnay8c81f622018-07-31 23:34:35 -07001035 BinOp::MulEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001036 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001037 }
David Tolnay8c81f622018-07-31 23:34:35 -07001038 BinOp::DivEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001039 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001040 }
David Tolnay8c81f622018-07-31 23:34:35 -07001041 BinOp::RemEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001042 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001043 }
David Tolnay8c81f622018-07-31 23:34:35 -07001044 BinOp::BitXorEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001045 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001046 }
David Tolnay8c81f622018-07-31 23:34:35 -07001047 BinOp::BitAndEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001048 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001049 }
David Tolnay8c81f622018-07-31 23:34:35 -07001050 BinOp::BitOrEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001051 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001052 }
David Tolnay8c81f622018-07-31 23:34:35 -07001053 BinOp::ShlEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001054 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001055 }
David Tolnay8c81f622018-07-31 23:34:35 -07001056 BinOp::ShrEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001057 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001058 }
1059 }
1060}
David Tolnay8c81f622018-07-31 23:34:35 -07001061#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001062pub fn visit_binding<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Binding) {
David Tolnay8c81f622018-07-31 23:34:35 -07001063 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001064 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001065 _visitor.visit_type(&_i.ty);
David Tolnay506e43a2017-12-29 11:34:36 -05001066}
David Tolnay8c81f622018-07-31 23:34:35 -07001067#[cfg(any(feature = "full", feature = "derive"))]
1068#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001069pub fn visit_block<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Block) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001070 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001071 for it in &_i.stmts {
1072 _visitor.visit_stmt(it)
1073 }
Nika Layzell27726662017-10-24 23:16:35 -04001074}
David Tolnay8c81f622018-07-31 23:34:35 -07001075#[cfg(any(feature = "full", feature = "derive"))]
1076pub fn visit_bound_lifetimes<'ast, V: Visit<'ast> + ?Sized>(
1077 _visitor: &mut V,
1078 _i: &'ast BoundLifetimes,
1079) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001080 tokens_helper(_visitor, &_i.for_token.span);
1081 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001082 for el in Punctuated::pairs(&_i.lifetimes) {
1083 let it = el.value();
1084 _visitor.visit_lifetime_def(it)
1085 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001086 tokens_helper(_visitor, &_i.gt_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001087}
David Tolnay8c81f622018-07-31 23:34:35 -07001088#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001089pub fn visit_const_param<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ConstParam) {
David Tolnay8c81f622018-07-31 23:34:35 -07001090 for it in &_i.attrs {
1091 _visitor.visit_attribute(it)
1092 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001093 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001094 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001095 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001096 _visitor.visit_type(&_i.ty);
1097 if let Some(ref it) = _i.eq_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001098 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001099 };
1100 if let Some(ref it) = _i.default {
1101 _visitor.visit_expr(it)
1102 };
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001103}
David Tolnay8c81f622018-07-31 23:34:35 -07001104#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001105pub fn visit_data<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Data) {
David Tolnaye3d41b72017-12-31 15:24:00 -05001106 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001107 Data::Struct(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05001108 _visitor.visit_data_struct(_binding_0);
1109 }
David Tolnay8c81f622018-07-31 23:34:35 -07001110 Data::Enum(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05001111 _visitor.visit_data_enum(_binding_0);
1112 }
David Tolnay8c81f622018-07-31 23:34:35 -07001113 Data::Union(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05001114 _visitor.visit_data_union(_binding_0);
1115 }
1116 }
1117}
David Tolnay8c81f622018-07-31 23:34:35 -07001118#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001119pub fn visit_data_enum<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataEnum) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001120 tokens_helper(_visitor, &_i.enum_token.span);
1121 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001122 for el in Punctuated::pairs(&_i.variants) {
1123 let it = el.value();
1124 _visitor.visit_variant(it)
1125 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001126}
David Tolnay8c81f622018-07-31 23:34:35 -07001127#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001128pub fn visit_data_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataStruct) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001129 tokens_helper(_visitor, &_i.struct_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001130 _visitor.visit_fields(&_i.fields);
1131 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001132 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001133 };
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_union<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataUnion) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001137 tokens_helper(_visitor, &_i.union_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001138 _visitor.visit_fields_named(&_i.fields);
David Tolnaye3d41b72017-12-31 15:24:00 -05001139}
David Tolnay8c81f622018-07-31 23:34:35 -07001140#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001141pub fn visit_derive_input<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DeriveInput) {
David Tolnay8c81f622018-07-31 23:34:35 -07001142 for it in &_i.attrs {
1143 _visitor.visit_attribute(it)
1144 }
1145 _visitor.visit_visibility(&_i.vis);
1146 _visitor.visit_ident(&_i.ident);
1147 _visitor.visit_generics(&_i.generics);
1148 _visitor.visit_data(&_i.data);
Nika Layzell27726662017-10-24 23:16:35 -04001149}
David Tolnay8c81f622018-07-31 23:34:35 -07001150#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001151pub fn visit_expr<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Expr) {
Nika Layzell27726662017-10-24 23:16:35 -04001152 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001153 Expr::Box(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001154 full!(_visitor.visit_expr_box(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001155 }
David Tolnay8c81f622018-07-31 23:34:35 -07001156 Expr::InPlace(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001157 full!(_visitor.visit_expr_in_place(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001158 }
David Tolnay8c81f622018-07-31 23:34:35 -07001159 Expr::Array(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001160 full!(_visitor.visit_expr_array(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001161 }
David Tolnay8c81f622018-07-31 23:34:35 -07001162 Expr::Call(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001163 _visitor.visit_expr_call(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001164 }
David Tolnay8c81f622018-07-31 23:34:35 -07001165 Expr::MethodCall(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001166 full!(_visitor.visit_expr_method_call(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001167 }
David Tolnay8c81f622018-07-31 23:34:35 -07001168 Expr::Tuple(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001169 full!(_visitor.visit_expr_tuple(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001170 }
David Tolnay8c81f622018-07-31 23:34:35 -07001171 Expr::Binary(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001172 _visitor.visit_expr_binary(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001173 }
David Tolnay8c81f622018-07-31 23:34:35 -07001174 Expr::Unary(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001175 _visitor.visit_expr_unary(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001176 }
David Tolnay8c81f622018-07-31 23:34:35 -07001177 Expr::Lit(ref _binding_0) => {
David Tolnay8c91b882017-12-28 23:04:32 -05001178 _visitor.visit_expr_lit(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001179 }
David Tolnay8c81f622018-07-31 23:34:35 -07001180 Expr::Cast(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001181 _visitor.visit_expr_cast(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001182 }
David Tolnay8c81f622018-07-31 23:34:35 -07001183 Expr::Type(ref _binding_0) => {
David Tolnay0cf94f22017-12-28 23:46:26 -05001184 full!(_visitor.visit_expr_type(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001185 }
David Tolnay8c81f622018-07-31 23:34:35 -07001186 Expr::If(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001187 full!(_visitor.visit_expr_if(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001188 }
David Tolnay8c81f622018-07-31 23:34:35 -07001189 Expr::IfLet(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001190 full!(_visitor.visit_expr_if_let(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001191 }
David Tolnay8c81f622018-07-31 23:34:35 -07001192 Expr::While(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001193 full!(_visitor.visit_expr_while(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001194 }
David Tolnay8c81f622018-07-31 23:34:35 -07001195 Expr::WhileLet(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001196 full!(_visitor.visit_expr_while_let(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001197 }
David Tolnay8c81f622018-07-31 23:34:35 -07001198 Expr::ForLoop(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001199 full!(_visitor.visit_expr_for_loop(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001200 }
David Tolnay8c81f622018-07-31 23:34:35 -07001201 Expr::Loop(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001202 full!(_visitor.visit_expr_loop(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001203 }
David Tolnay8c81f622018-07-31 23:34:35 -07001204 Expr::Match(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001205 full!(_visitor.visit_expr_match(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001206 }
David Tolnay8c81f622018-07-31 23:34:35 -07001207 Expr::Closure(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001208 full!(_visitor.visit_expr_closure(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001209 }
David Tolnay8c81f622018-07-31 23:34:35 -07001210 Expr::Unsafe(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001211 full!(_visitor.visit_expr_unsafe(_binding_0));
Nika Layzell640832a2017-12-04 13:37:09 -05001212 }
David Tolnay8c81f622018-07-31 23:34:35 -07001213 Expr::Block(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001214 full!(_visitor.visit_expr_block(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001215 }
David Tolnay8c81f622018-07-31 23:34:35 -07001216 Expr::Assign(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001217 full!(_visitor.visit_expr_assign(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001218 }
David Tolnay8c81f622018-07-31 23:34:35 -07001219 Expr::AssignOp(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001220 full!(_visitor.visit_expr_assign_op(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001221 }
David Tolnay8c81f622018-07-31 23:34:35 -07001222 Expr::Field(ref _binding_0) => {
David Tolnayd093fa92018-06-30 10:23:25 -07001223 _visitor.visit_expr_field(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001224 }
David Tolnay8c81f622018-07-31 23:34:35 -07001225 Expr::Index(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001226 _visitor.visit_expr_index(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001227 }
David Tolnay8c81f622018-07-31 23:34:35 -07001228 Expr::Range(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001229 full!(_visitor.visit_expr_range(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001230 }
David Tolnay8c81f622018-07-31 23:34:35 -07001231 Expr::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001232 _visitor.visit_expr_path(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001233 }
David Tolnay8c81f622018-07-31 23:34:35 -07001234 Expr::Reference(ref _binding_0) => {
David Tolnay00674ba2018-03-31 18:14:11 +02001235 full!(_visitor.visit_expr_reference(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001236 }
David Tolnay8c81f622018-07-31 23:34:35 -07001237 Expr::Break(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001238 full!(_visitor.visit_expr_break(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001239 }
David Tolnay8c81f622018-07-31 23:34:35 -07001240 Expr::Continue(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001241 full!(_visitor.visit_expr_continue(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001242 }
David Tolnay8c81f622018-07-31 23:34:35 -07001243 Expr::Return(ref _binding_0) => {
David Tolnayc246cd32017-12-28 23:14:32 -05001244 full!(_visitor.visit_expr_return(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001245 }
David Tolnay8c81f622018-07-31 23:34:35 -07001246 Expr::Macro(ref _binding_0) => {
David Tolnay8c91b882017-12-28 23:04:32 -05001247 full!(_visitor.visit_expr_macro(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001248 }
David Tolnay8c81f622018-07-31 23:34:35 -07001249 Expr::Struct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001250 full!(_visitor.visit_expr_struct(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001251 }
David Tolnay8c81f622018-07-31 23:34:35 -07001252 Expr::Repeat(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001253 full!(_visitor.visit_expr_repeat(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001254 }
David Tolnay8c81f622018-07-31 23:34:35 -07001255 Expr::Paren(ref _binding_0) => {
David Tolnay81ab4f62018-01-27 19:02:51 -08001256 _visitor.visit_expr_paren(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001257 }
David Tolnay8c81f622018-07-31 23:34:35 -07001258 Expr::Group(ref _binding_0) => {
David Tolnaye98775f2017-12-28 23:17:00 -05001259 full!(_visitor.visit_expr_group(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001260 }
David Tolnay8c81f622018-07-31 23:34:35 -07001261 Expr::Try(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001262 full!(_visitor.visit_expr_try(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001263 }
David Tolnay02a9c6f2018-08-24 18:58:45 -04001264 Expr::Async(ref _binding_0) => {
1265 full!(_visitor.visit_expr_async(_binding_0));
1266 }
David Tolnayfb2dd4b2018-08-24 16:45:34 -04001267 Expr::TryBlock(ref _binding_0) => {
1268 full!(_visitor.visit_expr_try_block(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001269 }
David Tolnay8c81f622018-07-31 23:34:35 -07001270 Expr::Yield(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001271 full!(_visitor.visit_expr_yield(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001272 }
David Tolnay8c81f622018-07-31 23:34:35 -07001273 Expr::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05001274 _visitor.visit_expr_verbatim(_binding_0);
1275 }
Nika Layzell27726662017-10-24 23:16:35 -04001276 }
1277}
David Tolnay8c81f622018-07-31 23:34:35 -07001278#[cfg(feature = "full")]
1279#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001280pub fn visit_expr_array<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprArray) {
David Tolnay8c81f622018-07-31 23:34:35 -07001281 for it in &_i.attrs {
1282 _visitor.visit_attribute(it)
1283 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001284 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001285 for el in Punctuated::pairs(&_i.elems) {
1286 let it = el.value();
1287 _visitor.visit_expr(it)
David Tolnaye3d41b72017-12-31 15:24:00 -05001288 }
1289}
David Tolnay8c81f622018-07-31 23:34:35 -07001290#[cfg(feature = "full")]
1291#[cfg(any(feature = "full", feature = "derive"))]
1292pub fn visit_expr_assign<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprAssign) {
1293 for it in &_i.attrs {
1294 _visitor.visit_attribute(it)
1295 }
1296 _visitor.visit_expr(&*_i.left);
David Tolnay7ac699c2018-08-24 14:00:58 -04001297 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001298 _visitor.visit_expr(&*_i.right);
1299}
1300#[cfg(feature = "full")]
1301#[cfg(any(feature = "full", feature = "derive"))]
1302pub fn visit_expr_assign_op<'ast, V: Visit<'ast> + ?Sized>(
1303 _visitor: &mut V,
1304 _i: &'ast ExprAssignOp,
1305) {
1306 for it in &_i.attrs {
1307 _visitor.visit_attribute(it)
1308 }
1309 _visitor.visit_expr(&*_i.left);
1310 _visitor.visit_bin_op(&_i.op);
1311 _visitor.visit_expr(&*_i.right);
1312}
David Tolnay02a9c6f2018-08-24 18:58:45 -04001313#[cfg(feature = "full")]
1314#[cfg(any(feature = "full", feature = "derive"))]
1315pub fn visit_expr_async<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprAsync) {
1316 for it in &_i.attrs {
1317 _visitor.visit_attribute(it)
1318 }
1319 tokens_helper(_visitor, &_i.async_token.span);
1320 if let Some(ref it) = _i.capture {
1321 tokens_helper(_visitor, &it.span)
1322 };
1323 _visitor.visit_block(&_i.block);
1324}
David Tolnay8c81f622018-07-31 23:34:35 -07001325#[cfg(any(feature = "full", feature = "derive"))]
1326pub fn visit_expr_binary<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBinary) {
1327 for it in &_i.attrs {
1328 _visitor.visit_attribute(it)
1329 }
1330 _visitor.visit_expr(&*_i.left);
1331 _visitor.visit_bin_op(&_i.op);
1332 _visitor.visit_expr(&*_i.right);
1333}
1334#[cfg(feature = "full")]
1335#[cfg(any(feature = "full", feature = "derive"))]
1336pub fn visit_expr_block<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBlock) {
1337 for it in &_i.attrs {
1338 _visitor.visit_attribute(it)
1339 }
1340 _visitor.visit_block(&_i.block);
1341}
1342#[cfg(feature = "full")]
1343#[cfg(any(feature = "full", feature = "derive"))]
1344pub fn visit_expr_box<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBox) {
1345 for it in &_i.attrs {
1346 _visitor.visit_attribute(it)
1347 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001348 tokens_helper(_visitor, &_i.box_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001349 _visitor.visit_expr(&*_i.expr);
1350}
1351#[cfg(feature = "full")]
1352#[cfg(any(feature = "full", feature = "derive"))]
1353pub fn visit_expr_break<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBreak) {
1354 for it in &_i.attrs {
1355 _visitor.visit_attribute(it)
1356 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001357 tokens_helper(_visitor, &_i.break_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001358 if let Some(ref it) = _i.label {
1359 _visitor.visit_lifetime(it)
1360 };
1361 if let Some(ref it) = _i.expr {
1362 _visitor.visit_expr(&**it)
1363 };
1364}
1365#[cfg(any(feature = "full", feature = "derive"))]
1366pub fn visit_expr_call<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprCall) {
1367 for it in &_i.attrs {
1368 _visitor.visit_attribute(it)
1369 }
1370 _visitor.visit_expr(&*_i.func);
David Tolnay7ac699c2018-08-24 14:00:58 -04001371 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001372 for el in Punctuated::pairs(&_i.args) {
1373 let it = el.value();
1374 _visitor.visit_expr(it)
1375 }
1376}
1377#[cfg(any(feature = "full", feature = "derive"))]
1378pub fn visit_expr_cast<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprCast) {
1379 for it in &_i.attrs {
1380 _visitor.visit_attribute(it)
1381 }
1382 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001383 tokens_helper(_visitor, &_i.as_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001384 _visitor.visit_type(&*_i.ty);
1385}
1386#[cfg(feature = "full")]
1387#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001388pub fn visit_expr_closure<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprClosure) {
1389 for it in &_i.attrs {
1390 _visitor.visit_attribute(it)
1391 }
Yusuke Sasaki4e5d9662018-07-21 02:49:47 +09001392 if let Some(ref it) = _i.asyncness {
1393 tokens_helper(_visitor, &it.span)
1394 };
David Tolnay8c81f622018-07-31 23:34:35 -07001395 if let Some(ref it) = _i.movability {
David Tolnay7ac699c2018-08-24 14:00:58 -04001396 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001397 };
1398 if let Some(ref it) = _i.capture {
David Tolnay7ac699c2018-08-24 14:00:58 -04001399 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001400 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001401 tokens_helper(_visitor, &_i.or1_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001402 for el in Punctuated::pairs(&_i.inputs) {
1403 let it = el.value();
1404 _visitor.visit_fn_arg(it)
1405 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001406 tokens_helper(_visitor, &_i.or2_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001407 _visitor.visit_return_type(&_i.output);
1408 _visitor.visit_expr(&*_i.body);
1409}
1410#[cfg(feature = "full")]
1411#[cfg(any(feature = "full", feature = "derive"))]
1412pub fn visit_expr_continue<'ast, V: Visit<'ast> + ?Sized>(
1413 _visitor: &mut V,
1414 _i: &'ast ExprContinue,
1415) {
1416 for it in &_i.attrs {
1417 _visitor.visit_attribute(it)
1418 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001419 tokens_helper(_visitor, &_i.continue_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001420 if let Some(ref it) = _i.label {
1421 _visitor.visit_lifetime(it)
1422 };
1423}
1424#[cfg(any(feature = "full", feature = "derive"))]
1425pub fn visit_expr_field<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprField) {
1426 for it in &_i.attrs {
1427 _visitor.visit_attribute(it)
1428 }
1429 _visitor.visit_expr(&*_i.base);
David Tolnay7ac699c2018-08-24 14:00:58 -04001430 tokens_helper(_visitor, &_i.dot_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001431 _visitor.visit_member(&_i.member);
1432}
1433#[cfg(feature = "full")]
1434#[cfg(any(feature = "full", feature = "derive"))]
1435pub fn visit_expr_for_loop<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprForLoop) {
1436 for it in &_i.attrs {
1437 _visitor.visit_attribute(it)
1438 }
1439 if let Some(ref it) = _i.label {
1440 _visitor.visit_label(it)
1441 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001442 tokens_helper(_visitor, &_i.for_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001443 _visitor.visit_pat(&*_i.pat);
David Tolnay7ac699c2018-08-24 14:00:58 -04001444 tokens_helper(_visitor, &_i.in_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001445 _visitor.visit_expr(&*_i.expr);
1446 _visitor.visit_block(&_i.body);
1447}
1448#[cfg(feature = "full")]
1449#[cfg(any(feature = "full", feature = "derive"))]
1450pub fn visit_expr_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprGroup) {
1451 for it in &_i.attrs {
1452 _visitor.visit_attribute(it)
1453 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001454 tokens_helper(_visitor, &_i.group_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001455 _visitor.visit_expr(&*_i.expr);
1456}
1457#[cfg(feature = "full")]
1458#[cfg(any(feature = "full", feature = "derive"))]
1459pub fn visit_expr_if<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprIf) {
1460 for it in &_i.attrs {
1461 _visitor.visit_attribute(it)
1462 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001463 tokens_helper(_visitor, &_i.if_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001464 _visitor.visit_expr(&*_i.cond);
1465 _visitor.visit_block(&_i.then_branch);
1466 if let Some(ref it) = _i.else_branch {
David Tolnay7ac699c2018-08-24 14:00:58 -04001467 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001468 _visitor.visit_expr(&*(it).1);
1469 };
1470}
1471#[cfg(feature = "full")]
1472#[cfg(any(feature = "full", feature = "derive"))]
1473pub fn visit_expr_if_let<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprIfLet) {
1474 for it in &_i.attrs {
1475 _visitor.visit_attribute(it)
1476 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001477 tokens_helper(_visitor, &_i.if_token.span);
1478 tokens_helper(_visitor, &_i.let_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001479 for el in Punctuated::pairs(&_i.pats) {
1480 let it = el.value();
1481 _visitor.visit_pat(it)
1482 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001483 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001484 _visitor.visit_expr(&*_i.expr);
1485 _visitor.visit_block(&_i.then_branch);
1486 if let Some(ref it) = _i.else_branch {
David Tolnay7ac699c2018-08-24 14:00:58 -04001487 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001488 _visitor.visit_expr(&*(it).1);
1489 };
1490}
1491#[cfg(feature = "full")]
1492#[cfg(any(feature = "full", feature = "derive"))]
1493pub fn visit_expr_in_place<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprInPlace) {
1494 for it in &_i.attrs {
1495 _visitor.visit_attribute(it)
1496 }
1497 _visitor.visit_expr(&*_i.place);
David Tolnay7ac699c2018-08-24 14:00:58 -04001498 tokens_helper(_visitor, &_i.arrow_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001499 _visitor.visit_expr(&*_i.value);
1500}
1501#[cfg(any(feature = "full", feature = "derive"))]
1502pub fn visit_expr_index<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprIndex) {
1503 for it in &_i.attrs {
1504 _visitor.visit_attribute(it)
1505 }
1506 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001507 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001508 _visitor.visit_expr(&*_i.index);
1509}
1510#[cfg(any(feature = "full", feature = "derive"))]
1511pub fn visit_expr_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprLit) {
1512 for it in &_i.attrs {
1513 _visitor.visit_attribute(it)
1514 }
1515 _visitor.visit_lit(&_i.lit);
1516}
1517#[cfg(feature = "full")]
1518#[cfg(any(feature = "full", feature = "derive"))]
1519pub fn visit_expr_loop<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprLoop) {
1520 for it in &_i.attrs {
1521 _visitor.visit_attribute(it)
1522 }
1523 if let Some(ref it) = _i.label {
1524 _visitor.visit_label(it)
1525 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001526 tokens_helper(_visitor, &_i.loop_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001527 _visitor.visit_block(&_i.body);
1528}
1529#[cfg(feature = "full")]
1530#[cfg(any(feature = "full", feature = "derive"))]
1531pub fn visit_expr_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprMacro) {
1532 for it in &_i.attrs {
1533 _visitor.visit_attribute(it)
1534 }
1535 _visitor.visit_macro(&_i.mac);
1536}
1537#[cfg(feature = "full")]
1538#[cfg(any(feature = "full", feature = "derive"))]
1539pub fn visit_expr_match<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprMatch) {
1540 for it in &_i.attrs {
1541 _visitor.visit_attribute(it)
1542 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001543 tokens_helper(_visitor, &_i.match_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001544 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001545 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001546 for it in &_i.arms {
1547 _visitor.visit_arm(it)
1548 }
1549}
1550#[cfg(feature = "full")]
1551#[cfg(any(feature = "full", feature = "derive"))]
1552pub fn visit_expr_method_call<'ast, V: Visit<'ast> + ?Sized>(
1553 _visitor: &mut V,
1554 _i: &'ast ExprMethodCall,
1555) {
1556 for it in &_i.attrs {
1557 _visitor.visit_attribute(it)
1558 }
1559 _visitor.visit_expr(&*_i.receiver);
David Tolnay7ac699c2018-08-24 14:00:58 -04001560 tokens_helper(_visitor, &_i.dot_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001561 _visitor.visit_ident(&_i.method);
1562 if let Some(ref it) = _i.turbofish {
1563 _visitor.visit_method_turbofish(it)
1564 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001565 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001566 for el in Punctuated::pairs(&_i.args) {
1567 let it = el.value();
1568 _visitor.visit_expr(it)
1569 }
1570}
1571#[cfg(any(feature = "full", feature = "derive"))]
1572pub fn visit_expr_paren<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprParen) {
1573 for it in &_i.attrs {
1574 _visitor.visit_attribute(it)
1575 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001576 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001577 _visitor.visit_expr(&*_i.expr);
1578}
1579#[cfg(any(feature = "full", feature = "derive"))]
1580pub fn visit_expr_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprPath) {
1581 for it in &_i.attrs {
1582 _visitor.visit_attribute(it)
1583 }
1584 if let Some(ref it) = _i.qself {
1585 _visitor.visit_qself(it)
1586 };
1587 _visitor.visit_path(&_i.path);
1588}
1589#[cfg(feature = "full")]
1590#[cfg(any(feature = "full", feature = "derive"))]
1591pub fn visit_expr_range<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprRange) {
1592 for it in &_i.attrs {
1593 _visitor.visit_attribute(it)
1594 }
1595 if let Some(ref it) = _i.from {
1596 _visitor.visit_expr(&**it)
1597 };
1598 _visitor.visit_range_limits(&_i.limits);
1599 if let Some(ref it) = _i.to {
1600 _visitor.visit_expr(&**it)
1601 };
1602}
1603#[cfg(feature = "full")]
1604#[cfg(any(feature = "full", feature = "derive"))]
1605pub fn visit_expr_reference<'ast, V: Visit<'ast> + ?Sized>(
1606 _visitor: &mut V,
1607 _i: &'ast ExprReference,
1608) {
1609 for it in &_i.attrs {
1610 _visitor.visit_attribute(it)
1611 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001612 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001613 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04001614 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001615 };
1616 _visitor.visit_expr(&*_i.expr);
1617}
1618#[cfg(feature = "full")]
1619#[cfg(any(feature = "full", feature = "derive"))]
1620pub fn visit_expr_repeat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprRepeat) {
1621 for it in &_i.attrs {
1622 _visitor.visit_attribute(it)
1623 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001624 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001625 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001626 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001627 _visitor.visit_expr(&*_i.len);
1628}
1629#[cfg(feature = "full")]
1630#[cfg(any(feature = "full", feature = "derive"))]
1631pub fn visit_expr_return<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprReturn) {
1632 for it in &_i.attrs {
1633 _visitor.visit_attribute(it)
1634 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001635 tokens_helper(_visitor, &_i.return_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001636 if let Some(ref it) = _i.expr {
1637 _visitor.visit_expr(&**it)
1638 };
1639}
1640#[cfg(feature = "full")]
1641#[cfg(any(feature = "full", feature = "derive"))]
1642pub fn visit_expr_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprStruct) {
1643 for it in &_i.attrs {
1644 _visitor.visit_attribute(it)
1645 }
1646 _visitor.visit_path(&_i.path);
David Tolnay7ac699c2018-08-24 14:00:58 -04001647 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001648 for el in Punctuated::pairs(&_i.fields) {
1649 let it = el.value();
1650 _visitor.visit_field_value(it)
1651 }
1652 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001653 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001654 };
1655 if let Some(ref it) = _i.rest {
1656 _visitor.visit_expr(&**it)
1657 };
1658}
1659#[cfg(feature = "full")]
1660#[cfg(any(feature = "full", feature = "derive"))]
1661pub fn visit_expr_try<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprTry) {
1662 for it in &_i.attrs {
1663 _visitor.visit_attribute(it)
1664 }
1665 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001666 tokens_helper(_visitor, &_i.question_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001667}
1668#[cfg(feature = "full")]
1669#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayfb2dd4b2018-08-24 16:45:34 -04001670pub fn visit_expr_try_block<'ast, V: Visit<'ast> + ?Sized>(
1671 _visitor: &mut V,
1672 _i: &'ast ExprTryBlock,
1673) {
1674 for it in &_i.attrs {
1675 _visitor.visit_attribute(it)
1676 }
1677 tokens_helper(_visitor, &_i.try_token.span);
1678 _visitor.visit_block(&_i.block);
1679}
1680#[cfg(feature = "full")]
1681#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001682pub fn visit_expr_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprTuple) {
1683 for it in &_i.attrs {
1684 _visitor.visit_attribute(it)
1685 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001686 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001687 for el in Punctuated::pairs(&_i.elems) {
1688 let it = el.value();
1689 _visitor.visit_expr(it)
1690 }
1691}
1692#[cfg(feature = "full")]
1693#[cfg(any(feature = "full", feature = "derive"))]
1694pub fn visit_expr_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprType) {
1695 for it in &_i.attrs {
1696 _visitor.visit_attribute(it)
1697 }
1698 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001699 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001700 _visitor.visit_type(&*_i.ty);
1701}
1702#[cfg(any(feature = "full", feature = "derive"))]
1703pub fn visit_expr_unary<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprUnary) {
1704 for it in &_i.attrs {
1705 _visitor.visit_attribute(it)
1706 }
1707 _visitor.visit_un_op(&_i.op);
1708 _visitor.visit_expr(&*_i.expr);
1709}
1710#[cfg(feature = "full")]
1711#[cfg(any(feature = "full", feature = "derive"))]
1712pub fn visit_expr_unsafe<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprUnsafe) {
1713 for it in &_i.attrs {
1714 _visitor.visit_attribute(it)
1715 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001716 tokens_helper(_visitor, &_i.unsafe_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001717 _visitor.visit_block(&_i.block);
1718}
1719#[cfg(any(feature = "full", feature = "derive"))]
1720pub fn visit_expr_verbatim<'ast, V: Visit<'ast> + ?Sized>(
1721 _visitor: &mut V,
1722 _i: &'ast ExprVerbatim,
1723) {
David Tolnay6af48992018-08-01 11:16:28 -07001724 skip!(_i.tts);
David Tolnay8c81f622018-07-31 23:34:35 -07001725}
1726#[cfg(feature = "full")]
1727#[cfg(any(feature = "full", feature = "derive"))]
1728pub fn visit_expr_while<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprWhile) {
1729 for it in &_i.attrs {
1730 _visitor.visit_attribute(it)
1731 }
1732 if let Some(ref it) = _i.label {
1733 _visitor.visit_label(it)
1734 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001735 tokens_helper(_visitor, &_i.while_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001736 _visitor.visit_expr(&*_i.cond);
1737 _visitor.visit_block(&_i.body);
1738}
1739#[cfg(feature = "full")]
1740#[cfg(any(feature = "full", feature = "derive"))]
1741pub fn visit_expr_while_let<'ast, V: Visit<'ast> + ?Sized>(
1742 _visitor: &mut V,
1743 _i: &'ast ExprWhileLet,
1744) {
1745 for it in &_i.attrs {
1746 _visitor.visit_attribute(it)
1747 }
1748 if let Some(ref it) = _i.label {
1749 _visitor.visit_label(it)
1750 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001751 tokens_helper(_visitor, &_i.while_token.span);
1752 tokens_helper(_visitor, &_i.let_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001753 for el in Punctuated::pairs(&_i.pats) {
1754 let it = el.value();
1755 _visitor.visit_pat(it)
1756 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001757 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001758 _visitor.visit_expr(&*_i.expr);
1759 _visitor.visit_block(&_i.body);
1760}
1761#[cfg(feature = "full")]
1762#[cfg(any(feature = "full", feature = "derive"))]
1763pub fn visit_expr_yield<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprYield) {
1764 for it in &_i.attrs {
1765 _visitor.visit_attribute(it)
1766 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001767 tokens_helper(_visitor, &_i.yield_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001768 if let Some(ref it) = _i.expr {
1769 _visitor.visit_expr(&**it)
1770 };
1771}
1772#[cfg(any(feature = "full", feature = "derive"))]
1773pub fn visit_field<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Field) {
1774 for it in &_i.attrs {
1775 _visitor.visit_attribute(it)
1776 }
1777 _visitor.visit_visibility(&_i.vis);
1778 if let Some(ref it) = _i.ident {
1779 _visitor.visit_ident(it)
1780 };
1781 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001782 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001783 };
1784 _visitor.visit_type(&_i.ty);
1785}
1786#[cfg(any(feature = "full", feature = "derive"))]
1787#[cfg(feature = "full")]
1788pub fn visit_field_pat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldPat) {
1789 for it in &_i.attrs {
1790 _visitor.visit_attribute(it)
1791 }
1792 _visitor.visit_member(&_i.member);
1793 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001794 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001795 };
1796 _visitor.visit_pat(&*_i.pat);
1797}
1798#[cfg(any(feature = "full", feature = "derive"))]
1799#[cfg(feature = "full")]
1800pub fn visit_field_value<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldValue) {
1801 for it in &_i.attrs {
1802 _visitor.visit_attribute(it)
1803 }
1804 _visitor.visit_member(&_i.member);
1805 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001806 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001807 };
1808 _visitor.visit_expr(&_i.expr);
1809}
1810#[cfg(any(feature = "full", feature = "derive"))]
1811pub fn visit_fields<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Fields) {
1812 match *_i {
1813 Fields::Named(ref _binding_0) => {
1814 _visitor.visit_fields_named(_binding_0);
1815 }
1816 Fields::Unnamed(ref _binding_0) => {
1817 _visitor.visit_fields_unnamed(_binding_0);
1818 }
1819 Fields::Unit => {}
1820 }
1821}
1822#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001823pub fn visit_fields_named<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldsNamed) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001824 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001825 for el in Punctuated::pairs(&_i.named) {
1826 let it = el.value();
1827 _visitor.visit_field(it)
1828 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001829}
David Tolnay8c81f622018-07-31 23:34:35 -07001830#[cfg(any(feature = "full", feature = "derive"))]
1831pub fn visit_fields_unnamed<'ast, V: Visit<'ast> + ?Sized>(
1832 _visitor: &mut V,
1833 _i: &'ast FieldsUnnamed,
1834) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001835 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001836 for el in Punctuated::pairs(&_i.unnamed) {
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(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001842pub fn visit_file<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast File) {
David Tolnay6af48992018-08-01 11:16:28 -07001843 skip!(_i.shebang);
David Tolnay8c81f622018-07-31 23:34:35 -07001844 for it in &_i.attrs {
1845 _visitor.visit_attribute(it)
1846 }
1847 for it in &_i.items {
1848 _visitor.visit_item(it)
1849 }
Nika Layzell27726662017-10-24 23:16:35 -04001850}
David Tolnay8c81f622018-07-31 23:34:35 -07001851#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001852pub fn visit_fn_arg<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FnArg) {
Nika Layzell27726662017-10-24 23:16:35 -04001853 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001854 FnArg::SelfRef(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001855 _visitor.visit_arg_self_ref(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001856 }
David Tolnay8c81f622018-07-31 23:34:35 -07001857 FnArg::SelfValue(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001858 _visitor.visit_arg_self(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001859 }
David Tolnay8c81f622018-07-31 23:34:35 -07001860 FnArg::Captured(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001861 _visitor.visit_arg_captured(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001862 }
David Tolnay8c81f622018-07-31 23:34:35 -07001863 FnArg::Inferred(ref _binding_0) => {
David Tolnay80ed55f2017-12-27 22:54:40 -05001864 _visitor.visit_pat(_binding_0);
1865 }
David Tolnay8c81f622018-07-31 23:34:35 -07001866 FnArg::Ignored(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001867 _visitor.visit_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001868 }
1869 }
1870}
David Tolnay8c81f622018-07-31 23:34:35 -07001871#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001872pub fn visit_fn_decl<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FnDecl) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001873 tokens_helper(_visitor, &_i.fn_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001874 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04001875 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001876 for el in Punctuated::pairs(&_i.inputs) {
1877 let it = el.value();
1878 _visitor.visit_fn_arg(it)
1879 }
1880 if let Some(ref it) = _i.variadic {
David Tolnay7ac699c2018-08-24 14:00:58 -04001881 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001882 };
1883 _visitor.visit_return_type(&_i.output);
Nika Layzell27726662017-10-24 23:16:35 -04001884}
David Tolnay8c81f622018-07-31 23:34:35 -07001885#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001886pub fn visit_foreign_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ForeignItem) {
Nika Layzell27726662017-10-24 23:16:35 -04001887 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001888 ForeignItem::Fn(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001889 _visitor.visit_foreign_item_fn(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001890 }
David Tolnay8c81f622018-07-31 23:34:35 -07001891 ForeignItem::Static(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001892 _visitor.visit_foreign_item_static(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001893 }
David Tolnay8c81f622018-07-31 23:34:35 -07001894 ForeignItem::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001895 _visitor.visit_foreign_item_type(_binding_0);
David Tolnay199bcbb2017-11-12 10:33:52 -08001896 }
David Tolnay435c1782018-08-24 16:15:44 -04001897 ForeignItem::Macro(ref _binding_0) => {
1898 _visitor.visit_foreign_item_macro(_binding_0);
1899 }
David Tolnay8c81f622018-07-31 23:34:35 -07001900 ForeignItem::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05001901 _visitor.visit_foreign_item_verbatim(_binding_0);
1902 }
Nika Layzell27726662017-10-24 23:16:35 -04001903 }
1904}
David Tolnay8c81f622018-07-31 23:34:35 -07001905#[cfg(feature = "full")]
1906pub fn visit_foreign_item_fn<'ast, V: Visit<'ast> + ?Sized>(
1907 _visitor: &mut V,
1908 _i: &'ast ForeignItemFn,
1909) {
1910 for it in &_i.attrs {
1911 _visitor.visit_attribute(it)
1912 }
1913 _visitor.visit_visibility(&_i.vis);
1914 _visitor.visit_ident(&_i.ident);
1915 _visitor.visit_fn_decl(&*_i.decl);
David Tolnay7ac699c2018-08-24 14:00:58 -04001916 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay8894f602017-11-11 12:11:04 -08001917}
David Tolnay8c81f622018-07-31 23:34:35 -07001918#[cfg(feature = "full")]
David Tolnay435c1782018-08-24 16:15:44 -04001919pub fn visit_foreign_item_macro<'ast, V: Visit<'ast> + ?Sized>(
1920 _visitor: &mut V,
1921 _i: &'ast ForeignItemMacro,
1922) {
1923 for it in &_i.attrs {
1924 _visitor.visit_attribute(it)
1925 }
1926 _visitor.visit_macro(&_i.mac);
1927 if let Some(ref it) = _i.semi_token {
1928 tokens_helper(_visitor, &it.spans)
1929 };
1930}
1931#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001932pub fn visit_foreign_item_static<'ast, V: Visit<'ast> + ?Sized>(
1933 _visitor: &mut V,
1934 _i: &'ast ForeignItemStatic,
1935) {
1936 for it in &_i.attrs {
1937 _visitor.visit_attribute(it)
1938 }
1939 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04001940 tokens_helper(_visitor, &_i.static_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001941 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04001942 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001943 };
1944 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001945 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001946 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04001947 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001948}
David Tolnay8c81f622018-07-31 23:34:35 -07001949#[cfg(feature = "full")]
1950pub fn visit_foreign_item_type<'ast, V: Visit<'ast> + ?Sized>(
1951 _visitor: &mut V,
1952 _i: &'ast ForeignItemType,
1953) {
1954 for it in &_i.attrs {
1955 _visitor.visit_attribute(it)
1956 }
1957 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04001958 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001959 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001960 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay199bcbb2017-11-12 10:33:52 -08001961}
David Tolnay8c81f622018-07-31 23:34:35 -07001962#[cfg(feature = "full")]
1963pub fn visit_foreign_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
1964 _visitor: &mut V,
1965 _i: &'ast ForeignItemVerbatim,
1966) {
David Tolnay6af48992018-08-01 11:16:28 -07001967 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05001968}
David Tolnay8c81f622018-07-31 23:34:35 -07001969#[cfg(any(feature = "full", feature = "derive"))]
1970pub fn visit_generic_argument<'ast, V: Visit<'ast> + ?Sized>(
1971 _visitor: &mut V,
1972 _i: &'ast GenericArgument,
1973) {
Nika Layzell357885a2017-12-04 15:47:07 -05001974 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001975 GenericArgument::Lifetime(ref _binding_0) => {
David Tolnay4ba63a02017-12-28 15:53:05 -05001976 _visitor.visit_lifetime(_binding_0);
Nika Layzell357885a2017-12-04 15:47:07 -05001977 }
David Tolnay8c81f622018-07-31 23:34:35 -07001978 GenericArgument::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001979 _visitor.visit_type(_binding_0);
Nika Layzell357885a2017-12-04 15:47:07 -05001980 }
David Tolnay8c81f622018-07-31 23:34:35 -07001981 GenericArgument::Binding(ref _binding_0) => {
David Tolnay506e43a2017-12-29 11:34:36 -05001982 _visitor.visit_binding(_binding_0);
Nika Layzell357885a2017-12-04 15:47:07 -05001983 }
David Tolnay8c81f622018-07-31 23:34:35 -07001984 GenericArgument::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001985 _visitor.visit_expr(_binding_0);
Nika Layzellc680e612017-12-04 19:07:20 -05001986 }
Nika Layzell357885a2017-12-04 15:47:07 -05001987 }
1988}
David Tolnay8c81f622018-07-31 23:34:35 -07001989#[cfg(any(feature = "full", feature = "derive"))]
1990#[cfg(feature = "full")]
1991pub fn visit_generic_method_argument<'ast, V: Visit<'ast> + ?Sized>(
1992 _visitor: &mut V,
1993 _i: &'ast GenericMethodArgument,
1994) {
David Tolnayd60cfec2017-12-29 00:21:38 -05001995 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001996 GenericMethodArgument::Type(ref _binding_0) => {
David Tolnayd60cfec2017-12-29 00:21:38 -05001997 _visitor.visit_type(_binding_0);
1998 }
David Tolnay8c81f622018-07-31 23:34:35 -07001999 GenericMethodArgument::Const(ref _binding_0) => {
David Tolnayd60cfec2017-12-29 00:21:38 -05002000 _visitor.visit_expr(_binding_0);
2001 }
2002 }
2003}
David Tolnay8c81f622018-07-31 23:34:35 -07002004#[cfg(any(feature = "full", feature = "derive"))]
2005pub fn visit_generic_param<'ast, V: Visit<'ast> + ?Sized>(
2006 _visitor: &mut V,
2007 _i: &'ast GenericParam,
2008) {
David Tolnayc2f1aba2017-11-12 20:29:22 -08002009 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002010 GenericParam::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002011 _visitor.visit_type_param(_binding_0);
David Tolnayc2f1aba2017-11-12 20:29:22 -08002012 }
David Tolnay8c81f622018-07-31 23:34:35 -07002013 GenericParam::Lifetime(ref _binding_0) => {
David Tolnay517f3692018-01-01 20:17:23 -08002014 _visitor.visit_lifetime_def(_binding_0);
2015 }
David Tolnay8c81f622018-07-31 23:34:35 -07002016 GenericParam::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002017 _visitor.visit_const_param(_binding_0);
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05002018 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08002019 }
2020}
David Tolnay8c81f622018-07-31 23:34:35 -07002021#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002022pub fn visit_generics<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Generics) {
David Tolnay8c81f622018-07-31 23:34:35 -07002023 if let Some(ref it) = _i.lt_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002024 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002025 };
2026 for el in Punctuated::pairs(&_i.params) {
2027 let it = el.value();
2028 _visitor.visit_generic_param(it)
2029 }
2030 if let Some(ref it) = _i.gt_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002031 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002032 };
2033 if let Some(ref it) = _i.where_clause {
2034 _visitor.visit_where_clause(it)
2035 };
Nika Layzell27726662017-10-24 23:16:35 -04002036}
David Tolnay8c81f622018-07-31 23:34:35 -07002037pub fn visit_ident<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Ident) {}
2038#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002039pub fn visit_impl_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ImplItem) {
Nika Layzell27726662017-10-24 23:16:35 -04002040 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002041 ImplItem::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002042 _visitor.visit_impl_item_const(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002043 }
David Tolnay8c81f622018-07-31 23:34:35 -07002044 ImplItem::Method(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002045 _visitor.visit_impl_item_method(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002046 }
David Tolnay8c81f622018-07-31 23:34:35 -07002047 ImplItem::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002048 _visitor.visit_impl_item_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002049 }
David Tolnay8c81f622018-07-31 23:34:35 -07002050 ImplItem::Macro(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002051 _visitor.visit_impl_item_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002052 }
David Tolnay8c81f622018-07-31 23:34:35 -07002053 ImplItem::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002054 _visitor.visit_impl_item_verbatim(_binding_0);
2055 }
Nika Layzell27726662017-10-24 23:16:35 -04002056 }
2057}
David Tolnay8c81f622018-07-31 23:34:35 -07002058#[cfg(feature = "full")]
2059pub fn visit_impl_item_const<'ast, V: Visit<'ast> + ?Sized>(
2060 _visitor: &mut V,
2061 _i: &'ast ImplItemConst,
2062) {
2063 for it in &_i.attrs {
2064 _visitor.visit_attribute(it)
2065 }
2066 _visitor.visit_visibility(&_i.vis);
2067 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002068 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002069 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002070 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002071 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002072 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002073 _visitor.visit_type(&_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002074 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002075 _visitor.visit_expr(&_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04002076 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay857628c2017-11-11 12:25:31 -08002077}
David Tolnay8c81f622018-07-31 23:34:35 -07002078#[cfg(feature = "full")]
2079pub fn visit_impl_item_macro<'ast, V: Visit<'ast> + ?Sized>(
2080 _visitor: &mut V,
2081 _i: &'ast ImplItemMacro,
2082) {
2083 for it in &_i.attrs {
2084 _visitor.visit_attribute(it)
2085 }
2086 _visitor.visit_macro(&_i.mac);
2087 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002088 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002089 };
David Tolnay857628c2017-11-11 12:25:31 -08002090}
David Tolnay8c81f622018-07-31 23:34:35 -07002091#[cfg(feature = "full")]
2092pub fn visit_impl_item_method<'ast, V: Visit<'ast> + ?Sized>(
2093 _visitor: &mut V,
2094 _i: &'ast ImplItemMethod,
2095) {
2096 for it in &_i.attrs {
2097 _visitor.visit_attribute(it)
2098 }
2099 _visitor.visit_visibility(&_i.vis);
2100 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002101 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002102 };
2103 _visitor.visit_method_sig(&_i.sig);
2104 _visitor.visit_block(&_i.block);
Nika Layzell27726662017-10-24 23:16:35 -04002105}
David Tolnay8c81f622018-07-31 23:34:35 -07002106#[cfg(feature = "full")]
2107pub fn visit_impl_item_type<'ast, V: Visit<'ast> + ?Sized>(
2108 _visitor: &mut V,
2109 _i: &'ast ImplItemType,
2110) {
2111 for it in &_i.attrs {
2112 _visitor.visit_attribute(it)
2113 }
2114 _visitor.visit_visibility(&_i.vis);
2115 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002116 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002117 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002118 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002119 _visitor.visit_ident(&_i.ident);
2120 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04002121 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002122 _visitor.visit_type(&_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002123 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002124}
David Tolnay8c81f622018-07-31 23:34:35 -07002125#[cfg(feature = "full")]
2126pub fn visit_impl_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
2127 _visitor: &mut V,
2128 _i: &'ast ImplItemVerbatim,
2129) {
David Tolnay6af48992018-08-01 11:16:28 -07002130 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05002131}
David Tolnay8c81f622018-07-31 23:34:35 -07002132#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002133pub fn visit_index<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Index) {
David Tolnay6af48992018-08-01 11:16:28 -07002134 skip!(_i.index);
David Tolnay8c81f622018-07-31 23:34:35 -07002135 _visitor.visit_span(&_i.span);
David Tolnay85b69a42017-12-27 20:43:10 -05002136}
David Tolnay8c81f622018-07-31 23:34:35 -07002137#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002138pub fn visit_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Item) {
Nika Layzell27726662017-10-24 23:16:35 -04002139 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002140 Item::ExternCrate(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002141 _visitor.visit_item_extern_crate(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002142 }
David Tolnay8c81f622018-07-31 23:34:35 -07002143 Item::Use(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002144 _visitor.visit_item_use(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002145 }
David Tolnay8c81f622018-07-31 23:34:35 -07002146 Item::Static(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002147 _visitor.visit_item_static(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002148 }
David Tolnay8c81f622018-07-31 23:34:35 -07002149 Item::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002150 _visitor.visit_item_const(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002151 }
David Tolnay8c81f622018-07-31 23:34:35 -07002152 Item::Fn(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002153 _visitor.visit_item_fn(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002154 }
David Tolnay8c81f622018-07-31 23:34:35 -07002155 Item::Mod(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002156 _visitor.visit_item_mod(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002157 }
David Tolnay8c81f622018-07-31 23:34:35 -07002158 Item::ForeignMod(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002159 _visitor.visit_item_foreign_mod(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002160 }
David Tolnay8c81f622018-07-31 23:34:35 -07002161 Item::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002162 _visitor.visit_item_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002163 }
David Tolnay8c81f622018-07-31 23:34:35 -07002164 Item::Struct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002165 _visitor.visit_item_struct(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002166 }
David Tolnay8c81f622018-07-31 23:34:35 -07002167 Item::Enum(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05002168 _visitor.visit_item_enum(_binding_0);
2169 }
David Tolnay8c81f622018-07-31 23:34:35 -07002170 Item::Union(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002171 _visitor.visit_item_union(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002172 }
David Tolnay8c81f622018-07-31 23:34:35 -07002173 Item::Trait(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002174 _visitor.visit_item_trait(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002175 }
David Tolnay8c81f622018-07-31 23:34:35 -07002176 Item::Impl(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002177 _visitor.visit_item_impl(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002178 }
David Tolnay8c81f622018-07-31 23:34:35 -07002179 Item::Macro(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002180 _visitor.visit_item_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002181 }
David Tolnay8c81f622018-07-31 23:34:35 -07002182 Item::Macro2(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002183 _visitor.visit_item_macro2(_binding_0);
David Tolnay500d8322017-12-18 00:32:51 -08002184 }
David Tolnay8c81f622018-07-31 23:34:35 -07002185 Item::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002186 _visitor.visit_item_verbatim(_binding_0);
2187 }
Nika Layzell27726662017-10-24 23:16:35 -04002188 }
2189}
David Tolnay8c81f622018-07-31 23:34:35 -07002190#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002191pub fn visit_item_const<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemConst) {
David Tolnay8c81f622018-07-31 23:34:35 -07002192 for it in &_i.attrs {
2193 _visitor.visit_attribute(it)
2194 }
2195 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002196 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002197 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002198 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002199 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002200 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002201 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04002202 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnayc6b55bc2017-11-09 22:48:38 -08002203}
David Tolnay8c81f622018-07-31 23:34:35 -07002204#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002205pub fn visit_item_enum<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemEnum) {
David Tolnay8c81f622018-07-31 23:34:35 -07002206 for it in &_i.attrs {
2207 _visitor.visit_attribute(it)
2208 }
2209 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002210 tokens_helper(_visitor, &_i.enum_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002211 _visitor.visit_ident(&_i.ident);
2212 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04002213 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002214 for el in Punctuated::pairs(&_i.variants) {
2215 let it = el.value();
2216 _visitor.visit_variant(it)
2217 }
David Tolnayc6b55bc2017-11-09 22:48:38 -08002218}
David Tolnay8c81f622018-07-31 23:34:35 -07002219#[cfg(feature = "full")]
2220pub fn visit_item_extern_crate<'ast, V: Visit<'ast> + ?Sized>(
2221 _visitor: &mut V,
2222 _i: &'ast ItemExternCrate,
2223) {
2224 for it in &_i.attrs {
2225 _visitor.visit_attribute(it)
2226 }
2227 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002228 tokens_helper(_visitor, &_i.extern_token.span);
2229 tokens_helper(_visitor, &_i.crate_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002230 _visitor.visit_ident(&_i.ident);
2231 if let Some(ref it) = _i.rename {
David Tolnay7ac699c2018-08-24 14:00:58 -04002232 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002233 _visitor.visit_ident(&(it).1);
2234 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002235 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnayc6b55bc2017-11-09 22:48:38 -08002236}
David Tolnay8c81f622018-07-31 23:34:35 -07002237#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002238pub fn visit_item_fn<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemFn) {
David Tolnay8c81f622018-07-31 23:34:35 -07002239 for it in &_i.attrs {
2240 _visitor.visit_attribute(it)
2241 }
2242 _visitor.visit_visibility(&_i.vis);
2243 if let Some(ref it) = _i.constness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002244 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002245 };
2246 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002247 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002248 };
Yusuke Sasakif00a3ef2018-07-20 22:08:42 +09002249 if let Some(ref it) = _i.asyncness {
2250 tokens_helper(_visitor, &it.span)
2251 };
David Tolnay8c81f622018-07-31 23:34:35 -07002252 if let Some(ref it) = _i.abi {
2253 _visitor.visit_abi(it)
2254 };
2255 _visitor.visit_ident(&_i.ident);
2256 _visitor.visit_fn_decl(&*_i.decl);
2257 _visitor.visit_block(&*_i.block);
David Tolnayc6b55bc2017-11-09 22:48:38 -08002258}
David Tolnay8c81f622018-07-31 23:34:35 -07002259#[cfg(feature = "full")]
2260pub fn visit_item_foreign_mod<'ast, V: Visit<'ast> + ?Sized>(
2261 _visitor: &mut V,
2262 _i: &'ast ItemForeignMod,
2263) {
2264 for it in &_i.attrs {
2265 _visitor.visit_attribute(it)
2266 }
2267 _visitor.visit_abi(&_i.abi);
David Tolnay7ac699c2018-08-24 14:00:58 -04002268 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002269 for it in &_i.items {
2270 _visitor.visit_foreign_item(it)
2271 }
David Tolnayc6b55bc2017-11-09 22:48:38 -08002272}
David Tolnay8c81f622018-07-31 23:34:35 -07002273#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002274pub fn visit_item_impl<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemImpl) {
David Tolnay8c81f622018-07-31 23:34:35 -07002275 for it in &_i.attrs {
2276 _visitor.visit_attribute(it)
2277 }
2278 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002279 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002280 };
2281 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002282 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002283 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002284 tokens_helper(_visitor, &_i.impl_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002285 _visitor.visit_generics(&_i.generics);
2286 if let Some(ref it) = _i.trait_ {
2287 if let Some(ref it) = (it).0 {
David Tolnay7ac699c2018-08-24 14:00:58 -04002288 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002289 };
2290 _visitor.visit_path(&(it).1);
David Tolnay7ac699c2018-08-24 14:00:58 -04002291 tokens_helper(_visitor, &(it).2.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002292 };
2293 _visitor.visit_type(&*_i.self_ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002294 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002295 for it in &_i.items {
2296 _visitor.visit_impl_item(it)
2297 }
David Tolnayc6b55bc2017-11-09 22:48:38 -08002298}
David Tolnay8c81f622018-07-31 23:34:35 -07002299#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002300pub fn visit_item_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemMacro) {
David Tolnay8c81f622018-07-31 23:34:35 -07002301 for it in &_i.attrs {
2302 _visitor.visit_attribute(it)
2303 }
2304 if let Some(ref it) = _i.ident {
2305 _visitor.visit_ident(it)
2306 };
2307 _visitor.visit_macro(&_i.mac);
2308 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002309 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002310 };
David Tolnayc6b55bc2017-11-09 22:48:38 -08002311}
David Tolnay8c81f622018-07-31 23:34:35 -07002312#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002313pub fn visit_item_macro2<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemMacro2) {
David Tolnay8c81f622018-07-31 23:34:35 -07002314 for it in &_i.attrs {
2315 _visitor.visit_attribute(it)
2316 }
2317 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002318 tokens_helper(_visitor, &_i.macro_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002319 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002320 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay6af48992018-08-01 11:16:28 -07002321 skip!(_i.args);
David Tolnay7ac699c2018-08-24 14:00:58 -04002322 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay6af48992018-08-01 11:16:28 -07002323 skip!(_i.body);
David Tolnay500d8322017-12-18 00:32:51 -08002324}
David Tolnay8c81f622018-07-31 23:34:35 -07002325#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002326pub fn visit_item_mod<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemMod) {
David Tolnay8c81f622018-07-31 23:34:35 -07002327 for it in &_i.attrs {
2328 _visitor.visit_attribute(it)
2329 }
2330 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002331 tokens_helper(_visitor, &_i.mod_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002332 _visitor.visit_ident(&_i.ident);
2333 if let Some(ref it) = _i.content {
David Tolnay7ac699c2018-08-24 14:00:58 -04002334 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002335 for it in &(it).1 {
2336 _visitor.visit_item(it)
2337 }
2338 };
2339 if let Some(ref it) = _i.semi {
David Tolnay7ac699c2018-08-24 14:00:58 -04002340 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002341 };
Nika Layzell27726662017-10-24 23:16:35 -04002342}
David Tolnay8c81f622018-07-31 23:34:35 -07002343#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002344pub fn visit_item_static<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemStatic) {
David Tolnay8c81f622018-07-31 23:34:35 -07002345 for it in &_i.attrs {
2346 _visitor.visit_attribute(it)
2347 }
2348 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002349 tokens_helper(_visitor, &_i.static_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002350 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04002351 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002352 };
2353 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002354 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002355 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002356 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002357 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04002358 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002359}
David Tolnay8c81f622018-07-31 23:34:35 -07002360#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002361pub fn visit_item_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemStruct) {
David Tolnay8c81f622018-07-31 23:34:35 -07002362 for it in &_i.attrs {
2363 _visitor.visit_attribute(it)
2364 }
2365 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002366 tokens_helper(_visitor, &_i.struct_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002367 _visitor.visit_ident(&_i.ident);
2368 _visitor.visit_generics(&_i.generics);
2369 _visitor.visit_fields(&_i.fields);
2370 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002371 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002372 };
Nika Layzell27726662017-10-24 23:16:35 -04002373}
David Tolnay8c81f622018-07-31 23:34:35 -07002374#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002375pub fn visit_item_trait<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemTrait) {
David Tolnay8c81f622018-07-31 23:34:35 -07002376 for it in &_i.attrs {
2377 _visitor.visit_attribute(it)
2378 }
2379 _visitor.visit_visibility(&_i.vis);
2380 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002381 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002382 };
2383 if let Some(ref it) = _i.auto_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002384 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002385 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002386 tokens_helper(_visitor, &_i.trait_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002387 _visitor.visit_ident(&_i.ident);
2388 _visitor.visit_generics(&_i.generics);
2389 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002390 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002391 };
2392 for el in Punctuated::pairs(&_i.supertraits) {
2393 let it = el.value();
2394 _visitor.visit_type_param_bound(it)
2395 }
David Tolnay7ac699c2018-08-24 14:00:58 -04002396 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002397 for it in &_i.items {
2398 _visitor.visit_trait_item(it)
2399 }
Nika Layzell27726662017-10-24 23:16:35 -04002400}
David Tolnay8c81f622018-07-31 23:34:35 -07002401#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002402pub fn visit_item_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemType) {
David Tolnay8c81f622018-07-31 23:34:35 -07002403 for it in &_i.attrs {
2404 _visitor.visit_attribute(it)
2405 }
2406 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002407 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002408 _visitor.visit_ident(&_i.ident);
2409 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04002410 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002411 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002412 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002413}
David Tolnay8c81f622018-07-31 23:34:35 -07002414#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002415pub fn visit_item_union<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemUnion) {
David Tolnay8c81f622018-07-31 23:34:35 -07002416 for it in &_i.attrs {
2417 _visitor.visit_attribute(it)
2418 }
2419 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002420 tokens_helper(_visitor, &_i.union_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002421 _visitor.visit_ident(&_i.ident);
2422 _visitor.visit_generics(&_i.generics);
2423 _visitor.visit_fields_named(&_i.fields);
Nika Layzell27726662017-10-24 23:16:35 -04002424}
David Tolnay8c81f622018-07-31 23:34:35 -07002425#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002426pub fn visit_item_use<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemUse) {
David Tolnay8c81f622018-07-31 23:34:35 -07002427 for it in &_i.attrs {
2428 _visitor.visit_attribute(it)
2429 }
2430 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002431 tokens_helper(_visitor, &_i.use_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002432 if let Some(ref it) = _i.leading_colon {
David Tolnay7ac699c2018-08-24 14:00:58 -04002433 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002434 };
2435 _visitor.visit_use_tree(&_i.tree);
David Tolnay7ac699c2018-08-24 14:00:58 -04002436 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002437}
David Tolnay8c81f622018-07-31 23:34:35 -07002438#[cfg(feature = "full")]
2439pub fn visit_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
2440 _visitor: &mut V,
2441 _i: &'ast ItemVerbatim,
2442) {
David Tolnay6af48992018-08-01 11:16:28 -07002443 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05002444}
David Tolnay8c81f622018-07-31 23:34:35 -07002445#[cfg(any(feature = "full", feature = "derive"))]
2446#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002447pub fn visit_label<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Label) {
David Tolnay8c81f622018-07-31 23:34:35 -07002448 _visitor.visit_lifetime(&_i.name);
David Tolnay7ac699c2018-08-24 14:00:58 -04002449 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnaybcd498f2017-12-29 12:02:33 -05002450}
David Tolnay8c81f622018-07-31 23:34:35 -07002451#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002452pub fn visit_lifetime<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Lifetime) {
David Tolnay6af48992018-08-01 11:16:28 -07002453 skip!(_i.apostrophe);
David Tolnay8c81f622018-07-31 23:34:35 -07002454 _visitor.visit_ident(&_i.ident);
David Tolnay4ba63a02017-12-28 15:53:05 -05002455}
David Tolnay8c81f622018-07-31 23:34:35 -07002456#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002457pub fn visit_lifetime_def<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LifetimeDef) {
David Tolnay8c81f622018-07-31 23:34:35 -07002458 for it in &_i.attrs {
2459 _visitor.visit_attribute(it)
2460 }
2461 _visitor.visit_lifetime(&_i.lifetime);
2462 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002463 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002464 };
2465 for el in Punctuated::pairs(&_i.bounds) {
2466 let it = el.value();
2467 _visitor.visit_lifetime(it)
2468 }
David Tolnay4ba63a02017-12-28 15:53:05 -05002469}
David Tolnay8c81f622018-07-31 23:34:35 -07002470#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002471pub fn visit_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Lit) {
David Tolnay360efd22018-01-04 23:35:26 -08002472 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002473 Lit::Str(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002474 _visitor.visit_lit_str(_binding_0);
2475 }
David Tolnay8c81f622018-07-31 23:34:35 -07002476 Lit::ByteStr(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002477 _visitor.visit_lit_byte_str(_binding_0);
2478 }
David Tolnay8c81f622018-07-31 23:34:35 -07002479 Lit::Byte(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002480 _visitor.visit_lit_byte(_binding_0);
2481 }
David Tolnay8c81f622018-07-31 23:34:35 -07002482 Lit::Char(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002483 _visitor.visit_lit_char(_binding_0);
2484 }
David Tolnay8c81f622018-07-31 23:34:35 -07002485 Lit::Int(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002486 _visitor.visit_lit_int(_binding_0);
2487 }
David Tolnay8c81f622018-07-31 23:34:35 -07002488 Lit::Float(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002489 _visitor.visit_lit_float(_binding_0);
2490 }
David Tolnay8c81f622018-07-31 23:34:35 -07002491 Lit::Bool(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002492 _visitor.visit_lit_bool(_binding_0);
2493 }
David Tolnay8c81f622018-07-31 23:34:35 -07002494 Lit::Verbatim(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002495 _visitor.visit_lit_verbatim(_binding_0);
2496 }
2497 }
2498}
David Tolnay8c81f622018-07-31 23:34:35 -07002499#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002500pub fn visit_lit_bool<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitBool) {
David Tolnay6af48992018-08-01 11:16:28 -07002501 skip!(_i.value);
David Tolnay8c81f622018-07-31 23:34:35 -07002502 _visitor.visit_span(&_i.span);
Nika Layzell27726662017-10-24 23:16:35 -04002503}
David Tolnay8c81f622018-07-31 23:34:35 -07002504#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002505pub fn visit_lit_byte<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitByte) {
David Tolnay6af48992018-08-01 11:16:28 -07002506 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002507}
David Tolnay8c81f622018-07-31 23:34:35 -07002508#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002509pub fn visit_lit_byte_str<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitByteStr) {
David Tolnay6af48992018-08-01 11:16:28 -07002510 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002511}
David Tolnay8c81f622018-07-31 23:34:35 -07002512#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002513pub fn visit_lit_char<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitChar) {
David Tolnay6af48992018-08-01 11:16:28 -07002514 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002515}
David Tolnay8c81f622018-07-31 23:34:35 -07002516#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002517pub fn visit_lit_float<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitFloat) {
David Tolnay6af48992018-08-01 11:16:28 -07002518 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002519}
David Tolnay8c81f622018-07-31 23:34:35 -07002520#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002521pub fn visit_lit_int<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitInt) {
David Tolnay6af48992018-08-01 11:16:28 -07002522 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002523}
David Tolnay8c81f622018-07-31 23:34:35 -07002524#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002525pub fn visit_lit_str<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitStr) {
David Tolnay6af48992018-08-01 11:16:28 -07002526 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002527}
David Tolnay8c81f622018-07-31 23:34:35 -07002528#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002529pub fn visit_lit_verbatim<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitVerbatim) {
David Tolnay6af48992018-08-01 11:16:28 -07002530 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002531}
David Tolnay8c81f622018-07-31 23:34:35 -07002532#[cfg(any(feature = "full", feature = "derive"))]
2533#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002534pub fn visit_local<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Local) {
David Tolnay8c81f622018-07-31 23:34:35 -07002535 for it in &_i.attrs {
2536 _visitor.visit_attribute(it)
2537 }
David Tolnay7ac699c2018-08-24 14:00:58 -04002538 tokens_helper(_visitor, &_i.let_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002539 for el in Punctuated::pairs(&_i.pats) {
2540 let it = el.value();
2541 _visitor.visit_pat(it)
2542 }
2543 if let Some(ref it) = _i.ty {
David Tolnay7ac699c2018-08-24 14:00:58 -04002544 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002545 _visitor.visit_type(&*(it).1);
2546 };
2547 if let Some(ref it) = _i.init {
David Tolnay7ac699c2018-08-24 14:00:58 -04002548 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002549 _visitor.visit_expr(&*(it).1);
2550 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002551 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002552}
David Tolnay8c81f622018-07-31 23:34:35 -07002553#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002554pub fn visit_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Macro) {
David Tolnay8c81f622018-07-31 23:34:35 -07002555 _visitor.visit_path(&_i.path);
David Tolnay7ac699c2018-08-24 14:00:58 -04002556 tokens_helper(_visitor, &_i.bang_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002557 _visitor.visit_macro_delimiter(&_i.delimiter);
David Tolnay6af48992018-08-01 11:16:28 -07002558 skip!(_i.tts);
David Tolnayab919512017-12-30 23:31:51 -05002559}
David Tolnay8c81f622018-07-31 23:34:35 -07002560#[cfg(any(feature = "full", feature = "derive"))]
2561pub fn visit_macro_delimiter<'ast, V: Visit<'ast> + ?Sized>(
2562 _visitor: &mut V,
2563 _i: &'ast MacroDelimiter,
2564) {
David Tolnayab919512017-12-30 23:31:51 -05002565 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002566 MacroDelimiter::Paren(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002567 tokens_helper(_visitor, &_binding_0.span);
David Tolnayab919512017-12-30 23:31:51 -05002568 }
David Tolnay8c81f622018-07-31 23:34:35 -07002569 MacroDelimiter::Brace(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002570 tokens_helper(_visitor, &_binding_0.span);
David Tolnayab919512017-12-30 23:31:51 -05002571 }
David Tolnay8c81f622018-07-31 23:34:35 -07002572 MacroDelimiter::Bracket(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002573 tokens_helper(_visitor, &_binding_0.span);
David Tolnayab919512017-12-30 23:31:51 -05002574 }
2575 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002576}
David Tolnay8c81f622018-07-31 23:34:35 -07002577#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002578pub fn visit_member<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Member) {
David Tolnay85b69a42017-12-27 20:43:10 -05002579 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002580 Member::Named(ref _binding_0) => {
Alex Crichtond261d092018-05-18 13:47:35 -07002581 _visitor.visit_ident(_binding_0);
David Tolnay85b69a42017-12-27 20:43:10 -05002582 }
David Tolnay8c81f622018-07-31 23:34:35 -07002583 Member::Unnamed(ref _binding_0) => {
David Tolnay85b69a42017-12-27 20:43:10 -05002584 _visitor.visit_index(_binding_0);
2585 }
2586 }
2587}
David Tolnay8c81f622018-07-31 23:34:35 -07002588#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayaaadd782018-01-06 22:58:13 -08002589pub fn visit_meta<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Meta) {
Nika Layzell27726662017-10-24 23:16:35 -04002590 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002591 Meta::Word(ref _binding_0) => {
Alex Crichtond261d092018-05-18 13:47:35 -07002592 _visitor.visit_ident(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002593 }
David Tolnay8c81f622018-07-31 23:34:35 -07002594 Meta::List(ref _binding_0) => {
David Tolnayaaadd782018-01-06 22:58:13 -08002595 _visitor.visit_meta_list(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002596 }
David Tolnay8c81f622018-07-31 23:34:35 -07002597 Meta::NameValue(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002598 _visitor.visit_meta_name_value(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002599 }
2600 }
2601}
David Tolnay8c81f622018-07-31 23:34:35 -07002602#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayaaadd782018-01-06 22:58:13 -08002603pub fn visit_meta_list<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast MetaList) {
David Tolnay8c81f622018-07-31 23:34:35 -07002604 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002605 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002606 for el in Punctuated::pairs(&_i.nested) {
2607 let it = el.value();
2608 _visitor.visit_nested_meta(it)
2609 }
Nika Layzell27726662017-10-24 23:16:35 -04002610}
David Tolnay8c81f622018-07-31 23:34:35 -07002611#[cfg(any(feature = "full", feature = "derive"))]
2612pub fn visit_meta_name_value<'ast, V: Visit<'ast> + ?Sized>(
2613 _visitor: &mut V,
2614 _i: &'ast MetaNameValue,
2615) {
2616 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002617 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002618 _visitor.visit_lit(&_i.lit);
Nika Layzell27726662017-10-24 23:16:35 -04002619}
David Tolnay8c81f622018-07-31 23:34:35 -07002620#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002621pub fn visit_method_sig<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast MethodSig) {
David Tolnay8c81f622018-07-31 23:34:35 -07002622 if let Some(ref it) = _i.constness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002623 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002624 };
2625 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002626 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002627 };
Yusuke Sasakif00a3ef2018-07-20 22:08:42 +09002628 if let Some(ref it) = _i.asyncness {
2629 tokens_helper(_visitor, &it.span)
2630 };
David Tolnay8c81f622018-07-31 23:34:35 -07002631 if let Some(ref it) = _i.abi {
2632 _visitor.visit_abi(it)
2633 };
2634 _visitor.visit_ident(&_i.ident);
2635 _visitor.visit_fn_decl(&_i.decl);
Nika Layzell27726662017-10-24 23:16:35 -04002636}
David Tolnay8c81f622018-07-31 23:34:35 -07002637#[cfg(any(feature = "full", feature = "derive"))]
2638#[cfg(feature = "full")]
2639pub fn visit_method_turbofish<'ast, V: Visit<'ast> + ?Sized>(
2640 _visitor: &mut V,
2641 _i: &'ast MethodTurbofish,
2642) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002643 tokens_helper(_visitor, &_i.colon2_token.spans);
2644 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002645 for el in Punctuated::pairs(&_i.args) {
2646 let it = el.value();
2647 _visitor.visit_generic_method_argument(it)
2648 }
David Tolnay7ac699c2018-08-24 14:00:58 -04002649 tokens_helper(_visitor, &_i.gt_token.spans);
David Tolnayd60cfec2017-12-29 00:21:38 -05002650}
David Tolnay8c81f622018-07-31 23:34:35 -07002651#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayaaadd782018-01-06 22:58:13 -08002652pub fn visit_nested_meta<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast NestedMeta) {
Nika Layzell27726662017-10-24 23:16:35 -04002653 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002654 NestedMeta::Meta(ref _binding_0) => {
David Tolnayaaadd782018-01-06 22:58:13 -08002655 _visitor.visit_meta(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002656 }
David Tolnay8c81f622018-07-31 23:34:35 -07002657 NestedMeta::Literal(ref _binding_0) => {
David Tolnay4ba63a02017-12-28 15:53:05 -05002658 _visitor.visit_lit(_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"))]
2663pub fn visit_parenthesized_generic_arguments<'ast, V: Visit<'ast> + ?Sized>(
2664 _visitor: &mut V,
2665 _i: &'ast ParenthesizedGenericArguments,
2666) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002667 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002668 for el in Punctuated::pairs(&_i.inputs) {
2669 let it = el.value();
2670 _visitor.visit_type(it)
2671 }
2672 _visitor.visit_return_type(&_i.output);
Nika Layzell27726662017-10-24 23:16:35 -04002673}
David Tolnay8c81f622018-07-31 23:34:35 -07002674#[cfg(any(feature = "full", feature = "derive"))]
2675#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002676pub fn visit_pat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Pat) {
Nika Layzell27726662017-10-24 23:16:35 -04002677 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002678 Pat::Wild(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002679 _visitor.visit_pat_wild(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002680 }
David Tolnay8c81f622018-07-31 23:34:35 -07002681 Pat::Ident(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002682 _visitor.visit_pat_ident(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002683 }
David Tolnay8c81f622018-07-31 23:34:35 -07002684 Pat::Struct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002685 _visitor.visit_pat_struct(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002686 }
David Tolnay8c81f622018-07-31 23:34:35 -07002687 Pat::TupleStruct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002688 _visitor.visit_pat_tuple_struct(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002689 }
David Tolnay8c81f622018-07-31 23:34:35 -07002690 Pat::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002691 _visitor.visit_pat_path(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002692 }
David Tolnay8c81f622018-07-31 23:34:35 -07002693 Pat::Tuple(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002694 _visitor.visit_pat_tuple(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002695 }
David Tolnay8c81f622018-07-31 23:34:35 -07002696 Pat::Box(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002697 _visitor.visit_pat_box(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002698 }
David Tolnay8c81f622018-07-31 23:34:35 -07002699 Pat::Ref(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002700 _visitor.visit_pat_ref(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002701 }
David Tolnay8c81f622018-07-31 23:34:35 -07002702 Pat::Lit(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002703 _visitor.visit_pat_lit(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002704 }
David Tolnay8c81f622018-07-31 23:34:35 -07002705 Pat::Range(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002706 _visitor.visit_pat_range(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002707 }
David Tolnay8c81f622018-07-31 23:34:35 -07002708 Pat::Slice(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002709 _visitor.visit_pat_slice(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002710 }
David Tolnay8c81f622018-07-31 23:34:35 -07002711 Pat::Macro(ref _binding_0) => {
David Tolnay323279a2017-12-29 11:26:32 -05002712 _visitor.visit_pat_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002713 }
David Tolnay8c81f622018-07-31 23:34:35 -07002714 Pat::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002715 _visitor.visit_pat_verbatim(_binding_0);
2716 }
Nika Layzell27726662017-10-24 23:16:35 -04002717 }
2718}
David Tolnay8c81f622018-07-31 23:34:35 -07002719#[cfg(any(feature = "full", feature = "derive"))]
2720#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002721pub fn visit_pat_box<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatBox) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002722 tokens_helper(_visitor, &_i.box_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002723 _visitor.visit_pat(&*_i.pat);
Nika Layzell27726662017-10-24 23:16:35 -04002724}
David Tolnay8c81f622018-07-31 23:34:35 -07002725#[cfg(any(feature = "full", feature = "derive"))]
2726#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002727pub fn visit_pat_ident<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatIdent) {
David Tolnay8c81f622018-07-31 23:34:35 -07002728 if let Some(ref it) = _i.by_ref {
David Tolnay7ac699c2018-08-24 14:00:58 -04002729 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002730 };
2731 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04002732 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002733 };
2734 _visitor.visit_ident(&_i.ident);
2735 if let Some(ref it) = _i.subpat {
David Tolnay7ac699c2018-08-24 14:00:58 -04002736 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002737 _visitor.visit_pat(&*(it).1);
2738 };
Nika Layzell27726662017-10-24 23:16:35 -04002739}
David Tolnay8c81f622018-07-31 23:34:35 -07002740#[cfg(any(feature = "full", feature = "derive"))]
2741#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002742pub fn visit_pat_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatLit) {
David Tolnay8c81f622018-07-31 23:34:35 -07002743 _visitor.visit_expr(&*_i.expr);
Nika Layzell27726662017-10-24 23:16:35 -04002744}
David Tolnay8c81f622018-07-31 23:34:35 -07002745#[cfg(any(feature = "full", feature = "derive"))]
2746#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002747pub fn visit_pat_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatMacro) {
David Tolnay8c81f622018-07-31 23:34:35 -07002748 _visitor.visit_macro(&_i.mac);
David Tolnay323279a2017-12-29 11:26:32 -05002749}
David Tolnay8c81f622018-07-31 23:34:35 -07002750#[cfg(any(feature = "full", feature = "derive"))]
2751#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002752pub fn visit_pat_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatPath) {
David Tolnay8c81f622018-07-31 23:34:35 -07002753 if let Some(ref it) = _i.qself {
2754 _visitor.visit_qself(it)
2755 };
2756 _visitor.visit_path(&_i.path);
Nika Layzell27726662017-10-24 23:16:35 -04002757}
David Tolnay8c81f622018-07-31 23:34:35 -07002758#[cfg(any(feature = "full", feature = "derive"))]
2759#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002760pub fn visit_pat_range<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatRange) {
David Tolnay8c81f622018-07-31 23:34:35 -07002761 _visitor.visit_expr(&*_i.lo);
2762 _visitor.visit_range_limits(&_i.limits);
2763 _visitor.visit_expr(&*_i.hi);
Nika Layzell27726662017-10-24 23:16:35 -04002764}
David Tolnay8c81f622018-07-31 23:34:35 -07002765#[cfg(any(feature = "full", feature = "derive"))]
2766#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002767pub fn visit_pat_ref<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatRef) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002768 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002769 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04002770 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002771 };
2772 _visitor.visit_pat(&*_i.pat);
Nika Layzell27726662017-10-24 23:16:35 -04002773}
David Tolnay8c81f622018-07-31 23:34:35 -07002774#[cfg(any(feature = "full", feature = "derive"))]
2775#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002776pub fn visit_pat_slice<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatSlice) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002777 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002778 for el in Punctuated::pairs(&_i.front) {
2779 let it = el.value();
2780 _visitor.visit_pat(it)
2781 }
2782 if let Some(ref it) = _i.middle {
2783 _visitor.visit_pat(&**it)
2784 };
2785 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002786 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002787 };
2788 if let Some(ref it) = _i.comma_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002789 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002790 };
2791 for el in Punctuated::pairs(&_i.back) {
2792 let it = el.value();
2793 _visitor.visit_pat(it)
2794 }
Nika Layzell27726662017-10-24 23:16:35 -04002795}
David Tolnay8c81f622018-07-31 23:34:35 -07002796#[cfg(any(feature = "full", feature = "derive"))]
2797#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002798pub fn visit_pat_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatStruct) {
David Tolnay8c81f622018-07-31 23:34:35 -07002799 _visitor.visit_path(&_i.path);
David Tolnay7ac699c2018-08-24 14:00:58 -04002800 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002801 for el in Punctuated::pairs(&_i.fields) {
2802 let it = el.value();
2803 _visitor.visit_field_pat(it)
2804 }
2805 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002806 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002807 };
Nika Layzell27726662017-10-24 23:16:35 -04002808}
David Tolnay8c81f622018-07-31 23:34:35 -07002809#[cfg(any(feature = "full", feature = "derive"))]
2810#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002811pub fn visit_pat_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatTuple) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002812 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002813 for el in Punctuated::pairs(&_i.front) {
2814 let it = el.value();
2815 _visitor.visit_pat(it)
2816 }
2817 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002818 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002819 };
2820 if let Some(ref it) = _i.comma_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002821 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002822 };
2823 for el in Punctuated::pairs(&_i.back) {
2824 let it = el.value();
2825 _visitor.visit_pat(it)
2826 }
Nika Layzell27726662017-10-24 23:16:35 -04002827}
David Tolnay8c81f622018-07-31 23:34:35 -07002828#[cfg(any(feature = "full", feature = "derive"))]
2829#[cfg(feature = "full")]
2830pub fn visit_pat_tuple_struct<'ast, V: Visit<'ast> + ?Sized>(
2831 _visitor: &mut V,
2832 _i: &'ast PatTupleStruct,
2833) {
2834 _visitor.visit_path(&_i.path);
2835 _visitor.visit_pat_tuple(&_i.pat);
Nika Layzell27726662017-10-24 23:16:35 -04002836}
David Tolnay8c81f622018-07-31 23:34:35 -07002837#[cfg(any(feature = "full", feature = "derive"))]
2838#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002839pub fn visit_pat_verbatim<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatVerbatim) {
David Tolnay6af48992018-08-01 11:16:28 -07002840 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05002841}
David Tolnay8c81f622018-07-31 23:34:35 -07002842#[cfg(any(feature = "full", feature = "derive"))]
2843#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002844pub fn visit_pat_wild<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatWild) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002845 tokens_helper(_visitor, &_i.underscore_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002846}
David Tolnay8c81f622018-07-31 23:34:35 -07002847#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002848pub fn visit_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Path) {
David Tolnay8c81f622018-07-31 23:34:35 -07002849 if let Some(ref it) = _i.leading_colon {
David Tolnay7ac699c2018-08-24 14:00:58 -04002850 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002851 };
2852 for el in Punctuated::pairs(&_i.segments) {
2853 let it = el.value();
2854 _visitor.visit_path_segment(it)
2855 }
Nika Layzell27726662017-10-24 23:16:35 -04002856}
David Tolnay8c81f622018-07-31 23:34:35 -07002857#[cfg(any(feature = "full", feature = "derive"))]
2858pub fn visit_path_arguments<'ast, V: Visit<'ast> + ?Sized>(
2859 _visitor: &mut V,
2860 _i: &'ast PathArguments,
2861) {
Nika Layzellc08227a2017-12-04 16:30:17 -05002862 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002863 PathArguments::None => {}
2864 PathArguments::AngleBracketed(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002865 _visitor.visit_angle_bracketed_generic_arguments(_binding_0);
Nika Layzellc08227a2017-12-04 16:30:17 -05002866 }
David Tolnay8c81f622018-07-31 23:34:35 -07002867 PathArguments::Parenthesized(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002868 _visitor.visit_parenthesized_generic_arguments(_binding_0);
Nika Layzellc08227a2017-12-04 16:30:17 -05002869 }
2870 }
2871}
David Tolnay8c81f622018-07-31 23:34:35 -07002872#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002873pub fn visit_path_segment<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PathSegment) {
David Tolnay8c81f622018-07-31 23:34:35 -07002874 _visitor.visit_ident(&_i.ident);
2875 _visitor.visit_path_arguments(&_i.arguments);
Nika Layzell27726662017-10-24 23:16:35 -04002876}
David Tolnay8c81f622018-07-31 23:34:35 -07002877#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002878pub fn visit_predicate_eq<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PredicateEq) {
David Tolnay8c81f622018-07-31 23:34:35 -07002879 _visitor.visit_type(&_i.lhs_ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002880 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002881 _visitor.visit_type(&_i.rhs_ty);
David Tolnayd4add852018-01-01 20:13:24 -08002882}
David Tolnay8c81f622018-07-31 23:34:35 -07002883#[cfg(any(feature = "full", feature = "derive"))]
2884pub fn visit_predicate_lifetime<'ast, V: Visit<'ast> + ?Sized>(
2885 _visitor: &mut V,
2886 _i: &'ast PredicateLifetime,
2887) {
2888 _visitor.visit_lifetime(&_i.lifetime);
2889 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002890 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002891 };
2892 for el in Punctuated::pairs(&_i.bounds) {
2893 let it = el.value();
2894 _visitor.visit_lifetime(it)
2895 }
David Tolnayd4add852018-01-01 20:13:24 -08002896}
David Tolnay8c81f622018-07-31 23:34:35 -07002897#[cfg(any(feature = "full", feature = "derive"))]
2898pub fn visit_predicate_type<'ast, V: Visit<'ast> + ?Sized>(
2899 _visitor: &mut V,
2900 _i: &'ast PredicateType,
2901) {
2902 if let Some(ref it) = _i.lifetimes {
2903 _visitor.visit_bound_lifetimes(it)
2904 };
2905 _visitor.visit_type(&_i.bounded_ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002906 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002907 for el in Punctuated::pairs(&_i.bounds) {
2908 let it = el.value();
2909 _visitor.visit_type_param_bound(it)
2910 }
David Tolnayd4add852018-01-01 20:13:24 -08002911}
David Tolnay8c81f622018-07-31 23:34:35 -07002912#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002913pub fn visit_qself<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast QSelf) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002914 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002915 _visitor.visit_type(&*_i.ty);
David Tolnay6af48992018-08-01 11:16:28 -07002916 skip!(_i.position);
David Tolnay8c81f622018-07-31 23:34:35 -07002917 if let Some(ref it) = _i.as_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002918 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002919 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002920 tokens_helper(_visitor, &_i.gt_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002921}
David Tolnay8c81f622018-07-31 23:34:35 -07002922#[cfg(any(feature = "full", feature = "derive"))]
2923#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002924pub fn visit_range_limits<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast RangeLimits) {
Nika Layzell27726662017-10-24 23:16:35 -04002925 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002926 RangeLimits::HalfOpen(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002927 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002928 }
David Tolnay8c81f622018-07-31 23:34:35 -07002929 RangeLimits::Closed(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002930 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002931 }
2932 }
2933}
David Tolnay8c81f622018-07-31 23:34:35 -07002934#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002935pub fn visit_return_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ReturnType) {
David Tolnayf93b90d2017-11-11 19:21:26 -08002936 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002937 ReturnType::Default => {}
2938 ReturnType::Type(ref _binding_0, ref _binding_1) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002939 tokens_helper(_visitor, &_binding_0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002940 _visitor.visit_type(&**_binding_1);
David Tolnayf93b90d2017-11-11 19:21:26 -08002941 }
2942 }
2943}
David Tolnay8c81f622018-07-31 23:34:35 -07002944pub fn visit_span<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Span) {}
2945#[cfg(any(feature = "full", feature = "derive"))]
2946#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002947pub fn visit_stmt<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Stmt) {
Nika Layzell27726662017-10-24 23:16:35 -04002948 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002949 Stmt::Local(ref _binding_0) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08002950 _visitor.visit_local(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002951 }
David Tolnay8c81f622018-07-31 23:34:35 -07002952 Stmt::Item(ref _binding_0) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08002953 _visitor.visit_item(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002954 }
David Tolnay8c81f622018-07-31 23:34:35 -07002955 Stmt::Expr(ref _binding_0) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08002956 _visitor.visit_expr(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002957 }
David Tolnay8c81f622018-07-31 23:34:35 -07002958 Stmt::Semi(ref _binding_0, ref _binding_1) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08002959 _visitor.visit_expr(_binding_0);
David Tolnay7ac699c2018-08-24 14:00:58 -04002960 tokens_helper(_visitor, &_binding_1.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002961 }
Nika Layzell27726662017-10-24 23:16:35 -04002962 }
2963}
David Tolnay8c81f622018-07-31 23:34:35 -07002964#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002965pub fn visit_trait_bound<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TraitBound) {
David Tolnay8c81f622018-07-31 23:34:35 -07002966 if let Some(ref it) = _i.paren_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002967 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002968 };
2969 _visitor.visit_trait_bound_modifier(&_i.modifier);
2970 if let Some(ref it) = _i.lifetimes {
2971 _visitor.visit_bound_lifetimes(it)
2972 };
2973 _visitor.visit_path(&_i.path);
David Tolnay40fb8ce2018-01-02 10:53:46 -08002974}
David Tolnay8c81f622018-07-31 23:34:35 -07002975#[cfg(any(feature = "full", feature = "derive"))]
2976pub fn visit_trait_bound_modifier<'ast, V: Visit<'ast> + ?Sized>(
2977 _visitor: &mut V,
2978 _i: &'ast TraitBoundModifier,
2979) {
Nika Layzell27726662017-10-24 23:16:35 -04002980 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002981 TraitBoundModifier::None => {}
2982 TraitBoundModifier::Maybe(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002983 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002984 }
2985 }
2986}
David Tolnay8c81f622018-07-31 23:34:35 -07002987#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002988pub fn visit_trait_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TraitItem) {
Nika Layzell27726662017-10-24 23:16:35 -04002989 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002990 TraitItem::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002991 _visitor.visit_trait_item_const(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002992 }
David Tolnay8c81f622018-07-31 23:34:35 -07002993 TraitItem::Method(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002994 _visitor.visit_trait_item_method(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002995 }
David Tolnay8c81f622018-07-31 23:34:35 -07002996 TraitItem::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002997 _visitor.visit_trait_item_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002998 }
David Tolnay8c81f622018-07-31 23:34:35 -07002999 TraitItem::Macro(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003000 _visitor.visit_trait_item_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003001 }
David Tolnay8c81f622018-07-31 23:34:35 -07003002 TraitItem::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05003003 _visitor.visit_trait_item_verbatim(_binding_0);
3004 }
Nika Layzell27726662017-10-24 23:16:35 -04003005 }
3006}
David Tolnay8c81f622018-07-31 23:34:35 -07003007#[cfg(feature = "full")]
3008pub fn visit_trait_item_const<'ast, V: Visit<'ast> + ?Sized>(
3009 _visitor: &mut V,
3010 _i: &'ast TraitItemConst,
3011) {
3012 for it in &_i.attrs {
3013 _visitor.visit_attribute(it)
3014 }
David Tolnay7ac699c2018-08-24 14:00:58 -04003015 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003016 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04003017 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003018 _visitor.visit_type(&_i.ty);
3019 if let Some(ref it) = _i.default {
David Tolnay7ac699c2018-08-24 14:00:58 -04003020 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003021 _visitor.visit_expr(&(it).1);
3022 };
David Tolnay7ac699c2018-08-24 14:00:58 -04003023 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnayda705bd2017-11-10 21:58:05 -08003024}
David Tolnay8c81f622018-07-31 23:34:35 -07003025#[cfg(feature = "full")]
3026pub fn visit_trait_item_macro<'ast, V: Visit<'ast> + ?Sized>(
3027 _visitor: &mut V,
3028 _i: &'ast TraitItemMacro,
3029) {
3030 for it in &_i.attrs {
3031 _visitor.visit_attribute(it)
3032 }
3033 _visitor.visit_macro(&_i.mac);
3034 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003035 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003036 };
David Tolnayda705bd2017-11-10 21:58:05 -08003037}
David Tolnay8c81f622018-07-31 23:34:35 -07003038#[cfg(feature = "full")]
3039pub fn visit_trait_item_method<'ast, V: Visit<'ast> + ?Sized>(
3040 _visitor: &mut V,
3041 _i: &'ast TraitItemMethod,
3042) {
3043 for it in &_i.attrs {
3044 _visitor.visit_attribute(it)
3045 }
3046 _visitor.visit_method_sig(&_i.sig);
3047 if let Some(ref it) = _i.default {
3048 _visitor.visit_block(it)
3049 };
3050 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003051 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003052 };
Nika Layzell27726662017-10-24 23:16:35 -04003053}
David Tolnay8c81f622018-07-31 23:34:35 -07003054#[cfg(feature = "full")]
3055pub fn visit_trait_item_type<'ast, V: Visit<'ast> + ?Sized>(
3056 _visitor: &mut V,
3057 _i: &'ast TraitItemType,
3058) {
3059 for it in &_i.attrs {
3060 _visitor.visit_attribute(it)
3061 }
David Tolnay7ac699c2018-08-24 14:00:58 -04003062 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003063 _visitor.visit_ident(&_i.ident);
3064 _visitor.visit_generics(&_i.generics);
3065 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003066 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003067 };
3068 for el in Punctuated::pairs(&_i.bounds) {
3069 let it = el.value();
3070 _visitor.visit_type_param_bound(it)
3071 }
3072 if let Some(ref it) = _i.default {
David Tolnay7ac699c2018-08-24 14:00:58 -04003073 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003074 _visitor.visit_type(&(it).1);
3075 };
David Tolnay7ac699c2018-08-24 14:00:58 -04003076 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003077}
David Tolnay8c81f622018-07-31 23:34:35 -07003078#[cfg(feature = "full")]
3079pub fn visit_trait_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
3080 _visitor: &mut V,
3081 _i: &'ast TraitItemVerbatim,
3082) {
David Tolnay6af48992018-08-01 11:16:28 -07003083 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05003084}
David Tolnay8c81f622018-07-31 23:34:35 -07003085#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003086pub fn visit_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Type) {
Nika Layzell27726662017-10-24 23:16:35 -04003087 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003088 Type::Slice(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003089 _visitor.visit_type_slice(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003090 }
David Tolnay8c81f622018-07-31 23:34:35 -07003091 Type::Array(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003092 _visitor.visit_type_array(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003093 }
David Tolnay8c81f622018-07-31 23:34:35 -07003094 Type::Ptr(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003095 _visitor.visit_type_ptr(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003096 }
David Tolnay8c81f622018-07-31 23:34:35 -07003097 Type::Reference(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003098 _visitor.visit_type_reference(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003099 }
David Tolnay8c81f622018-07-31 23:34:35 -07003100 Type::BareFn(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003101 _visitor.visit_type_bare_fn(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003102 }
David Tolnay8c81f622018-07-31 23:34:35 -07003103 Type::Never(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003104 _visitor.visit_type_never(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003105 }
David Tolnay8c81f622018-07-31 23:34:35 -07003106 Type::Tuple(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003107 _visitor.visit_type_tuple(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003108 }
David Tolnay8c81f622018-07-31 23:34:35 -07003109 Type::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003110 _visitor.visit_type_path(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003111 }
David Tolnay8c81f622018-07-31 23:34:35 -07003112 Type::TraitObject(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003113 _visitor.visit_type_trait_object(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003114 }
David Tolnay8c81f622018-07-31 23:34:35 -07003115 Type::ImplTrait(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003116 _visitor.visit_type_impl_trait(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003117 }
David Tolnay8c81f622018-07-31 23:34:35 -07003118 Type::Paren(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003119 _visitor.visit_type_paren(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003120 }
David Tolnay8c81f622018-07-31 23:34:35 -07003121 Type::Group(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003122 _visitor.visit_type_group(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003123 }
David Tolnay8c81f622018-07-31 23:34:35 -07003124 Type::Infer(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003125 _visitor.visit_type_infer(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003126 }
David Tolnay8c81f622018-07-31 23:34:35 -07003127 Type::Macro(ref _binding_0) => {
David Tolnay323279a2017-12-29 11:26:32 -05003128 _visitor.visit_type_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003129 }
David Tolnay8c81f622018-07-31 23:34:35 -07003130 Type::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05003131 _visitor.visit_type_verbatim(_binding_0);
3132 }
Nika Layzell27726662017-10-24 23:16:35 -04003133 }
3134}
David Tolnay8c81f622018-07-31 23:34:35 -07003135#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003136pub fn visit_type_array<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeArray) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003137 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003138 _visitor.visit_type(&*_i.elem);
David Tolnay7ac699c2018-08-24 14:00:58 -04003139 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003140 _visitor.visit_expr(&_i.len);
Nika Layzell27726662017-10-24 23:16:35 -04003141}
David Tolnay8c81f622018-07-31 23:34:35 -07003142#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003143pub fn visit_type_bare_fn<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeBareFn) {
David Tolnay8c81f622018-07-31 23:34:35 -07003144 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04003145 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003146 };
3147 if let Some(ref it) = _i.abi {
3148 _visitor.visit_abi(it)
3149 };
David Tolnay7ac699c2018-08-24 14:00:58 -04003150 tokens_helper(_visitor, &_i.fn_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003151 if let Some(ref it) = _i.lifetimes {
3152 _visitor.visit_bound_lifetimes(it)
3153 };
David Tolnay7ac699c2018-08-24 14:00:58 -04003154 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003155 for el in Punctuated::pairs(&_i.inputs) {
3156 let it = el.value();
3157 _visitor.visit_bare_fn_arg(it)
3158 }
3159 if let Some(ref it) = _i.variadic {
David Tolnay7ac699c2018-08-24 14:00:58 -04003160 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003161 };
3162 _visitor.visit_return_type(&_i.output);
Nika Layzell27726662017-10-24 23:16:35 -04003163}
David Tolnay8c81f622018-07-31 23:34:35 -07003164#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003165pub fn visit_type_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeGroup) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003166 tokens_helper(_visitor, &_i.group_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003167 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003168}
David Tolnay8c81f622018-07-31 23:34:35 -07003169#[cfg(any(feature = "full", feature = "derive"))]
3170pub fn visit_type_impl_trait<'ast, V: Visit<'ast> + ?Sized>(
3171 _visitor: &mut V,
3172 _i: &'ast TypeImplTrait,
3173) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003174 tokens_helper(_visitor, &_i.impl_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003175 for el in Punctuated::pairs(&_i.bounds) {
3176 let it = el.value();
3177 _visitor.visit_type_param_bound(it)
3178 }
Nika Layzell27726662017-10-24 23:16:35 -04003179}
David Tolnay8c81f622018-07-31 23:34:35 -07003180#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003181pub fn visit_type_infer<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeInfer) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003182 tokens_helper(_visitor, &_i.underscore_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003183}
David Tolnay8c81f622018-07-31 23:34:35 -07003184#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003185pub fn visit_type_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeMacro) {
David Tolnay8c81f622018-07-31 23:34:35 -07003186 _visitor.visit_macro(&_i.mac);
David Tolnay323279a2017-12-29 11:26:32 -05003187}
David Tolnay8c81f622018-07-31 23:34:35 -07003188#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003189pub fn visit_type_never<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeNever) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003190 tokens_helper(_visitor, &_i.bang_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003191}
David Tolnay8c81f622018-07-31 23:34:35 -07003192#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003193pub fn visit_type_param<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeParam) {
David Tolnay8c81f622018-07-31 23:34:35 -07003194 for it in &_i.attrs {
3195 _visitor.visit_attribute(it)
3196 }
3197 _visitor.visit_ident(&_i.ident);
3198 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003199 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003200 };
3201 for el in Punctuated::pairs(&_i.bounds) {
3202 let it = el.value();
3203 _visitor.visit_type_param_bound(it)
3204 }
3205 if let Some(ref it) = _i.eq_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003206 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003207 };
3208 if let Some(ref it) = _i.default {
3209 _visitor.visit_type(it)
3210 };
Nika Layzell27726662017-10-24 23:16:35 -04003211}
David Tolnay8c81f622018-07-31 23:34:35 -07003212#[cfg(any(feature = "full", feature = "derive"))]
3213pub fn visit_type_param_bound<'ast, V: Visit<'ast> + ?Sized>(
3214 _visitor: &mut V,
3215 _i: &'ast TypeParamBound,
3216) {
Nika Layzell27726662017-10-24 23:16:35 -04003217 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003218 TypeParamBound::Trait(ref _binding_0) => {
David Tolnay40fb8ce2018-01-02 10:53:46 -08003219 _visitor.visit_trait_bound(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003220 }
David Tolnay8c81f622018-07-31 23:34:35 -07003221 TypeParamBound::Lifetime(ref _binding_0) => {
David Tolnay4ba63a02017-12-28 15:53:05 -05003222 _visitor.visit_lifetime(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003223 }
3224 }
3225}
David Tolnay8c81f622018-07-31 23:34:35 -07003226#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003227pub fn visit_type_paren<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeParen) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003228 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003229 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003230}
David Tolnay8c81f622018-07-31 23:34:35 -07003231#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003232pub fn visit_type_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypePath) {
David Tolnay8c81f622018-07-31 23:34:35 -07003233 if let Some(ref it) = _i.qself {
3234 _visitor.visit_qself(it)
3235 };
3236 _visitor.visit_path(&_i.path);
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_ptr<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypePtr) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003240 tokens_helper(_visitor, &_i.star_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003241 if let Some(ref it) = _i.const_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003242 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003243 };
3244 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04003245 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003246 };
3247 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003248}
David Tolnay8c81f622018-07-31 23:34:35 -07003249#[cfg(any(feature = "full", feature = "derive"))]
3250pub fn visit_type_reference<'ast, V: Visit<'ast> + ?Sized>(
3251 _visitor: &mut V,
3252 _i: &'ast TypeReference,
3253) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003254 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003255 if let Some(ref it) = _i.lifetime {
3256 _visitor.visit_lifetime(it)
3257 };
3258 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04003259 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003260 };
3261 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003262}
David Tolnay8c81f622018-07-31 23:34:35 -07003263#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003264pub fn visit_type_slice<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeSlice) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003265 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003266 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003267}
David Tolnay8c81f622018-07-31 23:34:35 -07003268#[cfg(any(feature = "full", feature = "derive"))]
3269pub fn visit_type_trait_object<'ast, V: Visit<'ast> + ?Sized>(
3270 _visitor: &mut V,
3271 _i: &'ast TypeTraitObject,
3272) {
3273 if let Some(ref it) = _i.dyn_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003274 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003275 };
3276 for el in Punctuated::pairs(&_i.bounds) {
3277 let it = el.value();
3278 _visitor.visit_type_param_bound(it)
3279 }
Nika Layzell27726662017-10-24 23:16:35 -04003280}
David Tolnay8c81f622018-07-31 23:34:35 -07003281#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003282pub fn visit_type_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeTuple) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003283 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003284 for el in Punctuated::pairs(&_i.elems) {
3285 let it = el.value();
3286 _visitor.visit_type(it)
3287 }
Nika Layzell27726662017-10-24 23:16:35 -04003288}
David Tolnay8c81f622018-07-31 23:34:35 -07003289#[cfg(any(feature = "full", feature = "derive"))]
3290pub fn visit_type_verbatim<'ast, V: Visit<'ast> + ?Sized>(
3291 _visitor: &mut V,
3292 _i: &'ast TypeVerbatim,
3293) {
David Tolnay6af48992018-08-01 11:16:28 -07003294 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05003295}
David Tolnay8c81f622018-07-31 23:34:35 -07003296#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003297pub fn visit_un_op<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UnOp) {
Nika Layzell27726662017-10-24 23:16:35 -04003298 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003299 UnOp::Deref(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003300 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003301 }
David Tolnay8c81f622018-07-31 23:34:35 -07003302 UnOp::Not(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003303 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003304 }
David Tolnay8c81f622018-07-31 23:34:35 -07003305 UnOp::Neg(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003306 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003307 }
3308 }
3309}
David Tolnay8c81f622018-07-31 23:34:35 -07003310#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003311pub fn visit_use_glob<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseGlob) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003312 tokens_helper(_visitor, &_i.star_token.spans);
David Tolnay5f332a92017-12-26 00:42:45 -05003313}
David Tolnay8c81f622018-07-31 23:34:35 -07003314#[cfg(feature = "full")]
David Tolnayd97a7d22018-03-31 19:17:01 +02003315pub fn visit_use_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseGroup) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003316 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003317 for el in Punctuated::pairs(&_i.items) {
3318 let it = el.value();
3319 _visitor.visit_use_tree(it)
3320 }
David Tolnay5f332a92017-12-26 00:42:45 -05003321}
David Tolnay8c81f622018-07-31 23:34:35 -07003322#[cfg(feature = "full")]
David Tolnayd97a7d22018-03-31 19:17:01 +02003323pub fn visit_use_name<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseName) {
David Tolnay8c81f622018-07-31 23:34:35 -07003324 _visitor.visit_ident(&_i.ident);
David Tolnayd97a7d22018-03-31 19:17:01 +02003325}
David Tolnay8c81f622018-07-31 23:34:35 -07003326#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003327pub fn visit_use_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UsePath) {
David Tolnay8c81f622018-07-31 23:34:35 -07003328 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04003329 tokens_helper(_visitor, &_i.colon2_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003330 _visitor.visit_use_tree(&*_i.tree);
David Tolnayd97a7d22018-03-31 19:17:01 +02003331}
David Tolnay8c81f622018-07-31 23:34:35 -07003332#[cfg(feature = "full")]
David Tolnayd97a7d22018-03-31 19:17:01 +02003333pub fn visit_use_rename<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseRename) {
David Tolnay8c81f622018-07-31 23:34:35 -07003334 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04003335 tokens_helper(_visitor, &_i.as_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003336 _visitor.visit_ident(&_i.rename);
David Tolnay5f332a92017-12-26 00:42:45 -05003337}
David Tolnay8c81f622018-07-31 23:34:35 -07003338#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003339pub fn visit_use_tree<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseTree) {
David Tolnay5f332a92017-12-26 00:42:45 -05003340 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003341 UseTree::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003342 _visitor.visit_use_path(_binding_0);
David Tolnay5f332a92017-12-26 00:42:45 -05003343 }
David Tolnay8c81f622018-07-31 23:34:35 -07003344 UseTree::Name(ref _binding_0) => {
David Tolnayd97a7d22018-03-31 19:17:01 +02003345 _visitor.visit_use_name(_binding_0);
3346 }
David Tolnay8c81f622018-07-31 23:34:35 -07003347 UseTree::Rename(ref _binding_0) => {
David Tolnayd97a7d22018-03-31 19:17:01 +02003348 _visitor.visit_use_rename(_binding_0);
3349 }
David Tolnay8c81f622018-07-31 23:34:35 -07003350 UseTree::Glob(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003351 _visitor.visit_use_glob(_binding_0);
David Tolnay5f332a92017-12-26 00:42:45 -05003352 }
David Tolnay8c81f622018-07-31 23:34:35 -07003353 UseTree::Group(ref _binding_0) => {
David Tolnayd97a7d22018-03-31 19:17:01 +02003354 _visitor.visit_use_group(_binding_0);
David Tolnay5f332a92017-12-26 00:42:45 -05003355 }
3356 }
3357}
David Tolnay8c81f622018-07-31 23:34:35 -07003358#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003359pub fn visit_variant<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Variant) {
David Tolnay8c81f622018-07-31 23:34:35 -07003360 for it in &_i.attrs {
3361 _visitor.visit_attribute(it)
3362 }
3363 _visitor.visit_ident(&_i.ident);
3364 _visitor.visit_fields(&_i.fields);
3365 if let Some(ref it) = _i.discriminant {
David Tolnay7ac699c2018-08-24 14:00:58 -04003366 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003367 _visitor.visit_expr(&(it).1);
3368 };
Nika Layzell27726662017-10-24 23:16:35 -04003369}
David Tolnay8c81f622018-07-31 23:34:35 -07003370#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003371pub fn visit_vis_crate<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast VisCrate) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003372 tokens_helper(_visitor, &_i.crate_token.span);
Nika Layzell27726662017-10-24 23:16:35 -04003373}
David Tolnay8c81f622018-07-31 23:34:35 -07003374#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003375pub fn visit_vis_public<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast VisPublic) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003376 tokens_helper(_visitor, &_i.pub_token.span);
Nika Layzell27726662017-10-24 23:16:35 -04003377}
David Tolnay8c81f622018-07-31 23:34:35 -07003378#[cfg(any(feature = "full", feature = "derive"))]
3379pub fn visit_vis_restricted<'ast, V: Visit<'ast> + ?Sized>(
3380 _visitor: &mut V,
3381 _i: &'ast VisRestricted,
3382) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003383 tokens_helper(_visitor, &_i.pub_token.span);
3384 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003385 if let Some(ref it) = _i.in_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003386 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003387 };
3388 _visitor.visit_path(&*_i.path);
Nika Layzell27726662017-10-24 23:16:35 -04003389}
David Tolnay8c81f622018-07-31 23:34:35 -07003390#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003391pub fn visit_visibility<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Visibility) {
Nika Layzell27726662017-10-24 23:16:35 -04003392 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003393 Visibility::Public(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003394 _visitor.visit_vis_public(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003395 }
David Tolnay8c81f622018-07-31 23:34:35 -07003396 Visibility::Crate(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003397 _visitor.visit_vis_crate(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003398 }
David Tolnay8c81f622018-07-31 23:34:35 -07003399 Visibility::Restricted(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003400 _visitor.visit_vis_restricted(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003401 }
David Tolnay8c81f622018-07-31 23:34:35 -07003402 Visibility::Inherited => {}
Nika Layzell27726662017-10-24 23:16:35 -04003403 }
3404}
David Tolnay8c81f622018-07-31 23:34:35 -07003405#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003406pub fn visit_where_clause<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast WhereClause) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003407 tokens_helper(_visitor, &_i.where_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003408 for el in Punctuated::pairs(&_i.predicates) {
3409 let it = el.value();
3410 _visitor.visit_where_predicate(it)
3411 }
Nika Layzell27726662017-10-24 23:16:35 -04003412}
David Tolnay8c81f622018-07-31 23:34:35 -07003413#[cfg(any(feature = "full", feature = "derive"))]
3414pub fn visit_where_predicate<'ast, V: Visit<'ast> + ?Sized>(
3415 _visitor: &mut V,
3416 _i: &'ast WherePredicate,
3417) {
Nika Layzell27726662017-10-24 23:16:35 -04003418 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003419 WherePredicate::Type(ref _binding_0) => {
David Tolnayd4add852018-01-01 20:13:24 -08003420 _visitor.visit_predicate_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003421 }
David Tolnay8c81f622018-07-31 23:34:35 -07003422 WherePredicate::Lifetime(ref _binding_0) => {
David Tolnayd4add852018-01-01 20:13:24 -08003423 _visitor.visit_predicate_lifetime(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003424 }
David Tolnay8c81f622018-07-31 23:34:35 -07003425 WherePredicate::Eq(ref _binding_0) => {
David Tolnayd4add852018-01-01 20:13:24 -08003426 _visitor.visit_predicate_eq(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003427 }
3428 }
3429}