blob: 9af098bb22fee1b1c5d6bf24164f9f4d51eef3d7 [file] [log] [blame]
Nika Layzell27726662017-10-24 23:16:35 -04001// THIS FILE IS AUTOMATICALLY GENERATED; DO NOT EDIT
2
David Tolnayc1f55792018-11-21 01:39:42 -08003#![cfg_attr(feature = "cargo-clippy", allow(trivially_copy_pass_by_ref))]
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}
David Tolnay53160352019-02-07 23:36:17 +010026/// Syntax tree traversal to walk a shared borrow of a syntax tree.
27///
28/// See the [module documentation] for details.
29///
30/// [module documentation]: index.html
31///
32/// *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 }
David Tolnay8c81f622018-07-31 23:34:35 -070054 #[cfg(feature = "full")]
55 fn visit_arm(&mut self, i: &'ast Arm) {
56 visit_arm(self, i)
57 }
58 #[cfg(any(feature = "full", feature = "derive"))]
59 fn visit_attr_style(&mut self, i: &'ast AttrStyle) {
60 visit_attr_style(self, i)
61 }
62 #[cfg(any(feature = "full", feature = "derive"))]
63 fn visit_attribute(&mut self, i: &'ast Attribute) {
64 visit_attribute(self, i)
65 }
66 #[cfg(any(feature = "full", feature = "derive"))]
67 fn visit_bare_fn_arg(&mut self, i: &'ast BareFnArg) {
68 visit_bare_fn_arg(self, i)
69 }
70 #[cfg(any(feature = "full", feature = "derive"))]
71 fn visit_bare_fn_arg_name(&mut self, i: &'ast BareFnArgName) {
72 visit_bare_fn_arg_name(self, i)
73 }
74 #[cfg(any(feature = "full", feature = "derive"))]
75 fn visit_bin_op(&mut self, i: &'ast BinOp) {
76 visit_bin_op(self, i)
77 }
78 #[cfg(any(feature = "full", feature = "derive"))]
79 fn visit_binding(&mut self, i: &'ast Binding) {
80 visit_binding(self, i)
81 }
David Tolnay8c81f622018-07-31 23:34:35 -070082 #[cfg(feature = "full")]
83 fn visit_block(&mut self, i: &'ast Block) {
84 visit_block(self, i)
85 }
86 #[cfg(any(feature = "full", feature = "derive"))]
87 fn visit_bound_lifetimes(&mut self, i: &'ast BoundLifetimes) {
88 visit_bound_lifetimes(self, i)
89 }
90 #[cfg(any(feature = "full", feature = "derive"))]
91 fn visit_const_param(&mut self, i: &'ast ConstParam) {
92 visit_const_param(self, i)
93 }
David Tolnay9d0882a2018-09-01 19:49:14 -070094 #[cfg(any(feature = "full", feature = "derive"))]
95 fn visit_constraint(&mut self, i: &'ast Constraint) {
96 visit_constraint(self, i)
97 }
David Tolnay8c81f622018-07-31 23:34:35 -070098 #[cfg(feature = "derive")]
99 fn visit_data(&mut self, i: &'ast Data) {
100 visit_data(self, i)
101 }
102 #[cfg(feature = "derive")]
103 fn visit_data_enum(&mut self, i: &'ast DataEnum) {
104 visit_data_enum(self, i)
105 }
106 #[cfg(feature = "derive")]
107 fn visit_data_struct(&mut self, i: &'ast DataStruct) {
108 visit_data_struct(self, i)
109 }
110 #[cfg(feature = "derive")]
111 fn visit_data_union(&mut self, i: &'ast DataUnion) {
112 visit_data_union(self, i)
113 }
114 #[cfg(feature = "derive")]
115 fn visit_derive_input(&mut self, i: &'ast DeriveInput) {
116 visit_derive_input(self, i)
117 }
118 #[cfg(any(feature = "full", feature = "derive"))]
119 fn visit_expr(&mut self, i: &'ast Expr) {
120 visit_expr(self, i)
121 }
122 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700123 fn visit_expr_array(&mut self, i: &'ast ExprArray) {
124 visit_expr_array(self, i)
125 }
126 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700127 fn visit_expr_assign(&mut self, i: &'ast ExprAssign) {
128 visit_expr_assign(self, i)
129 }
130 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700131 fn visit_expr_assign_op(&mut self, i: &'ast ExprAssignOp) {
132 visit_expr_assign_op(self, i)
133 }
David Tolnay02a9c6f2018-08-24 18:58:45 -0400134 #[cfg(feature = "full")]
David Tolnay02a9c6f2018-08-24 18:58:45 -0400135 fn visit_expr_async(&mut self, i: &'ast ExprAsync) {
136 visit_expr_async(self, i)
137 }
David Tolnay8c81f622018-07-31 23:34:35 -0700138 #[cfg(any(feature = "full", feature = "derive"))]
139 fn visit_expr_binary(&mut self, i: &'ast ExprBinary) {
140 visit_expr_binary(self, i)
141 }
142 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700143 fn visit_expr_block(&mut self, i: &'ast ExprBlock) {
144 visit_expr_block(self, i)
145 }
146 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700147 fn visit_expr_box(&mut self, i: &'ast ExprBox) {
148 visit_expr_box(self, i)
149 }
150 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700151 fn visit_expr_break(&mut self, i: &'ast ExprBreak) {
152 visit_expr_break(self, i)
153 }
154 #[cfg(any(feature = "full", feature = "derive"))]
155 fn visit_expr_call(&mut self, i: &'ast ExprCall) {
156 visit_expr_call(self, i)
157 }
158 #[cfg(any(feature = "full", feature = "derive"))]
159 fn visit_expr_cast(&mut self, i: &'ast ExprCast) {
160 visit_expr_cast(self, i)
161 }
162 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700163 fn visit_expr_closure(&mut self, i: &'ast ExprClosure) {
164 visit_expr_closure(self, i)
165 }
166 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700167 fn visit_expr_continue(&mut self, i: &'ast ExprContinue) {
168 visit_expr_continue(self, i)
169 }
170 #[cfg(any(feature = "full", feature = "derive"))]
171 fn visit_expr_field(&mut self, i: &'ast ExprField) {
172 visit_expr_field(self, i)
173 }
174 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700175 fn visit_expr_for_loop(&mut self, i: &'ast ExprForLoop) {
176 visit_expr_for_loop(self, i)
177 }
178 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700179 fn visit_expr_group(&mut self, i: &'ast ExprGroup) {
180 visit_expr_group(self, i)
181 }
182 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700183 fn visit_expr_if(&mut self, i: &'ast ExprIf) {
184 visit_expr_if(self, i)
185 }
186 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700187 fn visit_expr_in_place(&mut self, i: &'ast ExprInPlace) {
188 visit_expr_in_place(self, i)
189 }
190 #[cfg(any(feature = "full", feature = "derive"))]
191 fn visit_expr_index(&mut self, i: &'ast ExprIndex) {
192 visit_expr_index(self, i)
193 }
David Tolnay9c119122018-09-01 18:47:02 -0700194 #[cfg(feature = "full")]
David Tolnay9c119122018-09-01 18:47:02 -0700195 fn visit_expr_let(&mut self, i: &'ast ExprLet) {
196 visit_expr_let(self, i)
197 }
David Tolnay8c81f622018-07-31 23:34:35 -0700198 #[cfg(any(feature = "full", feature = "derive"))]
199 fn visit_expr_lit(&mut self, i: &'ast ExprLit) {
200 visit_expr_lit(self, i)
201 }
202 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700203 fn visit_expr_loop(&mut self, i: &'ast ExprLoop) {
204 visit_expr_loop(self, i)
205 }
206 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700207 fn visit_expr_macro(&mut self, i: &'ast ExprMacro) {
208 visit_expr_macro(self, i)
209 }
210 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700211 fn visit_expr_match(&mut self, i: &'ast ExprMatch) {
212 visit_expr_match(self, i)
213 }
214 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700215 fn visit_expr_method_call(&mut self, i: &'ast ExprMethodCall) {
216 visit_expr_method_call(self, i)
217 }
218 #[cfg(any(feature = "full", feature = "derive"))]
219 fn visit_expr_paren(&mut self, i: &'ast ExprParen) {
220 visit_expr_paren(self, i)
221 }
222 #[cfg(any(feature = "full", feature = "derive"))]
223 fn visit_expr_path(&mut self, i: &'ast ExprPath) {
224 visit_expr_path(self, i)
225 }
226 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700227 fn visit_expr_range(&mut self, i: &'ast ExprRange) {
228 visit_expr_range(self, i)
229 }
230 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700231 fn visit_expr_reference(&mut self, i: &'ast ExprReference) {
232 visit_expr_reference(self, i)
233 }
234 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700235 fn visit_expr_repeat(&mut self, i: &'ast ExprRepeat) {
236 visit_expr_repeat(self, i)
237 }
238 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700239 fn visit_expr_return(&mut self, i: &'ast ExprReturn) {
240 visit_expr_return(self, i)
241 }
242 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700243 fn visit_expr_struct(&mut self, i: &'ast ExprStruct) {
244 visit_expr_struct(self, i)
245 }
246 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700247 fn visit_expr_try(&mut self, i: &'ast ExprTry) {
248 visit_expr_try(self, i)
249 }
250 #[cfg(feature = "full")]
David Tolnayfb2dd4b2018-08-24 16:45:34 -0400251 fn visit_expr_try_block(&mut self, i: &'ast ExprTryBlock) {
252 visit_expr_try_block(self, i)
253 }
254 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700255 fn visit_expr_tuple(&mut self, i: &'ast ExprTuple) {
256 visit_expr_tuple(self, i)
257 }
258 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700259 fn visit_expr_type(&mut self, i: &'ast ExprType) {
260 visit_expr_type(self, i)
261 }
262 #[cfg(any(feature = "full", feature = "derive"))]
263 fn visit_expr_unary(&mut self, i: &'ast ExprUnary) {
264 visit_expr_unary(self, i)
265 }
266 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700267 fn visit_expr_unsafe(&mut self, i: &'ast ExprUnsafe) {
268 visit_expr_unsafe(self, i)
269 }
270 #[cfg(any(feature = "full", feature = "derive"))]
271 fn visit_expr_verbatim(&mut self, i: &'ast ExprVerbatim) {
272 visit_expr_verbatim(self, i)
273 }
274 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700275 fn visit_expr_while(&mut self, i: &'ast ExprWhile) {
276 visit_expr_while(self, i)
277 }
278 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700279 fn visit_expr_yield(&mut self, i: &'ast ExprYield) {
280 visit_expr_yield(self, i)
281 }
282 #[cfg(any(feature = "full", feature = "derive"))]
283 fn visit_field(&mut self, i: &'ast Field) {
284 visit_field(self, i)
285 }
David Tolnay8c81f622018-07-31 23:34:35 -0700286 #[cfg(feature = "full")]
287 fn visit_field_pat(&mut self, i: &'ast FieldPat) {
288 visit_field_pat(self, i)
289 }
David Tolnay8c81f622018-07-31 23:34:35 -0700290 #[cfg(feature = "full")]
291 fn visit_field_value(&mut self, i: &'ast FieldValue) {
292 visit_field_value(self, i)
293 }
294 #[cfg(any(feature = "full", feature = "derive"))]
295 fn visit_fields(&mut self, i: &'ast Fields) {
296 visit_fields(self, i)
297 }
298 #[cfg(any(feature = "full", feature = "derive"))]
299 fn visit_fields_named(&mut self, i: &'ast FieldsNamed) {
300 visit_fields_named(self, i)
301 }
302 #[cfg(any(feature = "full", feature = "derive"))]
303 fn visit_fields_unnamed(&mut self, i: &'ast FieldsUnnamed) {
304 visit_fields_unnamed(self, i)
305 }
306 #[cfg(feature = "full")]
307 fn visit_file(&mut self, i: &'ast File) {
308 visit_file(self, i)
309 }
310 #[cfg(feature = "full")]
311 fn visit_fn_arg(&mut self, i: &'ast FnArg) {
312 visit_fn_arg(self, i)
313 }
314 #[cfg(feature = "full")]
315 fn visit_fn_decl(&mut self, i: &'ast FnDecl) {
316 visit_fn_decl(self, i)
317 }
318 #[cfg(feature = "full")]
319 fn visit_foreign_item(&mut self, i: &'ast ForeignItem) {
320 visit_foreign_item(self, i)
321 }
322 #[cfg(feature = "full")]
323 fn visit_foreign_item_fn(&mut self, i: &'ast ForeignItemFn) {
324 visit_foreign_item_fn(self, i)
325 }
326 #[cfg(feature = "full")]
David Tolnay435c1782018-08-24 16:15:44 -0400327 fn visit_foreign_item_macro(&mut self, i: &'ast ForeignItemMacro) {
328 visit_foreign_item_macro(self, i)
329 }
330 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700331 fn visit_foreign_item_static(&mut self, i: &'ast ForeignItemStatic) {
332 visit_foreign_item_static(self, i)
333 }
334 #[cfg(feature = "full")]
335 fn visit_foreign_item_type(&mut self, i: &'ast ForeignItemType) {
336 visit_foreign_item_type(self, i)
337 }
338 #[cfg(feature = "full")]
339 fn visit_foreign_item_verbatim(&mut self, i: &'ast ForeignItemVerbatim) {
340 visit_foreign_item_verbatim(self, i)
341 }
342 #[cfg(any(feature = "full", feature = "derive"))]
343 fn visit_generic_argument(&mut self, i: &'ast GenericArgument) {
344 visit_generic_argument(self, i)
345 }
David Tolnay8c81f622018-07-31 23:34:35 -0700346 #[cfg(feature = "full")]
347 fn visit_generic_method_argument(&mut self, i: &'ast GenericMethodArgument) {
348 visit_generic_method_argument(self, i)
349 }
350 #[cfg(any(feature = "full", feature = "derive"))]
351 fn visit_generic_param(&mut self, i: &'ast GenericParam) {
352 visit_generic_param(self, i)
353 }
354 #[cfg(any(feature = "full", feature = "derive"))]
355 fn visit_generics(&mut self, i: &'ast Generics) {
356 visit_generics(self, i)
357 }
David Tolnay8c81f622018-07-31 23:34:35 -0700358 fn visit_ident(&mut self, i: &'ast Ident) {
359 visit_ident(self, i)
360 }
361 #[cfg(feature = "full")]
362 fn visit_impl_item(&mut self, i: &'ast ImplItem) {
363 visit_impl_item(self, i)
364 }
365 #[cfg(feature = "full")]
366 fn visit_impl_item_const(&mut self, i: &'ast ImplItemConst) {
367 visit_impl_item_const(self, i)
368 }
369 #[cfg(feature = "full")]
David Tolnaybb82ef02018-08-24 20:15:45 -0400370 fn visit_impl_item_existential(&mut self, i: &'ast ImplItemExistential) {
371 visit_impl_item_existential(self, i)
372 }
373 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700374 fn visit_impl_item_macro(&mut self, i: &'ast ImplItemMacro) {
375 visit_impl_item_macro(self, i)
376 }
377 #[cfg(feature = "full")]
378 fn visit_impl_item_method(&mut self, i: &'ast ImplItemMethod) {
379 visit_impl_item_method(self, i)
380 }
381 #[cfg(feature = "full")]
382 fn visit_impl_item_type(&mut self, i: &'ast ImplItemType) {
383 visit_impl_item_type(self, i)
384 }
385 #[cfg(feature = "full")]
386 fn visit_impl_item_verbatim(&mut self, i: &'ast ImplItemVerbatim) {
387 visit_impl_item_verbatim(self, i)
388 }
389 #[cfg(any(feature = "full", feature = "derive"))]
390 fn visit_index(&mut self, i: &'ast Index) {
391 visit_index(self, i)
392 }
393 #[cfg(feature = "full")]
394 fn visit_item(&mut self, i: &'ast Item) {
395 visit_item(self, i)
396 }
397 #[cfg(feature = "full")]
398 fn visit_item_const(&mut self, i: &'ast ItemConst) {
399 visit_item_const(self, i)
400 }
401 #[cfg(feature = "full")]
402 fn visit_item_enum(&mut self, i: &'ast ItemEnum) {
403 visit_item_enum(self, i)
404 }
405 #[cfg(feature = "full")]
David Tolnaybb82ef02018-08-24 20:15:45 -0400406 fn visit_item_existential(&mut self, i: &'ast ItemExistential) {
407 visit_item_existential(self, i)
408 }
409 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700410 fn visit_item_extern_crate(&mut self, i: &'ast ItemExternCrate) {
411 visit_item_extern_crate(self, i)
412 }
413 #[cfg(feature = "full")]
414 fn visit_item_fn(&mut self, i: &'ast ItemFn) {
415 visit_item_fn(self, i)
416 }
417 #[cfg(feature = "full")]
418 fn visit_item_foreign_mod(&mut self, i: &'ast ItemForeignMod) {
419 visit_item_foreign_mod(self, i)
420 }
421 #[cfg(feature = "full")]
422 fn visit_item_impl(&mut self, i: &'ast ItemImpl) {
423 visit_item_impl(self, i)
424 }
425 #[cfg(feature = "full")]
426 fn visit_item_macro(&mut self, i: &'ast ItemMacro) {
427 visit_item_macro(self, i)
428 }
429 #[cfg(feature = "full")]
430 fn visit_item_macro2(&mut self, i: &'ast ItemMacro2) {
431 visit_item_macro2(self, i)
432 }
433 #[cfg(feature = "full")]
434 fn visit_item_mod(&mut self, i: &'ast ItemMod) {
435 visit_item_mod(self, i)
436 }
437 #[cfg(feature = "full")]
438 fn visit_item_static(&mut self, i: &'ast ItemStatic) {
439 visit_item_static(self, i)
440 }
441 #[cfg(feature = "full")]
442 fn visit_item_struct(&mut self, i: &'ast ItemStruct) {
443 visit_item_struct(self, i)
444 }
445 #[cfg(feature = "full")]
446 fn visit_item_trait(&mut self, i: &'ast ItemTrait) {
447 visit_item_trait(self, i)
448 }
449 #[cfg(feature = "full")]
David Tolnayc6b04dd2018-08-30 23:22:51 -0700450 fn visit_item_trait_alias(&mut self, i: &'ast ItemTraitAlias) {
451 visit_item_trait_alias(self, i)
452 }
453 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700454 fn visit_item_type(&mut self, i: &'ast ItemType) {
455 visit_item_type(self, i)
456 }
457 #[cfg(feature = "full")]
458 fn visit_item_union(&mut self, i: &'ast ItemUnion) {
459 visit_item_union(self, i)
460 }
461 #[cfg(feature = "full")]
462 fn visit_item_use(&mut self, i: &'ast ItemUse) {
463 visit_item_use(self, i)
464 }
465 #[cfg(feature = "full")]
466 fn visit_item_verbatim(&mut self, i: &'ast ItemVerbatim) {
467 visit_item_verbatim(self, i)
468 }
David Tolnay8c81f622018-07-31 23:34:35 -0700469 #[cfg(feature = "full")]
470 fn visit_label(&mut self, i: &'ast Label) {
471 visit_label(self, i)
472 }
David Tolnay8c81f622018-07-31 23:34:35 -0700473 fn visit_lifetime(&mut self, i: &'ast Lifetime) {
474 visit_lifetime(self, i)
475 }
476 #[cfg(any(feature = "full", feature = "derive"))]
477 fn visit_lifetime_def(&mut self, i: &'ast LifetimeDef) {
478 visit_lifetime_def(self, i)
479 }
480 #[cfg(any(feature = "full", feature = "derive"))]
481 fn visit_lit(&mut self, i: &'ast Lit) {
482 visit_lit(self, i)
483 }
484 #[cfg(any(feature = "full", feature = "derive"))]
485 fn visit_lit_bool(&mut self, i: &'ast LitBool) {
486 visit_lit_bool(self, i)
487 }
488 #[cfg(any(feature = "full", feature = "derive"))]
489 fn visit_lit_byte(&mut self, i: &'ast LitByte) {
490 visit_lit_byte(self, i)
491 }
492 #[cfg(any(feature = "full", feature = "derive"))]
493 fn visit_lit_byte_str(&mut self, i: &'ast LitByteStr) {
494 visit_lit_byte_str(self, i)
495 }
496 #[cfg(any(feature = "full", feature = "derive"))]
497 fn visit_lit_char(&mut self, i: &'ast LitChar) {
498 visit_lit_char(self, i)
499 }
500 #[cfg(any(feature = "full", feature = "derive"))]
501 fn visit_lit_float(&mut self, i: &'ast LitFloat) {
502 visit_lit_float(self, i)
503 }
504 #[cfg(any(feature = "full", feature = "derive"))]
505 fn visit_lit_int(&mut self, i: &'ast LitInt) {
506 visit_lit_int(self, i)
507 }
508 #[cfg(any(feature = "full", feature = "derive"))]
509 fn visit_lit_str(&mut self, i: &'ast LitStr) {
510 visit_lit_str(self, i)
511 }
512 #[cfg(any(feature = "full", feature = "derive"))]
513 fn visit_lit_verbatim(&mut self, i: &'ast LitVerbatim) {
514 visit_lit_verbatim(self, i)
515 }
David Tolnay8c81f622018-07-31 23:34:35 -0700516 #[cfg(feature = "full")]
517 fn visit_local(&mut self, i: &'ast Local) {
518 visit_local(self, i)
519 }
520 #[cfg(any(feature = "full", feature = "derive"))]
521 fn visit_macro(&mut self, i: &'ast Macro) {
522 visit_macro(self, i)
523 }
524 #[cfg(any(feature = "full", feature = "derive"))]
525 fn visit_macro_delimiter(&mut self, i: &'ast MacroDelimiter) {
526 visit_macro_delimiter(self, i)
527 }
528 #[cfg(any(feature = "full", feature = "derive"))]
529 fn visit_member(&mut self, i: &'ast Member) {
530 visit_member(self, i)
531 }
532 #[cfg(any(feature = "full", feature = "derive"))]
533 fn visit_meta(&mut self, i: &'ast Meta) {
534 visit_meta(self, i)
535 }
536 #[cfg(any(feature = "full", feature = "derive"))]
537 fn visit_meta_list(&mut self, i: &'ast MetaList) {
538 visit_meta_list(self, i)
539 }
540 #[cfg(any(feature = "full", feature = "derive"))]
541 fn visit_meta_name_value(&mut self, i: &'ast MetaNameValue) {
542 visit_meta_name_value(self, i)
543 }
544 #[cfg(feature = "full")]
545 fn visit_method_sig(&mut self, i: &'ast MethodSig) {
546 visit_method_sig(self, i)
547 }
David Tolnay8c81f622018-07-31 23:34:35 -0700548 #[cfg(feature = "full")]
549 fn visit_method_turbofish(&mut self, i: &'ast MethodTurbofish) {
550 visit_method_turbofish(self, i)
551 }
552 #[cfg(any(feature = "full", feature = "derive"))]
553 fn visit_nested_meta(&mut self, i: &'ast NestedMeta) {
554 visit_nested_meta(self, i)
555 }
556 #[cfg(any(feature = "full", feature = "derive"))]
557 fn visit_parenthesized_generic_arguments(&mut self, i: &'ast ParenthesizedGenericArguments) {
558 visit_parenthesized_generic_arguments(self, i)
559 }
David Tolnay8c81f622018-07-31 23:34:35 -0700560 #[cfg(feature = "full")]
561 fn visit_pat(&mut self, i: &'ast Pat) {
562 visit_pat(self, i)
563 }
David Tolnay8c81f622018-07-31 23:34:35 -0700564 #[cfg(feature = "full")]
565 fn visit_pat_box(&mut self, i: &'ast PatBox) {
566 visit_pat_box(self, i)
567 }
David Tolnay8c81f622018-07-31 23:34:35 -0700568 #[cfg(feature = "full")]
569 fn visit_pat_ident(&mut self, i: &'ast PatIdent) {
570 visit_pat_ident(self, i)
571 }
David Tolnay8c81f622018-07-31 23:34:35 -0700572 #[cfg(feature = "full")]
573 fn visit_pat_lit(&mut self, i: &'ast PatLit) {
574 visit_pat_lit(self, i)
575 }
David Tolnay8c81f622018-07-31 23:34:35 -0700576 #[cfg(feature = "full")]
577 fn visit_pat_macro(&mut self, i: &'ast PatMacro) {
578 visit_pat_macro(self, i)
579 }
David Tolnay8c81f622018-07-31 23:34:35 -0700580 #[cfg(feature = "full")]
581 fn visit_pat_path(&mut self, i: &'ast PatPath) {
582 visit_pat_path(self, i)
583 }
David Tolnay8c81f622018-07-31 23:34:35 -0700584 #[cfg(feature = "full")]
585 fn visit_pat_range(&mut self, i: &'ast PatRange) {
586 visit_pat_range(self, i)
587 }
David Tolnay8c81f622018-07-31 23:34:35 -0700588 #[cfg(feature = "full")]
589 fn visit_pat_ref(&mut self, i: &'ast PatRef) {
590 visit_pat_ref(self, i)
591 }
David Tolnay8c81f622018-07-31 23:34:35 -0700592 #[cfg(feature = "full")]
593 fn visit_pat_slice(&mut self, i: &'ast PatSlice) {
594 visit_pat_slice(self, i)
595 }
David Tolnay8c81f622018-07-31 23:34:35 -0700596 #[cfg(feature = "full")]
597 fn visit_pat_struct(&mut self, i: &'ast PatStruct) {
598 visit_pat_struct(self, i)
599 }
David Tolnay8c81f622018-07-31 23:34:35 -0700600 #[cfg(feature = "full")]
601 fn visit_pat_tuple(&mut self, i: &'ast PatTuple) {
602 visit_pat_tuple(self, i)
603 }
David Tolnay8c81f622018-07-31 23:34:35 -0700604 #[cfg(feature = "full")]
605 fn visit_pat_tuple_struct(&mut self, i: &'ast PatTupleStruct) {
606 visit_pat_tuple_struct(self, i)
607 }
David Tolnay8c81f622018-07-31 23:34:35 -0700608 #[cfg(feature = "full")]
609 fn visit_pat_verbatim(&mut self, i: &'ast PatVerbatim) {
610 visit_pat_verbatim(self, i)
611 }
David Tolnay8c81f622018-07-31 23:34:35 -0700612 #[cfg(feature = "full")]
613 fn visit_pat_wild(&mut self, i: &'ast PatWild) {
614 visit_pat_wild(self, i)
615 }
616 #[cfg(any(feature = "full", feature = "derive"))]
617 fn visit_path(&mut self, i: &'ast Path) {
618 visit_path(self, i)
619 }
620 #[cfg(any(feature = "full", feature = "derive"))]
621 fn visit_path_arguments(&mut self, i: &'ast PathArguments) {
622 visit_path_arguments(self, i)
623 }
624 #[cfg(any(feature = "full", feature = "derive"))]
625 fn visit_path_segment(&mut self, i: &'ast PathSegment) {
626 visit_path_segment(self, i)
627 }
628 #[cfg(any(feature = "full", feature = "derive"))]
629 fn visit_predicate_eq(&mut self, i: &'ast PredicateEq) {
630 visit_predicate_eq(self, i)
631 }
632 #[cfg(any(feature = "full", feature = "derive"))]
633 fn visit_predicate_lifetime(&mut self, i: &'ast PredicateLifetime) {
634 visit_predicate_lifetime(self, i)
635 }
636 #[cfg(any(feature = "full", feature = "derive"))]
637 fn visit_predicate_type(&mut self, i: &'ast PredicateType) {
638 visit_predicate_type(self, i)
639 }
640 #[cfg(any(feature = "full", feature = "derive"))]
641 fn visit_qself(&mut self, i: &'ast QSelf) {
642 visit_qself(self, i)
643 }
David Tolnay8c81f622018-07-31 23:34:35 -0700644 #[cfg(feature = "full")]
645 fn visit_range_limits(&mut self, i: &'ast RangeLimits) {
646 visit_range_limits(self, i)
647 }
648 #[cfg(any(feature = "full", feature = "derive"))]
649 fn visit_return_type(&mut self, i: &'ast ReturnType) {
650 visit_return_type(self, i)
651 }
David Tolnay8c81f622018-07-31 23:34:35 -0700652 fn visit_span(&mut self, i: &'ast Span) {
653 visit_span(self, i)
654 }
David Tolnay8c81f622018-07-31 23:34:35 -0700655 #[cfg(feature = "full")]
656 fn visit_stmt(&mut self, i: &'ast Stmt) {
657 visit_stmt(self, i)
658 }
659 #[cfg(any(feature = "full", feature = "derive"))]
660 fn visit_trait_bound(&mut self, i: &'ast TraitBound) {
661 visit_trait_bound(self, i)
662 }
663 #[cfg(any(feature = "full", feature = "derive"))]
664 fn visit_trait_bound_modifier(&mut self, i: &'ast TraitBoundModifier) {
665 visit_trait_bound_modifier(self, i)
666 }
667 #[cfg(feature = "full")]
668 fn visit_trait_item(&mut self, i: &'ast TraitItem) {
669 visit_trait_item(self, i)
670 }
671 #[cfg(feature = "full")]
672 fn visit_trait_item_const(&mut self, i: &'ast TraitItemConst) {
673 visit_trait_item_const(self, i)
674 }
675 #[cfg(feature = "full")]
676 fn visit_trait_item_macro(&mut self, i: &'ast TraitItemMacro) {
677 visit_trait_item_macro(self, i)
678 }
679 #[cfg(feature = "full")]
680 fn visit_trait_item_method(&mut self, i: &'ast TraitItemMethod) {
681 visit_trait_item_method(self, i)
682 }
683 #[cfg(feature = "full")]
684 fn visit_trait_item_type(&mut self, i: &'ast TraitItemType) {
685 visit_trait_item_type(self, i)
686 }
687 #[cfg(feature = "full")]
688 fn visit_trait_item_verbatim(&mut self, i: &'ast TraitItemVerbatim) {
689 visit_trait_item_verbatim(self, i)
690 }
691 #[cfg(any(feature = "full", feature = "derive"))]
692 fn visit_type(&mut self, i: &'ast Type) {
693 visit_type(self, i)
694 }
695 #[cfg(any(feature = "full", feature = "derive"))]
696 fn visit_type_array(&mut self, i: &'ast TypeArray) {
697 visit_type_array(self, i)
698 }
699 #[cfg(any(feature = "full", feature = "derive"))]
700 fn visit_type_bare_fn(&mut self, i: &'ast TypeBareFn) {
701 visit_type_bare_fn(self, i)
702 }
703 #[cfg(any(feature = "full", feature = "derive"))]
704 fn visit_type_group(&mut self, i: &'ast TypeGroup) {
705 visit_type_group(self, i)
706 }
707 #[cfg(any(feature = "full", feature = "derive"))]
708 fn visit_type_impl_trait(&mut self, i: &'ast TypeImplTrait) {
709 visit_type_impl_trait(self, i)
710 }
711 #[cfg(any(feature = "full", feature = "derive"))]
712 fn visit_type_infer(&mut self, i: &'ast TypeInfer) {
713 visit_type_infer(self, i)
714 }
715 #[cfg(any(feature = "full", feature = "derive"))]
716 fn visit_type_macro(&mut self, i: &'ast TypeMacro) {
717 visit_type_macro(self, i)
718 }
719 #[cfg(any(feature = "full", feature = "derive"))]
720 fn visit_type_never(&mut self, i: &'ast TypeNever) {
721 visit_type_never(self, i)
722 }
723 #[cfg(any(feature = "full", feature = "derive"))]
724 fn visit_type_param(&mut self, i: &'ast TypeParam) {
725 visit_type_param(self, i)
726 }
727 #[cfg(any(feature = "full", feature = "derive"))]
728 fn visit_type_param_bound(&mut self, i: &'ast TypeParamBound) {
729 visit_type_param_bound(self, i)
730 }
731 #[cfg(any(feature = "full", feature = "derive"))]
732 fn visit_type_paren(&mut self, i: &'ast TypeParen) {
733 visit_type_paren(self, i)
734 }
735 #[cfg(any(feature = "full", feature = "derive"))]
736 fn visit_type_path(&mut self, i: &'ast TypePath) {
737 visit_type_path(self, i)
738 }
739 #[cfg(any(feature = "full", feature = "derive"))]
740 fn visit_type_ptr(&mut self, i: &'ast TypePtr) {
741 visit_type_ptr(self, i)
742 }
743 #[cfg(any(feature = "full", feature = "derive"))]
744 fn visit_type_reference(&mut self, i: &'ast TypeReference) {
745 visit_type_reference(self, i)
746 }
747 #[cfg(any(feature = "full", feature = "derive"))]
748 fn visit_type_slice(&mut self, i: &'ast TypeSlice) {
749 visit_type_slice(self, i)
750 }
751 #[cfg(any(feature = "full", feature = "derive"))]
752 fn visit_type_trait_object(&mut self, i: &'ast TypeTraitObject) {
753 visit_type_trait_object(self, i)
754 }
755 #[cfg(any(feature = "full", feature = "derive"))]
756 fn visit_type_tuple(&mut self, i: &'ast TypeTuple) {
757 visit_type_tuple(self, i)
758 }
759 #[cfg(any(feature = "full", feature = "derive"))]
760 fn visit_type_verbatim(&mut self, i: &'ast TypeVerbatim) {
761 visit_type_verbatim(self, i)
762 }
763 #[cfg(any(feature = "full", feature = "derive"))]
764 fn visit_un_op(&mut self, i: &'ast UnOp) {
765 visit_un_op(self, i)
766 }
767 #[cfg(feature = "full")]
768 fn visit_use_glob(&mut self, i: &'ast UseGlob) {
769 visit_use_glob(self, i)
770 }
771 #[cfg(feature = "full")]
772 fn visit_use_group(&mut self, i: &'ast UseGroup) {
773 visit_use_group(self, i)
774 }
775 #[cfg(feature = "full")]
776 fn visit_use_name(&mut self, i: &'ast UseName) {
777 visit_use_name(self, i)
778 }
779 #[cfg(feature = "full")]
780 fn visit_use_path(&mut self, i: &'ast UsePath) {
781 visit_use_path(self, i)
782 }
783 #[cfg(feature = "full")]
784 fn visit_use_rename(&mut self, i: &'ast UseRename) {
785 visit_use_rename(self, i)
786 }
787 #[cfg(feature = "full")]
788 fn visit_use_tree(&mut self, i: &'ast UseTree) {
789 visit_use_tree(self, i)
790 }
791 #[cfg(any(feature = "full", feature = "derive"))]
792 fn visit_variant(&mut self, i: &'ast Variant) {
793 visit_variant(self, i)
794 }
795 #[cfg(any(feature = "full", feature = "derive"))]
796 fn visit_vis_crate(&mut self, i: &'ast VisCrate) {
797 visit_vis_crate(self, i)
798 }
799 #[cfg(any(feature = "full", feature = "derive"))]
800 fn visit_vis_public(&mut self, i: &'ast VisPublic) {
801 visit_vis_public(self, i)
802 }
803 #[cfg(any(feature = "full", feature = "derive"))]
804 fn visit_vis_restricted(&mut self, i: &'ast VisRestricted) {
805 visit_vis_restricted(self, i)
806 }
807 #[cfg(any(feature = "full", feature = "derive"))]
808 fn visit_visibility(&mut self, i: &'ast Visibility) {
809 visit_visibility(self, i)
810 }
811 #[cfg(any(feature = "full", feature = "derive"))]
812 fn visit_where_clause(&mut self, i: &'ast WhereClause) {
813 visit_where_clause(self, i)
814 }
815 #[cfg(any(feature = "full", feature = "derive"))]
816 fn visit_where_predicate(&mut self, i: &'ast WherePredicate) {
817 visit_where_predicate(self, i)
818 }
Nika Layzell27726662017-10-24 23:16:35 -0400819}
David Tolnay8c81f622018-07-31 23:34:35 -0700820#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800821pub fn visit_abi<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Abi) {
David Tolnay7ac699c2018-08-24 14:00:58 -0400822 tokens_helper(_visitor, &_i.extern_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -0700823 if let Some(ref it) = _i.name {
824 _visitor.visit_lit_str(it)
825 };
Nika Layzell27726662017-10-24 23:16:35 -0400826}
David Tolnay8c81f622018-07-31 23:34:35 -0700827#[cfg(any(feature = "full", feature = "derive"))]
828pub fn visit_angle_bracketed_generic_arguments<'ast, V: Visit<'ast> + ?Sized>(
829 _visitor: &mut V,
830 _i: &'ast AngleBracketedGenericArguments,
831) {
832 if let Some(ref it) = _i.colon2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -0400833 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -0700834 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400835 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700836 for el in Punctuated::pairs(&_i.args) {
837 let it = el.value();
838 _visitor.visit_generic_argument(it)
839 }
David Tolnay7ac699c2018-08-24 14:00:58 -0400840 tokens_helper(_visitor, &_i.gt_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400841}
David Tolnay8c81f622018-07-31 23:34:35 -0700842#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800843pub fn visit_arg_captured<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ArgCaptured) {
David Tolnay8c81f622018-07-31 23:34:35 -0700844 _visitor.visit_pat(&_i.pat);
David Tolnay7ac699c2018-08-24 14:00:58 -0400845 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700846 _visitor.visit_type(&_i.ty);
Nika Layzell27726662017-10-24 23:16:35 -0400847}
David Tolnay8c81f622018-07-31 23:34:35 -0700848#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800849pub fn visit_arg_self<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ArgSelf) {
David Tolnay8c81f622018-07-31 23:34:35 -0700850 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -0400851 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -0700852 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400853 tokens_helper(_visitor, &_i.self_token.span);
Nika Layzell27726662017-10-24 23:16:35 -0400854}
David Tolnay8c81f622018-07-31 23:34:35 -0700855#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800856pub fn visit_arg_self_ref<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ArgSelfRef) {
David Tolnay7ac699c2018-08-24 14:00:58 -0400857 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700858 if let Some(ref it) = _i.lifetime {
859 _visitor.visit_lifetime(it)
860 };
861 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -0400862 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -0700863 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400864 tokens_helper(_visitor, &_i.self_token.span);
Nika Layzell27726662017-10-24 23:16:35 -0400865}
David Tolnay8c81f622018-07-31 23:34:35 -0700866#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800867pub fn visit_arm<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Arm) {
David Tolnay8c81f622018-07-31 23:34:35 -0700868 for it in &_i.attrs {
869 _visitor.visit_attribute(it)
870 }
871 if let Some(ref it) = _i.leading_vert {
David Tolnay7ac699c2018-08-24 14:00:58 -0400872 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -0700873 };
874 for el in Punctuated::pairs(&_i.pats) {
875 let it = el.value();
876 _visitor.visit_pat(it)
877 }
878 if let Some(ref it) = _i.guard {
David Tolnay7ac699c2018-08-24 14:00:58 -0400879 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -0700880 _visitor.visit_expr(&*(it).1);
881 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400882 tokens_helper(_visitor, &_i.fat_arrow_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700883 _visitor.visit_expr(&*_i.body);
884 if let Some(ref it) = _i.comma {
David Tolnay7ac699c2018-08-24 14:00:58 -0400885 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -0700886 };
Nika Layzell27726662017-10-24 23:16:35 -0400887}
David Tolnay8c81f622018-07-31 23:34:35 -0700888#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800889pub fn visit_attr_style<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast AttrStyle) {
Nika Layzell27726662017-10-24 23:16:35 -0400890 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -0700891 AttrStyle::Outer => {}
892 AttrStyle::Inner(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400893 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400894 }
895 }
896}
David Tolnay8c81f622018-07-31 23:34:35 -0700897#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800898pub fn visit_attribute<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Attribute) {
David Tolnay7ac699c2018-08-24 14:00:58 -0400899 tokens_helper(_visitor, &_i.pound_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700900 _visitor.visit_attr_style(&_i.style);
David Tolnay7ac699c2018-08-24 14:00:58 -0400901 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -0700902 _visitor.visit_path(&_i.path);
David Tolnay6af48992018-08-01 11:16:28 -0700903 skip!(_i.tts);
Nika Layzell27726662017-10-24 23:16:35 -0400904}
David Tolnay8c81f622018-07-31 23:34:35 -0700905#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800906pub fn visit_bare_fn_arg<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast BareFnArg) {
David Tolnay8c81f622018-07-31 23:34:35 -0700907 if let Some(ref it) = _i.name {
908 _visitor.visit_bare_fn_arg_name(&(it).0);
David Tolnay7ac699c2018-08-24 14:00:58 -0400909 tokens_helper(_visitor, &(it).1.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700910 };
911 _visitor.visit_type(&_i.ty);
Nika Layzell27726662017-10-24 23:16:35 -0400912}
David Tolnay8c81f622018-07-31 23:34:35 -0700913#[cfg(any(feature = "full", feature = "derive"))]
914pub fn visit_bare_fn_arg_name<'ast, V: Visit<'ast> + ?Sized>(
915 _visitor: &mut V,
916 _i: &'ast BareFnArgName,
917) {
Nika Layzell27726662017-10-24 23:16:35 -0400918 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -0700919 BareFnArgName::Named(ref _binding_0) => {
Alex Crichtond261d092018-05-18 13:47:35 -0700920 _visitor.visit_ident(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -0400921 }
David Tolnay8c81f622018-07-31 23:34:35 -0700922 BareFnArgName::Wild(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400923 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400924 }
925 }
926}
David Tolnay8c81f622018-07-31 23:34:35 -0700927#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800928pub fn visit_bin_op<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast BinOp) {
Nika Layzell27726662017-10-24 23:16:35 -0400929 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -0700930 BinOp::Add(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400931 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400932 }
David Tolnay8c81f622018-07-31 23:34:35 -0700933 BinOp::Sub(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400934 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400935 }
David Tolnay8c81f622018-07-31 23:34:35 -0700936 BinOp::Mul(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400937 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400938 }
David Tolnay8c81f622018-07-31 23:34:35 -0700939 BinOp::Div(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400940 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400941 }
David Tolnay8c81f622018-07-31 23:34:35 -0700942 BinOp::Rem(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400943 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400944 }
David Tolnay8c81f622018-07-31 23:34:35 -0700945 BinOp::And(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400946 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400947 }
David Tolnay8c81f622018-07-31 23:34:35 -0700948 BinOp::Or(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400949 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400950 }
David Tolnay8c81f622018-07-31 23:34:35 -0700951 BinOp::BitXor(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400952 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400953 }
David Tolnay8c81f622018-07-31 23:34:35 -0700954 BinOp::BitAnd(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400955 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400956 }
David Tolnay8c81f622018-07-31 23:34:35 -0700957 BinOp::BitOr(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400958 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400959 }
David Tolnay8c81f622018-07-31 23:34:35 -0700960 BinOp::Shl(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400961 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400962 }
David Tolnay8c81f622018-07-31 23:34:35 -0700963 BinOp::Shr(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400964 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400965 }
David Tolnay8c81f622018-07-31 23:34:35 -0700966 BinOp::Eq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400967 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400968 }
David Tolnay8c81f622018-07-31 23:34:35 -0700969 BinOp::Lt(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400970 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400971 }
David Tolnay8c81f622018-07-31 23:34:35 -0700972 BinOp::Le(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400973 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400974 }
David Tolnay8c81f622018-07-31 23:34:35 -0700975 BinOp::Ne(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::Ge(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::Gt(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::AddEq(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::SubEq(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::MulEq(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::DivEq(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::RemEq(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::BitXorEq(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::BitAndEq(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::BitOrEq(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::ShlEq(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::ShrEq(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 }
1014 }
1015}
David Tolnay8c81f622018-07-31 23:34:35 -07001016#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001017pub fn visit_binding<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Binding) {
David Tolnay8c81f622018-07-31 23:34:35 -07001018 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001019 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001020 _visitor.visit_type(&_i.ty);
David Tolnay506e43a2017-12-29 11:34:36 -05001021}
David Tolnay8c81f622018-07-31 23:34:35 -07001022#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001023pub fn visit_block<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Block) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001024 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001025 for it in &_i.stmts {
1026 _visitor.visit_stmt(it)
1027 }
Nika Layzell27726662017-10-24 23:16:35 -04001028}
David Tolnay8c81f622018-07-31 23:34:35 -07001029#[cfg(any(feature = "full", feature = "derive"))]
1030pub fn visit_bound_lifetimes<'ast, V: Visit<'ast> + ?Sized>(
1031 _visitor: &mut V,
1032 _i: &'ast BoundLifetimes,
1033) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001034 tokens_helper(_visitor, &_i.for_token.span);
1035 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001036 for el in Punctuated::pairs(&_i.lifetimes) {
1037 let it = el.value();
1038 _visitor.visit_lifetime_def(it)
1039 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001040 tokens_helper(_visitor, &_i.gt_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001041}
David Tolnay8c81f622018-07-31 23:34:35 -07001042#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001043pub fn visit_const_param<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ConstParam) {
David Tolnay8c81f622018-07-31 23:34:35 -07001044 for it in &_i.attrs {
1045 _visitor.visit_attribute(it)
1046 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001047 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001048 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001049 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001050 _visitor.visit_type(&_i.ty);
1051 if let Some(ref it) = _i.eq_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001052 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001053 };
1054 if let Some(ref it) = _i.default {
1055 _visitor.visit_expr(it)
1056 };
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001057}
David Tolnay9d0882a2018-09-01 19:49:14 -07001058#[cfg(any(feature = "full", feature = "derive"))]
1059pub fn visit_constraint<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Constraint) {
1060 _visitor.visit_ident(&_i.ident);
1061 tokens_helper(_visitor, &_i.colon_token.spans);
1062 for el in Punctuated::pairs(&_i.bounds) {
1063 let it = el.value();
1064 _visitor.visit_type_param_bound(it)
1065 }
1066}
David Tolnay8c81f622018-07-31 23:34:35 -07001067#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001068pub fn visit_data<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Data) {
David Tolnaye3d41b72017-12-31 15:24:00 -05001069 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001070 Data::Struct(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05001071 _visitor.visit_data_struct(_binding_0);
1072 }
David Tolnay8c81f622018-07-31 23:34:35 -07001073 Data::Enum(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05001074 _visitor.visit_data_enum(_binding_0);
1075 }
David Tolnay8c81f622018-07-31 23:34:35 -07001076 Data::Union(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05001077 _visitor.visit_data_union(_binding_0);
1078 }
1079 }
1080}
David Tolnay8c81f622018-07-31 23:34:35 -07001081#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001082pub fn visit_data_enum<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataEnum) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001083 tokens_helper(_visitor, &_i.enum_token.span);
1084 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001085 for el in Punctuated::pairs(&_i.variants) {
1086 let it = el.value();
1087 _visitor.visit_variant(it)
1088 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001089}
David Tolnay8c81f622018-07-31 23:34:35 -07001090#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001091pub fn visit_data_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataStruct) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001092 tokens_helper(_visitor, &_i.struct_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001093 _visitor.visit_fields(&_i.fields);
1094 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001095 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001096 };
David Tolnaye3d41b72017-12-31 15:24:00 -05001097}
David Tolnay8c81f622018-07-31 23:34:35 -07001098#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001099pub fn visit_data_union<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataUnion) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001100 tokens_helper(_visitor, &_i.union_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001101 _visitor.visit_fields_named(&_i.fields);
David Tolnaye3d41b72017-12-31 15:24:00 -05001102}
David Tolnay8c81f622018-07-31 23:34:35 -07001103#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001104pub fn visit_derive_input<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DeriveInput) {
David Tolnay8c81f622018-07-31 23:34:35 -07001105 for it in &_i.attrs {
1106 _visitor.visit_attribute(it)
1107 }
1108 _visitor.visit_visibility(&_i.vis);
1109 _visitor.visit_ident(&_i.ident);
1110 _visitor.visit_generics(&_i.generics);
1111 _visitor.visit_data(&_i.data);
Nika Layzell27726662017-10-24 23:16:35 -04001112}
David Tolnay8c81f622018-07-31 23:34:35 -07001113#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001114pub fn visit_expr<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Expr) {
Nika Layzell27726662017-10-24 23:16:35 -04001115 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001116 Expr::Box(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001117 full!(_visitor.visit_expr_box(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001118 }
David Tolnay8c81f622018-07-31 23:34:35 -07001119 Expr::InPlace(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001120 full!(_visitor.visit_expr_in_place(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001121 }
David Tolnay8c81f622018-07-31 23:34:35 -07001122 Expr::Array(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001123 full!(_visitor.visit_expr_array(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001124 }
David Tolnay8c81f622018-07-31 23:34:35 -07001125 Expr::Call(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001126 _visitor.visit_expr_call(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001127 }
David Tolnay8c81f622018-07-31 23:34:35 -07001128 Expr::MethodCall(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001129 full!(_visitor.visit_expr_method_call(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001130 }
David Tolnay8c81f622018-07-31 23:34:35 -07001131 Expr::Tuple(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001132 full!(_visitor.visit_expr_tuple(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001133 }
David Tolnay8c81f622018-07-31 23:34:35 -07001134 Expr::Binary(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001135 _visitor.visit_expr_binary(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001136 }
David Tolnay8c81f622018-07-31 23:34:35 -07001137 Expr::Unary(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001138 _visitor.visit_expr_unary(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001139 }
David Tolnay8c81f622018-07-31 23:34:35 -07001140 Expr::Lit(ref _binding_0) => {
David Tolnay8c91b882017-12-28 23:04:32 -05001141 _visitor.visit_expr_lit(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001142 }
David Tolnay8c81f622018-07-31 23:34:35 -07001143 Expr::Cast(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001144 _visitor.visit_expr_cast(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001145 }
David Tolnay8c81f622018-07-31 23:34:35 -07001146 Expr::Type(ref _binding_0) => {
David Tolnay0cf94f22017-12-28 23:46:26 -05001147 full!(_visitor.visit_expr_type(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001148 }
David Tolnay9c119122018-09-01 18:47:02 -07001149 Expr::Let(ref _binding_0) => {
1150 full!(_visitor.visit_expr_let(_binding_0));
1151 }
David Tolnay8c81f622018-07-31 23:34:35 -07001152 Expr::If(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001153 full!(_visitor.visit_expr_if(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001154 }
David Tolnay8c81f622018-07-31 23:34:35 -07001155 Expr::While(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001156 full!(_visitor.visit_expr_while(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001157 }
David Tolnay8c81f622018-07-31 23:34:35 -07001158 Expr::ForLoop(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001159 full!(_visitor.visit_expr_for_loop(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001160 }
David Tolnay8c81f622018-07-31 23:34:35 -07001161 Expr::Loop(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001162 full!(_visitor.visit_expr_loop(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001163 }
David Tolnay8c81f622018-07-31 23:34:35 -07001164 Expr::Match(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001165 full!(_visitor.visit_expr_match(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001166 }
David Tolnay8c81f622018-07-31 23:34:35 -07001167 Expr::Closure(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001168 full!(_visitor.visit_expr_closure(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001169 }
David Tolnay8c81f622018-07-31 23:34:35 -07001170 Expr::Unsafe(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001171 full!(_visitor.visit_expr_unsafe(_binding_0));
Nika Layzell640832a2017-12-04 13:37:09 -05001172 }
David Tolnay8c81f622018-07-31 23:34:35 -07001173 Expr::Block(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001174 full!(_visitor.visit_expr_block(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001175 }
David Tolnay8c81f622018-07-31 23:34:35 -07001176 Expr::Assign(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001177 full!(_visitor.visit_expr_assign(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001178 }
David Tolnay8c81f622018-07-31 23:34:35 -07001179 Expr::AssignOp(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001180 full!(_visitor.visit_expr_assign_op(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001181 }
David Tolnay8c81f622018-07-31 23:34:35 -07001182 Expr::Field(ref _binding_0) => {
David Tolnayd093fa92018-06-30 10:23:25 -07001183 _visitor.visit_expr_field(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001184 }
David Tolnay8c81f622018-07-31 23:34:35 -07001185 Expr::Index(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001186 _visitor.visit_expr_index(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001187 }
David Tolnay8c81f622018-07-31 23:34:35 -07001188 Expr::Range(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001189 full!(_visitor.visit_expr_range(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001190 }
David Tolnay8c81f622018-07-31 23:34:35 -07001191 Expr::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001192 _visitor.visit_expr_path(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001193 }
David Tolnay8c81f622018-07-31 23:34:35 -07001194 Expr::Reference(ref _binding_0) => {
David Tolnay00674ba2018-03-31 18:14:11 +02001195 full!(_visitor.visit_expr_reference(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001196 }
David Tolnay8c81f622018-07-31 23:34:35 -07001197 Expr::Break(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001198 full!(_visitor.visit_expr_break(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001199 }
David Tolnay8c81f622018-07-31 23:34:35 -07001200 Expr::Continue(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001201 full!(_visitor.visit_expr_continue(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001202 }
David Tolnay8c81f622018-07-31 23:34:35 -07001203 Expr::Return(ref _binding_0) => {
David Tolnayc246cd32017-12-28 23:14:32 -05001204 full!(_visitor.visit_expr_return(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001205 }
David Tolnay8c81f622018-07-31 23:34:35 -07001206 Expr::Macro(ref _binding_0) => {
David Tolnay8c91b882017-12-28 23:04:32 -05001207 full!(_visitor.visit_expr_macro(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001208 }
David Tolnay8c81f622018-07-31 23:34:35 -07001209 Expr::Struct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001210 full!(_visitor.visit_expr_struct(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001211 }
David Tolnay8c81f622018-07-31 23:34:35 -07001212 Expr::Repeat(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001213 full!(_visitor.visit_expr_repeat(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001214 }
David Tolnay8c81f622018-07-31 23:34:35 -07001215 Expr::Paren(ref _binding_0) => {
David Tolnay81ab4f62018-01-27 19:02:51 -08001216 _visitor.visit_expr_paren(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001217 }
David Tolnay8c81f622018-07-31 23:34:35 -07001218 Expr::Group(ref _binding_0) => {
David Tolnaye98775f2017-12-28 23:17:00 -05001219 full!(_visitor.visit_expr_group(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001220 }
David Tolnay8c81f622018-07-31 23:34:35 -07001221 Expr::Try(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001222 full!(_visitor.visit_expr_try(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001223 }
David Tolnay02a9c6f2018-08-24 18:58:45 -04001224 Expr::Async(ref _binding_0) => {
1225 full!(_visitor.visit_expr_async(_binding_0));
1226 }
David Tolnayfb2dd4b2018-08-24 16:45:34 -04001227 Expr::TryBlock(ref _binding_0) => {
1228 full!(_visitor.visit_expr_try_block(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001229 }
David Tolnay8c81f622018-07-31 23:34:35 -07001230 Expr::Yield(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001231 full!(_visitor.visit_expr_yield(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001232 }
David Tolnay8c81f622018-07-31 23:34:35 -07001233 Expr::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05001234 _visitor.visit_expr_verbatim(_binding_0);
1235 }
Nika Layzell27726662017-10-24 23:16:35 -04001236 }
1237}
David Tolnay8c81f622018-07-31 23:34:35 -07001238#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001239pub fn visit_expr_array<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprArray) {
David Tolnay8c81f622018-07-31 23:34:35 -07001240 for it in &_i.attrs {
1241 _visitor.visit_attribute(it)
1242 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001243 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001244 for el in Punctuated::pairs(&_i.elems) {
1245 let it = el.value();
1246 _visitor.visit_expr(it)
David Tolnaye3d41b72017-12-31 15:24:00 -05001247 }
1248}
David Tolnay8c81f622018-07-31 23:34:35 -07001249#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001250pub fn visit_expr_assign<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprAssign) {
1251 for it in &_i.attrs {
1252 _visitor.visit_attribute(it)
1253 }
1254 _visitor.visit_expr(&*_i.left);
David Tolnay7ac699c2018-08-24 14:00:58 -04001255 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001256 _visitor.visit_expr(&*_i.right);
1257}
1258#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001259pub fn visit_expr_assign_op<'ast, V: Visit<'ast> + ?Sized>(
1260 _visitor: &mut V,
1261 _i: &'ast ExprAssignOp,
1262) {
1263 for it in &_i.attrs {
1264 _visitor.visit_attribute(it)
1265 }
1266 _visitor.visit_expr(&*_i.left);
1267 _visitor.visit_bin_op(&_i.op);
1268 _visitor.visit_expr(&*_i.right);
1269}
David Tolnay02a9c6f2018-08-24 18:58:45 -04001270#[cfg(feature = "full")]
David Tolnay02a9c6f2018-08-24 18:58:45 -04001271pub fn visit_expr_async<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprAsync) {
1272 for it in &_i.attrs {
1273 _visitor.visit_attribute(it)
1274 }
1275 tokens_helper(_visitor, &_i.async_token.span);
1276 if let Some(ref it) = _i.capture {
1277 tokens_helper(_visitor, &it.span)
1278 };
1279 _visitor.visit_block(&_i.block);
1280}
David Tolnay8c81f622018-07-31 23:34:35 -07001281#[cfg(any(feature = "full", feature = "derive"))]
1282pub fn visit_expr_binary<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBinary) {
1283 for it in &_i.attrs {
1284 _visitor.visit_attribute(it)
1285 }
1286 _visitor.visit_expr(&*_i.left);
1287 _visitor.visit_bin_op(&_i.op);
1288 _visitor.visit_expr(&*_i.right);
1289}
1290#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001291pub fn visit_expr_block<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBlock) {
1292 for it in &_i.attrs {
1293 _visitor.visit_attribute(it)
1294 }
David Tolnay1d8e9962018-08-24 19:04:20 -04001295 if let Some(ref it) = _i.label {
1296 _visitor.visit_label(it)
1297 };
David Tolnay8c81f622018-07-31 23:34:35 -07001298 _visitor.visit_block(&_i.block);
1299}
1300#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001301pub fn visit_expr_box<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBox) {
1302 for it in &_i.attrs {
1303 _visitor.visit_attribute(it)
1304 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001305 tokens_helper(_visitor, &_i.box_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001306 _visitor.visit_expr(&*_i.expr);
1307}
1308#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001309pub fn visit_expr_break<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBreak) {
1310 for it in &_i.attrs {
1311 _visitor.visit_attribute(it)
1312 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001313 tokens_helper(_visitor, &_i.break_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001314 if let Some(ref it) = _i.label {
1315 _visitor.visit_lifetime(it)
1316 };
1317 if let Some(ref it) = _i.expr {
1318 _visitor.visit_expr(&**it)
1319 };
1320}
1321#[cfg(any(feature = "full", feature = "derive"))]
1322pub fn visit_expr_call<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprCall) {
1323 for it in &_i.attrs {
1324 _visitor.visit_attribute(it)
1325 }
1326 _visitor.visit_expr(&*_i.func);
David Tolnay7ac699c2018-08-24 14:00:58 -04001327 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001328 for el in Punctuated::pairs(&_i.args) {
1329 let it = el.value();
1330 _visitor.visit_expr(it)
1331 }
1332}
1333#[cfg(any(feature = "full", feature = "derive"))]
1334pub fn visit_expr_cast<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprCast) {
1335 for it in &_i.attrs {
1336 _visitor.visit_attribute(it)
1337 }
1338 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001339 tokens_helper(_visitor, &_i.as_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001340 _visitor.visit_type(&*_i.ty);
1341}
1342#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001343pub fn visit_expr_closure<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprClosure) {
1344 for it in &_i.attrs {
1345 _visitor.visit_attribute(it)
1346 }
Yusuke Sasaki4e5d9662018-07-21 02:49:47 +09001347 if let Some(ref it) = _i.asyncness {
1348 tokens_helper(_visitor, &it.span)
1349 };
David Tolnay8c81f622018-07-31 23:34:35 -07001350 if let Some(ref it) = _i.movability {
David Tolnay7ac699c2018-08-24 14:00:58 -04001351 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001352 };
1353 if let Some(ref it) = _i.capture {
David Tolnay7ac699c2018-08-24 14:00:58 -04001354 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001355 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001356 tokens_helper(_visitor, &_i.or1_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001357 for el in Punctuated::pairs(&_i.inputs) {
1358 let it = el.value();
1359 _visitor.visit_fn_arg(it)
1360 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001361 tokens_helper(_visitor, &_i.or2_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001362 _visitor.visit_return_type(&_i.output);
1363 _visitor.visit_expr(&*_i.body);
1364}
1365#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001366pub fn visit_expr_continue<'ast, V: Visit<'ast> + ?Sized>(
1367 _visitor: &mut V,
1368 _i: &'ast ExprContinue,
1369) {
1370 for it in &_i.attrs {
1371 _visitor.visit_attribute(it)
1372 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001373 tokens_helper(_visitor, &_i.continue_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001374 if let Some(ref it) = _i.label {
1375 _visitor.visit_lifetime(it)
1376 };
1377}
1378#[cfg(any(feature = "full", feature = "derive"))]
1379pub fn visit_expr_field<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprField) {
1380 for it in &_i.attrs {
1381 _visitor.visit_attribute(it)
1382 }
1383 _visitor.visit_expr(&*_i.base);
David Tolnay7ac699c2018-08-24 14:00:58 -04001384 tokens_helper(_visitor, &_i.dot_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001385 _visitor.visit_member(&_i.member);
1386}
1387#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001388pub fn visit_expr_for_loop<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprForLoop) {
1389 for it in &_i.attrs {
1390 _visitor.visit_attribute(it)
1391 }
1392 if let Some(ref it) = _i.label {
1393 _visitor.visit_label(it)
1394 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001395 tokens_helper(_visitor, &_i.for_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001396 _visitor.visit_pat(&*_i.pat);
David Tolnay7ac699c2018-08-24 14:00:58 -04001397 tokens_helper(_visitor, &_i.in_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001398 _visitor.visit_expr(&*_i.expr);
1399 _visitor.visit_block(&_i.body);
1400}
1401#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001402pub fn visit_expr_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprGroup) {
1403 for it in &_i.attrs {
1404 _visitor.visit_attribute(it)
1405 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001406 tokens_helper(_visitor, &_i.group_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001407 _visitor.visit_expr(&*_i.expr);
1408}
1409#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001410pub fn visit_expr_if<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprIf) {
1411 for it in &_i.attrs {
1412 _visitor.visit_attribute(it)
1413 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001414 tokens_helper(_visitor, &_i.if_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001415 _visitor.visit_expr(&*_i.cond);
1416 _visitor.visit_block(&_i.then_branch);
1417 if let Some(ref it) = _i.else_branch {
David Tolnay7ac699c2018-08-24 14:00:58 -04001418 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001419 _visitor.visit_expr(&*(it).1);
1420 };
1421}
1422#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001423pub fn visit_expr_in_place<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprInPlace) {
1424 for it in &_i.attrs {
1425 _visitor.visit_attribute(it)
1426 }
1427 _visitor.visit_expr(&*_i.place);
David Tolnay7ac699c2018-08-24 14:00:58 -04001428 tokens_helper(_visitor, &_i.arrow_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001429 _visitor.visit_expr(&*_i.value);
1430}
1431#[cfg(any(feature = "full", feature = "derive"))]
1432pub fn visit_expr_index<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprIndex) {
1433 for it in &_i.attrs {
1434 _visitor.visit_attribute(it)
1435 }
1436 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001437 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001438 _visitor.visit_expr(&*_i.index);
1439}
David Tolnay9c119122018-09-01 18:47:02 -07001440#[cfg(feature = "full")]
David Tolnay9c119122018-09-01 18:47:02 -07001441pub fn visit_expr_let<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprLet) {
1442 for it in &_i.attrs {
1443 _visitor.visit_attribute(it)
1444 }
1445 tokens_helper(_visitor, &_i.let_token.span);
1446 for el in Punctuated::pairs(&_i.pats) {
1447 let it = el.value();
1448 _visitor.visit_pat(it)
1449 }
1450 tokens_helper(_visitor, &_i.eq_token.spans);
1451 _visitor.visit_expr(&*_i.expr);
1452}
David Tolnay8c81f622018-07-31 23:34:35 -07001453#[cfg(any(feature = "full", feature = "derive"))]
1454pub fn visit_expr_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprLit) {
1455 for it in &_i.attrs {
1456 _visitor.visit_attribute(it)
1457 }
1458 _visitor.visit_lit(&_i.lit);
1459}
1460#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001461pub fn visit_expr_loop<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprLoop) {
1462 for it in &_i.attrs {
1463 _visitor.visit_attribute(it)
1464 }
1465 if let Some(ref it) = _i.label {
1466 _visitor.visit_label(it)
1467 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001468 tokens_helper(_visitor, &_i.loop_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001469 _visitor.visit_block(&_i.body);
1470}
1471#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001472pub fn visit_expr_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprMacro) {
1473 for it in &_i.attrs {
1474 _visitor.visit_attribute(it)
1475 }
1476 _visitor.visit_macro(&_i.mac);
1477}
1478#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001479pub fn visit_expr_match<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprMatch) {
1480 for it in &_i.attrs {
1481 _visitor.visit_attribute(it)
1482 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001483 tokens_helper(_visitor, &_i.match_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001484 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001485 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001486 for it in &_i.arms {
1487 _visitor.visit_arm(it)
1488 }
1489}
1490#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001491pub fn visit_expr_method_call<'ast, V: Visit<'ast> + ?Sized>(
1492 _visitor: &mut V,
1493 _i: &'ast ExprMethodCall,
1494) {
1495 for it in &_i.attrs {
1496 _visitor.visit_attribute(it)
1497 }
1498 _visitor.visit_expr(&*_i.receiver);
David Tolnay7ac699c2018-08-24 14:00:58 -04001499 tokens_helper(_visitor, &_i.dot_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001500 _visitor.visit_ident(&_i.method);
1501 if let Some(ref it) = _i.turbofish {
1502 _visitor.visit_method_turbofish(it)
1503 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001504 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001505 for el in Punctuated::pairs(&_i.args) {
1506 let it = el.value();
1507 _visitor.visit_expr(it)
1508 }
1509}
1510#[cfg(any(feature = "full", feature = "derive"))]
1511pub fn visit_expr_paren<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprParen) {
1512 for it in &_i.attrs {
1513 _visitor.visit_attribute(it)
1514 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001515 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001516 _visitor.visit_expr(&*_i.expr);
1517}
1518#[cfg(any(feature = "full", feature = "derive"))]
1519pub fn visit_expr_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprPath) {
1520 for it in &_i.attrs {
1521 _visitor.visit_attribute(it)
1522 }
1523 if let Some(ref it) = _i.qself {
1524 _visitor.visit_qself(it)
1525 };
1526 _visitor.visit_path(&_i.path);
1527}
1528#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001529pub fn visit_expr_range<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprRange) {
1530 for it in &_i.attrs {
1531 _visitor.visit_attribute(it)
1532 }
1533 if let Some(ref it) = _i.from {
1534 _visitor.visit_expr(&**it)
1535 };
1536 _visitor.visit_range_limits(&_i.limits);
1537 if let Some(ref it) = _i.to {
1538 _visitor.visit_expr(&**it)
1539 };
1540}
1541#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001542pub fn visit_expr_reference<'ast, V: Visit<'ast> + ?Sized>(
1543 _visitor: &mut V,
1544 _i: &'ast ExprReference,
1545) {
1546 for it in &_i.attrs {
1547 _visitor.visit_attribute(it)
1548 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001549 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001550 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04001551 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001552 };
1553 _visitor.visit_expr(&*_i.expr);
1554}
1555#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001556pub fn visit_expr_repeat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprRepeat) {
1557 for it in &_i.attrs {
1558 _visitor.visit_attribute(it)
1559 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001560 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001561 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001562 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001563 _visitor.visit_expr(&*_i.len);
1564}
1565#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001566pub fn visit_expr_return<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprReturn) {
1567 for it in &_i.attrs {
1568 _visitor.visit_attribute(it)
1569 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001570 tokens_helper(_visitor, &_i.return_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001571 if let Some(ref it) = _i.expr {
1572 _visitor.visit_expr(&**it)
1573 };
1574}
1575#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001576pub fn visit_expr_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprStruct) {
1577 for it in &_i.attrs {
1578 _visitor.visit_attribute(it)
1579 }
1580 _visitor.visit_path(&_i.path);
David Tolnay7ac699c2018-08-24 14:00:58 -04001581 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001582 for el in Punctuated::pairs(&_i.fields) {
1583 let it = el.value();
1584 _visitor.visit_field_value(it)
1585 }
1586 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001587 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001588 };
1589 if let Some(ref it) = _i.rest {
1590 _visitor.visit_expr(&**it)
1591 };
1592}
1593#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001594pub fn visit_expr_try<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprTry) {
1595 for it in &_i.attrs {
1596 _visitor.visit_attribute(it)
1597 }
1598 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001599 tokens_helper(_visitor, &_i.question_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001600}
1601#[cfg(feature = "full")]
David Tolnayfb2dd4b2018-08-24 16:45:34 -04001602pub fn visit_expr_try_block<'ast, V: Visit<'ast> + ?Sized>(
1603 _visitor: &mut V,
1604 _i: &'ast ExprTryBlock,
1605) {
1606 for it in &_i.attrs {
1607 _visitor.visit_attribute(it)
1608 }
1609 tokens_helper(_visitor, &_i.try_token.span);
1610 _visitor.visit_block(&_i.block);
1611}
1612#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001613pub fn visit_expr_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprTuple) {
1614 for it in &_i.attrs {
1615 _visitor.visit_attribute(it)
1616 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001617 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001618 for el in Punctuated::pairs(&_i.elems) {
1619 let it = el.value();
1620 _visitor.visit_expr(it)
1621 }
1622}
1623#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001624pub fn visit_expr_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprType) {
1625 for it in &_i.attrs {
1626 _visitor.visit_attribute(it)
1627 }
1628 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001629 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001630 _visitor.visit_type(&*_i.ty);
1631}
1632#[cfg(any(feature = "full", feature = "derive"))]
1633pub fn visit_expr_unary<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprUnary) {
1634 for it in &_i.attrs {
1635 _visitor.visit_attribute(it)
1636 }
1637 _visitor.visit_un_op(&_i.op);
1638 _visitor.visit_expr(&*_i.expr);
1639}
1640#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001641pub fn visit_expr_unsafe<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprUnsafe) {
1642 for it in &_i.attrs {
1643 _visitor.visit_attribute(it)
1644 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001645 tokens_helper(_visitor, &_i.unsafe_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001646 _visitor.visit_block(&_i.block);
1647}
1648#[cfg(any(feature = "full", feature = "derive"))]
1649pub fn visit_expr_verbatim<'ast, V: Visit<'ast> + ?Sized>(
1650 _visitor: &mut V,
1651 _i: &'ast ExprVerbatim,
1652) {
David Tolnay6af48992018-08-01 11:16:28 -07001653 skip!(_i.tts);
David Tolnay8c81f622018-07-31 23:34:35 -07001654}
1655#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001656pub fn visit_expr_while<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprWhile) {
1657 for it in &_i.attrs {
1658 _visitor.visit_attribute(it)
1659 }
1660 if let Some(ref it) = _i.label {
1661 _visitor.visit_label(it)
1662 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001663 tokens_helper(_visitor, &_i.while_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001664 _visitor.visit_expr(&*_i.cond);
1665 _visitor.visit_block(&_i.body);
1666}
1667#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001668pub fn visit_expr_yield<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprYield) {
1669 for it in &_i.attrs {
1670 _visitor.visit_attribute(it)
1671 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001672 tokens_helper(_visitor, &_i.yield_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001673 if let Some(ref it) = _i.expr {
1674 _visitor.visit_expr(&**it)
1675 };
1676}
1677#[cfg(any(feature = "full", feature = "derive"))]
1678pub fn visit_field<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Field) {
1679 for it in &_i.attrs {
1680 _visitor.visit_attribute(it)
1681 }
1682 _visitor.visit_visibility(&_i.vis);
1683 if let Some(ref it) = _i.ident {
1684 _visitor.visit_ident(it)
1685 };
1686 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001687 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001688 };
1689 _visitor.visit_type(&_i.ty);
1690}
David Tolnay8c81f622018-07-31 23:34:35 -07001691#[cfg(feature = "full")]
1692pub fn visit_field_pat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldPat) {
1693 for it in &_i.attrs {
1694 _visitor.visit_attribute(it)
1695 }
1696 _visitor.visit_member(&_i.member);
1697 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001698 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001699 };
1700 _visitor.visit_pat(&*_i.pat);
1701}
David Tolnay8c81f622018-07-31 23:34:35 -07001702#[cfg(feature = "full")]
1703pub fn visit_field_value<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldValue) {
1704 for it in &_i.attrs {
1705 _visitor.visit_attribute(it)
1706 }
1707 _visitor.visit_member(&_i.member);
1708 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001709 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001710 };
1711 _visitor.visit_expr(&_i.expr);
1712}
1713#[cfg(any(feature = "full", feature = "derive"))]
1714pub fn visit_fields<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Fields) {
1715 match *_i {
1716 Fields::Named(ref _binding_0) => {
1717 _visitor.visit_fields_named(_binding_0);
1718 }
1719 Fields::Unnamed(ref _binding_0) => {
1720 _visitor.visit_fields_unnamed(_binding_0);
1721 }
1722 Fields::Unit => {}
1723 }
1724}
1725#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001726pub fn visit_fields_named<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldsNamed) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001727 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001728 for el in Punctuated::pairs(&_i.named) {
1729 let it = el.value();
1730 _visitor.visit_field(it)
1731 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001732}
David Tolnay8c81f622018-07-31 23:34:35 -07001733#[cfg(any(feature = "full", feature = "derive"))]
1734pub fn visit_fields_unnamed<'ast, V: Visit<'ast> + ?Sized>(
1735 _visitor: &mut V,
1736 _i: &'ast FieldsUnnamed,
1737) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001738 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001739 for el in Punctuated::pairs(&_i.unnamed) {
1740 let it = el.value();
1741 _visitor.visit_field(it)
1742 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001743}
David Tolnay8c81f622018-07-31 23:34:35 -07001744#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001745pub fn visit_file<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast File) {
David Tolnay6af48992018-08-01 11:16:28 -07001746 skip!(_i.shebang);
David Tolnay8c81f622018-07-31 23:34:35 -07001747 for it in &_i.attrs {
1748 _visitor.visit_attribute(it)
1749 }
1750 for it in &_i.items {
1751 _visitor.visit_item(it)
1752 }
Nika Layzell27726662017-10-24 23:16:35 -04001753}
David Tolnay8c81f622018-07-31 23:34:35 -07001754#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001755pub fn visit_fn_arg<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FnArg) {
Nika Layzell27726662017-10-24 23:16:35 -04001756 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001757 FnArg::SelfRef(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001758 _visitor.visit_arg_self_ref(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001759 }
David Tolnay8c81f622018-07-31 23:34:35 -07001760 FnArg::SelfValue(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001761 _visitor.visit_arg_self(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001762 }
David Tolnay8c81f622018-07-31 23:34:35 -07001763 FnArg::Captured(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001764 _visitor.visit_arg_captured(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001765 }
David Tolnay8c81f622018-07-31 23:34:35 -07001766 FnArg::Inferred(ref _binding_0) => {
David Tolnay80ed55f2017-12-27 22:54:40 -05001767 _visitor.visit_pat(_binding_0);
1768 }
David Tolnay8c81f622018-07-31 23:34:35 -07001769 FnArg::Ignored(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001770 _visitor.visit_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001771 }
1772 }
1773}
David Tolnay8c81f622018-07-31 23:34:35 -07001774#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001775pub fn visit_fn_decl<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FnDecl) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001776 tokens_helper(_visitor, &_i.fn_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001777 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04001778 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001779 for el in Punctuated::pairs(&_i.inputs) {
1780 let it = el.value();
1781 _visitor.visit_fn_arg(it)
1782 }
1783 if let Some(ref it) = _i.variadic {
David Tolnay7ac699c2018-08-24 14:00:58 -04001784 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001785 };
1786 _visitor.visit_return_type(&_i.output);
Nika Layzell27726662017-10-24 23:16:35 -04001787}
David Tolnay8c81f622018-07-31 23:34:35 -07001788#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001789pub fn visit_foreign_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ForeignItem) {
Nika Layzell27726662017-10-24 23:16:35 -04001790 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001791 ForeignItem::Fn(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001792 _visitor.visit_foreign_item_fn(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001793 }
David Tolnay8c81f622018-07-31 23:34:35 -07001794 ForeignItem::Static(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001795 _visitor.visit_foreign_item_static(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001796 }
David Tolnay8c81f622018-07-31 23:34:35 -07001797 ForeignItem::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001798 _visitor.visit_foreign_item_type(_binding_0);
David Tolnay199bcbb2017-11-12 10:33:52 -08001799 }
David Tolnay435c1782018-08-24 16:15:44 -04001800 ForeignItem::Macro(ref _binding_0) => {
1801 _visitor.visit_foreign_item_macro(_binding_0);
1802 }
David Tolnay8c81f622018-07-31 23:34:35 -07001803 ForeignItem::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05001804 _visitor.visit_foreign_item_verbatim(_binding_0);
1805 }
Nika Layzell27726662017-10-24 23:16:35 -04001806 }
1807}
David Tolnay8c81f622018-07-31 23:34:35 -07001808#[cfg(feature = "full")]
1809pub fn visit_foreign_item_fn<'ast, V: Visit<'ast> + ?Sized>(
1810 _visitor: &mut V,
1811 _i: &'ast ForeignItemFn,
1812) {
1813 for it in &_i.attrs {
1814 _visitor.visit_attribute(it)
1815 }
1816 _visitor.visit_visibility(&_i.vis);
1817 _visitor.visit_ident(&_i.ident);
1818 _visitor.visit_fn_decl(&*_i.decl);
David Tolnay7ac699c2018-08-24 14:00:58 -04001819 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay8894f602017-11-11 12:11:04 -08001820}
David Tolnay8c81f622018-07-31 23:34:35 -07001821#[cfg(feature = "full")]
David Tolnay435c1782018-08-24 16:15:44 -04001822pub fn visit_foreign_item_macro<'ast, V: Visit<'ast> + ?Sized>(
1823 _visitor: &mut V,
1824 _i: &'ast ForeignItemMacro,
1825) {
1826 for it in &_i.attrs {
1827 _visitor.visit_attribute(it)
1828 }
1829 _visitor.visit_macro(&_i.mac);
1830 if let Some(ref it) = _i.semi_token {
1831 tokens_helper(_visitor, &it.spans)
1832 };
1833}
1834#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001835pub fn visit_foreign_item_static<'ast, V: Visit<'ast> + ?Sized>(
1836 _visitor: &mut V,
1837 _i: &'ast ForeignItemStatic,
1838) {
1839 for it in &_i.attrs {
1840 _visitor.visit_attribute(it)
1841 }
1842 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04001843 tokens_helper(_visitor, &_i.static_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001844 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04001845 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001846 };
1847 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001848 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001849 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04001850 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001851}
David Tolnay8c81f622018-07-31 23:34:35 -07001852#[cfg(feature = "full")]
1853pub fn visit_foreign_item_type<'ast, V: Visit<'ast> + ?Sized>(
1854 _visitor: &mut V,
1855 _i: &'ast ForeignItemType,
1856) {
1857 for it in &_i.attrs {
1858 _visitor.visit_attribute(it)
1859 }
1860 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04001861 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001862 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001863 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay199bcbb2017-11-12 10:33:52 -08001864}
David Tolnay8c81f622018-07-31 23:34:35 -07001865#[cfg(feature = "full")]
1866pub fn visit_foreign_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
1867 _visitor: &mut V,
1868 _i: &'ast ForeignItemVerbatim,
1869) {
David Tolnay6af48992018-08-01 11:16:28 -07001870 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05001871}
David Tolnay8c81f622018-07-31 23:34:35 -07001872#[cfg(any(feature = "full", feature = "derive"))]
1873pub fn visit_generic_argument<'ast, V: Visit<'ast> + ?Sized>(
1874 _visitor: &mut V,
1875 _i: &'ast GenericArgument,
1876) {
Nika Layzell357885a2017-12-04 15:47:07 -05001877 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001878 GenericArgument::Lifetime(ref _binding_0) => {
David Tolnay4ba63a02017-12-28 15:53:05 -05001879 _visitor.visit_lifetime(_binding_0);
Nika Layzell357885a2017-12-04 15:47:07 -05001880 }
David Tolnay8c81f622018-07-31 23:34:35 -07001881 GenericArgument::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001882 _visitor.visit_type(_binding_0);
Nika Layzell357885a2017-12-04 15:47:07 -05001883 }
David Tolnay8c81f622018-07-31 23:34:35 -07001884 GenericArgument::Binding(ref _binding_0) => {
David Tolnay506e43a2017-12-29 11:34:36 -05001885 _visitor.visit_binding(_binding_0);
Nika Layzell357885a2017-12-04 15:47:07 -05001886 }
David Tolnay9d0882a2018-09-01 19:49:14 -07001887 GenericArgument::Constraint(ref _binding_0) => {
1888 _visitor.visit_constraint(_binding_0);
1889 }
David Tolnay8c81f622018-07-31 23:34:35 -07001890 GenericArgument::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001891 _visitor.visit_expr(_binding_0);
Nika Layzellc680e612017-12-04 19:07:20 -05001892 }
Nika Layzell357885a2017-12-04 15:47:07 -05001893 }
1894}
David Tolnay8c81f622018-07-31 23:34:35 -07001895#[cfg(feature = "full")]
1896pub fn visit_generic_method_argument<'ast, V: Visit<'ast> + ?Sized>(
1897 _visitor: &mut V,
1898 _i: &'ast GenericMethodArgument,
1899) {
David Tolnayd60cfec2017-12-29 00:21:38 -05001900 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001901 GenericMethodArgument::Type(ref _binding_0) => {
David Tolnayd60cfec2017-12-29 00:21:38 -05001902 _visitor.visit_type(_binding_0);
1903 }
David Tolnay8c81f622018-07-31 23:34:35 -07001904 GenericMethodArgument::Const(ref _binding_0) => {
David Tolnayd60cfec2017-12-29 00:21:38 -05001905 _visitor.visit_expr(_binding_0);
1906 }
1907 }
1908}
David Tolnay8c81f622018-07-31 23:34:35 -07001909#[cfg(any(feature = "full", feature = "derive"))]
1910pub fn visit_generic_param<'ast, V: Visit<'ast> + ?Sized>(
1911 _visitor: &mut V,
1912 _i: &'ast GenericParam,
1913) {
David Tolnayc2f1aba2017-11-12 20:29:22 -08001914 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001915 GenericParam::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001916 _visitor.visit_type_param(_binding_0);
David Tolnayc2f1aba2017-11-12 20:29:22 -08001917 }
David Tolnay8c81f622018-07-31 23:34:35 -07001918 GenericParam::Lifetime(ref _binding_0) => {
David Tolnay517f3692018-01-01 20:17:23 -08001919 _visitor.visit_lifetime_def(_binding_0);
1920 }
David Tolnay8c81f622018-07-31 23:34:35 -07001921 GenericParam::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001922 _visitor.visit_const_param(_binding_0);
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001923 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08001924 }
1925}
David Tolnay8c81f622018-07-31 23:34:35 -07001926#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001927pub fn visit_generics<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Generics) {
David Tolnay8c81f622018-07-31 23:34:35 -07001928 if let Some(ref it) = _i.lt_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001929 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001930 };
1931 for el in Punctuated::pairs(&_i.params) {
1932 let it = el.value();
1933 _visitor.visit_generic_param(it)
1934 }
1935 if let Some(ref it) = _i.gt_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001936 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001937 };
1938 if let Some(ref it) = _i.where_clause {
1939 _visitor.visit_where_clause(it)
1940 };
Nika Layzell27726662017-10-24 23:16:35 -04001941}
David Tolnay8c81f622018-07-31 23:34:35 -07001942pub fn visit_ident<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Ident) {}
1943#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001944pub fn visit_impl_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ImplItem) {
Nika Layzell27726662017-10-24 23:16:35 -04001945 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001946 ImplItem::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001947 _visitor.visit_impl_item_const(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001948 }
David Tolnay8c81f622018-07-31 23:34:35 -07001949 ImplItem::Method(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001950 _visitor.visit_impl_item_method(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001951 }
David Tolnay8c81f622018-07-31 23:34:35 -07001952 ImplItem::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001953 _visitor.visit_impl_item_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001954 }
David Tolnaybb82ef02018-08-24 20:15:45 -04001955 ImplItem::Existential(ref _binding_0) => {
1956 _visitor.visit_impl_item_existential(_binding_0);
1957 }
David Tolnay8c81f622018-07-31 23:34:35 -07001958 ImplItem::Macro(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001959 _visitor.visit_impl_item_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001960 }
David Tolnay8c81f622018-07-31 23:34:35 -07001961 ImplItem::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05001962 _visitor.visit_impl_item_verbatim(_binding_0);
1963 }
Nika Layzell27726662017-10-24 23:16:35 -04001964 }
1965}
David Tolnay8c81f622018-07-31 23:34:35 -07001966#[cfg(feature = "full")]
1967pub fn visit_impl_item_const<'ast, V: Visit<'ast> + ?Sized>(
1968 _visitor: &mut V,
1969 _i: &'ast ImplItemConst,
1970) {
1971 for it in &_i.attrs {
1972 _visitor.visit_attribute(it)
1973 }
1974 _visitor.visit_visibility(&_i.vis);
1975 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04001976 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001977 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001978 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001979 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001980 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001981 _visitor.visit_type(&_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04001982 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001983 _visitor.visit_expr(&_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001984 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay857628c2017-11-11 12:25:31 -08001985}
David Tolnay8c81f622018-07-31 23:34:35 -07001986#[cfg(feature = "full")]
David Tolnaybb82ef02018-08-24 20:15:45 -04001987pub fn visit_impl_item_existential<'ast, V: Visit<'ast> + ?Sized>(
1988 _visitor: &mut V,
1989 _i: &'ast ImplItemExistential,
1990) {
1991 for it in &_i.attrs {
1992 _visitor.visit_attribute(it)
1993 }
1994 tokens_helper(_visitor, &_i.existential_token.span);
1995 tokens_helper(_visitor, &_i.type_token.span);
1996 _visitor.visit_ident(&_i.ident);
1997 _visitor.visit_generics(&_i.generics);
1998 if let Some(ref it) = _i.colon_token {
1999 tokens_helper(_visitor, &it.spans)
2000 };
2001 for el in Punctuated::pairs(&_i.bounds) {
2002 let it = el.value();
2003 _visitor.visit_type_param_bound(it)
2004 }
2005 tokens_helper(_visitor, &_i.semi_token.spans);
2006}
2007#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07002008pub fn visit_impl_item_macro<'ast, V: Visit<'ast> + ?Sized>(
2009 _visitor: &mut V,
2010 _i: &'ast ImplItemMacro,
2011) {
2012 for it in &_i.attrs {
2013 _visitor.visit_attribute(it)
2014 }
2015 _visitor.visit_macro(&_i.mac);
2016 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002017 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002018 };
David Tolnay857628c2017-11-11 12:25:31 -08002019}
David Tolnay8c81f622018-07-31 23:34:35 -07002020#[cfg(feature = "full")]
2021pub fn visit_impl_item_method<'ast, V: Visit<'ast> + ?Sized>(
2022 _visitor: &mut V,
2023 _i: &'ast ImplItemMethod,
2024) {
2025 for it in &_i.attrs {
2026 _visitor.visit_attribute(it)
2027 }
2028 _visitor.visit_visibility(&_i.vis);
2029 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002030 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002031 };
2032 _visitor.visit_method_sig(&_i.sig);
2033 _visitor.visit_block(&_i.block);
Nika Layzell27726662017-10-24 23:16:35 -04002034}
David Tolnay8c81f622018-07-31 23:34:35 -07002035#[cfg(feature = "full")]
2036pub fn visit_impl_item_type<'ast, V: Visit<'ast> + ?Sized>(
2037 _visitor: &mut V,
2038 _i: &'ast ImplItemType,
2039) {
2040 for it in &_i.attrs {
2041 _visitor.visit_attribute(it)
2042 }
2043 _visitor.visit_visibility(&_i.vis);
2044 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002045 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002046 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002047 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002048 _visitor.visit_ident(&_i.ident);
2049 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04002050 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002051 _visitor.visit_type(&_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002052 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002053}
David Tolnay8c81f622018-07-31 23:34:35 -07002054#[cfg(feature = "full")]
2055pub fn visit_impl_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
2056 _visitor: &mut V,
2057 _i: &'ast ImplItemVerbatim,
2058) {
David Tolnay6af48992018-08-01 11:16:28 -07002059 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05002060}
David Tolnay8c81f622018-07-31 23:34:35 -07002061#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002062pub fn visit_index<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Index) {
David Tolnay6af48992018-08-01 11:16:28 -07002063 skip!(_i.index);
David Tolnay8c81f622018-07-31 23:34:35 -07002064 _visitor.visit_span(&_i.span);
David Tolnay85b69a42017-12-27 20:43:10 -05002065}
David Tolnay8c81f622018-07-31 23:34:35 -07002066#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002067pub fn visit_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Item) {
Nika Layzell27726662017-10-24 23:16:35 -04002068 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002069 Item::ExternCrate(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002070 _visitor.visit_item_extern_crate(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002071 }
David Tolnay8c81f622018-07-31 23:34:35 -07002072 Item::Use(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002073 _visitor.visit_item_use(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002074 }
David Tolnay8c81f622018-07-31 23:34:35 -07002075 Item::Static(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002076 _visitor.visit_item_static(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002077 }
David Tolnay8c81f622018-07-31 23:34:35 -07002078 Item::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002079 _visitor.visit_item_const(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002080 }
David Tolnay8c81f622018-07-31 23:34:35 -07002081 Item::Fn(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002082 _visitor.visit_item_fn(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002083 }
David Tolnay8c81f622018-07-31 23:34:35 -07002084 Item::Mod(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002085 _visitor.visit_item_mod(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002086 }
David Tolnay8c81f622018-07-31 23:34:35 -07002087 Item::ForeignMod(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002088 _visitor.visit_item_foreign_mod(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002089 }
David Tolnay8c81f622018-07-31 23:34:35 -07002090 Item::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002091 _visitor.visit_item_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002092 }
David Tolnaybb82ef02018-08-24 20:15:45 -04002093 Item::Existential(ref _binding_0) => {
2094 _visitor.visit_item_existential(_binding_0);
2095 }
David Tolnay8c81f622018-07-31 23:34:35 -07002096 Item::Struct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002097 _visitor.visit_item_struct(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002098 }
David Tolnay8c81f622018-07-31 23:34:35 -07002099 Item::Enum(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05002100 _visitor.visit_item_enum(_binding_0);
2101 }
David Tolnay8c81f622018-07-31 23:34:35 -07002102 Item::Union(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002103 _visitor.visit_item_union(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002104 }
David Tolnay8c81f622018-07-31 23:34:35 -07002105 Item::Trait(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002106 _visitor.visit_item_trait(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002107 }
David Tolnayc6b04dd2018-08-30 23:22:51 -07002108 Item::TraitAlias(ref _binding_0) => {
2109 _visitor.visit_item_trait_alias(_binding_0);
2110 }
David Tolnay8c81f622018-07-31 23:34:35 -07002111 Item::Impl(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002112 _visitor.visit_item_impl(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002113 }
David Tolnay8c81f622018-07-31 23:34:35 -07002114 Item::Macro(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002115 _visitor.visit_item_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002116 }
David Tolnay8c81f622018-07-31 23:34:35 -07002117 Item::Macro2(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002118 _visitor.visit_item_macro2(_binding_0);
David Tolnay500d8322017-12-18 00:32:51 -08002119 }
David Tolnay8c81f622018-07-31 23:34:35 -07002120 Item::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002121 _visitor.visit_item_verbatim(_binding_0);
2122 }
Nika Layzell27726662017-10-24 23:16:35 -04002123 }
2124}
David Tolnay8c81f622018-07-31 23:34:35 -07002125#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002126pub fn visit_item_const<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemConst) {
David Tolnay8c81f622018-07-31 23:34:35 -07002127 for it in &_i.attrs {
2128 _visitor.visit_attribute(it)
2129 }
2130 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002131 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002132 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002133 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002134 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002135 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002136 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04002137 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnayc6b55bc2017-11-09 22:48:38 -08002138}
David Tolnay8c81f622018-07-31 23:34:35 -07002139#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002140pub fn visit_item_enum<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemEnum) {
David Tolnay8c81f622018-07-31 23:34:35 -07002141 for it in &_i.attrs {
2142 _visitor.visit_attribute(it)
2143 }
2144 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002145 tokens_helper(_visitor, &_i.enum_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002146 _visitor.visit_ident(&_i.ident);
2147 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04002148 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002149 for el in Punctuated::pairs(&_i.variants) {
2150 let it = el.value();
2151 _visitor.visit_variant(it)
2152 }
David Tolnayc6b55bc2017-11-09 22:48:38 -08002153}
David Tolnay8c81f622018-07-31 23:34:35 -07002154#[cfg(feature = "full")]
David Tolnaybb82ef02018-08-24 20:15:45 -04002155pub fn visit_item_existential<'ast, V: Visit<'ast> + ?Sized>(
2156 _visitor: &mut V,
2157 _i: &'ast ItemExistential,
2158) {
2159 for it in &_i.attrs {
2160 _visitor.visit_attribute(it)
2161 }
2162 _visitor.visit_visibility(&_i.vis);
2163 tokens_helper(_visitor, &_i.existential_token.span);
2164 tokens_helper(_visitor, &_i.type_token.span);
2165 _visitor.visit_ident(&_i.ident);
2166 _visitor.visit_generics(&_i.generics);
2167 if let Some(ref it) = _i.colon_token {
2168 tokens_helper(_visitor, &it.spans)
2169 };
2170 for el in Punctuated::pairs(&_i.bounds) {
2171 let it = el.value();
2172 _visitor.visit_type_param_bound(it)
2173 }
2174 tokens_helper(_visitor, &_i.semi_token.spans);
2175}
2176#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07002177pub fn visit_item_extern_crate<'ast, V: Visit<'ast> + ?Sized>(
2178 _visitor: &mut V,
2179 _i: &'ast ItemExternCrate,
2180) {
2181 for it in &_i.attrs {
2182 _visitor.visit_attribute(it)
2183 }
2184 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002185 tokens_helper(_visitor, &_i.extern_token.span);
2186 tokens_helper(_visitor, &_i.crate_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002187 _visitor.visit_ident(&_i.ident);
2188 if let Some(ref it) = _i.rename {
David Tolnay7ac699c2018-08-24 14:00:58 -04002189 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002190 _visitor.visit_ident(&(it).1);
2191 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002192 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnayc6b55bc2017-11-09 22:48:38 -08002193}
David Tolnay8c81f622018-07-31 23:34:35 -07002194#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002195pub fn visit_item_fn<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemFn) {
David Tolnay8c81f622018-07-31 23:34:35 -07002196 for it in &_i.attrs {
2197 _visitor.visit_attribute(it)
2198 }
2199 _visitor.visit_visibility(&_i.vis);
2200 if let Some(ref it) = _i.constness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002201 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002202 };
2203 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002204 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002205 };
Yusuke Sasakif00a3ef2018-07-20 22:08:42 +09002206 if let Some(ref it) = _i.asyncness {
2207 tokens_helper(_visitor, &it.span)
2208 };
David Tolnay8c81f622018-07-31 23:34:35 -07002209 if let Some(ref it) = _i.abi {
2210 _visitor.visit_abi(it)
2211 };
2212 _visitor.visit_ident(&_i.ident);
2213 _visitor.visit_fn_decl(&*_i.decl);
2214 _visitor.visit_block(&*_i.block);
David Tolnayc6b55bc2017-11-09 22:48:38 -08002215}
David Tolnay8c81f622018-07-31 23:34:35 -07002216#[cfg(feature = "full")]
2217pub fn visit_item_foreign_mod<'ast, V: Visit<'ast> + ?Sized>(
2218 _visitor: &mut V,
2219 _i: &'ast ItemForeignMod,
2220) {
2221 for it in &_i.attrs {
2222 _visitor.visit_attribute(it)
2223 }
2224 _visitor.visit_abi(&_i.abi);
David Tolnay7ac699c2018-08-24 14:00:58 -04002225 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002226 for it in &_i.items {
2227 _visitor.visit_foreign_item(it)
2228 }
David Tolnayc6b55bc2017-11-09 22:48:38 -08002229}
David Tolnay8c81f622018-07-31 23:34:35 -07002230#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002231pub fn visit_item_impl<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemImpl) {
David Tolnay8c81f622018-07-31 23:34:35 -07002232 for it in &_i.attrs {
2233 _visitor.visit_attribute(it)
2234 }
2235 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002236 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002237 };
2238 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002239 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002240 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002241 tokens_helper(_visitor, &_i.impl_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002242 _visitor.visit_generics(&_i.generics);
2243 if let Some(ref it) = _i.trait_ {
2244 if let Some(ref it) = (it).0 {
David Tolnay7ac699c2018-08-24 14:00:58 -04002245 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002246 };
2247 _visitor.visit_path(&(it).1);
David Tolnay7ac699c2018-08-24 14:00:58 -04002248 tokens_helper(_visitor, &(it).2.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002249 };
2250 _visitor.visit_type(&*_i.self_ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002251 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002252 for it in &_i.items {
2253 _visitor.visit_impl_item(it)
2254 }
David Tolnayc6b55bc2017-11-09 22:48:38 -08002255}
David Tolnay8c81f622018-07-31 23:34:35 -07002256#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002257pub fn visit_item_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemMacro) {
David Tolnay8c81f622018-07-31 23:34:35 -07002258 for it in &_i.attrs {
2259 _visitor.visit_attribute(it)
2260 }
2261 if let Some(ref it) = _i.ident {
2262 _visitor.visit_ident(it)
2263 };
2264 _visitor.visit_macro(&_i.mac);
2265 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002266 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002267 };
David Tolnayc6b55bc2017-11-09 22:48:38 -08002268}
David Tolnay8c81f622018-07-31 23:34:35 -07002269#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002270pub fn visit_item_macro2<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemMacro2) {
David Tolnay8c81f622018-07-31 23:34:35 -07002271 for it in &_i.attrs {
2272 _visitor.visit_attribute(it)
2273 }
2274 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002275 tokens_helper(_visitor, &_i.macro_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002276 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002277 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay6af48992018-08-01 11:16:28 -07002278 skip!(_i.args);
David Tolnay7ac699c2018-08-24 14:00:58 -04002279 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay6af48992018-08-01 11:16:28 -07002280 skip!(_i.body);
David Tolnay500d8322017-12-18 00:32:51 -08002281}
David Tolnay8c81f622018-07-31 23:34:35 -07002282#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002283pub fn visit_item_mod<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemMod) {
David Tolnay8c81f622018-07-31 23:34:35 -07002284 for it in &_i.attrs {
2285 _visitor.visit_attribute(it)
2286 }
2287 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002288 tokens_helper(_visitor, &_i.mod_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002289 _visitor.visit_ident(&_i.ident);
2290 if let Some(ref it) = _i.content {
David Tolnay7ac699c2018-08-24 14:00:58 -04002291 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002292 for it in &(it).1 {
2293 _visitor.visit_item(it)
2294 }
2295 };
2296 if let Some(ref it) = _i.semi {
David Tolnay7ac699c2018-08-24 14:00:58 -04002297 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002298 };
Nika Layzell27726662017-10-24 23:16:35 -04002299}
David Tolnay8c81f622018-07-31 23:34:35 -07002300#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002301pub fn visit_item_static<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemStatic) {
David Tolnay8c81f622018-07-31 23:34:35 -07002302 for it in &_i.attrs {
2303 _visitor.visit_attribute(it)
2304 }
2305 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002306 tokens_helper(_visitor, &_i.static_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002307 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04002308 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002309 };
2310 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002311 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002312 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002313 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002314 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04002315 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002316}
David Tolnay8c81f622018-07-31 23:34:35 -07002317#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002318pub fn visit_item_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemStruct) {
David Tolnay8c81f622018-07-31 23:34:35 -07002319 for it in &_i.attrs {
2320 _visitor.visit_attribute(it)
2321 }
2322 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002323 tokens_helper(_visitor, &_i.struct_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002324 _visitor.visit_ident(&_i.ident);
2325 _visitor.visit_generics(&_i.generics);
2326 _visitor.visit_fields(&_i.fields);
2327 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002328 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002329 };
Nika Layzell27726662017-10-24 23:16:35 -04002330}
David Tolnay8c81f622018-07-31 23:34:35 -07002331#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002332pub fn visit_item_trait<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemTrait) {
David Tolnay8c81f622018-07-31 23:34:35 -07002333 for it in &_i.attrs {
2334 _visitor.visit_attribute(it)
2335 }
2336 _visitor.visit_visibility(&_i.vis);
2337 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002338 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002339 };
2340 if let Some(ref it) = _i.auto_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002341 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002342 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002343 tokens_helper(_visitor, &_i.trait_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002344 _visitor.visit_ident(&_i.ident);
2345 _visitor.visit_generics(&_i.generics);
2346 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002347 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002348 };
2349 for el in Punctuated::pairs(&_i.supertraits) {
2350 let it = el.value();
2351 _visitor.visit_type_param_bound(it)
2352 }
David Tolnay7ac699c2018-08-24 14:00:58 -04002353 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002354 for it in &_i.items {
2355 _visitor.visit_trait_item(it)
2356 }
Nika Layzell27726662017-10-24 23:16:35 -04002357}
David Tolnay8c81f622018-07-31 23:34:35 -07002358#[cfg(feature = "full")]
David Tolnayc6b04dd2018-08-30 23:22:51 -07002359pub fn visit_item_trait_alias<'ast, V: Visit<'ast> + ?Sized>(
2360 _visitor: &mut V,
2361 _i: &'ast ItemTraitAlias,
2362) {
2363 for it in &_i.attrs {
2364 _visitor.visit_attribute(it)
2365 }
2366 _visitor.visit_visibility(&_i.vis);
2367 tokens_helper(_visitor, &_i.trait_token.span);
2368 _visitor.visit_ident(&_i.ident);
2369 _visitor.visit_generics(&_i.generics);
2370 tokens_helper(_visitor, &_i.eq_token.spans);
2371 for el in Punctuated::pairs(&_i.bounds) {
2372 let it = el.value();
2373 _visitor.visit_type_param_bound(it)
2374 }
2375 tokens_helper(_visitor, &_i.semi_token.spans);
2376}
2377#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002378pub fn visit_item_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemType) {
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);
David Tolnay7ac699c2018-08-24 14:00:58 -04002383 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002384 _visitor.visit_ident(&_i.ident);
2385 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04002386 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002387 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002388 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002389}
David Tolnay8c81f622018-07-31 23:34:35 -07002390#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002391pub fn visit_item_union<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemUnion) {
David Tolnay8c81f622018-07-31 23:34:35 -07002392 for it in &_i.attrs {
2393 _visitor.visit_attribute(it)
2394 }
2395 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002396 tokens_helper(_visitor, &_i.union_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002397 _visitor.visit_ident(&_i.ident);
2398 _visitor.visit_generics(&_i.generics);
2399 _visitor.visit_fields_named(&_i.fields);
Nika Layzell27726662017-10-24 23:16:35 -04002400}
David Tolnay8c81f622018-07-31 23:34:35 -07002401#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002402pub fn visit_item_use<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemUse) {
David Tolnay8c81f622018-07-31 23:34:35 -07002403 for it in &_i.attrs {
2404 _visitor.visit_attribute(it)
2405 }
2406 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002407 tokens_helper(_visitor, &_i.use_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002408 if let Some(ref it) = _i.leading_colon {
David Tolnay7ac699c2018-08-24 14:00:58 -04002409 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002410 };
2411 _visitor.visit_use_tree(&_i.tree);
David Tolnay7ac699c2018-08-24 14:00:58 -04002412 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002413}
David Tolnay8c81f622018-07-31 23:34:35 -07002414#[cfg(feature = "full")]
2415pub fn visit_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
2416 _visitor: &mut V,
2417 _i: &'ast ItemVerbatim,
2418) {
David Tolnay6af48992018-08-01 11:16:28 -07002419 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05002420}
David Tolnay8c81f622018-07-31 23:34:35 -07002421#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002422pub fn visit_label<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Label) {
David Tolnay8c81f622018-07-31 23:34:35 -07002423 _visitor.visit_lifetime(&_i.name);
David Tolnay7ac699c2018-08-24 14:00:58 -04002424 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnaybcd498f2017-12-29 12:02:33 -05002425}
David Tolnay4b4c4b62018-01-06 13:48:05 -08002426pub fn visit_lifetime<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Lifetime) {
David Tolnay17f63892018-08-31 10:36:32 -07002427 _visitor.visit_span(&_i.apostrophe);
David Tolnay8c81f622018-07-31 23:34:35 -07002428 _visitor.visit_ident(&_i.ident);
David Tolnay4ba63a02017-12-28 15:53:05 -05002429}
David Tolnay8c81f622018-07-31 23:34:35 -07002430#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002431pub fn visit_lifetime_def<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LifetimeDef) {
David Tolnay8c81f622018-07-31 23:34:35 -07002432 for it in &_i.attrs {
2433 _visitor.visit_attribute(it)
2434 }
2435 _visitor.visit_lifetime(&_i.lifetime);
2436 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002437 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002438 };
2439 for el in Punctuated::pairs(&_i.bounds) {
2440 let it = el.value();
2441 _visitor.visit_lifetime(it)
2442 }
David Tolnay4ba63a02017-12-28 15:53:05 -05002443}
David Tolnay8c81f622018-07-31 23:34:35 -07002444#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002445pub fn visit_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Lit) {
David Tolnay360efd22018-01-04 23:35:26 -08002446 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002447 Lit::Str(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002448 _visitor.visit_lit_str(_binding_0);
2449 }
David Tolnay8c81f622018-07-31 23:34:35 -07002450 Lit::ByteStr(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002451 _visitor.visit_lit_byte_str(_binding_0);
2452 }
David Tolnay8c81f622018-07-31 23:34:35 -07002453 Lit::Byte(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002454 _visitor.visit_lit_byte(_binding_0);
2455 }
David Tolnay8c81f622018-07-31 23:34:35 -07002456 Lit::Char(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002457 _visitor.visit_lit_char(_binding_0);
2458 }
David Tolnay8c81f622018-07-31 23:34:35 -07002459 Lit::Int(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002460 _visitor.visit_lit_int(_binding_0);
2461 }
David Tolnay8c81f622018-07-31 23:34:35 -07002462 Lit::Float(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002463 _visitor.visit_lit_float(_binding_0);
2464 }
David Tolnay8c81f622018-07-31 23:34:35 -07002465 Lit::Bool(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002466 _visitor.visit_lit_bool(_binding_0);
2467 }
David Tolnay8c81f622018-07-31 23:34:35 -07002468 Lit::Verbatim(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002469 _visitor.visit_lit_verbatim(_binding_0);
2470 }
2471 }
2472}
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_bool<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitBool) {
David Tolnay6af48992018-08-01 11:16:28 -07002475 skip!(_i.value);
David Tolnay8c81f622018-07-31 23:34:35 -07002476 _visitor.visit_span(&_i.span);
Nika Layzell27726662017-10-24 23:16:35 -04002477}
David Tolnay8c81f622018-07-31 23:34:35 -07002478#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002479pub fn visit_lit_byte<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitByte) {
David Tolnay6af48992018-08-01 11:16:28 -07002480 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002481}
David Tolnay8c81f622018-07-31 23:34:35 -07002482#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002483pub fn visit_lit_byte_str<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitByteStr) {
David Tolnay6af48992018-08-01 11:16:28 -07002484 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002485}
David Tolnay8c81f622018-07-31 23:34:35 -07002486#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002487pub fn visit_lit_char<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitChar) {
David Tolnay6af48992018-08-01 11:16:28 -07002488 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002489}
David Tolnay8c81f622018-07-31 23:34:35 -07002490#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002491pub fn visit_lit_float<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitFloat) {
David Tolnay6af48992018-08-01 11:16:28 -07002492 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002493}
David Tolnay8c81f622018-07-31 23:34:35 -07002494#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002495pub fn visit_lit_int<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitInt) {
David Tolnay6af48992018-08-01 11:16:28 -07002496 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002497}
David Tolnay8c81f622018-07-31 23:34:35 -07002498#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002499pub fn visit_lit_str<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitStr) {
David Tolnay6af48992018-08-01 11:16:28 -07002500 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002501}
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_verbatim<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitVerbatim) {
David Tolnay6af48992018-08-01 11:16:28 -07002504 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002505}
David Tolnay8c81f622018-07-31 23:34:35 -07002506#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002507pub fn visit_local<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Local) {
David Tolnay8c81f622018-07-31 23:34:35 -07002508 for it in &_i.attrs {
2509 _visitor.visit_attribute(it)
2510 }
David Tolnay7ac699c2018-08-24 14:00:58 -04002511 tokens_helper(_visitor, &_i.let_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002512 for el in Punctuated::pairs(&_i.pats) {
2513 let it = el.value();
2514 _visitor.visit_pat(it)
2515 }
2516 if let Some(ref it) = _i.ty {
David Tolnay7ac699c2018-08-24 14:00:58 -04002517 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002518 _visitor.visit_type(&*(it).1);
2519 };
2520 if let Some(ref it) = _i.init {
David Tolnay7ac699c2018-08-24 14:00:58 -04002521 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002522 _visitor.visit_expr(&*(it).1);
2523 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002524 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002525}
David Tolnay8c81f622018-07-31 23:34:35 -07002526#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002527pub fn visit_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Macro) {
David Tolnay8c81f622018-07-31 23:34:35 -07002528 _visitor.visit_path(&_i.path);
David Tolnay7ac699c2018-08-24 14:00:58 -04002529 tokens_helper(_visitor, &_i.bang_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002530 _visitor.visit_macro_delimiter(&_i.delimiter);
David Tolnay6af48992018-08-01 11:16:28 -07002531 skip!(_i.tts);
David Tolnayab919512017-12-30 23:31:51 -05002532}
David Tolnay8c81f622018-07-31 23:34:35 -07002533#[cfg(any(feature = "full", feature = "derive"))]
2534pub fn visit_macro_delimiter<'ast, V: Visit<'ast> + ?Sized>(
2535 _visitor: &mut V,
2536 _i: &'ast MacroDelimiter,
2537) {
David Tolnayab919512017-12-30 23:31:51 -05002538 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002539 MacroDelimiter::Paren(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002540 tokens_helper(_visitor, &_binding_0.span);
David Tolnayab919512017-12-30 23:31:51 -05002541 }
David Tolnay8c81f622018-07-31 23:34:35 -07002542 MacroDelimiter::Brace(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002543 tokens_helper(_visitor, &_binding_0.span);
David Tolnayab919512017-12-30 23:31:51 -05002544 }
David Tolnay8c81f622018-07-31 23:34:35 -07002545 MacroDelimiter::Bracket(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002546 tokens_helper(_visitor, &_binding_0.span);
David Tolnayab919512017-12-30 23:31:51 -05002547 }
2548 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002549}
David Tolnay8c81f622018-07-31 23:34:35 -07002550#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002551pub fn visit_member<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Member) {
David Tolnay85b69a42017-12-27 20:43:10 -05002552 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002553 Member::Named(ref _binding_0) => {
Alex Crichtond261d092018-05-18 13:47:35 -07002554 _visitor.visit_ident(_binding_0);
David Tolnay85b69a42017-12-27 20:43:10 -05002555 }
David Tolnay8c81f622018-07-31 23:34:35 -07002556 Member::Unnamed(ref _binding_0) => {
David Tolnay85b69a42017-12-27 20:43:10 -05002557 _visitor.visit_index(_binding_0);
2558 }
2559 }
2560}
David Tolnay8c81f622018-07-31 23:34:35 -07002561#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayaaadd782018-01-06 22:58:13 -08002562pub fn visit_meta<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Meta) {
Nika Layzell27726662017-10-24 23:16:35 -04002563 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002564 Meta::Word(ref _binding_0) => {
Alex Crichtond261d092018-05-18 13:47:35 -07002565 _visitor.visit_ident(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002566 }
David Tolnay8c81f622018-07-31 23:34:35 -07002567 Meta::List(ref _binding_0) => {
David Tolnayaaadd782018-01-06 22:58:13 -08002568 _visitor.visit_meta_list(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002569 }
David Tolnay8c81f622018-07-31 23:34:35 -07002570 Meta::NameValue(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002571 _visitor.visit_meta_name_value(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002572 }
2573 }
2574}
David Tolnay8c81f622018-07-31 23:34:35 -07002575#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayaaadd782018-01-06 22:58:13 -08002576pub fn visit_meta_list<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast MetaList) {
David Tolnay8c81f622018-07-31 23:34:35 -07002577 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002578 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002579 for el in Punctuated::pairs(&_i.nested) {
2580 let it = el.value();
2581 _visitor.visit_nested_meta(it)
2582 }
Nika Layzell27726662017-10-24 23:16:35 -04002583}
David Tolnay8c81f622018-07-31 23:34:35 -07002584#[cfg(any(feature = "full", feature = "derive"))]
2585pub fn visit_meta_name_value<'ast, V: Visit<'ast> + ?Sized>(
2586 _visitor: &mut V,
2587 _i: &'ast MetaNameValue,
2588) {
2589 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002590 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002591 _visitor.visit_lit(&_i.lit);
Nika Layzell27726662017-10-24 23:16:35 -04002592}
David Tolnay8c81f622018-07-31 23:34:35 -07002593#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002594pub fn visit_method_sig<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast MethodSig) {
David Tolnay8c81f622018-07-31 23:34:35 -07002595 if let Some(ref it) = _i.constness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002596 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002597 };
2598 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002599 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002600 };
Yusuke Sasakif00a3ef2018-07-20 22:08:42 +09002601 if let Some(ref it) = _i.asyncness {
2602 tokens_helper(_visitor, &it.span)
2603 };
David Tolnay8c81f622018-07-31 23:34:35 -07002604 if let Some(ref it) = _i.abi {
2605 _visitor.visit_abi(it)
2606 };
2607 _visitor.visit_ident(&_i.ident);
2608 _visitor.visit_fn_decl(&_i.decl);
Nika Layzell27726662017-10-24 23:16:35 -04002609}
David Tolnay8c81f622018-07-31 23:34:35 -07002610#[cfg(feature = "full")]
2611pub fn visit_method_turbofish<'ast, V: Visit<'ast> + ?Sized>(
2612 _visitor: &mut V,
2613 _i: &'ast MethodTurbofish,
2614) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002615 tokens_helper(_visitor, &_i.colon2_token.spans);
2616 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002617 for el in Punctuated::pairs(&_i.args) {
2618 let it = el.value();
2619 _visitor.visit_generic_method_argument(it)
2620 }
David Tolnay7ac699c2018-08-24 14:00:58 -04002621 tokens_helper(_visitor, &_i.gt_token.spans);
David Tolnayd60cfec2017-12-29 00:21:38 -05002622}
David Tolnay8c81f622018-07-31 23:34:35 -07002623#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayaaadd782018-01-06 22:58:13 -08002624pub fn visit_nested_meta<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast NestedMeta) {
Nika Layzell27726662017-10-24 23:16:35 -04002625 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002626 NestedMeta::Meta(ref _binding_0) => {
David Tolnayaaadd782018-01-06 22:58:13 -08002627 _visitor.visit_meta(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002628 }
David Tolnay8c81f622018-07-31 23:34:35 -07002629 NestedMeta::Literal(ref _binding_0) => {
David Tolnay4ba63a02017-12-28 15:53:05 -05002630 _visitor.visit_lit(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002631 }
2632 }
2633}
David Tolnay8c81f622018-07-31 23:34:35 -07002634#[cfg(any(feature = "full", feature = "derive"))]
2635pub fn visit_parenthesized_generic_arguments<'ast, V: Visit<'ast> + ?Sized>(
2636 _visitor: &mut V,
2637 _i: &'ast ParenthesizedGenericArguments,
2638) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002639 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002640 for el in Punctuated::pairs(&_i.inputs) {
2641 let it = el.value();
2642 _visitor.visit_type(it)
2643 }
2644 _visitor.visit_return_type(&_i.output);
Nika Layzell27726662017-10-24 23:16:35 -04002645}
David Tolnay8c81f622018-07-31 23:34:35 -07002646#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002647pub fn visit_pat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Pat) {
Nika Layzell27726662017-10-24 23:16:35 -04002648 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002649 Pat::Wild(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002650 _visitor.visit_pat_wild(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002651 }
David Tolnay8c81f622018-07-31 23:34:35 -07002652 Pat::Ident(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002653 _visitor.visit_pat_ident(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002654 }
David Tolnay8c81f622018-07-31 23:34:35 -07002655 Pat::Struct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002656 _visitor.visit_pat_struct(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002657 }
David Tolnay8c81f622018-07-31 23:34:35 -07002658 Pat::TupleStruct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002659 _visitor.visit_pat_tuple_struct(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002660 }
David Tolnay8c81f622018-07-31 23:34:35 -07002661 Pat::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002662 _visitor.visit_pat_path(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002663 }
David Tolnay8c81f622018-07-31 23:34:35 -07002664 Pat::Tuple(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002665 _visitor.visit_pat_tuple(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002666 }
David Tolnay8c81f622018-07-31 23:34:35 -07002667 Pat::Box(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002668 _visitor.visit_pat_box(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002669 }
David Tolnay8c81f622018-07-31 23:34:35 -07002670 Pat::Ref(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002671 _visitor.visit_pat_ref(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002672 }
David Tolnay8c81f622018-07-31 23:34:35 -07002673 Pat::Lit(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002674 _visitor.visit_pat_lit(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002675 }
David Tolnay8c81f622018-07-31 23:34:35 -07002676 Pat::Range(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002677 _visitor.visit_pat_range(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002678 }
David Tolnay8c81f622018-07-31 23:34:35 -07002679 Pat::Slice(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002680 _visitor.visit_pat_slice(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002681 }
David Tolnay8c81f622018-07-31 23:34:35 -07002682 Pat::Macro(ref _binding_0) => {
David Tolnay323279a2017-12-29 11:26:32 -05002683 _visitor.visit_pat_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002684 }
David Tolnay8c81f622018-07-31 23:34:35 -07002685 Pat::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002686 _visitor.visit_pat_verbatim(_binding_0);
2687 }
Nika Layzell27726662017-10-24 23:16:35 -04002688 }
2689}
David Tolnay8c81f622018-07-31 23:34:35 -07002690#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002691pub fn visit_pat_box<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatBox) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002692 tokens_helper(_visitor, &_i.box_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002693 _visitor.visit_pat(&*_i.pat);
Nika Layzell27726662017-10-24 23:16:35 -04002694}
David Tolnay8c81f622018-07-31 23:34:35 -07002695#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002696pub fn visit_pat_ident<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatIdent) {
David Tolnay8c81f622018-07-31 23:34:35 -07002697 if let Some(ref it) = _i.by_ref {
David Tolnay7ac699c2018-08-24 14:00:58 -04002698 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002699 };
2700 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04002701 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002702 };
2703 _visitor.visit_ident(&_i.ident);
2704 if let Some(ref it) = _i.subpat {
David Tolnay7ac699c2018-08-24 14:00:58 -04002705 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002706 _visitor.visit_pat(&*(it).1);
2707 };
Nika Layzell27726662017-10-24 23:16:35 -04002708}
David Tolnay8c81f622018-07-31 23:34:35 -07002709#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002710pub fn visit_pat_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatLit) {
David Tolnay8c81f622018-07-31 23:34:35 -07002711 _visitor.visit_expr(&*_i.expr);
Nika Layzell27726662017-10-24 23:16:35 -04002712}
David Tolnay8c81f622018-07-31 23:34:35 -07002713#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002714pub fn visit_pat_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatMacro) {
David Tolnay8c81f622018-07-31 23:34:35 -07002715 _visitor.visit_macro(&_i.mac);
David Tolnay323279a2017-12-29 11:26:32 -05002716}
David Tolnay8c81f622018-07-31 23:34:35 -07002717#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002718pub fn visit_pat_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatPath) {
David Tolnay8c81f622018-07-31 23:34:35 -07002719 if let Some(ref it) = _i.qself {
2720 _visitor.visit_qself(it)
2721 };
2722 _visitor.visit_path(&_i.path);
Nika Layzell27726662017-10-24 23:16:35 -04002723}
David Tolnay8c81f622018-07-31 23:34:35 -07002724#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002725pub fn visit_pat_range<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatRange) {
David Tolnay8c81f622018-07-31 23:34:35 -07002726 _visitor.visit_expr(&*_i.lo);
2727 _visitor.visit_range_limits(&_i.limits);
2728 _visitor.visit_expr(&*_i.hi);
Nika Layzell27726662017-10-24 23:16:35 -04002729}
David Tolnay8c81f622018-07-31 23:34:35 -07002730#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002731pub fn visit_pat_ref<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatRef) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002732 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002733 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04002734 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002735 };
2736 _visitor.visit_pat(&*_i.pat);
Nika Layzell27726662017-10-24 23:16:35 -04002737}
David Tolnay8c81f622018-07-31 23:34:35 -07002738#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002739pub fn visit_pat_slice<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatSlice) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002740 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002741 for el in Punctuated::pairs(&_i.front) {
2742 let it = el.value();
2743 _visitor.visit_pat(it)
2744 }
2745 if let Some(ref it) = _i.middle {
2746 _visitor.visit_pat(&**it)
2747 };
2748 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002749 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002750 };
2751 if let Some(ref it) = _i.comma_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002752 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002753 };
2754 for el in Punctuated::pairs(&_i.back) {
2755 let it = el.value();
2756 _visitor.visit_pat(it)
2757 }
Nika Layzell27726662017-10-24 23:16:35 -04002758}
David Tolnay8c81f622018-07-31 23:34:35 -07002759#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002760pub fn visit_pat_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatStruct) {
David Tolnay8c81f622018-07-31 23:34:35 -07002761 _visitor.visit_path(&_i.path);
David Tolnay7ac699c2018-08-24 14:00:58 -04002762 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002763 for el in Punctuated::pairs(&_i.fields) {
2764 let it = el.value();
2765 _visitor.visit_field_pat(it)
2766 }
2767 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002768 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002769 };
Nika Layzell27726662017-10-24 23:16:35 -04002770}
David Tolnay8c81f622018-07-31 23:34:35 -07002771#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002772pub fn visit_pat_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatTuple) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002773 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002774 for el in Punctuated::pairs(&_i.front) {
2775 let it = el.value();
2776 _visitor.visit_pat(it)
2777 }
2778 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002779 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002780 };
2781 if let Some(ref it) = _i.comma_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002782 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002783 };
2784 for el in Punctuated::pairs(&_i.back) {
2785 let it = el.value();
2786 _visitor.visit_pat(it)
2787 }
Nika Layzell27726662017-10-24 23:16:35 -04002788}
David Tolnay8c81f622018-07-31 23:34:35 -07002789#[cfg(feature = "full")]
2790pub fn visit_pat_tuple_struct<'ast, V: Visit<'ast> + ?Sized>(
2791 _visitor: &mut V,
2792 _i: &'ast PatTupleStruct,
2793) {
2794 _visitor.visit_path(&_i.path);
2795 _visitor.visit_pat_tuple(&_i.pat);
Nika Layzell27726662017-10-24 23:16:35 -04002796}
David Tolnay8c81f622018-07-31 23:34:35 -07002797#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002798pub fn visit_pat_verbatim<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatVerbatim) {
David Tolnay6af48992018-08-01 11:16:28 -07002799 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05002800}
David Tolnay8c81f622018-07-31 23:34:35 -07002801#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002802pub fn visit_pat_wild<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatWild) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002803 tokens_helper(_visitor, &_i.underscore_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002804}
David Tolnay8c81f622018-07-31 23:34:35 -07002805#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002806pub fn visit_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Path) {
David Tolnay8c81f622018-07-31 23:34:35 -07002807 if let Some(ref it) = _i.leading_colon {
David Tolnay7ac699c2018-08-24 14:00:58 -04002808 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002809 };
2810 for el in Punctuated::pairs(&_i.segments) {
2811 let it = el.value();
2812 _visitor.visit_path_segment(it)
2813 }
Nika Layzell27726662017-10-24 23:16:35 -04002814}
David Tolnay8c81f622018-07-31 23:34:35 -07002815#[cfg(any(feature = "full", feature = "derive"))]
2816pub fn visit_path_arguments<'ast, V: Visit<'ast> + ?Sized>(
2817 _visitor: &mut V,
2818 _i: &'ast PathArguments,
2819) {
Nika Layzellc08227a2017-12-04 16:30:17 -05002820 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002821 PathArguments::None => {}
2822 PathArguments::AngleBracketed(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002823 _visitor.visit_angle_bracketed_generic_arguments(_binding_0);
Nika Layzellc08227a2017-12-04 16:30:17 -05002824 }
David Tolnay8c81f622018-07-31 23:34:35 -07002825 PathArguments::Parenthesized(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002826 _visitor.visit_parenthesized_generic_arguments(_binding_0);
Nika Layzellc08227a2017-12-04 16:30:17 -05002827 }
2828 }
2829}
David Tolnay8c81f622018-07-31 23:34:35 -07002830#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002831pub fn visit_path_segment<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PathSegment) {
David Tolnay8c81f622018-07-31 23:34:35 -07002832 _visitor.visit_ident(&_i.ident);
2833 _visitor.visit_path_arguments(&_i.arguments);
Nika Layzell27726662017-10-24 23:16:35 -04002834}
David Tolnay8c81f622018-07-31 23:34:35 -07002835#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002836pub fn visit_predicate_eq<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PredicateEq) {
David Tolnay8c81f622018-07-31 23:34:35 -07002837 _visitor.visit_type(&_i.lhs_ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002838 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002839 _visitor.visit_type(&_i.rhs_ty);
David Tolnayd4add852018-01-01 20:13:24 -08002840}
David Tolnay8c81f622018-07-31 23:34:35 -07002841#[cfg(any(feature = "full", feature = "derive"))]
2842pub fn visit_predicate_lifetime<'ast, V: Visit<'ast> + ?Sized>(
2843 _visitor: &mut V,
2844 _i: &'ast PredicateLifetime,
2845) {
2846 _visitor.visit_lifetime(&_i.lifetime);
David Tolnay1b8e2852018-08-26 08:25:18 -04002847 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002848 for el in Punctuated::pairs(&_i.bounds) {
2849 let it = el.value();
2850 _visitor.visit_lifetime(it)
2851 }
David Tolnayd4add852018-01-01 20:13:24 -08002852}
David Tolnay8c81f622018-07-31 23:34:35 -07002853#[cfg(any(feature = "full", feature = "derive"))]
2854pub fn visit_predicate_type<'ast, V: Visit<'ast> + ?Sized>(
2855 _visitor: &mut V,
2856 _i: &'ast PredicateType,
2857) {
2858 if let Some(ref it) = _i.lifetimes {
2859 _visitor.visit_bound_lifetimes(it)
2860 };
2861 _visitor.visit_type(&_i.bounded_ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002862 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002863 for el in Punctuated::pairs(&_i.bounds) {
2864 let it = el.value();
2865 _visitor.visit_type_param_bound(it)
2866 }
David Tolnayd4add852018-01-01 20:13:24 -08002867}
David Tolnay8c81f622018-07-31 23:34:35 -07002868#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002869pub fn visit_qself<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast QSelf) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002870 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002871 _visitor.visit_type(&*_i.ty);
David Tolnay6af48992018-08-01 11:16:28 -07002872 skip!(_i.position);
David Tolnay8c81f622018-07-31 23:34:35 -07002873 if let Some(ref it) = _i.as_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002874 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002875 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002876 tokens_helper(_visitor, &_i.gt_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002877}
David Tolnay8c81f622018-07-31 23:34:35 -07002878#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002879pub fn visit_range_limits<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast RangeLimits) {
Nika Layzell27726662017-10-24 23:16:35 -04002880 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002881 RangeLimits::HalfOpen(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002882 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002883 }
David Tolnay8c81f622018-07-31 23:34:35 -07002884 RangeLimits::Closed(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002885 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002886 }
2887 }
2888}
David Tolnay8c81f622018-07-31 23:34:35 -07002889#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002890pub fn visit_return_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ReturnType) {
David Tolnayf93b90d2017-11-11 19:21:26 -08002891 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002892 ReturnType::Default => {}
2893 ReturnType::Type(ref _binding_0, ref _binding_1) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002894 tokens_helper(_visitor, &_binding_0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002895 _visitor.visit_type(&**_binding_1);
David Tolnayf93b90d2017-11-11 19:21:26 -08002896 }
2897 }
2898}
David Tolnay8c81f622018-07-31 23:34:35 -07002899pub fn visit_span<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Span) {}
David Tolnay8c81f622018-07-31 23:34:35 -07002900#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002901pub fn visit_stmt<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Stmt) {
Nika Layzell27726662017-10-24 23:16:35 -04002902 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002903 Stmt::Local(ref _binding_0) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08002904 _visitor.visit_local(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002905 }
David Tolnay8c81f622018-07-31 23:34:35 -07002906 Stmt::Item(ref _binding_0) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08002907 _visitor.visit_item(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002908 }
David Tolnay8c81f622018-07-31 23:34:35 -07002909 Stmt::Expr(ref _binding_0) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08002910 _visitor.visit_expr(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002911 }
David Tolnay8c81f622018-07-31 23:34:35 -07002912 Stmt::Semi(ref _binding_0, ref _binding_1) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08002913 _visitor.visit_expr(_binding_0);
David Tolnay7ac699c2018-08-24 14:00:58 -04002914 tokens_helper(_visitor, &_binding_1.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002915 }
Nika Layzell27726662017-10-24 23:16:35 -04002916 }
2917}
David Tolnay8c81f622018-07-31 23:34:35 -07002918#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002919pub fn visit_trait_bound<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TraitBound) {
David Tolnay8c81f622018-07-31 23:34:35 -07002920 if let Some(ref it) = _i.paren_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002921 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002922 };
2923 _visitor.visit_trait_bound_modifier(&_i.modifier);
2924 if let Some(ref it) = _i.lifetimes {
2925 _visitor.visit_bound_lifetimes(it)
2926 };
2927 _visitor.visit_path(&_i.path);
David Tolnay40fb8ce2018-01-02 10:53:46 -08002928}
David Tolnay8c81f622018-07-31 23:34:35 -07002929#[cfg(any(feature = "full", feature = "derive"))]
2930pub fn visit_trait_bound_modifier<'ast, V: Visit<'ast> + ?Sized>(
2931 _visitor: &mut V,
2932 _i: &'ast TraitBoundModifier,
2933) {
Nika Layzell27726662017-10-24 23:16:35 -04002934 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002935 TraitBoundModifier::None => {}
2936 TraitBoundModifier::Maybe(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002937 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002938 }
2939 }
2940}
David Tolnay8c81f622018-07-31 23:34:35 -07002941#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002942pub fn visit_trait_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TraitItem) {
Nika Layzell27726662017-10-24 23:16:35 -04002943 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002944 TraitItem::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002945 _visitor.visit_trait_item_const(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002946 }
David Tolnay8c81f622018-07-31 23:34:35 -07002947 TraitItem::Method(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002948 _visitor.visit_trait_item_method(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002949 }
David Tolnay8c81f622018-07-31 23:34:35 -07002950 TraitItem::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002951 _visitor.visit_trait_item_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002952 }
David Tolnay8c81f622018-07-31 23:34:35 -07002953 TraitItem::Macro(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002954 _visitor.visit_trait_item_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002955 }
David Tolnay8c81f622018-07-31 23:34:35 -07002956 TraitItem::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002957 _visitor.visit_trait_item_verbatim(_binding_0);
2958 }
Nika Layzell27726662017-10-24 23:16:35 -04002959 }
2960}
David Tolnay8c81f622018-07-31 23:34:35 -07002961#[cfg(feature = "full")]
2962pub fn visit_trait_item_const<'ast, V: Visit<'ast> + ?Sized>(
2963 _visitor: &mut V,
2964 _i: &'ast TraitItemConst,
2965) {
2966 for it in &_i.attrs {
2967 _visitor.visit_attribute(it)
2968 }
David Tolnay7ac699c2018-08-24 14:00:58 -04002969 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002970 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002971 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002972 _visitor.visit_type(&_i.ty);
2973 if let Some(ref it) = _i.default {
David Tolnay7ac699c2018-08-24 14:00:58 -04002974 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002975 _visitor.visit_expr(&(it).1);
2976 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002977 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnayda705bd2017-11-10 21:58:05 -08002978}
David Tolnay8c81f622018-07-31 23:34:35 -07002979#[cfg(feature = "full")]
2980pub fn visit_trait_item_macro<'ast, V: Visit<'ast> + ?Sized>(
2981 _visitor: &mut V,
2982 _i: &'ast TraitItemMacro,
2983) {
2984 for it in &_i.attrs {
2985 _visitor.visit_attribute(it)
2986 }
2987 _visitor.visit_macro(&_i.mac);
2988 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002989 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002990 };
David Tolnayda705bd2017-11-10 21:58:05 -08002991}
David Tolnay8c81f622018-07-31 23:34:35 -07002992#[cfg(feature = "full")]
2993pub fn visit_trait_item_method<'ast, V: Visit<'ast> + ?Sized>(
2994 _visitor: &mut V,
2995 _i: &'ast TraitItemMethod,
2996) {
2997 for it in &_i.attrs {
2998 _visitor.visit_attribute(it)
2999 }
3000 _visitor.visit_method_sig(&_i.sig);
3001 if let Some(ref it) = _i.default {
3002 _visitor.visit_block(it)
3003 };
3004 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003005 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003006 };
Nika Layzell27726662017-10-24 23:16:35 -04003007}
David Tolnay8c81f622018-07-31 23:34:35 -07003008#[cfg(feature = "full")]
3009pub fn visit_trait_item_type<'ast, V: Visit<'ast> + ?Sized>(
3010 _visitor: &mut V,
3011 _i: &'ast TraitItemType,
3012) {
3013 for it in &_i.attrs {
3014 _visitor.visit_attribute(it)
3015 }
David Tolnay7ac699c2018-08-24 14:00:58 -04003016 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003017 _visitor.visit_ident(&_i.ident);
3018 _visitor.visit_generics(&_i.generics);
3019 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003020 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003021 };
3022 for el in Punctuated::pairs(&_i.bounds) {
3023 let it = el.value();
3024 _visitor.visit_type_param_bound(it)
3025 }
3026 if let Some(ref it) = _i.default {
David Tolnay7ac699c2018-08-24 14:00:58 -04003027 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003028 _visitor.visit_type(&(it).1);
3029 };
David Tolnay7ac699c2018-08-24 14:00:58 -04003030 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003031}
David Tolnay8c81f622018-07-31 23:34:35 -07003032#[cfg(feature = "full")]
3033pub fn visit_trait_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
3034 _visitor: &mut V,
3035 _i: &'ast TraitItemVerbatim,
3036) {
David Tolnay6af48992018-08-01 11:16:28 -07003037 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05003038}
David Tolnay8c81f622018-07-31 23:34:35 -07003039#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003040pub fn visit_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Type) {
Nika Layzell27726662017-10-24 23:16:35 -04003041 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003042 Type::Slice(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003043 _visitor.visit_type_slice(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003044 }
David Tolnay8c81f622018-07-31 23:34:35 -07003045 Type::Array(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003046 _visitor.visit_type_array(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003047 }
David Tolnay8c81f622018-07-31 23:34:35 -07003048 Type::Ptr(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003049 _visitor.visit_type_ptr(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003050 }
David Tolnay8c81f622018-07-31 23:34:35 -07003051 Type::Reference(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003052 _visitor.visit_type_reference(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003053 }
David Tolnay8c81f622018-07-31 23:34:35 -07003054 Type::BareFn(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003055 _visitor.visit_type_bare_fn(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003056 }
David Tolnay8c81f622018-07-31 23:34:35 -07003057 Type::Never(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003058 _visitor.visit_type_never(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003059 }
David Tolnay8c81f622018-07-31 23:34:35 -07003060 Type::Tuple(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003061 _visitor.visit_type_tuple(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003062 }
David Tolnay8c81f622018-07-31 23:34:35 -07003063 Type::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003064 _visitor.visit_type_path(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003065 }
David Tolnay8c81f622018-07-31 23:34:35 -07003066 Type::TraitObject(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003067 _visitor.visit_type_trait_object(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003068 }
David Tolnay8c81f622018-07-31 23:34:35 -07003069 Type::ImplTrait(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003070 _visitor.visit_type_impl_trait(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003071 }
David Tolnay8c81f622018-07-31 23:34:35 -07003072 Type::Paren(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003073 _visitor.visit_type_paren(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003074 }
David Tolnay8c81f622018-07-31 23:34:35 -07003075 Type::Group(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003076 _visitor.visit_type_group(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003077 }
David Tolnay8c81f622018-07-31 23:34:35 -07003078 Type::Infer(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003079 _visitor.visit_type_infer(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003080 }
David Tolnay8c81f622018-07-31 23:34:35 -07003081 Type::Macro(ref _binding_0) => {
David Tolnay323279a2017-12-29 11:26:32 -05003082 _visitor.visit_type_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003083 }
David Tolnay8c81f622018-07-31 23:34:35 -07003084 Type::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05003085 _visitor.visit_type_verbatim(_binding_0);
3086 }
Nika Layzell27726662017-10-24 23:16:35 -04003087 }
3088}
David Tolnay8c81f622018-07-31 23:34:35 -07003089#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003090pub fn visit_type_array<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeArray) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003091 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003092 _visitor.visit_type(&*_i.elem);
David Tolnay7ac699c2018-08-24 14:00:58 -04003093 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003094 _visitor.visit_expr(&_i.len);
Nika Layzell27726662017-10-24 23:16:35 -04003095}
David Tolnay8c81f622018-07-31 23:34:35 -07003096#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003097pub fn visit_type_bare_fn<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeBareFn) {
David Tolnay3779bb72018-08-26 18:46:07 -07003098 if let Some(ref it) = _i.lifetimes {
3099 _visitor.visit_bound_lifetimes(it)
3100 };
David Tolnay8c81f622018-07-31 23:34:35 -07003101 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04003102 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003103 };
3104 if let Some(ref it) = _i.abi {
3105 _visitor.visit_abi(it)
3106 };
David Tolnay7ac699c2018-08-24 14:00:58 -04003107 tokens_helper(_visitor, &_i.fn_token.span);
David Tolnay7ac699c2018-08-24 14:00:58 -04003108 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003109 for el in Punctuated::pairs(&_i.inputs) {
3110 let it = el.value();
3111 _visitor.visit_bare_fn_arg(it)
3112 }
3113 if let Some(ref it) = _i.variadic {
David Tolnay7ac699c2018-08-24 14:00:58 -04003114 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003115 };
3116 _visitor.visit_return_type(&_i.output);
Nika Layzell27726662017-10-24 23:16:35 -04003117}
David Tolnay8c81f622018-07-31 23:34:35 -07003118#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003119pub fn visit_type_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeGroup) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003120 tokens_helper(_visitor, &_i.group_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003121 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003122}
David Tolnay8c81f622018-07-31 23:34:35 -07003123#[cfg(any(feature = "full", feature = "derive"))]
3124pub fn visit_type_impl_trait<'ast, V: Visit<'ast> + ?Sized>(
3125 _visitor: &mut V,
3126 _i: &'ast TypeImplTrait,
3127) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003128 tokens_helper(_visitor, &_i.impl_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003129 for el in Punctuated::pairs(&_i.bounds) {
3130 let it = el.value();
3131 _visitor.visit_type_param_bound(it)
3132 }
Nika Layzell27726662017-10-24 23:16:35 -04003133}
David Tolnay8c81f622018-07-31 23:34:35 -07003134#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003135pub fn visit_type_infer<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeInfer) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003136 tokens_helper(_visitor, &_i.underscore_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003137}
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_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeMacro) {
David Tolnay8c81f622018-07-31 23:34:35 -07003140 _visitor.visit_macro(&_i.mac);
David Tolnay323279a2017-12-29 11:26:32 -05003141}
David Tolnay8c81f622018-07-31 23:34:35 -07003142#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003143pub fn visit_type_never<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeNever) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003144 tokens_helper(_visitor, &_i.bang_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003145}
David Tolnay8c81f622018-07-31 23:34:35 -07003146#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003147pub fn visit_type_param<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeParam) {
David Tolnay8c81f622018-07-31 23:34:35 -07003148 for it in &_i.attrs {
3149 _visitor.visit_attribute(it)
3150 }
3151 _visitor.visit_ident(&_i.ident);
3152 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003153 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003154 };
3155 for el in Punctuated::pairs(&_i.bounds) {
3156 let it = el.value();
3157 _visitor.visit_type_param_bound(it)
3158 }
3159 if let Some(ref it) = _i.eq_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003160 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003161 };
3162 if let Some(ref it) = _i.default {
3163 _visitor.visit_type(it)
3164 };
Nika Layzell27726662017-10-24 23:16:35 -04003165}
David Tolnay8c81f622018-07-31 23:34:35 -07003166#[cfg(any(feature = "full", feature = "derive"))]
3167pub fn visit_type_param_bound<'ast, V: Visit<'ast> + ?Sized>(
3168 _visitor: &mut V,
3169 _i: &'ast TypeParamBound,
3170) {
Nika Layzell27726662017-10-24 23:16:35 -04003171 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003172 TypeParamBound::Trait(ref _binding_0) => {
David Tolnay40fb8ce2018-01-02 10:53:46 -08003173 _visitor.visit_trait_bound(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003174 }
David Tolnay8c81f622018-07-31 23:34:35 -07003175 TypeParamBound::Lifetime(ref _binding_0) => {
David Tolnay4ba63a02017-12-28 15:53:05 -05003176 _visitor.visit_lifetime(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003177 }
3178 }
3179}
David Tolnay8c81f622018-07-31 23:34:35 -07003180#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003181pub fn visit_type_paren<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeParen) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003182 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003183 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003184}
David Tolnay8c81f622018-07-31 23:34:35 -07003185#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003186pub fn visit_type_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypePath) {
David Tolnay8c81f622018-07-31 23:34:35 -07003187 if let Some(ref it) = _i.qself {
3188 _visitor.visit_qself(it)
3189 };
3190 _visitor.visit_path(&_i.path);
Nika Layzell27726662017-10-24 23:16:35 -04003191}
David Tolnay8c81f622018-07-31 23:34:35 -07003192#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003193pub fn visit_type_ptr<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypePtr) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003194 tokens_helper(_visitor, &_i.star_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003195 if let Some(ref it) = _i.const_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003196 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003197 };
3198 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04003199 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003200 };
3201 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003202}
David Tolnay8c81f622018-07-31 23:34:35 -07003203#[cfg(any(feature = "full", feature = "derive"))]
3204pub fn visit_type_reference<'ast, V: Visit<'ast> + ?Sized>(
3205 _visitor: &mut V,
3206 _i: &'ast TypeReference,
3207) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003208 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003209 if let Some(ref it) = _i.lifetime {
3210 _visitor.visit_lifetime(it)
3211 };
3212 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04003213 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003214 };
3215 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003216}
David Tolnay8c81f622018-07-31 23:34:35 -07003217#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003218pub fn visit_type_slice<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeSlice) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003219 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003220 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003221}
David Tolnay8c81f622018-07-31 23:34:35 -07003222#[cfg(any(feature = "full", feature = "derive"))]
3223pub fn visit_type_trait_object<'ast, V: Visit<'ast> + ?Sized>(
3224 _visitor: &mut V,
3225 _i: &'ast TypeTraitObject,
3226) {
3227 if let Some(ref it) = _i.dyn_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003228 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003229 };
3230 for el in Punctuated::pairs(&_i.bounds) {
3231 let it = el.value();
3232 _visitor.visit_type_param_bound(it)
3233 }
Nika Layzell27726662017-10-24 23:16:35 -04003234}
David Tolnay8c81f622018-07-31 23:34:35 -07003235#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003236pub fn visit_type_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeTuple) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003237 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003238 for el in Punctuated::pairs(&_i.elems) {
3239 let it = el.value();
3240 _visitor.visit_type(it)
3241 }
Nika Layzell27726662017-10-24 23:16:35 -04003242}
David Tolnay8c81f622018-07-31 23:34:35 -07003243#[cfg(any(feature = "full", feature = "derive"))]
3244pub fn visit_type_verbatim<'ast, V: Visit<'ast> + ?Sized>(
3245 _visitor: &mut V,
3246 _i: &'ast TypeVerbatim,
3247) {
David Tolnay6af48992018-08-01 11:16:28 -07003248 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05003249}
David Tolnay8c81f622018-07-31 23:34:35 -07003250#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003251pub fn visit_un_op<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UnOp) {
Nika Layzell27726662017-10-24 23:16:35 -04003252 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003253 UnOp::Deref(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003254 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003255 }
David Tolnay8c81f622018-07-31 23:34:35 -07003256 UnOp::Not(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003257 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003258 }
David Tolnay8c81f622018-07-31 23:34:35 -07003259 UnOp::Neg(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003260 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003261 }
3262 }
3263}
David Tolnay8c81f622018-07-31 23:34:35 -07003264#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003265pub fn visit_use_glob<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseGlob) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003266 tokens_helper(_visitor, &_i.star_token.spans);
David Tolnay5f332a92017-12-26 00:42:45 -05003267}
David Tolnay8c81f622018-07-31 23:34:35 -07003268#[cfg(feature = "full")]
David Tolnayd97a7d22018-03-31 19:17:01 +02003269pub fn visit_use_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseGroup) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003270 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003271 for el in Punctuated::pairs(&_i.items) {
3272 let it = el.value();
3273 _visitor.visit_use_tree(it)
3274 }
David Tolnay5f332a92017-12-26 00:42:45 -05003275}
David Tolnay8c81f622018-07-31 23:34:35 -07003276#[cfg(feature = "full")]
David Tolnayd97a7d22018-03-31 19:17:01 +02003277pub fn visit_use_name<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseName) {
David Tolnay8c81f622018-07-31 23:34:35 -07003278 _visitor.visit_ident(&_i.ident);
David Tolnayd97a7d22018-03-31 19:17:01 +02003279}
David Tolnay8c81f622018-07-31 23:34:35 -07003280#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003281pub fn visit_use_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UsePath) {
David Tolnay8c81f622018-07-31 23:34:35 -07003282 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04003283 tokens_helper(_visitor, &_i.colon2_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003284 _visitor.visit_use_tree(&*_i.tree);
David Tolnayd97a7d22018-03-31 19:17:01 +02003285}
David Tolnay8c81f622018-07-31 23:34:35 -07003286#[cfg(feature = "full")]
David Tolnayd97a7d22018-03-31 19:17:01 +02003287pub fn visit_use_rename<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseRename) {
David Tolnay8c81f622018-07-31 23:34:35 -07003288 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04003289 tokens_helper(_visitor, &_i.as_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003290 _visitor.visit_ident(&_i.rename);
David Tolnay5f332a92017-12-26 00:42:45 -05003291}
David Tolnay8c81f622018-07-31 23:34:35 -07003292#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003293pub fn visit_use_tree<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseTree) {
David Tolnay5f332a92017-12-26 00:42:45 -05003294 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003295 UseTree::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003296 _visitor.visit_use_path(_binding_0);
David Tolnay5f332a92017-12-26 00:42:45 -05003297 }
David Tolnay8c81f622018-07-31 23:34:35 -07003298 UseTree::Name(ref _binding_0) => {
David Tolnayd97a7d22018-03-31 19:17:01 +02003299 _visitor.visit_use_name(_binding_0);
3300 }
David Tolnay8c81f622018-07-31 23:34:35 -07003301 UseTree::Rename(ref _binding_0) => {
David Tolnayd97a7d22018-03-31 19:17:01 +02003302 _visitor.visit_use_rename(_binding_0);
3303 }
David Tolnay8c81f622018-07-31 23:34:35 -07003304 UseTree::Glob(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003305 _visitor.visit_use_glob(_binding_0);
David Tolnay5f332a92017-12-26 00:42:45 -05003306 }
David Tolnay8c81f622018-07-31 23:34:35 -07003307 UseTree::Group(ref _binding_0) => {
David Tolnayd97a7d22018-03-31 19:17:01 +02003308 _visitor.visit_use_group(_binding_0);
David Tolnay5f332a92017-12-26 00:42:45 -05003309 }
3310 }
3311}
David Tolnay8c81f622018-07-31 23:34:35 -07003312#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003313pub fn visit_variant<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Variant) {
David Tolnay8c81f622018-07-31 23:34:35 -07003314 for it in &_i.attrs {
3315 _visitor.visit_attribute(it)
3316 }
3317 _visitor.visit_ident(&_i.ident);
3318 _visitor.visit_fields(&_i.fields);
3319 if let Some(ref it) = _i.discriminant {
David Tolnay7ac699c2018-08-24 14:00:58 -04003320 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003321 _visitor.visit_expr(&(it).1);
3322 };
Nika Layzell27726662017-10-24 23:16:35 -04003323}
David Tolnay8c81f622018-07-31 23:34:35 -07003324#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003325pub fn visit_vis_crate<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast VisCrate) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003326 tokens_helper(_visitor, &_i.crate_token.span);
Nika Layzell27726662017-10-24 23:16:35 -04003327}
David Tolnay8c81f622018-07-31 23:34:35 -07003328#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003329pub fn visit_vis_public<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast VisPublic) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003330 tokens_helper(_visitor, &_i.pub_token.span);
Nika Layzell27726662017-10-24 23:16:35 -04003331}
David Tolnay8c81f622018-07-31 23:34:35 -07003332#[cfg(any(feature = "full", feature = "derive"))]
3333pub fn visit_vis_restricted<'ast, V: Visit<'ast> + ?Sized>(
3334 _visitor: &mut V,
3335 _i: &'ast VisRestricted,
3336) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003337 tokens_helper(_visitor, &_i.pub_token.span);
3338 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003339 if let Some(ref it) = _i.in_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003340 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003341 };
3342 _visitor.visit_path(&*_i.path);
Nika Layzell27726662017-10-24 23:16:35 -04003343}
David Tolnay8c81f622018-07-31 23:34:35 -07003344#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003345pub fn visit_visibility<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Visibility) {
Nika Layzell27726662017-10-24 23:16:35 -04003346 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003347 Visibility::Public(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003348 _visitor.visit_vis_public(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003349 }
David Tolnay8c81f622018-07-31 23:34:35 -07003350 Visibility::Crate(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003351 _visitor.visit_vis_crate(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003352 }
David Tolnay8c81f622018-07-31 23:34:35 -07003353 Visibility::Restricted(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003354 _visitor.visit_vis_restricted(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003355 }
David Tolnay8c81f622018-07-31 23:34:35 -07003356 Visibility::Inherited => {}
Nika Layzell27726662017-10-24 23:16:35 -04003357 }
3358}
David Tolnay8c81f622018-07-31 23:34:35 -07003359#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003360pub fn visit_where_clause<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast WhereClause) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003361 tokens_helper(_visitor, &_i.where_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003362 for el in Punctuated::pairs(&_i.predicates) {
3363 let it = el.value();
3364 _visitor.visit_where_predicate(it)
3365 }
Nika Layzell27726662017-10-24 23:16:35 -04003366}
David Tolnay8c81f622018-07-31 23:34:35 -07003367#[cfg(any(feature = "full", feature = "derive"))]
3368pub fn visit_where_predicate<'ast, V: Visit<'ast> + ?Sized>(
3369 _visitor: &mut V,
3370 _i: &'ast WherePredicate,
3371) {
Nika Layzell27726662017-10-24 23:16:35 -04003372 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003373 WherePredicate::Type(ref _binding_0) => {
David Tolnayd4add852018-01-01 20:13:24 -08003374 _visitor.visit_predicate_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003375 }
David Tolnay8c81f622018-07-31 23:34:35 -07003376 WherePredicate::Lifetime(ref _binding_0) => {
David Tolnayd4add852018-01-01 20:13:24 -08003377 _visitor.visit_predicate_lifetime(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003378 }
David Tolnay8c81f622018-07-31 23:34:35 -07003379 WherePredicate::Eq(ref _binding_0) => {
David Tolnayd4add852018-01-01 20:13:24 -08003380 _visitor.visit_predicate_eq(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003381 }
3382 }
3383}