blob: a21e1085dc29914ba037c977643ba343b9d81c17 [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 }
David Tolnay1d8e9962018-08-24 19:04:20 -04001340 if let Some(ref it) = _i.label {
1341 _visitor.visit_label(it)
1342 };
David Tolnay8c81f622018-07-31 23:34:35 -07001343 _visitor.visit_block(&_i.block);
1344}
1345#[cfg(feature = "full")]
1346#[cfg(any(feature = "full", feature = "derive"))]
1347pub fn visit_expr_box<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBox) {
1348 for it in &_i.attrs {
1349 _visitor.visit_attribute(it)
1350 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001351 tokens_helper(_visitor, &_i.box_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001352 _visitor.visit_expr(&*_i.expr);
1353}
1354#[cfg(feature = "full")]
1355#[cfg(any(feature = "full", feature = "derive"))]
1356pub fn visit_expr_break<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBreak) {
1357 for it in &_i.attrs {
1358 _visitor.visit_attribute(it)
1359 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001360 tokens_helper(_visitor, &_i.break_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001361 if let Some(ref it) = _i.label {
1362 _visitor.visit_lifetime(it)
1363 };
1364 if let Some(ref it) = _i.expr {
1365 _visitor.visit_expr(&**it)
1366 };
1367}
1368#[cfg(any(feature = "full", feature = "derive"))]
1369pub fn visit_expr_call<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprCall) {
1370 for it in &_i.attrs {
1371 _visitor.visit_attribute(it)
1372 }
1373 _visitor.visit_expr(&*_i.func);
David Tolnay7ac699c2018-08-24 14:00:58 -04001374 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001375 for el in Punctuated::pairs(&_i.args) {
1376 let it = el.value();
1377 _visitor.visit_expr(it)
1378 }
1379}
1380#[cfg(any(feature = "full", feature = "derive"))]
1381pub fn visit_expr_cast<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprCast) {
1382 for it in &_i.attrs {
1383 _visitor.visit_attribute(it)
1384 }
1385 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001386 tokens_helper(_visitor, &_i.as_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001387 _visitor.visit_type(&*_i.ty);
1388}
1389#[cfg(feature = "full")]
1390#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001391pub fn visit_expr_closure<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprClosure) {
1392 for it in &_i.attrs {
1393 _visitor.visit_attribute(it)
1394 }
Yusuke Sasaki4e5d9662018-07-21 02:49:47 +09001395 if let Some(ref it) = _i.asyncness {
1396 tokens_helper(_visitor, &it.span)
1397 };
David Tolnay8c81f622018-07-31 23:34:35 -07001398 if let Some(ref it) = _i.movability {
David Tolnay7ac699c2018-08-24 14:00:58 -04001399 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001400 };
1401 if let Some(ref it) = _i.capture {
David Tolnay7ac699c2018-08-24 14:00:58 -04001402 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001403 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001404 tokens_helper(_visitor, &_i.or1_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001405 for el in Punctuated::pairs(&_i.inputs) {
1406 let it = el.value();
1407 _visitor.visit_fn_arg(it)
1408 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001409 tokens_helper(_visitor, &_i.or2_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001410 _visitor.visit_return_type(&_i.output);
1411 _visitor.visit_expr(&*_i.body);
1412}
1413#[cfg(feature = "full")]
1414#[cfg(any(feature = "full", feature = "derive"))]
1415pub fn visit_expr_continue<'ast, V: Visit<'ast> + ?Sized>(
1416 _visitor: &mut V,
1417 _i: &'ast ExprContinue,
1418) {
1419 for it in &_i.attrs {
1420 _visitor.visit_attribute(it)
1421 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001422 tokens_helper(_visitor, &_i.continue_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001423 if let Some(ref it) = _i.label {
1424 _visitor.visit_lifetime(it)
1425 };
1426}
1427#[cfg(any(feature = "full", feature = "derive"))]
1428pub fn visit_expr_field<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprField) {
1429 for it in &_i.attrs {
1430 _visitor.visit_attribute(it)
1431 }
1432 _visitor.visit_expr(&*_i.base);
David Tolnay7ac699c2018-08-24 14:00:58 -04001433 tokens_helper(_visitor, &_i.dot_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001434 _visitor.visit_member(&_i.member);
1435}
1436#[cfg(feature = "full")]
1437#[cfg(any(feature = "full", feature = "derive"))]
1438pub fn visit_expr_for_loop<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprForLoop) {
1439 for it in &_i.attrs {
1440 _visitor.visit_attribute(it)
1441 }
1442 if let Some(ref it) = _i.label {
1443 _visitor.visit_label(it)
1444 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001445 tokens_helper(_visitor, &_i.for_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001446 _visitor.visit_pat(&*_i.pat);
David Tolnay7ac699c2018-08-24 14:00:58 -04001447 tokens_helper(_visitor, &_i.in_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001448 _visitor.visit_expr(&*_i.expr);
1449 _visitor.visit_block(&_i.body);
1450}
1451#[cfg(feature = "full")]
1452#[cfg(any(feature = "full", feature = "derive"))]
1453pub fn visit_expr_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprGroup) {
1454 for it in &_i.attrs {
1455 _visitor.visit_attribute(it)
1456 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001457 tokens_helper(_visitor, &_i.group_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001458 _visitor.visit_expr(&*_i.expr);
1459}
1460#[cfg(feature = "full")]
1461#[cfg(any(feature = "full", feature = "derive"))]
1462pub fn visit_expr_if<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprIf) {
1463 for it in &_i.attrs {
1464 _visitor.visit_attribute(it)
1465 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001466 tokens_helper(_visitor, &_i.if_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001467 _visitor.visit_expr(&*_i.cond);
1468 _visitor.visit_block(&_i.then_branch);
1469 if let Some(ref it) = _i.else_branch {
David Tolnay7ac699c2018-08-24 14:00:58 -04001470 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001471 _visitor.visit_expr(&*(it).1);
1472 };
1473}
1474#[cfg(feature = "full")]
1475#[cfg(any(feature = "full", feature = "derive"))]
1476pub fn visit_expr_if_let<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprIfLet) {
1477 for it in &_i.attrs {
1478 _visitor.visit_attribute(it)
1479 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001480 tokens_helper(_visitor, &_i.if_token.span);
1481 tokens_helper(_visitor, &_i.let_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001482 for el in Punctuated::pairs(&_i.pats) {
1483 let it = el.value();
1484 _visitor.visit_pat(it)
1485 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001486 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001487 _visitor.visit_expr(&*_i.expr);
1488 _visitor.visit_block(&_i.then_branch);
1489 if let Some(ref it) = _i.else_branch {
David Tolnay7ac699c2018-08-24 14:00:58 -04001490 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001491 _visitor.visit_expr(&*(it).1);
1492 };
1493}
1494#[cfg(feature = "full")]
1495#[cfg(any(feature = "full", feature = "derive"))]
1496pub fn visit_expr_in_place<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprInPlace) {
1497 for it in &_i.attrs {
1498 _visitor.visit_attribute(it)
1499 }
1500 _visitor.visit_expr(&*_i.place);
David Tolnay7ac699c2018-08-24 14:00:58 -04001501 tokens_helper(_visitor, &_i.arrow_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001502 _visitor.visit_expr(&*_i.value);
1503}
1504#[cfg(any(feature = "full", feature = "derive"))]
1505pub fn visit_expr_index<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprIndex) {
1506 for it in &_i.attrs {
1507 _visitor.visit_attribute(it)
1508 }
1509 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001510 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001511 _visitor.visit_expr(&*_i.index);
1512}
1513#[cfg(any(feature = "full", feature = "derive"))]
1514pub fn visit_expr_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprLit) {
1515 for it in &_i.attrs {
1516 _visitor.visit_attribute(it)
1517 }
1518 _visitor.visit_lit(&_i.lit);
1519}
1520#[cfg(feature = "full")]
1521#[cfg(any(feature = "full", feature = "derive"))]
1522pub fn visit_expr_loop<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprLoop) {
1523 for it in &_i.attrs {
1524 _visitor.visit_attribute(it)
1525 }
1526 if let Some(ref it) = _i.label {
1527 _visitor.visit_label(it)
1528 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001529 tokens_helper(_visitor, &_i.loop_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001530 _visitor.visit_block(&_i.body);
1531}
1532#[cfg(feature = "full")]
1533#[cfg(any(feature = "full", feature = "derive"))]
1534pub fn visit_expr_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprMacro) {
1535 for it in &_i.attrs {
1536 _visitor.visit_attribute(it)
1537 }
1538 _visitor.visit_macro(&_i.mac);
1539}
1540#[cfg(feature = "full")]
1541#[cfg(any(feature = "full", feature = "derive"))]
1542pub fn visit_expr_match<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprMatch) {
1543 for it in &_i.attrs {
1544 _visitor.visit_attribute(it)
1545 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001546 tokens_helper(_visitor, &_i.match_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001547 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001548 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001549 for it in &_i.arms {
1550 _visitor.visit_arm(it)
1551 }
1552}
1553#[cfg(feature = "full")]
1554#[cfg(any(feature = "full", feature = "derive"))]
1555pub fn visit_expr_method_call<'ast, V: Visit<'ast> + ?Sized>(
1556 _visitor: &mut V,
1557 _i: &'ast ExprMethodCall,
1558) {
1559 for it in &_i.attrs {
1560 _visitor.visit_attribute(it)
1561 }
1562 _visitor.visit_expr(&*_i.receiver);
David Tolnay7ac699c2018-08-24 14:00:58 -04001563 tokens_helper(_visitor, &_i.dot_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001564 _visitor.visit_ident(&_i.method);
1565 if let Some(ref it) = _i.turbofish {
1566 _visitor.visit_method_turbofish(it)
1567 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001568 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001569 for el in Punctuated::pairs(&_i.args) {
1570 let it = el.value();
1571 _visitor.visit_expr(it)
1572 }
1573}
1574#[cfg(any(feature = "full", feature = "derive"))]
1575pub fn visit_expr_paren<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprParen) {
1576 for it in &_i.attrs {
1577 _visitor.visit_attribute(it)
1578 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001579 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001580 _visitor.visit_expr(&*_i.expr);
1581}
1582#[cfg(any(feature = "full", feature = "derive"))]
1583pub fn visit_expr_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprPath) {
1584 for it in &_i.attrs {
1585 _visitor.visit_attribute(it)
1586 }
1587 if let Some(ref it) = _i.qself {
1588 _visitor.visit_qself(it)
1589 };
1590 _visitor.visit_path(&_i.path);
1591}
1592#[cfg(feature = "full")]
1593#[cfg(any(feature = "full", feature = "derive"))]
1594pub fn visit_expr_range<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprRange) {
1595 for it in &_i.attrs {
1596 _visitor.visit_attribute(it)
1597 }
1598 if let Some(ref it) = _i.from {
1599 _visitor.visit_expr(&**it)
1600 };
1601 _visitor.visit_range_limits(&_i.limits);
1602 if let Some(ref it) = _i.to {
1603 _visitor.visit_expr(&**it)
1604 };
1605}
1606#[cfg(feature = "full")]
1607#[cfg(any(feature = "full", feature = "derive"))]
1608pub fn visit_expr_reference<'ast, V: Visit<'ast> + ?Sized>(
1609 _visitor: &mut V,
1610 _i: &'ast ExprReference,
1611) {
1612 for it in &_i.attrs {
1613 _visitor.visit_attribute(it)
1614 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001615 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001616 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04001617 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001618 };
1619 _visitor.visit_expr(&*_i.expr);
1620}
1621#[cfg(feature = "full")]
1622#[cfg(any(feature = "full", feature = "derive"))]
1623pub fn visit_expr_repeat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprRepeat) {
1624 for it in &_i.attrs {
1625 _visitor.visit_attribute(it)
1626 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001627 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001628 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001629 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001630 _visitor.visit_expr(&*_i.len);
1631}
1632#[cfg(feature = "full")]
1633#[cfg(any(feature = "full", feature = "derive"))]
1634pub fn visit_expr_return<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprReturn) {
1635 for it in &_i.attrs {
1636 _visitor.visit_attribute(it)
1637 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001638 tokens_helper(_visitor, &_i.return_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001639 if let Some(ref it) = _i.expr {
1640 _visitor.visit_expr(&**it)
1641 };
1642}
1643#[cfg(feature = "full")]
1644#[cfg(any(feature = "full", feature = "derive"))]
1645pub fn visit_expr_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprStruct) {
1646 for it in &_i.attrs {
1647 _visitor.visit_attribute(it)
1648 }
1649 _visitor.visit_path(&_i.path);
David Tolnay7ac699c2018-08-24 14:00:58 -04001650 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001651 for el in Punctuated::pairs(&_i.fields) {
1652 let it = el.value();
1653 _visitor.visit_field_value(it)
1654 }
1655 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001656 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001657 };
1658 if let Some(ref it) = _i.rest {
1659 _visitor.visit_expr(&**it)
1660 };
1661}
1662#[cfg(feature = "full")]
1663#[cfg(any(feature = "full", feature = "derive"))]
1664pub fn visit_expr_try<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprTry) {
1665 for it in &_i.attrs {
1666 _visitor.visit_attribute(it)
1667 }
1668 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001669 tokens_helper(_visitor, &_i.question_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001670}
1671#[cfg(feature = "full")]
1672#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayfb2dd4b2018-08-24 16:45:34 -04001673pub fn visit_expr_try_block<'ast, V: Visit<'ast> + ?Sized>(
1674 _visitor: &mut V,
1675 _i: &'ast ExprTryBlock,
1676) {
1677 for it in &_i.attrs {
1678 _visitor.visit_attribute(it)
1679 }
1680 tokens_helper(_visitor, &_i.try_token.span);
1681 _visitor.visit_block(&_i.block);
1682}
1683#[cfg(feature = "full")]
1684#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001685pub fn visit_expr_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprTuple) {
1686 for it in &_i.attrs {
1687 _visitor.visit_attribute(it)
1688 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001689 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001690 for el in Punctuated::pairs(&_i.elems) {
1691 let it = el.value();
1692 _visitor.visit_expr(it)
1693 }
1694}
1695#[cfg(feature = "full")]
1696#[cfg(any(feature = "full", feature = "derive"))]
1697pub fn visit_expr_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprType) {
1698 for it in &_i.attrs {
1699 _visitor.visit_attribute(it)
1700 }
1701 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001702 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001703 _visitor.visit_type(&*_i.ty);
1704}
1705#[cfg(any(feature = "full", feature = "derive"))]
1706pub fn visit_expr_unary<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprUnary) {
1707 for it in &_i.attrs {
1708 _visitor.visit_attribute(it)
1709 }
1710 _visitor.visit_un_op(&_i.op);
1711 _visitor.visit_expr(&*_i.expr);
1712}
1713#[cfg(feature = "full")]
1714#[cfg(any(feature = "full", feature = "derive"))]
1715pub fn visit_expr_unsafe<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprUnsafe) {
1716 for it in &_i.attrs {
1717 _visitor.visit_attribute(it)
1718 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001719 tokens_helper(_visitor, &_i.unsafe_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001720 _visitor.visit_block(&_i.block);
1721}
1722#[cfg(any(feature = "full", feature = "derive"))]
1723pub fn visit_expr_verbatim<'ast, V: Visit<'ast> + ?Sized>(
1724 _visitor: &mut V,
1725 _i: &'ast ExprVerbatim,
1726) {
David Tolnay6af48992018-08-01 11:16:28 -07001727 skip!(_i.tts);
David Tolnay8c81f622018-07-31 23:34:35 -07001728}
1729#[cfg(feature = "full")]
1730#[cfg(any(feature = "full", feature = "derive"))]
1731pub fn visit_expr_while<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprWhile) {
1732 for it in &_i.attrs {
1733 _visitor.visit_attribute(it)
1734 }
1735 if let Some(ref it) = _i.label {
1736 _visitor.visit_label(it)
1737 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001738 tokens_helper(_visitor, &_i.while_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001739 _visitor.visit_expr(&*_i.cond);
1740 _visitor.visit_block(&_i.body);
1741}
1742#[cfg(feature = "full")]
1743#[cfg(any(feature = "full", feature = "derive"))]
1744pub fn visit_expr_while_let<'ast, V: Visit<'ast> + ?Sized>(
1745 _visitor: &mut V,
1746 _i: &'ast ExprWhileLet,
1747) {
1748 for it in &_i.attrs {
1749 _visitor.visit_attribute(it)
1750 }
1751 if let Some(ref it) = _i.label {
1752 _visitor.visit_label(it)
1753 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001754 tokens_helper(_visitor, &_i.while_token.span);
1755 tokens_helper(_visitor, &_i.let_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001756 for el in Punctuated::pairs(&_i.pats) {
1757 let it = el.value();
1758 _visitor.visit_pat(it)
1759 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001760 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001761 _visitor.visit_expr(&*_i.expr);
1762 _visitor.visit_block(&_i.body);
1763}
1764#[cfg(feature = "full")]
1765#[cfg(any(feature = "full", feature = "derive"))]
1766pub fn visit_expr_yield<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprYield) {
1767 for it in &_i.attrs {
1768 _visitor.visit_attribute(it)
1769 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001770 tokens_helper(_visitor, &_i.yield_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001771 if let Some(ref it) = _i.expr {
1772 _visitor.visit_expr(&**it)
1773 };
1774}
1775#[cfg(any(feature = "full", feature = "derive"))]
1776pub fn visit_field<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Field) {
1777 for it in &_i.attrs {
1778 _visitor.visit_attribute(it)
1779 }
1780 _visitor.visit_visibility(&_i.vis);
1781 if let Some(ref it) = _i.ident {
1782 _visitor.visit_ident(it)
1783 };
1784 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001785 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001786 };
1787 _visitor.visit_type(&_i.ty);
1788}
1789#[cfg(any(feature = "full", feature = "derive"))]
1790#[cfg(feature = "full")]
1791pub fn visit_field_pat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldPat) {
1792 for it in &_i.attrs {
1793 _visitor.visit_attribute(it)
1794 }
1795 _visitor.visit_member(&_i.member);
1796 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001797 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001798 };
1799 _visitor.visit_pat(&*_i.pat);
1800}
1801#[cfg(any(feature = "full", feature = "derive"))]
1802#[cfg(feature = "full")]
1803pub fn visit_field_value<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldValue) {
1804 for it in &_i.attrs {
1805 _visitor.visit_attribute(it)
1806 }
1807 _visitor.visit_member(&_i.member);
1808 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001809 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001810 };
1811 _visitor.visit_expr(&_i.expr);
1812}
1813#[cfg(any(feature = "full", feature = "derive"))]
1814pub fn visit_fields<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Fields) {
1815 match *_i {
1816 Fields::Named(ref _binding_0) => {
1817 _visitor.visit_fields_named(_binding_0);
1818 }
1819 Fields::Unnamed(ref _binding_0) => {
1820 _visitor.visit_fields_unnamed(_binding_0);
1821 }
1822 Fields::Unit => {}
1823 }
1824}
1825#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001826pub fn visit_fields_named<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldsNamed) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001827 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001828 for el in Punctuated::pairs(&_i.named) {
1829 let it = el.value();
1830 _visitor.visit_field(it)
1831 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001832}
David Tolnay8c81f622018-07-31 23:34:35 -07001833#[cfg(any(feature = "full", feature = "derive"))]
1834pub fn visit_fields_unnamed<'ast, V: Visit<'ast> + ?Sized>(
1835 _visitor: &mut V,
1836 _i: &'ast FieldsUnnamed,
1837) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001838 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001839 for el in Punctuated::pairs(&_i.unnamed) {
1840 let it = el.value();
1841 _visitor.visit_field(it)
1842 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001843}
David Tolnay8c81f622018-07-31 23:34:35 -07001844#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001845pub fn visit_file<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast File) {
David Tolnay6af48992018-08-01 11:16:28 -07001846 skip!(_i.shebang);
David Tolnay8c81f622018-07-31 23:34:35 -07001847 for it in &_i.attrs {
1848 _visitor.visit_attribute(it)
1849 }
1850 for it in &_i.items {
1851 _visitor.visit_item(it)
1852 }
Nika Layzell27726662017-10-24 23:16:35 -04001853}
David Tolnay8c81f622018-07-31 23:34:35 -07001854#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001855pub fn visit_fn_arg<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FnArg) {
Nika Layzell27726662017-10-24 23:16:35 -04001856 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001857 FnArg::SelfRef(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001858 _visitor.visit_arg_self_ref(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001859 }
David Tolnay8c81f622018-07-31 23:34:35 -07001860 FnArg::SelfValue(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001861 _visitor.visit_arg_self(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001862 }
David Tolnay8c81f622018-07-31 23:34:35 -07001863 FnArg::Captured(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001864 _visitor.visit_arg_captured(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001865 }
David Tolnay8c81f622018-07-31 23:34:35 -07001866 FnArg::Inferred(ref _binding_0) => {
David Tolnay80ed55f2017-12-27 22:54:40 -05001867 _visitor.visit_pat(_binding_0);
1868 }
David Tolnay8c81f622018-07-31 23:34:35 -07001869 FnArg::Ignored(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001870 _visitor.visit_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001871 }
1872 }
1873}
David Tolnay8c81f622018-07-31 23:34:35 -07001874#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001875pub fn visit_fn_decl<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FnDecl) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001876 tokens_helper(_visitor, &_i.fn_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001877 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04001878 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001879 for el in Punctuated::pairs(&_i.inputs) {
1880 let it = el.value();
1881 _visitor.visit_fn_arg(it)
1882 }
1883 if let Some(ref it) = _i.variadic {
David Tolnay7ac699c2018-08-24 14:00:58 -04001884 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001885 };
1886 _visitor.visit_return_type(&_i.output);
Nika Layzell27726662017-10-24 23:16:35 -04001887}
David Tolnay8c81f622018-07-31 23:34:35 -07001888#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001889pub fn visit_foreign_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ForeignItem) {
Nika Layzell27726662017-10-24 23:16:35 -04001890 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001891 ForeignItem::Fn(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001892 _visitor.visit_foreign_item_fn(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001893 }
David Tolnay8c81f622018-07-31 23:34:35 -07001894 ForeignItem::Static(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001895 _visitor.visit_foreign_item_static(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001896 }
David Tolnay8c81f622018-07-31 23:34:35 -07001897 ForeignItem::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001898 _visitor.visit_foreign_item_type(_binding_0);
David Tolnay199bcbb2017-11-12 10:33:52 -08001899 }
David Tolnay435c1782018-08-24 16:15:44 -04001900 ForeignItem::Macro(ref _binding_0) => {
1901 _visitor.visit_foreign_item_macro(_binding_0);
1902 }
David Tolnay8c81f622018-07-31 23:34:35 -07001903 ForeignItem::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05001904 _visitor.visit_foreign_item_verbatim(_binding_0);
1905 }
Nika Layzell27726662017-10-24 23:16:35 -04001906 }
1907}
David Tolnay8c81f622018-07-31 23:34:35 -07001908#[cfg(feature = "full")]
1909pub fn visit_foreign_item_fn<'ast, V: Visit<'ast> + ?Sized>(
1910 _visitor: &mut V,
1911 _i: &'ast ForeignItemFn,
1912) {
1913 for it in &_i.attrs {
1914 _visitor.visit_attribute(it)
1915 }
1916 _visitor.visit_visibility(&_i.vis);
1917 _visitor.visit_ident(&_i.ident);
1918 _visitor.visit_fn_decl(&*_i.decl);
David Tolnay7ac699c2018-08-24 14:00:58 -04001919 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay8894f602017-11-11 12:11:04 -08001920}
David Tolnay8c81f622018-07-31 23:34:35 -07001921#[cfg(feature = "full")]
David Tolnay435c1782018-08-24 16:15:44 -04001922pub fn visit_foreign_item_macro<'ast, V: Visit<'ast> + ?Sized>(
1923 _visitor: &mut V,
1924 _i: &'ast ForeignItemMacro,
1925) {
1926 for it in &_i.attrs {
1927 _visitor.visit_attribute(it)
1928 }
1929 _visitor.visit_macro(&_i.mac);
1930 if let Some(ref it) = _i.semi_token {
1931 tokens_helper(_visitor, &it.spans)
1932 };
1933}
1934#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001935pub fn visit_foreign_item_static<'ast, V: Visit<'ast> + ?Sized>(
1936 _visitor: &mut V,
1937 _i: &'ast ForeignItemStatic,
1938) {
1939 for it in &_i.attrs {
1940 _visitor.visit_attribute(it)
1941 }
1942 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04001943 tokens_helper(_visitor, &_i.static_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001944 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04001945 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001946 };
1947 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001948 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001949 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04001950 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001951}
David Tolnay8c81f622018-07-31 23:34:35 -07001952#[cfg(feature = "full")]
1953pub fn visit_foreign_item_type<'ast, V: Visit<'ast> + ?Sized>(
1954 _visitor: &mut V,
1955 _i: &'ast ForeignItemType,
1956) {
1957 for it in &_i.attrs {
1958 _visitor.visit_attribute(it)
1959 }
1960 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04001961 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001962 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001963 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay199bcbb2017-11-12 10:33:52 -08001964}
David Tolnay8c81f622018-07-31 23:34:35 -07001965#[cfg(feature = "full")]
1966pub fn visit_foreign_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
1967 _visitor: &mut V,
1968 _i: &'ast ForeignItemVerbatim,
1969) {
David Tolnay6af48992018-08-01 11:16:28 -07001970 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05001971}
David Tolnay8c81f622018-07-31 23:34:35 -07001972#[cfg(any(feature = "full", feature = "derive"))]
1973pub fn visit_generic_argument<'ast, V: Visit<'ast> + ?Sized>(
1974 _visitor: &mut V,
1975 _i: &'ast GenericArgument,
1976) {
Nika Layzell357885a2017-12-04 15:47:07 -05001977 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001978 GenericArgument::Lifetime(ref _binding_0) => {
David Tolnay4ba63a02017-12-28 15:53:05 -05001979 _visitor.visit_lifetime(_binding_0);
Nika Layzell357885a2017-12-04 15:47:07 -05001980 }
David Tolnay8c81f622018-07-31 23:34:35 -07001981 GenericArgument::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001982 _visitor.visit_type(_binding_0);
Nika Layzell357885a2017-12-04 15:47:07 -05001983 }
David Tolnay8c81f622018-07-31 23:34:35 -07001984 GenericArgument::Binding(ref _binding_0) => {
David Tolnay506e43a2017-12-29 11:34:36 -05001985 _visitor.visit_binding(_binding_0);
Nika Layzell357885a2017-12-04 15:47:07 -05001986 }
David Tolnay8c81f622018-07-31 23:34:35 -07001987 GenericArgument::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001988 _visitor.visit_expr(_binding_0);
Nika Layzellc680e612017-12-04 19:07:20 -05001989 }
Nika Layzell357885a2017-12-04 15:47:07 -05001990 }
1991}
David Tolnay8c81f622018-07-31 23:34:35 -07001992#[cfg(any(feature = "full", feature = "derive"))]
1993#[cfg(feature = "full")]
1994pub fn visit_generic_method_argument<'ast, V: Visit<'ast> + ?Sized>(
1995 _visitor: &mut V,
1996 _i: &'ast GenericMethodArgument,
1997) {
David Tolnayd60cfec2017-12-29 00:21:38 -05001998 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001999 GenericMethodArgument::Type(ref _binding_0) => {
David Tolnayd60cfec2017-12-29 00:21:38 -05002000 _visitor.visit_type(_binding_0);
2001 }
David Tolnay8c81f622018-07-31 23:34:35 -07002002 GenericMethodArgument::Const(ref _binding_0) => {
David Tolnayd60cfec2017-12-29 00:21:38 -05002003 _visitor.visit_expr(_binding_0);
2004 }
2005 }
2006}
David Tolnay8c81f622018-07-31 23:34:35 -07002007#[cfg(any(feature = "full", feature = "derive"))]
2008pub fn visit_generic_param<'ast, V: Visit<'ast> + ?Sized>(
2009 _visitor: &mut V,
2010 _i: &'ast GenericParam,
2011) {
David Tolnayc2f1aba2017-11-12 20:29:22 -08002012 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002013 GenericParam::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002014 _visitor.visit_type_param(_binding_0);
David Tolnayc2f1aba2017-11-12 20:29:22 -08002015 }
David Tolnay8c81f622018-07-31 23:34:35 -07002016 GenericParam::Lifetime(ref _binding_0) => {
David Tolnay517f3692018-01-01 20:17:23 -08002017 _visitor.visit_lifetime_def(_binding_0);
2018 }
David Tolnay8c81f622018-07-31 23:34:35 -07002019 GenericParam::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002020 _visitor.visit_const_param(_binding_0);
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05002021 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08002022 }
2023}
David Tolnay8c81f622018-07-31 23:34:35 -07002024#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002025pub fn visit_generics<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Generics) {
David Tolnay8c81f622018-07-31 23:34:35 -07002026 if let Some(ref it) = _i.lt_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002027 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002028 };
2029 for el in Punctuated::pairs(&_i.params) {
2030 let it = el.value();
2031 _visitor.visit_generic_param(it)
2032 }
2033 if let Some(ref it) = _i.gt_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002034 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002035 };
2036 if let Some(ref it) = _i.where_clause {
2037 _visitor.visit_where_clause(it)
2038 };
Nika Layzell27726662017-10-24 23:16:35 -04002039}
David Tolnay8c81f622018-07-31 23:34:35 -07002040pub fn visit_ident<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Ident) {}
2041#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002042pub fn visit_impl_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ImplItem) {
Nika Layzell27726662017-10-24 23:16:35 -04002043 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002044 ImplItem::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002045 _visitor.visit_impl_item_const(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002046 }
David Tolnay8c81f622018-07-31 23:34:35 -07002047 ImplItem::Method(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002048 _visitor.visit_impl_item_method(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002049 }
David Tolnay8c81f622018-07-31 23:34:35 -07002050 ImplItem::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002051 _visitor.visit_impl_item_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002052 }
David Tolnay8c81f622018-07-31 23:34:35 -07002053 ImplItem::Macro(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002054 _visitor.visit_impl_item_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002055 }
David Tolnay8c81f622018-07-31 23:34:35 -07002056 ImplItem::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002057 _visitor.visit_impl_item_verbatim(_binding_0);
2058 }
Nika Layzell27726662017-10-24 23:16:35 -04002059 }
2060}
David Tolnay8c81f622018-07-31 23:34:35 -07002061#[cfg(feature = "full")]
2062pub fn visit_impl_item_const<'ast, V: Visit<'ast> + ?Sized>(
2063 _visitor: &mut V,
2064 _i: &'ast ImplItemConst,
2065) {
2066 for it in &_i.attrs {
2067 _visitor.visit_attribute(it)
2068 }
2069 _visitor.visit_visibility(&_i.vis);
2070 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002071 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002072 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002073 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002074 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002075 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002076 _visitor.visit_type(&_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002077 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002078 _visitor.visit_expr(&_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04002079 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay857628c2017-11-11 12:25:31 -08002080}
David Tolnay8c81f622018-07-31 23:34:35 -07002081#[cfg(feature = "full")]
2082pub fn visit_impl_item_macro<'ast, V: Visit<'ast> + ?Sized>(
2083 _visitor: &mut V,
2084 _i: &'ast ImplItemMacro,
2085) {
2086 for it in &_i.attrs {
2087 _visitor.visit_attribute(it)
2088 }
2089 _visitor.visit_macro(&_i.mac);
2090 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002091 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002092 };
David Tolnay857628c2017-11-11 12:25:31 -08002093}
David Tolnay8c81f622018-07-31 23:34:35 -07002094#[cfg(feature = "full")]
2095pub fn visit_impl_item_method<'ast, V: Visit<'ast> + ?Sized>(
2096 _visitor: &mut V,
2097 _i: &'ast ImplItemMethod,
2098) {
2099 for it in &_i.attrs {
2100 _visitor.visit_attribute(it)
2101 }
2102 _visitor.visit_visibility(&_i.vis);
2103 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002104 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002105 };
2106 _visitor.visit_method_sig(&_i.sig);
2107 _visitor.visit_block(&_i.block);
Nika Layzell27726662017-10-24 23:16:35 -04002108}
David Tolnay8c81f622018-07-31 23:34:35 -07002109#[cfg(feature = "full")]
2110pub fn visit_impl_item_type<'ast, V: Visit<'ast> + ?Sized>(
2111 _visitor: &mut V,
2112 _i: &'ast ImplItemType,
2113) {
2114 for it in &_i.attrs {
2115 _visitor.visit_attribute(it)
2116 }
2117 _visitor.visit_visibility(&_i.vis);
2118 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002119 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002120 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002121 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002122 _visitor.visit_ident(&_i.ident);
2123 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04002124 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002125 _visitor.visit_type(&_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002126 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002127}
David Tolnay8c81f622018-07-31 23:34:35 -07002128#[cfg(feature = "full")]
2129pub fn visit_impl_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
2130 _visitor: &mut V,
2131 _i: &'ast ImplItemVerbatim,
2132) {
David Tolnay6af48992018-08-01 11:16:28 -07002133 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05002134}
David Tolnay8c81f622018-07-31 23:34:35 -07002135#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002136pub fn visit_index<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Index) {
David Tolnay6af48992018-08-01 11:16:28 -07002137 skip!(_i.index);
David Tolnay8c81f622018-07-31 23:34:35 -07002138 _visitor.visit_span(&_i.span);
David Tolnay85b69a42017-12-27 20:43:10 -05002139}
David Tolnay8c81f622018-07-31 23:34:35 -07002140#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002141pub fn visit_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Item) {
Nika Layzell27726662017-10-24 23:16:35 -04002142 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002143 Item::ExternCrate(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002144 _visitor.visit_item_extern_crate(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002145 }
David Tolnay8c81f622018-07-31 23:34:35 -07002146 Item::Use(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002147 _visitor.visit_item_use(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002148 }
David Tolnay8c81f622018-07-31 23:34:35 -07002149 Item::Static(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002150 _visitor.visit_item_static(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002151 }
David Tolnay8c81f622018-07-31 23:34:35 -07002152 Item::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002153 _visitor.visit_item_const(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002154 }
David Tolnay8c81f622018-07-31 23:34:35 -07002155 Item::Fn(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002156 _visitor.visit_item_fn(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002157 }
David Tolnay8c81f622018-07-31 23:34:35 -07002158 Item::Mod(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002159 _visitor.visit_item_mod(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002160 }
David Tolnay8c81f622018-07-31 23:34:35 -07002161 Item::ForeignMod(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002162 _visitor.visit_item_foreign_mod(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002163 }
David Tolnay8c81f622018-07-31 23:34:35 -07002164 Item::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002165 _visitor.visit_item_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002166 }
David Tolnay8c81f622018-07-31 23:34:35 -07002167 Item::Struct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002168 _visitor.visit_item_struct(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002169 }
David Tolnay8c81f622018-07-31 23:34:35 -07002170 Item::Enum(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05002171 _visitor.visit_item_enum(_binding_0);
2172 }
David Tolnay8c81f622018-07-31 23:34:35 -07002173 Item::Union(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002174 _visitor.visit_item_union(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002175 }
David Tolnay8c81f622018-07-31 23:34:35 -07002176 Item::Trait(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002177 _visitor.visit_item_trait(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002178 }
David Tolnay8c81f622018-07-31 23:34:35 -07002179 Item::Impl(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002180 _visitor.visit_item_impl(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002181 }
David Tolnay8c81f622018-07-31 23:34:35 -07002182 Item::Macro(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002183 _visitor.visit_item_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002184 }
David Tolnay8c81f622018-07-31 23:34:35 -07002185 Item::Macro2(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002186 _visitor.visit_item_macro2(_binding_0);
David Tolnay500d8322017-12-18 00:32:51 -08002187 }
David Tolnay8c81f622018-07-31 23:34:35 -07002188 Item::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002189 _visitor.visit_item_verbatim(_binding_0);
2190 }
Nika Layzell27726662017-10-24 23:16:35 -04002191 }
2192}
David Tolnay8c81f622018-07-31 23:34:35 -07002193#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002194pub fn visit_item_const<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemConst) {
David Tolnay8c81f622018-07-31 23:34:35 -07002195 for it in &_i.attrs {
2196 _visitor.visit_attribute(it)
2197 }
2198 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002199 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002200 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002201 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002202 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002203 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002204 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04002205 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnayc6b55bc2017-11-09 22:48:38 -08002206}
David Tolnay8c81f622018-07-31 23:34:35 -07002207#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002208pub fn visit_item_enum<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemEnum) {
David Tolnay8c81f622018-07-31 23:34:35 -07002209 for it in &_i.attrs {
2210 _visitor.visit_attribute(it)
2211 }
2212 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002213 tokens_helper(_visitor, &_i.enum_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002214 _visitor.visit_ident(&_i.ident);
2215 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04002216 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002217 for el in Punctuated::pairs(&_i.variants) {
2218 let it = el.value();
2219 _visitor.visit_variant(it)
2220 }
David Tolnayc6b55bc2017-11-09 22:48:38 -08002221}
David Tolnay8c81f622018-07-31 23:34:35 -07002222#[cfg(feature = "full")]
2223pub fn visit_item_extern_crate<'ast, V: Visit<'ast> + ?Sized>(
2224 _visitor: &mut V,
2225 _i: &'ast ItemExternCrate,
2226) {
2227 for it in &_i.attrs {
2228 _visitor.visit_attribute(it)
2229 }
2230 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002231 tokens_helper(_visitor, &_i.extern_token.span);
2232 tokens_helper(_visitor, &_i.crate_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002233 _visitor.visit_ident(&_i.ident);
2234 if let Some(ref it) = _i.rename {
David Tolnay7ac699c2018-08-24 14:00:58 -04002235 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002236 _visitor.visit_ident(&(it).1);
2237 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002238 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnayc6b55bc2017-11-09 22:48:38 -08002239}
David Tolnay8c81f622018-07-31 23:34:35 -07002240#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002241pub fn visit_item_fn<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemFn) {
David Tolnay8c81f622018-07-31 23:34:35 -07002242 for it in &_i.attrs {
2243 _visitor.visit_attribute(it)
2244 }
2245 _visitor.visit_visibility(&_i.vis);
2246 if let Some(ref it) = _i.constness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002247 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002248 };
2249 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002250 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002251 };
Yusuke Sasakif00a3ef2018-07-20 22:08:42 +09002252 if let Some(ref it) = _i.asyncness {
2253 tokens_helper(_visitor, &it.span)
2254 };
David Tolnay8c81f622018-07-31 23:34:35 -07002255 if let Some(ref it) = _i.abi {
2256 _visitor.visit_abi(it)
2257 };
2258 _visitor.visit_ident(&_i.ident);
2259 _visitor.visit_fn_decl(&*_i.decl);
2260 _visitor.visit_block(&*_i.block);
David Tolnayc6b55bc2017-11-09 22:48:38 -08002261}
David Tolnay8c81f622018-07-31 23:34:35 -07002262#[cfg(feature = "full")]
2263pub fn visit_item_foreign_mod<'ast, V: Visit<'ast> + ?Sized>(
2264 _visitor: &mut V,
2265 _i: &'ast ItemForeignMod,
2266) {
2267 for it in &_i.attrs {
2268 _visitor.visit_attribute(it)
2269 }
2270 _visitor.visit_abi(&_i.abi);
David Tolnay7ac699c2018-08-24 14:00:58 -04002271 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002272 for it in &_i.items {
2273 _visitor.visit_foreign_item(it)
2274 }
David Tolnayc6b55bc2017-11-09 22:48:38 -08002275}
David Tolnay8c81f622018-07-31 23:34:35 -07002276#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002277pub fn visit_item_impl<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemImpl) {
David Tolnay8c81f622018-07-31 23:34:35 -07002278 for it in &_i.attrs {
2279 _visitor.visit_attribute(it)
2280 }
2281 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002282 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002283 };
2284 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002285 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002286 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002287 tokens_helper(_visitor, &_i.impl_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002288 _visitor.visit_generics(&_i.generics);
2289 if let Some(ref it) = _i.trait_ {
2290 if let Some(ref it) = (it).0 {
David Tolnay7ac699c2018-08-24 14:00:58 -04002291 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002292 };
2293 _visitor.visit_path(&(it).1);
David Tolnay7ac699c2018-08-24 14:00:58 -04002294 tokens_helper(_visitor, &(it).2.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002295 };
2296 _visitor.visit_type(&*_i.self_ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002297 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002298 for it in &_i.items {
2299 _visitor.visit_impl_item(it)
2300 }
David Tolnayc6b55bc2017-11-09 22:48:38 -08002301}
David Tolnay8c81f622018-07-31 23:34:35 -07002302#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002303pub fn visit_item_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemMacro) {
David Tolnay8c81f622018-07-31 23:34:35 -07002304 for it in &_i.attrs {
2305 _visitor.visit_attribute(it)
2306 }
2307 if let Some(ref it) = _i.ident {
2308 _visitor.visit_ident(it)
2309 };
2310 _visitor.visit_macro(&_i.mac);
2311 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002312 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002313 };
David Tolnayc6b55bc2017-11-09 22:48:38 -08002314}
David Tolnay8c81f622018-07-31 23:34:35 -07002315#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002316pub fn visit_item_macro2<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemMacro2) {
David Tolnay8c81f622018-07-31 23:34:35 -07002317 for it in &_i.attrs {
2318 _visitor.visit_attribute(it)
2319 }
2320 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002321 tokens_helper(_visitor, &_i.macro_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002322 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002323 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay6af48992018-08-01 11:16:28 -07002324 skip!(_i.args);
David Tolnay7ac699c2018-08-24 14:00:58 -04002325 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay6af48992018-08-01 11:16:28 -07002326 skip!(_i.body);
David Tolnay500d8322017-12-18 00:32:51 -08002327}
David Tolnay8c81f622018-07-31 23:34:35 -07002328#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002329pub fn visit_item_mod<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemMod) {
David Tolnay8c81f622018-07-31 23:34:35 -07002330 for it in &_i.attrs {
2331 _visitor.visit_attribute(it)
2332 }
2333 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002334 tokens_helper(_visitor, &_i.mod_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002335 _visitor.visit_ident(&_i.ident);
2336 if let Some(ref it) = _i.content {
David Tolnay7ac699c2018-08-24 14:00:58 -04002337 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002338 for it in &(it).1 {
2339 _visitor.visit_item(it)
2340 }
2341 };
2342 if let Some(ref it) = _i.semi {
David Tolnay7ac699c2018-08-24 14:00:58 -04002343 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002344 };
Nika Layzell27726662017-10-24 23:16:35 -04002345}
David Tolnay8c81f622018-07-31 23:34:35 -07002346#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002347pub fn visit_item_static<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemStatic) {
David Tolnay8c81f622018-07-31 23:34:35 -07002348 for it in &_i.attrs {
2349 _visitor.visit_attribute(it)
2350 }
2351 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002352 tokens_helper(_visitor, &_i.static_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002353 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04002354 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002355 };
2356 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002357 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002358 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002359 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002360 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04002361 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002362}
David Tolnay8c81f622018-07-31 23:34:35 -07002363#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002364pub fn visit_item_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemStruct) {
David Tolnay8c81f622018-07-31 23:34:35 -07002365 for it in &_i.attrs {
2366 _visitor.visit_attribute(it)
2367 }
2368 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002369 tokens_helper(_visitor, &_i.struct_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002370 _visitor.visit_ident(&_i.ident);
2371 _visitor.visit_generics(&_i.generics);
2372 _visitor.visit_fields(&_i.fields);
2373 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002374 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002375 };
Nika Layzell27726662017-10-24 23:16:35 -04002376}
David Tolnay8c81f622018-07-31 23:34:35 -07002377#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002378pub fn visit_item_trait<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemTrait) {
David Tolnay8c81f622018-07-31 23:34:35 -07002379 for it in &_i.attrs {
2380 _visitor.visit_attribute(it)
2381 }
2382 _visitor.visit_visibility(&_i.vis);
2383 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002384 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002385 };
2386 if let Some(ref it) = _i.auto_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002387 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002388 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002389 tokens_helper(_visitor, &_i.trait_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002390 _visitor.visit_ident(&_i.ident);
2391 _visitor.visit_generics(&_i.generics);
2392 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002393 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002394 };
2395 for el in Punctuated::pairs(&_i.supertraits) {
2396 let it = el.value();
2397 _visitor.visit_type_param_bound(it)
2398 }
David Tolnay7ac699c2018-08-24 14:00:58 -04002399 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002400 for it in &_i.items {
2401 _visitor.visit_trait_item(it)
2402 }
Nika Layzell27726662017-10-24 23:16:35 -04002403}
David Tolnay8c81f622018-07-31 23:34:35 -07002404#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002405pub fn visit_item_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemType) {
David Tolnay8c81f622018-07-31 23:34:35 -07002406 for it in &_i.attrs {
2407 _visitor.visit_attribute(it)
2408 }
2409 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002410 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002411 _visitor.visit_ident(&_i.ident);
2412 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04002413 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002414 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002415 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002416}
David Tolnay8c81f622018-07-31 23:34:35 -07002417#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002418pub fn visit_item_union<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemUnion) {
David Tolnay8c81f622018-07-31 23:34:35 -07002419 for it in &_i.attrs {
2420 _visitor.visit_attribute(it)
2421 }
2422 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002423 tokens_helper(_visitor, &_i.union_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002424 _visitor.visit_ident(&_i.ident);
2425 _visitor.visit_generics(&_i.generics);
2426 _visitor.visit_fields_named(&_i.fields);
Nika Layzell27726662017-10-24 23:16:35 -04002427}
David Tolnay8c81f622018-07-31 23:34:35 -07002428#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002429pub fn visit_item_use<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemUse) {
David Tolnay8c81f622018-07-31 23:34:35 -07002430 for it in &_i.attrs {
2431 _visitor.visit_attribute(it)
2432 }
2433 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002434 tokens_helper(_visitor, &_i.use_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002435 if let Some(ref it) = _i.leading_colon {
David Tolnay7ac699c2018-08-24 14:00:58 -04002436 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002437 };
2438 _visitor.visit_use_tree(&_i.tree);
David Tolnay7ac699c2018-08-24 14:00:58 -04002439 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002440}
David Tolnay8c81f622018-07-31 23:34:35 -07002441#[cfg(feature = "full")]
2442pub fn visit_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
2443 _visitor: &mut V,
2444 _i: &'ast ItemVerbatim,
2445) {
David Tolnay6af48992018-08-01 11:16:28 -07002446 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05002447}
David Tolnay8c81f622018-07-31 23:34:35 -07002448#[cfg(any(feature = "full", feature = "derive"))]
2449#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002450pub fn visit_label<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Label) {
David Tolnay8c81f622018-07-31 23:34:35 -07002451 _visitor.visit_lifetime(&_i.name);
David Tolnay7ac699c2018-08-24 14:00:58 -04002452 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnaybcd498f2017-12-29 12:02:33 -05002453}
David Tolnay8c81f622018-07-31 23:34:35 -07002454#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002455pub fn visit_lifetime<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Lifetime) {
David Tolnay6af48992018-08-01 11:16:28 -07002456 skip!(_i.apostrophe);
David Tolnay8c81f622018-07-31 23:34:35 -07002457 _visitor.visit_ident(&_i.ident);
David Tolnay4ba63a02017-12-28 15:53:05 -05002458}
David Tolnay8c81f622018-07-31 23:34:35 -07002459#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002460pub fn visit_lifetime_def<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LifetimeDef) {
David Tolnay8c81f622018-07-31 23:34:35 -07002461 for it in &_i.attrs {
2462 _visitor.visit_attribute(it)
2463 }
2464 _visitor.visit_lifetime(&_i.lifetime);
2465 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002466 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002467 };
2468 for el in Punctuated::pairs(&_i.bounds) {
2469 let it = el.value();
2470 _visitor.visit_lifetime(it)
2471 }
David Tolnay4ba63a02017-12-28 15:53:05 -05002472}
David Tolnay8c81f622018-07-31 23:34:35 -07002473#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002474pub fn visit_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Lit) {
David Tolnay360efd22018-01-04 23:35:26 -08002475 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002476 Lit::Str(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002477 _visitor.visit_lit_str(_binding_0);
2478 }
David Tolnay8c81f622018-07-31 23:34:35 -07002479 Lit::ByteStr(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002480 _visitor.visit_lit_byte_str(_binding_0);
2481 }
David Tolnay8c81f622018-07-31 23:34:35 -07002482 Lit::Byte(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002483 _visitor.visit_lit_byte(_binding_0);
2484 }
David Tolnay8c81f622018-07-31 23:34:35 -07002485 Lit::Char(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002486 _visitor.visit_lit_char(_binding_0);
2487 }
David Tolnay8c81f622018-07-31 23:34:35 -07002488 Lit::Int(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002489 _visitor.visit_lit_int(_binding_0);
2490 }
David Tolnay8c81f622018-07-31 23:34:35 -07002491 Lit::Float(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002492 _visitor.visit_lit_float(_binding_0);
2493 }
David Tolnay8c81f622018-07-31 23:34:35 -07002494 Lit::Bool(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002495 _visitor.visit_lit_bool(_binding_0);
2496 }
David Tolnay8c81f622018-07-31 23:34:35 -07002497 Lit::Verbatim(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002498 _visitor.visit_lit_verbatim(_binding_0);
2499 }
2500 }
2501}
David Tolnay8c81f622018-07-31 23:34:35 -07002502#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002503pub fn visit_lit_bool<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitBool) {
David Tolnay6af48992018-08-01 11:16:28 -07002504 skip!(_i.value);
David Tolnay8c81f622018-07-31 23:34:35 -07002505 _visitor.visit_span(&_i.span);
Nika Layzell27726662017-10-24 23:16:35 -04002506}
David Tolnay8c81f622018-07-31 23:34:35 -07002507#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002508pub fn visit_lit_byte<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitByte) {
David Tolnay6af48992018-08-01 11:16:28 -07002509 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002510}
David Tolnay8c81f622018-07-31 23:34:35 -07002511#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002512pub fn visit_lit_byte_str<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitByteStr) {
David Tolnay6af48992018-08-01 11:16:28 -07002513 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002514}
David Tolnay8c81f622018-07-31 23:34:35 -07002515#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002516pub fn visit_lit_char<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitChar) {
David Tolnay6af48992018-08-01 11:16:28 -07002517 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002518}
David Tolnay8c81f622018-07-31 23:34:35 -07002519#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002520pub fn visit_lit_float<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitFloat) {
David Tolnay6af48992018-08-01 11:16:28 -07002521 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002522}
David Tolnay8c81f622018-07-31 23:34:35 -07002523#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002524pub fn visit_lit_int<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitInt) {
David Tolnay6af48992018-08-01 11:16:28 -07002525 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002526}
David Tolnay8c81f622018-07-31 23:34:35 -07002527#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002528pub fn visit_lit_str<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitStr) {
David Tolnay6af48992018-08-01 11:16:28 -07002529 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002530}
David Tolnay8c81f622018-07-31 23:34:35 -07002531#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002532pub fn visit_lit_verbatim<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitVerbatim) {
David Tolnay6af48992018-08-01 11:16:28 -07002533 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002534}
David Tolnay8c81f622018-07-31 23:34:35 -07002535#[cfg(any(feature = "full", feature = "derive"))]
2536#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002537pub fn visit_local<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Local) {
David Tolnay8c81f622018-07-31 23:34:35 -07002538 for it in &_i.attrs {
2539 _visitor.visit_attribute(it)
2540 }
David Tolnay7ac699c2018-08-24 14:00:58 -04002541 tokens_helper(_visitor, &_i.let_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002542 for el in Punctuated::pairs(&_i.pats) {
2543 let it = el.value();
2544 _visitor.visit_pat(it)
2545 }
2546 if let Some(ref it) = _i.ty {
David Tolnay7ac699c2018-08-24 14:00:58 -04002547 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002548 _visitor.visit_type(&*(it).1);
2549 };
2550 if let Some(ref it) = _i.init {
David Tolnay7ac699c2018-08-24 14:00:58 -04002551 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002552 _visitor.visit_expr(&*(it).1);
2553 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002554 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002555}
David Tolnay8c81f622018-07-31 23:34:35 -07002556#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002557pub fn visit_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Macro) {
David Tolnay8c81f622018-07-31 23:34:35 -07002558 _visitor.visit_path(&_i.path);
David Tolnay7ac699c2018-08-24 14:00:58 -04002559 tokens_helper(_visitor, &_i.bang_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002560 _visitor.visit_macro_delimiter(&_i.delimiter);
David Tolnay6af48992018-08-01 11:16:28 -07002561 skip!(_i.tts);
David Tolnayab919512017-12-30 23:31:51 -05002562}
David Tolnay8c81f622018-07-31 23:34:35 -07002563#[cfg(any(feature = "full", feature = "derive"))]
2564pub fn visit_macro_delimiter<'ast, V: Visit<'ast> + ?Sized>(
2565 _visitor: &mut V,
2566 _i: &'ast MacroDelimiter,
2567) {
David Tolnayab919512017-12-30 23:31:51 -05002568 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002569 MacroDelimiter::Paren(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::Brace(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 }
David Tolnay8c81f622018-07-31 23:34:35 -07002575 MacroDelimiter::Bracket(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002576 tokens_helper(_visitor, &_binding_0.span);
David Tolnayab919512017-12-30 23:31:51 -05002577 }
2578 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002579}
David Tolnay8c81f622018-07-31 23:34:35 -07002580#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002581pub fn visit_member<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Member) {
David Tolnay85b69a42017-12-27 20:43:10 -05002582 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002583 Member::Named(ref _binding_0) => {
Alex Crichtond261d092018-05-18 13:47:35 -07002584 _visitor.visit_ident(_binding_0);
David Tolnay85b69a42017-12-27 20:43:10 -05002585 }
David Tolnay8c81f622018-07-31 23:34:35 -07002586 Member::Unnamed(ref _binding_0) => {
David Tolnay85b69a42017-12-27 20:43:10 -05002587 _visitor.visit_index(_binding_0);
2588 }
2589 }
2590}
David Tolnay8c81f622018-07-31 23:34:35 -07002591#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayaaadd782018-01-06 22:58:13 -08002592pub fn visit_meta<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Meta) {
Nika Layzell27726662017-10-24 23:16:35 -04002593 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002594 Meta::Word(ref _binding_0) => {
Alex Crichtond261d092018-05-18 13:47:35 -07002595 _visitor.visit_ident(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002596 }
David Tolnay8c81f622018-07-31 23:34:35 -07002597 Meta::List(ref _binding_0) => {
David Tolnayaaadd782018-01-06 22:58:13 -08002598 _visitor.visit_meta_list(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002599 }
David Tolnay8c81f622018-07-31 23:34:35 -07002600 Meta::NameValue(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002601 _visitor.visit_meta_name_value(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002602 }
2603 }
2604}
David Tolnay8c81f622018-07-31 23:34:35 -07002605#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayaaadd782018-01-06 22:58:13 -08002606pub fn visit_meta_list<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast MetaList) {
David Tolnay8c81f622018-07-31 23:34:35 -07002607 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002608 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002609 for el in Punctuated::pairs(&_i.nested) {
2610 let it = el.value();
2611 _visitor.visit_nested_meta(it)
2612 }
Nika Layzell27726662017-10-24 23:16:35 -04002613}
David Tolnay8c81f622018-07-31 23:34:35 -07002614#[cfg(any(feature = "full", feature = "derive"))]
2615pub fn visit_meta_name_value<'ast, V: Visit<'ast> + ?Sized>(
2616 _visitor: &mut V,
2617 _i: &'ast MetaNameValue,
2618) {
2619 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002620 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002621 _visitor.visit_lit(&_i.lit);
Nika Layzell27726662017-10-24 23:16:35 -04002622}
David Tolnay8c81f622018-07-31 23:34:35 -07002623#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002624pub fn visit_method_sig<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast MethodSig) {
David Tolnay8c81f622018-07-31 23:34:35 -07002625 if let Some(ref it) = _i.constness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002626 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002627 };
2628 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002629 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002630 };
Yusuke Sasakif00a3ef2018-07-20 22:08:42 +09002631 if let Some(ref it) = _i.asyncness {
2632 tokens_helper(_visitor, &it.span)
2633 };
David Tolnay8c81f622018-07-31 23:34:35 -07002634 if let Some(ref it) = _i.abi {
2635 _visitor.visit_abi(it)
2636 };
2637 _visitor.visit_ident(&_i.ident);
2638 _visitor.visit_fn_decl(&_i.decl);
Nika Layzell27726662017-10-24 23:16:35 -04002639}
David Tolnay8c81f622018-07-31 23:34:35 -07002640#[cfg(any(feature = "full", feature = "derive"))]
2641#[cfg(feature = "full")]
2642pub fn visit_method_turbofish<'ast, V: Visit<'ast> + ?Sized>(
2643 _visitor: &mut V,
2644 _i: &'ast MethodTurbofish,
2645) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002646 tokens_helper(_visitor, &_i.colon2_token.spans);
2647 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002648 for el in Punctuated::pairs(&_i.args) {
2649 let it = el.value();
2650 _visitor.visit_generic_method_argument(it)
2651 }
David Tolnay7ac699c2018-08-24 14:00:58 -04002652 tokens_helper(_visitor, &_i.gt_token.spans);
David Tolnayd60cfec2017-12-29 00:21:38 -05002653}
David Tolnay8c81f622018-07-31 23:34:35 -07002654#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayaaadd782018-01-06 22:58:13 -08002655pub fn visit_nested_meta<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast NestedMeta) {
Nika Layzell27726662017-10-24 23:16:35 -04002656 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002657 NestedMeta::Meta(ref _binding_0) => {
David Tolnayaaadd782018-01-06 22:58:13 -08002658 _visitor.visit_meta(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002659 }
David Tolnay8c81f622018-07-31 23:34:35 -07002660 NestedMeta::Literal(ref _binding_0) => {
David Tolnay4ba63a02017-12-28 15:53:05 -05002661 _visitor.visit_lit(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002662 }
2663 }
2664}
David Tolnay8c81f622018-07-31 23:34:35 -07002665#[cfg(any(feature = "full", feature = "derive"))]
2666pub fn visit_parenthesized_generic_arguments<'ast, V: Visit<'ast> + ?Sized>(
2667 _visitor: &mut V,
2668 _i: &'ast ParenthesizedGenericArguments,
2669) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002670 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002671 for el in Punctuated::pairs(&_i.inputs) {
2672 let it = el.value();
2673 _visitor.visit_type(it)
2674 }
2675 _visitor.visit_return_type(&_i.output);
Nika Layzell27726662017-10-24 23:16:35 -04002676}
David Tolnay8c81f622018-07-31 23:34:35 -07002677#[cfg(any(feature = "full", feature = "derive"))]
2678#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002679pub fn visit_pat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Pat) {
Nika Layzell27726662017-10-24 23:16:35 -04002680 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002681 Pat::Wild(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002682 _visitor.visit_pat_wild(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002683 }
David Tolnay8c81f622018-07-31 23:34:35 -07002684 Pat::Ident(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002685 _visitor.visit_pat_ident(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002686 }
David Tolnay8c81f622018-07-31 23:34:35 -07002687 Pat::Struct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002688 _visitor.visit_pat_struct(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002689 }
David Tolnay8c81f622018-07-31 23:34:35 -07002690 Pat::TupleStruct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002691 _visitor.visit_pat_tuple_struct(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002692 }
David Tolnay8c81f622018-07-31 23:34:35 -07002693 Pat::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002694 _visitor.visit_pat_path(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002695 }
David Tolnay8c81f622018-07-31 23:34:35 -07002696 Pat::Tuple(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002697 _visitor.visit_pat_tuple(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002698 }
David Tolnay8c81f622018-07-31 23:34:35 -07002699 Pat::Box(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002700 _visitor.visit_pat_box(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002701 }
David Tolnay8c81f622018-07-31 23:34:35 -07002702 Pat::Ref(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002703 _visitor.visit_pat_ref(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002704 }
David Tolnay8c81f622018-07-31 23:34:35 -07002705 Pat::Lit(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002706 _visitor.visit_pat_lit(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002707 }
David Tolnay8c81f622018-07-31 23:34:35 -07002708 Pat::Range(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002709 _visitor.visit_pat_range(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002710 }
David Tolnay8c81f622018-07-31 23:34:35 -07002711 Pat::Slice(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002712 _visitor.visit_pat_slice(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002713 }
David Tolnay8c81f622018-07-31 23:34:35 -07002714 Pat::Macro(ref _binding_0) => {
David Tolnay323279a2017-12-29 11:26:32 -05002715 _visitor.visit_pat_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002716 }
David Tolnay8c81f622018-07-31 23:34:35 -07002717 Pat::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002718 _visitor.visit_pat_verbatim(_binding_0);
2719 }
Nika Layzell27726662017-10-24 23:16:35 -04002720 }
2721}
David Tolnay8c81f622018-07-31 23:34:35 -07002722#[cfg(any(feature = "full", feature = "derive"))]
2723#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002724pub fn visit_pat_box<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatBox) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002725 tokens_helper(_visitor, &_i.box_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002726 _visitor.visit_pat(&*_i.pat);
Nika Layzell27726662017-10-24 23:16:35 -04002727}
David Tolnay8c81f622018-07-31 23:34:35 -07002728#[cfg(any(feature = "full", feature = "derive"))]
2729#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002730pub fn visit_pat_ident<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatIdent) {
David Tolnay8c81f622018-07-31 23:34:35 -07002731 if let Some(ref it) = _i.by_ref {
David Tolnay7ac699c2018-08-24 14:00:58 -04002732 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002733 };
2734 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04002735 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002736 };
2737 _visitor.visit_ident(&_i.ident);
2738 if let Some(ref it) = _i.subpat {
David Tolnay7ac699c2018-08-24 14:00:58 -04002739 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002740 _visitor.visit_pat(&*(it).1);
2741 };
Nika Layzell27726662017-10-24 23:16:35 -04002742}
David Tolnay8c81f622018-07-31 23:34:35 -07002743#[cfg(any(feature = "full", feature = "derive"))]
2744#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002745pub fn visit_pat_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatLit) {
David Tolnay8c81f622018-07-31 23:34:35 -07002746 _visitor.visit_expr(&*_i.expr);
Nika Layzell27726662017-10-24 23:16:35 -04002747}
David Tolnay8c81f622018-07-31 23:34:35 -07002748#[cfg(any(feature = "full", feature = "derive"))]
2749#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002750pub fn visit_pat_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatMacro) {
David Tolnay8c81f622018-07-31 23:34:35 -07002751 _visitor.visit_macro(&_i.mac);
David Tolnay323279a2017-12-29 11:26:32 -05002752}
David Tolnay8c81f622018-07-31 23:34:35 -07002753#[cfg(any(feature = "full", feature = "derive"))]
2754#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002755pub fn visit_pat_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatPath) {
David Tolnay8c81f622018-07-31 23:34:35 -07002756 if let Some(ref it) = _i.qself {
2757 _visitor.visit_qself(it)
2758 };
2759 _visitor.visit_path(&_i.path);
Nika Layzell27726662017-10-24 23:16:35 -04002760}
David Tolnay8c81f622018-07-31 23:34:35 -07002761#[cfg(any(feature = "full", feature = "derive"))]
2762#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002763pub fn visit_pat_range<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatRange) {
David Tolnay8c81f622018-07-31 23:34:35 -07002764 _visitor.visit_expr(&*_i.lo);
2765 _visitor.visit_range_limits(&_i.limits);
2766 _visitor.visit_expr(&*_i.hi);
Nika Layzell27726662017-10-24 23:16:35 -04002767}
David Tolnay8c81f622018-07-31 23:34:35 -07002768#[cfg(any(feature = "full", feature = "derive"))]
2769#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002770pub fn visit_pat_ref<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatRef) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002771 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002772 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04002773 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002774 };
2775 _visitor.visit_pat(&*_i.pat);
Nika Layzell27726662017-10-24 23:16:35 -04002776}
David Tolnay8c81f622018-07-31 23:34:35 -07002777#[cfg(any(feature = "full", feature = "derive"))]
2778#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002779pub fn visit_pat_slice<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatSlice) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002780 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002781 for el in Punctuated::pairs(&_i.front) {
2782 let it = el.value();
2783 _visitor.visit_pat(it)
2784 }
2785 if let Some(ref it) = _i.middle {
2786 _visitor.visit_pat(&**it)
2787 };
2788 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002789 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002790 };
2791 if let Some(ref it) = _i.comma_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002792 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002793 };
2794 for el in Punctuated::pairs(&_i.back) {
2795 let it = el.value();
2796 _visitor.visit_pat(it)
2797 }
Nika Layzell27726662017-10-24 23:16:35 -04002798}
David Tolnay8c81f622018-07-31 23:34:35 -07002799#[cfg(any(feature = "full", feature = "derive"))]
2800#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002801pub fn visit_pat_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatStruct) {
David Tolnay8c81f622018-07-31 23:34:35 -07002802 _visitor.visit_path(&_i.path);
David Tolnay7ac699c2018-08-24 14:00:58 -04002803 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002804 for el in Punctuated::pairs(&_i.fields) {
2805 let it = el.value();
2806 _visitor.visit_field_pat(it)
2807 }
2808 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002809 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002810 };
Nika Layzell27726662017-10-24 23:16:35 -04002811}
David Tolnay8c81f622018-07-31 23:34:35 -07002812#[cfg(any(feature = "full", feature = "derive"))]
2813#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002814pub fn visit_pat_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatTuple) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002815 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002816 for el in Punctuated::pairs(&_i.front) {
2817 let it = el.value();
2818 _visitor.visit_pat(it)
2819 }
2820 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002821 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002822 };
2823 if let Some(ref it) = _i.comma_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002824 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002825 };
2826 for el in Punctuated::pairs(&_i.back) {
2827 let it = el.value();
2828 _visitor.visit_pat(it)
2829 }
Nika Layzell27726662017-10-24 23:16:35 -04002830}
David Tolnay8c81f622018-07-31 23:34:35 -07002831#[cfg(any(feature = "full", feature = "derive"))]
2832#[cfg(feature = "full")]
2833pub fn visit_pat_tuple_struct<'ast, V: Visit<'ast> + ?Sized>(
2834 _visitor: &mut V,
2835 _i: &'ast PatTupleStruct,
2836) {
2837 _visitor.visit_path(&_i.path);
2838 _visitor.visit_pat_tuple(&_i.pat);
Nika Layzell27726662017-10-24 23:16:35 -04002839}
David Tolnay8c81f622018-07-31 23:34:35 -07002840#[cfg(any(feature = "full", feature = "derive"))]
2841#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002842pub fn visit_pat_verbatim<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatVerbatim) {
David Tolnay6af48992018-08-01 11:16:28 -07002843 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05002844}
David Tolnay8c81f622018-07-31 23:34:35 -07002845#[cfg(any(feature = "full", feature = "derive"))]
2846#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002847pub fn visit_pat_wild<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatWild) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002848 tokens_helper(_visitor, &_i.underscore_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002849}
David Tolnay8c81f622018-07-31 23:34:35 -07002850#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002851pub fn visit_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Path) {
David Tolnay8c81f622018-07-31 23:34:35 -07002852 if let Some(ref it) = _i.leading_colon {
David Tolnay7ac699c2018-08-24 14:00:58 -04002853 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002854 };
2855 for el in Punctuated::pairs(&_i.segments) {
2856 let it = el.value();
2857 _visitor.visit_path_segment(it)
2858 }
Nika Layzell27726662017-10-24 23:16:35 -04002859}
David Tolnay8c81f622018-07-31 23:34:35 -07002860#[cfg(any(feature = "full", feature = "derive"))]
2861pub fn visit_path_arguments<'ast, V: Visit<'ast> + ?Sized>(
2862 _visitor: &mut V,
2863 _i: &'ast PathArguments,
2864) {
Nika Layzellc08227a2017-12-04 16:30:17 -05002865 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002866 PathArguments::None => {}
2867 PathArguments::AngleBracketed(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002868 _visitor.visit_angle_bracketed_generic_arguments(_binding_0);
Nika Layzellc08227a2017-12-04 16:30:17 -05002869 }
David Tolnay8c81f622018-07-31 23:34:35 -07002870 PathArguments::Parenthesized(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002871 _visitor.visit_parenthesized_generic_arguments(_binding_0);
Nika Layzellc08227a2017-12-04 16:30:17 -05002872 }
2873 }
2874}
David Tolnay8c81f622018-07-31 23:34:35 -07002875#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002876pub fn visit_path_segment<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PathSegment) {
David Tolnay8c81f622018-07-31 23:34:35 -07002877 _visitor.visit_ident(&_i.ident);
2878 _visitor.visit_path_arguments(&_i.arguments);
Nika Layzell27726662017-10-24 23:16:35 -04002879}
David Tolnay8c81f622018-07-31 23:34:35 -07002880#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002881pub fn visit_predicate_eq<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PredicateEq) {
David Tolnay8c81f622018-07-31 23:34:35 -07002882 _visitor.visit_type(&_i.lhs_ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002883 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002884 _visitor.visit_type(&_i.rhs_ty);
David Tolnayd4add852018-01-01 20:13:24 -08002885}
David Tolnay8c81f622018-07-31 23:34:35 -07002886#[cfg(any(feature = "full", feature = "derive"))]
2887pub fn visit_predicate_lifetime<'ast, V: Visit<'ast> + ?Sized>(
2888 _visitor: &mut V,
2889 _i: &'ast PredicateLifetime,
2890) {
2891 _visitor.visit_lifetime(&_i.lifetime);
2892 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002893 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002894 };
2895 for el in Punctuated::pairs(&_i.bounds) {
2896 let it = el.value();
2897 _visitor.visit_lifetime(it)
2898 }
David Tolnayd4add852018-01-01 20:13:24 -08002899}
David Tolnay8c81f622018-07-31 23:34:35 -07002900#[cfg(any(feature = "full", feature = "derive"))]
2901pub fn visit_predicate_type<'ast, V: Visit<'ast> + ?Sized>(
2902 _visitor: &mut V,
2903 _i: &'ast PredicateType,
2904) {
2905 if let Some(ref it) = _i.lifetimes {
2906 _visitor.visit_bound_lifetimes(it)
2907 };
2908 _visitor.visit_type(&_i.bounded_ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002909 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002910 for el in Punctuated::pairs(&_i.bounds) {
2911 let it = el.value();
2912 _visitor.visit_type_param_bound(it)
2913 }
David Tolnayd4add852018-01-01 20:13:24 -08002914}
David Tolnay8c81f622018-07-31 23:34:35 -07002915#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002916pub fn visit_qself<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast QSelf) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002917 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002918 _visitor.visit_type(&*_i.ty);
David Tolnay6af48992018-08-01 11:16:28 -07002919 skip!(_i.position);
David Tolnay8c81f622018-07-31 23:34:35 -07002920 if let Some(ref it) = _i.as_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002921 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002922 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002923 tokens_helper(_visitor, &_i.gt_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002924}
David Tolnay8c81f622018-07-31 23:34:35 -07002925#[cfg(any(feature = "full", feature = "derive"))]
2926#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002927pub fn visit_range_limits<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast RangeLimits) {
Nika Layzell27726662017-10-24 23:16:35 -04002928 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002929 RangeLimits::HalfOpen(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 }
David Tolnay8c81f622018-07-31 23:34:35 -07002932 RangeLimits::Closed(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002933 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002934 }
2935 }
2936}
David Tolnay8c81f622018-07-31 23:34:35 -07002937#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002938pub fn visit_return_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ReturnType) {
David Tolnayf93b90d2017-11-11 19:21:26 -08002939 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002940 ReturnType::Default => {}
2941 ReturnType::Type(ref _binding_0, ref _binding_1) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002942 tokens_helper(_visitor, &_binding_0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002943 _visitor.visit_type(&**_binding_1);
David Tolnayf93b90d2017-11-11 19:21:26 -08002944 }
2945 }
2946}
David Tolnay8c81f622018-07-31 23:34:35 -07002947pub fn visit_span<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Span) {}
2948#[cfg(any(feature = "full", feature = "derive"))]
2949#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002950pub fn visit_stmt<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Stmt) {
Nika Layzell27726662017-10-24 23:16:35 -04002951 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002952 Stmt::Local(ref _binding_0) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08002953 _visitor.visit_local(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002954 }
David Tolnay8c81f622018-07-31 23:34:35 -07002955 Stmt::Item(ref _binding_0) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08002956 _visitor.visit_item(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002957 }
David Tolnay8c81f622018-07-31 23:34:35 -07002958 Stmt::Expr(ref _binding_0) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08002959 _visitor.visit_expr(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002960 }
David Tolnay8c81f622018-07-31 23:34:35 -07002961 Stmt::Semi(ref _binding_0, ref _binding_1) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08002962 _visitor.visit_expr(_binding_0);
David Tolnay7ac699c2018-08-24 14:00:58 -04002963 tokens_helper(_visitor, &_binding_1.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002964 }
Nika Layzell27726662017-10-24 23:16:35 -04002965 }
2966}
David Tolnay8c81f622018-07-31 23:34:35 -07002967#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002968pub fn visit_trait_bound<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TraitBound) {
David Tolnay8c81f622018-07-31 23:34:35 -07002969 if let Some(ref it) = _i.paren_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002970 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002971 };
2972 _visitor.visit_trait_bound_modifier(&_i.modifier);
2973 if let Some(ref it) = _i.lifetimes {
2974 _visitor.visit_bound_lifetimes(it)
2975 };
2976 _visitor.visit_path(&_i.path);
David Tolnay40fb8ce2018-01-02 10:53:46 -08002977}
David Tolnay8c81f622018-07-31 23:34:35 -07002978#[cfg(any(feature = "full", feature = "derive"))]
2979pub fn visit_trait_bound_modifier<'ast, V: Visit<'ast> + ?Sized>(
2980 _visitor: &mut V,
2981 _i: &'ast TraitBoundModifier,
2982) {
Nika Layzell27726662017-10-24 23:16:35 -04002983 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002984 TraitBoundModifier::None => {}
2985 TraitBoundModifier::Maybe(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002986 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002987 }
2988 }
2989}
David Tolnay8c81f622018-07-31 23:34:35 -07002990#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002991pub fn visit_trait_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TraitItem) {
Nika Layzell27726662017-10-24 23:16:35 -04002992 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002993 TraitItem::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002994 _visitor.visit_trait_item_const(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002995 }
David Tolnay8c81f622018-07-31 23:34:35 -07002996 TraitItem::Method(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002997 _visitor.visit_trait_item_method(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002998 }
David Tolnay8c81f622018-07-31 23:34:35 -07002999 TraitItem::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003000 _visitor.visit_trait_item_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003001 }
David Tolnay8c81f622018-07-31 23:34:35 -07003002 TraitItem::Macro(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003003 _visitor.visit_trait_item_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003004 }
David Tolnay8c81f622018-07-31 23:34:35 -07003005 TraitItem::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05003006 _visitor.visit_trait_item_verbatim(_binding_0);
3007 }
Nika Layzell27726662017-10-24 23:16:35 -04003008 }
3009}
David Tolnay8c81f622018-07-31 23:34:35 -07003010#[cfg(feature = "full")]
3011pub fn visit_trait_item_const<'ast, V: Visit<'ast> + ?Sized>(
3012 _visitor: &mut V,
3013 _i: &'ast TraitItemConst,
3014) {
3015 for it in &_i.attrs {
3016 _visitor.visit_attribute(it)
3017 }
David Tolnay7ac699c2018-08-24 14:00:58 -04003018 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003019 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04003020 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003021 _visitor.visit_type(&_i.ty);
3022 if let Some(ref it) = _i.default {
David Tolnay7ac699c2018-08-24 14:00:58 -04003023 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003024 _visitor.visit_expr(&(it).1);
3025 };
David Tolnay7ac699c2018-08-24 14:00:58 -04003026 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnayda705bd2017-11-10 21:58:05 -08003027}
David Tolnay8c81f622018-07-31 23:34:35 -07003028#[cfg(feature = "full")]
3029pub fn visit_trait_item_macro<'ast, V: Visit<'ast> + ?Sized>(
3030 _visitor: &mut V,
3031 _i: &'ast TraitItemMacro,
3032) {
3033 for it in &_i.attrs {
3034 _visitor.visit_attribute(it)
3035 }
3036 _visitor.visit_macro(&_i.mac);
3037 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003038 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003039 };
David Tolnayda705bd2017-11-10 21:58:05 -08003040}
David Tolnay8c81f622018-07-31 23:34:35 -07003041#[cfg(feature = "full")]
3042pub fn visit_trait_item_method<'ast, V: Visit<'ast> + ?Sized>(
3043 _visitor: &mut V,
3044 _i: &'ast TraitItemMethod,
3045) {
3046 for it in &_i.attrs {
3047 _visitor.visit_attribute(it)
3048 }
3049 _visitor.visit_method_sig(&_i.sig);
3050 if let Some(ref it) = _i.default {
3051 _visitor.visit_block(it)
3052 };
3053 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003054 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003055 };
Nika Layzell27726662017-10-24 23:16:35 -04003056}
David Tolnay8c81f622018-07-31 23:34:35 -07003057#[cfg(feature = "full")]
3058pub fn visit_trait_item_type<'ast, V: Visit<'ast> + ?Sized>(
3059 _visitor: &mut V,
3060 _i: &'ast TraitItemType,
3061) {
3062 for it in &_i.attrs {
3063 _visitor.visit_attribute(it)
3064 }
David Tolnay7ac699c2018-08-24 14:00:58 -04003065 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003066 _visitor.visit_ident(&_i.ident);
3067 _visitor.visit_generics(&_i.generics);
3068 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003069 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003070 };
3071 for el in Punctuated::pairs(&_i.bounds) {
3072 let it = el.value();
3073 _visitor.visit_type_param_bound(it)
3074 }
3075 if let Some(ref it) = _i.default {
David Tolnay7ac699c2018-08-24 14:00:58 -04003076 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003077 _visitor.visit_type(&(it).1);
3078 };
David Tolnay7ac699c2018-08-24 14:00:58 -04003079 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003080}
David Tolnay8c81f622018-07-31 23:34:35 -07003081#[cfg(feature = "full")]
3082pub fn visit_trait_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
3083 _visitor: &mut V,
3084 _i: &'ast TraitItemVerbatim,
3085) {
David Tolnay6af48992018-08-01 11:16:28 -07003086 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05003087}
David Tolnay8c81f622018-07-31 23:34:35 -07003088#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003089pub fn visit_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Type) {
Nika Layzell27726662017-10-24 23:16:35 -04003090 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003091 Type::Slice(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003092 _visitor.visit_type_slice(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003093 }
David Tolnay8c81f622018-07-31 23:34:35 -07003094 Type::Array(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003095 _visitor.visit_type_array(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003096 }
David Tolnay8c81f622018-07-31 23:34:35 -07003097 Type::Ptr(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003098 _visitor.visit_type_ptr(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003099 }
David Tolnay8c81f622018-07-31 23:34:35 -07003100 Type::Reference(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003101 _visitor.visit_type_reference(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003102 }
David Tolnay8c81f622018-07-31 23:34:35 -07003103 Type::BareFn(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003104 _visitor.visit_type_bare_fn(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003105 }
David Tolnay8c81f622018-07-31 23:34:35 -07003106 Type::Never(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003107 _visitor.visit_type_never(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003108 }
David Tolnay8c81f622018-07-31 23:34:35 -07003109 Type::Tuple(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003110 _visitor.visit_type_tuple(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003111 }
David Tolnay8c81f622018-07-31 23:34:35 -07003112 Type::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003113 _visitor.visit_type_path(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003114 }
David Tolnay8c81f622018-07-31 23:34:35 -07003115 Type::TraitObject(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003116 _visitor.visit_type_trait_object(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003117 }
David Tolnay8c81f622018-07-31 23:34:35 -07003118 Type::ImplTrait(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003119 _visitor.visit_type_impl_trait(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003120 }
David Tolnay8c81f622018-07-31 23:34:35 -07003121 Type::Paren(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003122 _visitor.visit_type_paren(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003123 }
David Tolnay8c81f622018-07-31 23:34:35 -07003124 Type::Group(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003125 _visitor.visit_type_group(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003126 }
David Tolnay8c81f622018-07-31 23:34:35 -07003127 Type::Infer(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003128 _visitor.visit_type_infer(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003129 }
David Tolnay8c81f622018-07-31 23:34:35 -07003130 Type::Macro(ref _binding_0) => {
David Tolnay323279a2017-12-29 11:26:32 -05003131 _visitor.visit_type_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003132 }
David Tolnay8c81f622018-07-31 23:34:35 -07003133 Type::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05003134 _visitor.visit_type_verbatim(_binding_0);
3135 }
Nika Layzell27726662017-10-24 23:16:35 -04003136 }
3137}
David Tolnay8c81f622018-07-31 23:34:35 -07003138#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003139pub fn visit_type_array<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeArray) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003140 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003141 _visitor.visit_type(&*_i.elem);
David Tolnay7ac699c2018-08-24 14:00:58 -04003142 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003143 _visitor.visit_expr(&_i.len);
Nika Layzell27726662017-10-24 23:16:35 -04003144}
David Tolnay8c81f622018-07-31 23:34:35 -07003145#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003146pub fn visit_type_bare_fn<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeBareFn) {
David Tolnay8c81f622018-07-31 23:34:35 -07003147 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04003148 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003149 };
3150 if let Some(ref it) = _i.abi {
3151 _visitor.visit_abi(it)
3152 };
David Tolnay7ac699c2018-08-24 14:00:58 -04003153 tokens_helper(_visitor, &_i.fn_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003154 if let Some(ref it) = _i.lifetimes {
3155 _visitor.visit_bound_lifetimes(it)
3156 };
David Tolnay7ac699c2018-08-24 14:00:58 -04003157 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003158 for el in Punctuated::pairs(&_i.inputs) {
3159 let it = el.value();
3160 _visitor.visit_bare_fn_arg(it)
3161 }
3162 if let Some(ref it) = _i.variadic {
David Tolnay7ac699c2018-08-24 14:00:58 -04003163 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003164 };
3165 _visitor.visit_return_type(&_i.output);
Nika Layzell27726662017-10-24 23:16:35 -04003166}
David Tolnay8c81f622018-07-31 23:34:35 -07003167#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003168pub fn visit_type_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeGroup) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003169 tokens_helper(_visitor, &_i.group_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003170 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003171}
David Tolnay8c81f622018-07-31 23:34:35 -07003172#[cfg(any(feature = "full", feature = "derive"))]
3173pub fn visit_type_impl_trait<'ast, V: Visit<'ast> + ?Sized>(
3174 _visitor: &mut V,
3175 _i: &'ast TypeImplTrait,
3176) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003177 tokens_helper(_visitor, &_i.impl_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003178 for el in Punctuated::pairs(&_i.bounds) {
3179 let it = el.value();
3180 _visitor.visit_type_param_bound(it)
3181 }
Nika Layzell27726662017-10-24 23:16:35 -04003182}
David Tolnay8c81f622018-07-31 23:34:35 -07003183#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003184pub fn visit_type_infer<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeInfer) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003185 tokens_helper(_visitor, &_i.underscore_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003186}
David Tolnay8c81f622018-07-31 23:34:35 -07003187#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003188pub fn visit_type_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeMacro) {
David Tolnay8c81f622018-07-31 23:34:35 -07003189 _visitor.visit_macro(&_i.mac);
David Tolnay323279a2017-12-29 11:26:32 -05003190}
David Tolnay8c81f622018-07-31 23:34:35 -07003191#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003192pub fn visit_type_never<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeNever) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003193 tokens_helper(_visitor, &_i.bang_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003194}
David Tolnay8c81f622018-07-31 23:34:35 -07003195#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003196pub fn visit_type_param<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeParam) {
David Tolnay8c81f622018-07-31 23:34:35 -07003197 for it in &_i.attrs {
3198 _visitor.visit_attribute(it)
3199 }
3200 _visitor.visit_ident(&_i.ident);
3201 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003202 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003203 };
3204 for el in Punctuated::pairs(&_i.bounds) {
3205 let it = el.value();
3206 _visitor.visit_type_param_bound(it)
3207 }
3208 if let Some(ref it) = _i.eq_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003209 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003210 };
3211 if let Some(ref it) = _i.default {
3212 _visitor.visit_type(it)
3213 };
Nika Layzell27726662017-10-24 23:16:35 -04003214}
David Tolnay8c81f622018-07-31 23:34:35 -07003215#[cfg(any(feature = "full", feature = "derive"))]
3216pub fn visit_type_param_bound<'ast, V: Visit<'ast> + ?Sized>(
3217 _visitor: &mut V,
3218 _i: &'ast TypeParamBound,
3219) {
Nika Layzell27726662017-10-24 23:16:35 -04003220 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003221 TypeParamBound::Trait(ref _binding_0) => {
David Tolnay40fb8ce2018-01-02 10:53:46 -08003222 _visitor.visit_trait_bound(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003223 }
David Tolnay8c81f622018-07-31 23:34:35 -07003224 TypeParamBound::Lifetime(ref _binding_0) => {
David Tolnay4ba63a02017-12-28 15:53:05 -05003225 _visitor.visit_lifetime(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003226 }
3227 }
3228}
David Tolnay8c81f622018-07-31 23:34:35 -07003229#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003230pub fn visit_type_paren<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeParen) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003231 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003232 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003233}
David Tolnay8c81f622018-07-31 23:34:35 -07003234#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003235pub fn visit_type_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypePath) {
David Tolnay8c81f622018-07-31 23:34:35 -07003236 if let Some(ref it) = _i.qself {
3237 _visitor.visit_qself(it)
3238 };
3239 _visitor.visit_path(&_i.path);
Nika Layzell27726662017-10-24 23:16:35 -04003240}
David Tolnay8c81f622018-07-31 23:34:35 -07003241#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003242pub fn visit_type_ptr<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypePtr) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003243 tokens_helper(_visitor, &_i.star_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003244 if let Some(ref it) = _i.const_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003245 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003246 };
3247 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04003248 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003249 };
3250 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003251}
David Tolnay8c81f622018-07-31 23:34:35 -07003252#[cfg(any(feature = "full", feature = "derive"))]
3253pub fn visit_type_reference<'ast, V: Visit<'ast> + ?Sized>(
3254 _visitor: &mut V,
3255 _i: &'ast TypeReference,
3256) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003257 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003258 if let Some(ref it) = _i.lifetime {
3259 _visitor.visit_lifetime(it)
3260 };
3261 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04003262 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003263 };
3264 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003265}
David Tolnay8c81f622018-07-31 23:34:35 -07003266#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003267pub fn visit_type_slice<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeSlice) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003268 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003269 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003270}
David Tolnay8c81f622018-07-31 23:34:35 -07003271#[cfg(any(feature = "full", feature = "derive"))]
3272pub fn visit_type_trait_object<'ast, V: Visit<'ast> + ?Sized>(
3273 _visitor: &mut V,
3274 _i: &'ast TypeTraitObject,
3275) {
3276 if let Some(ref it) = _i.dyn_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003277 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003278 };
3279 for el in Punctuated::pairs(&_i.bounds) {
3280 let it = el.value();
3281 _visitor.visit_type_param_bound(it)
3282 }
Nika Layzell27726662017-10-24 23:16:35 -04003283}
David Tolnay8c81f622018-07-31 23:34:35 -07003284#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003285pub fn visit_type_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeTuple) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003286 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003287 for el in Punctuated::pairs(&_i.elems) {
3288 let it = el.value();
3289 _visitor.visit_type(it)
3290 }
Nika Layzell27726662017-10-24 23:16:35 -04003291}
David Tolnay8c81f622018-07-31 23:34:35 -07003292#[cfg(any(feature = "full", feature = "derive"))]
3293pub fn visit_type_verbatim<'ast, V: Visit<'ast> + ?Sized>(
3294 _visitor: &mut V,
3295 _i: &'ast TypeVerbatim,
3296) {
David Tolnay6af48992018-08-01 11:16:28 -07003297 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05003298}
David Tolnay8c81f622018-07-31 23:34:35 -07003299#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003300pub fn visit_un_op<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UnOp) {
Nika Layzell27726662017-10-24 23:16:35 -04003301 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003302 UnOp::Deref(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::Not(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 }
David Tolnay8c81f622018-07-31 23:34:35 -07003308 UnOp::Neg(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003309 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003310 }
3311 }
3312}
David Tolnay8c81f622018-07-31 23:34:35 -07003313#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003314pub fn visit_use_glob<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseGlob) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003315 tokens_helper(_visitor, &_i.star_token.spans);
David Tolnay5f332a92017-12-26 00:42:45 -05003316}
David Tolnay8c81f622018-07-31 23:34:35 -07003317#[cfg(feature = "full")]
David Tolnayd97a7d22018-03-31 19:17:01 +02003318pub fn visit_use_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseGroup) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003319 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003320 for el in Punctuated::pairs(&_i.items) {
3321 let it = el.value();
3322 _visitor.visit_use_tree(it)
3323 }
David Tolnay5f332a92017-12-26 00:42:45 -05003324}
David Tolnay8c81f622018-07-31 23:34:35 -07003325#[cfg(feature = "full")]
David Tolnayd97a7d22018-03-31 19:17:01 +02003326pub fn visit_use_name<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseName) {
David Tolnay8c81f622018-07-31 23:34:35 -07003327 _visitor.visit_ident(&_i.ident);
David Tolnayd97a7d22018-03-31 19:17:01 +02003328}
David Tolnay8c81f622018-07-31 23:34:35 -07003329#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003330pub fn visit_use_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UsePath) {
David Tolnay8c81f622018-07-31 23:34:35 -07003331 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04003332 tokens_helper(_visitor, &_i.colon2_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003333 _visitor.visit_use_tree(&*_i.tree);
David Tolnayd97a7d22018-03-31 19:17:01 +02003334}
David Tolnay8c81f622018-07-31 23:34:35 -07003335#[cfg(feature = "full")]
David Tolnayd97a7d22018-03-31 19:17:01 +02003336pub fn visit_use_rename<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseRename) {
David Tolnay8c81f622018-07-31 23:34:35 -07003337 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04003338 tokens_helper(_visitor, &_i.as_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003339 _visitor.visit_ident(&_i.rename);
David Tolnay5f332a92017-12-26 00:42:45 -05003340}
David Tolnay8c81f622018-07-31 23:34:35 -07003341#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003342pub fn visit_use_tree<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseTree) {
David Tolnay5f332a92017-12-26 00:42:45 -05003343 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003344 UseTree::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003345 _visitor.visit_use_path(_binding_0);
David Tolnay5f332a92017-12-26 00:42:45 -05003346 }
David Tolnay8c81f622018-07-31 23:34:35 -07003347 UseTree::Name(ref _binding_0) => {
David Tolnayd97a7d22018-03-31 19:17:01 +02003348 _visitor.visit_use_name(_binding_0);
3349 }
David Tolnay8c81f622018-07-31 23:34:35 -07003350 UseTree::Rename(ref _binding_0) => {
David Tolnayd97a7d22018-03-31 19:17:01 +02003351 _visitor.visit_use_rename(_binding_0);
3352 }
David Tolnay8c81f622018-07-31 23:34:35 -07003353 UseTree::Glob(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003354 _visitor.visit_use_glob(_binding_0);
David Tolnay5f332a92017-12-26 00:42:45 -05003355 }
David Tolnay8c81f622018-07-31 23:34:35 -07003356 UseTree::Group(ref _binding_0) => {
David Tolnayd97a7d22018-03-31 19:17:01 +02003357 _visitor.visit_use_group(_binding_0);
David Tolnay5f332a92017-12-26 00:42:45 -05003358 }
3359 }
3360}
David Tolnay8c81f622018-07-31 23:34:35 -07003361#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003362pub fn visit_variant<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Variant) {
David Tolnay8c81f622018-07-31 23:34:35 -07003363 for it in &_i.attrs {
3364 _visitor.visit_attribute(it)
3365 }
3366 _visitor.visit_ident(&_i.ident);
3367 _visitor.visit_fields(&_i.fields);
3368 if let Some(ref it) = _i.discriminant {
David Tolnay7ac699c2018-08-24 14:00:58 -04003369 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003370 _visitor.visit_expr(&(it).1);
3371 };
Nika Layzell27726662017-10-24 23:16:35 -04003372}
David Tolnay8c81f622018-07-31 23:34:35 -07003373#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003374pub fn visit_vis_crate<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast VisCrate) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003375 tokens_helper(_visitor, &_i.crate_token.span);
Nika Layzell27726662017-10-24 23:16:35 -04003376}
David Tolnay8c81f622018-07-31 23:34:35 -07003377#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003378pub fn visit_vis_public<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast VisPublic) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003379 tokens_helper(_visitor, &_i.pub_token.span);
Nika Layzell27726662017-10-24 23:16:35 -04003380}
David Tolnay8c81f622018-07-31 23:34:35 -07003381#[cfg(any(feature = "full", feature = "derive"))]
3382pub fn visit_vis_restricted<'ast, V: Visit<'ast> + ?Sized>(
3383 _visitor: &mut V,
3384 _i: &'ast VisRestricted,
3385) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003386 tokens_helper(_visitor, &_i.pub_token.span);
3387 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003388 if let Some(ref it) = _i.in_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003389 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003390 };
3391 _visitor.visit_path(&*_i.path);
Nika Layzell27726662017-10-24 23:16:35 -04003392}
David Tolnay8c81f622018-07-31 23:34:35 -07003393#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003394pub fn visit_visibility<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Visibility) {
Nika Layzell27726662017-10-24 23:16:35 -04003395 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003396 Visibility::Public(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003397 _visitor.visit_vis_public(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003398 }
David Tolnay8c81f622018-07-31 23:34:35 -07003399 Visibility::Crate(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003400 _visitor.visit_vis_crate(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003401 }
David Tolnay8c81f622018-07-31 23:34:35 -07003402 Visibility::Restricted(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003403 _visitor.visit_vis_restricted(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003404 }
David Tolnay8c81f622018-07-31 23:34:35 -07003405 Visibility::Inherited => {}
Nika Layzell27726662017-10-24 23:16:35 -04003406 }
3407}
David Tolnay8c81f622018-07-31 23:34:35 -07003408#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003409pub fn visit_where_clause<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast WhereClause) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003410 tokens_helper(_visitor, &_i.where_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003411 for el in Punctuated::pairs(&_i.predicates) {
3412 let it = el.value();
3413 _visitor.visit_where_predicate(it)
3414 }
Nika Layzell27726662017-10-24 23:16:35 -04003415}
David Tolnay8c81f622018-07-31 23:34:35 -07003416#[cfg(any(feature = "full", feature = "derive"))]
3417pub fn visit_where_predicate<'ast, V: Visit<'ast> + ?Sized>(
3418 _visitor: &mut V,
3419 _i: &'ast WherePredicate,
3420) {
Nika Layzell27726662017-10-24 23:16:35 -04003421 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003422 WherePredicate::Type(ref _binding_0) => {
David Tolnayd4add852018-01-01 20:13:24 -08003423 _visitor.visit_predicate_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003424 }
David Tolnay8c81f622018-07-31 23:34:35 -07003425 WherePredicate::Lifetime(ref _binding_0) => {
David Tolnayd4add852018-01-01 20:13:24 -08003426 _visitor.visit_predicate_lifetime(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003427 }
David Tolnay8c81f622018-07-31 23:34:35 -07003428 WherePredicate::Eq(ref _binding_0) => {
David Tolnayd4add852018-01-01 20:13:24 -08003429 _visitor.visit_predicate_eq(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003430 }
3431 }
3432}