blob: 3e43914ed0d67f07b63f5fad8532a7a260bbf268 [file] [log] [blame]
David Tolnaycab909c2019-05-09 13:22:39 -07001// This file is @generated by syn-internal-codegen.
2// It is not intended for manual editing.
Nika Layzell27726662017-10-24 23:16:35 -04003
David Tolnayc1f55792018-11-21 01:39:42 -08004#![cfg_attr(feature = "cargo-clippy", allow(trivially_copy_pass_by_ref))]
David Tolnay0a0d78c2018-01-05 15:24:01 -08005#[cfg(any(feature = "full", feature = "derive"))]
David Tolnaycc0f0372017-12-28 19:11:04 -05006use gen::helper::visit::*;
David Tolnay8c81f622018-07-31 23:34:35 -07007use proc_macro2::Span;
8#[cfg(any(feature = "full", feature = "derive"))]
9use punctuated::Punctuated;
10use *;
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040011#[cfg(feature = "full")]
12macro_rules! full {
David Tolnay280202f2018-08-02 00:29:54 -070013 ($e:expr) => {
David Tolnay8c81f622018-07-31 23:34:35 -070014 $e
15 };
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040016}
David Tolnay0a0d78c2018-01-05 15:24:01 -080017#[cfg(all(feature = "derive", not(feature = "full")))]
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040018macro_rules! full {
David Tolnay280202f2018-08-02 00:29:54 -070019 ($e:expr) => {
David Tolnay8c81f622018-07-31 23:34:35 -070020 unreachable!()
21 };
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040022}
David Tolnay6af48992018-08-01 11:16:28 -070023#[cfg(any(feature = "full", feature = "derive"))]
24macro_rules! skip {
David Tolnay280202f2018-08-02 00:29:54 -070025 ($($tt:tt)*) => {};
David Tolnay6af48992018-08-01 11:16:28 -070026}
David Tolnay53160352019-02-07 23:36:17 +010027/// Syntax tree traversal to walk a shared borrow of a syntax tree.
28///
29/// See the [module documentation] for details.
30///
31/// [module documentation]: index.html
32///
33/// *This trait is available if Syn is built with the `"visit"` feature.*
David Tolnay4b4c4b62018-01-06 13:48:05 -080034pub trait Visit<'ast> {
David Tolnay440fe582019-02-15 20:23:14 -080035 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -070036 fn visit_abi(&mut self, i: &'ast Abi) {
37 visit_abi(self, i)
38 }
David Tolnay440fe582019-02-15 20:23:14 -080039 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -070040 fn visit_angle_bracketed_generic_arguments(&mut self, i: &'ast AngleBracketedGenericArguments) {
41 visit_angle_bracketed_generic_arguments(self, i)
42 }
43 #[cfg(feature = "full")]
44 fn visit_arg_captured(&mut self, i: &'ast ArgCaptured) {
45 visit_arg_captured(self, i)
46 }
47 #[cfg(feature = "full")]
48 fn visit_arg_self(&mut self, i: &'ast ArgSelf) {
49 visit_arg_self(self, i)
50 }
51 #[cfg(feature = "full")]
52 fn visit_arg_self_ref(&mut self, i: &'ast ArgSelfRef) {
53 visit_arg_self_ref(self, i)
54 }
David Tolnay8c81f622018-07-31 23:34:35 -070055 #[cfg(feature = "full")]
56 fn visit_arm(&mut self, i: &'ast Arm) {
57 visit_arm(self, i)
58 }
David Tolnay440fe582019-02-15 20:23:14 -080059 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -070060 fn visit_attr_style(&mut self, i: &'ast AttrStyle) {
61 visit_attr_style(self, i)
62 }
David Tolnay440fe582019-02-15 20:23:14 -080063 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -070064 fn visit_attribute(&mut self, i: &'ast Attribute) {
65 visit_attribute(self, i)
66 }
David Tolnay440fe582019-02-15 20:23:14 -080067 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -070068 fn visit_bare_fn_arg(&mut self, i: &'ast BareFnArg) {
69 visit_bare_fn_arg(self, i)
70 }
David Tolnay440fe582019-02-15 20:23:14 -080071 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -070072 fn visit_bare_fn_arg_name(&mut self, i: &'ast BareFnArgName) {
73 visit_bare_fn_arg_name(self, i)
74 }
David Tolnay440fe582019-02-15 20:23:14 -080075 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -070076 fn visit_bin_op(&mut self, i: &'ast BinOp) {
77 visit_bin_op(self, i)
78 }
David Tolnay440fe582019-02-15 20:23:14 -080079 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -070080 fn visit_binding(&mut self, i: &'ast Binding) {
81 visit_binding(self, i)
82 }
David Tolnay8c81f622018-07-31 23:34:35 -070083 #[cfg(feature = "full")]
84 fn visit_block(&mut self, i: &'ast Block) {
85 visit_block(self, i)
86 }
David Tolnay440fe582019-02-15 20:23:14 -080087 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -070088 fn visit_bound_lifetimes(&mut self, i: &'ast BoundLifetimes) {
89 visit_bound_lifetimes(self, i)
90 }
David Tolnay440fe582019-02-15 20:23:14 -080091 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -070092 fn visit_const_param(&mut self, i: &'ast ConstParam) {
93 visit_const_param(self, i)
94 }
David Tolnay440fe582019-02-15 20:23:14 -080095 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay9d0882a2018-09-01 19:49:14 -070096 fn visit_constraint(&mut self, i: &'ast Constraint) {
97 visit_constraint(self, i)
98 }
David Tolnay8c81f622018-07-31 23:34:35 -070099 #[cfg(feature = "derive")]
100 fn visit_data(&mut self, i: &'ast Data) {
101 visit_data(self, i)
102 }
103 #[cfg(feature = "derive")]
104 fn visit_data_enum(&mut self, i: &'ast DataEnum) {
105 visit_data_enum(self, i)
106 }
107 #[cfg(feature = "derive")]
108 fn visit_data_struct(&mut self, i: &'ast DataStruct) {
109 visit_data_struct(self, i)
110 }
111 #[cfg(feature = "derive")]
112 fn visit_data_union(&mut self, i: &'ast DataUnion) {
113 visit_data_union(self, i)
114 }
115 #[cfg(feature = "derive")]
116 fn visit_derive_input(&mut self, i: &'ast DeriveInput) {
117 visit_derive_input(self, i)
118 }
David Tolnay440fe582019-02-15 20:23:14 -0800119 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700120 fn visit_expr(&mut self, i: &'ast Expr) {
121 visit_expr(self, i)
122 }
123 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700124 fn visit_expr_array(&mut self, i: &'ast ExprArray) {
125 visit_expr_array(self, i)
126 }
127 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700128 fn visit_expr_assign(&mut self, i: &'ast ExprAssign) {
129 visit_expr_assign(self, i)
130 }
131 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700132 fn visit_expr_assign_op(&mut self, i: &'ast ExprAssignOp) {
133 visit_expr_assign_op(self, i)
134 }
David Tolnay02a9c6f2018-08-24 18:58:45 -0400135 #[cfg(feature = "full")]
David Tolnay02a9c6f2018-08-24 18:58:45 -0400136 fn visit_expr_async(&mut self, i: &'ast ExprAsync) {
137 visit_expr_async(self, i)
138 }
David Tolnay440fe582019-02-15 20:23:14 -0800139 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700140 fn visit_expr_binary(&mut self, i: &'ast ExprBinary) {
141 visit_expr_binary(self, i)
142 }
143 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700144 fn visit_expr_block(&mut self, i: &'ast ExprBlock) {
145 visit_expr_block(self, i)
146 }
147 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700148 fn visit_expr_box(&mut self, i: &'ast ExprBox) {
149 visit_expr_box(self, i)
150 }
151 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700152 fn visit_expr_break(&mut self, i: &'ast ExprBreak) {
153 visit_expr_break(self, i)
154 }
David Tolnay440fe582019-02-15 20:23:14 -0800155 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700156 fn visit_expr_call(&mut self, i: &'ast ExprCall) {
157 visit_expr_call(self, i)
158 }
David Tolnay440fe582019-02-15 20:23:14 -0800159 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700160 fn visit_expr_cast(&mut self, i: &'ast ExprCast) {
161 visit_expr_cast(self, i)
162 }
163 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700164 fn visit_expr_closure(&mut self, i: &'ast ExprClosure) {
165 visit_expr_closure(self, i)
166 }
167 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700168 fn visit_expr_continue(&mut self, i: &'ast ExprContinue) {
169 visit_expr_continue(self, i)
170 }
David Tolnay440fe582019-02-15 20:23:14 -0800171 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700172 fn visit_expr_field(&mut self, i: &'ast ExprField) {
173 visit_expr_field(self, i)
174 }
175 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700176 fn visit_expr_for_loop(&mut self, i: &'ast ExprForLoop) {
177 visit_expr_for_loop(self, i)
178 }
179 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700180 fn visit_expr_group(&mut self, i: &'ast ExprGroup) {
181 visit_expr_group(self, i)
182 }
183 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700184 fn visit_expr_if(&mut self, i: &'ast ExprIf) {
185 visit_expr_if(self, i)
186 }
187 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700188 fn visit_expr_in_place(&mut self, i: &'ast ExprInPlace) {
189 visit_expr_in_place(self, i)
190 }
David Tolnay440fe582019-02-15 20:23:14 -0800191 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700192 fn visit_expr_index(&mut self, i: &'ast ExprIndex) {
193 visit_expr_index(self, i)
194 }
David Tolnay9c119122018-09-01 18:47:02 -0700195 #[cfg(feature = "full")]
David Tolnay9c119122018-09-01 18:47:02 -0700196 fn visit_expr_let(&mut self, i: &'ast ExprLet) {
197 visit_expr_let(self, i)
198 }
David Tolnay440fe582019-02-15 20:23:14 -0800199 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700200 fn visit_expr_lit(&mut self, i: &'ast ExprLit) {
201 visit_expr_lit(self, i)
202 }
203 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700204 fn visit_expr_loop(&mut self, i: &'ast ExprLoop) {
205 visit_expr_loop(self, i)
206 }
207 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700208 fn visit_expr_macro(&mut self, i: &'ast ExprMacro) {
209 visit_expr_macro(self, i)
210 }
211 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700212 fn visit_expr_match(&mut self, i: &'ast ExprMatch) {
213 visit_expr_match(self, i)
214 }
215 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700216 fn visit_expr_method_call(&mut self, i: &'ast ExprMethodCall) {
217 visit_expr_method_call(self, i)
218 }
David Tolnay440fe582019-02-15 20:23:14 -0800219 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700220 fn visit_expr_paren(&mut self, i: &'ast ExprParen) {
221 visit_expr_paren(self, i)
222 }
David Tolnay440fe582019-02-15 20:23:14 -0800223 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700224 fn visit_expr_path(&mut self, i: &'ast ExprPath) {
225 visit_expr_path(self, i)
226 }
227 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700228 fn visit_expr_range(&mut self, i: &'ast ExprRange) {
229 visit_expr_range(self, i)
230 }
231 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700232 fn visit_expr_reference(&mut self, i: &'ast ExprReference) {
233 visit_expr_reference(self, i)
234 }
235 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700236 fn visit_expr_repeat(&mut self, i: &'ast ExprRepeat) {
237 visit_expr_repeat(self, i)
238 }
239 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700240 fn visit_expr_return(&mut self, i: &'ast ExprReturn) {
241 visit_expr_return(self, i)
242 }
243 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700244 fn visit_expr_struct(&mut self, i: &'ast ExprStruct) {
245 visit_expr_struct(self, i)
246 }
247 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700248 fn visit_expr_try(&mut self, i: &'ast ExprTry) {
249 visit_expr_try(self, i)
250 }
251 #[cfg(feature = "full")]
David Tolnayfb2dd4b2018-08-24 16:45:34 -0400252 fn visit_expr_try_block(&mut self, i: &'ast ExprTryBlock) {
253 visit_expr_try_block(self, i)
254 }
255 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700256 fn visit_expr_tuple(&mut self, i: &'ast ExprTuple) {
257 visit_expr_tuple(self, i)
258 }
259 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700260 fn visit_expr_type(&mut self, i: &'ast ExprType) {
261 visit_expr_type(self, i)
262 }
David Tolnay440fe582019-02-15 20:23:14 -0800263 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700264 fn visit_expr_unary(&mut self, i: &'ast ExprUnary) {
265 visit_expr_unary(self, i)
266 }
267 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700268 fn visit_expr_unsafe(&mut self, i: &'ast ExprUnsafe) {
269 visit_expr_unsafe(self, i)
270 }
David Tolnay440fe582019-02-15 20:23:14 -0800271 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700272 fn visit_expr_verbatim(&mut self, i: &'ast ExprVerbatim) {
273 visit_expr_verbatim(self, i)
274 }
275 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700276 fn visit_expr_while(&mut self, i: &'ast ExprWhile) {
277 visit_expr_while(self, i)
278 }
279 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700280 fn visit_expr_yield(&mut self, i: &'ast ExprYield) {
281 visit_expr_yield(self, i)
282 }
David Tolnay440fe582019-02-15 20:23:14 -0800283 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700284 fn visit_field(&mut self, i: &'ast Field) {
285 visit_field(self, i)
286 }
David Tolnay8c81f622018-07-31 23:34:35 -0700287 #[cfg(feature = "full")]
288 fn visit_field_pat(&mut self, i: &'ast FieldPat) {
289 visit_field_pat(self, i)
290 }
David Tolnay8c81f622018-07-31 23:34:35 -0700291 #[cfg(feature = "full")]
292 fn visit_field_value(&mut self, i: &'ast FieldValue) {
293 visit_field_value(self, i)
294 }
David Tolnay440fe582019-02-15 20:23:14 -0800295 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700296 fn visit_fields(&mut self, i: &'ast Fields) {
297 visit_fields(self, i)
298 }
David Tolnay440fe582019-02-15 20:23:14 -0800299 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700300 fn visit_fields_named(&mut self, i: &'ast FieldsNamed) {
301 visit_fields_named(self, i)
302 }
David Tolnay440fe582019-02-15 20:23:14 -0800303 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700304 fn visit_fields_unnamed(&mut self, i: &'ast FieldsUnnamed) {
305 visit_fields_unnamed(self, i)
306 }
307 #[cfg(feature = "full")]
308 fn visit_file(&mut self, i: &'ast File) {
309 visit_file(self, i)
310 }
311 #[cfg(feature = "full")]
312 fn visit_fn_arg(&mut self, i: &'ast FnArg) {
313 visit_fn_arg(self, i)
314 }
315 #[cfg(feature = "full")]
316 fn visit_fn_decl(&mut self, i: &'ast FnDecl) {
317 visit_fn_decl(self, i)
318 }
319 #[cfg(feature = "full")]
320 fn visit_foreign_item(&mut self, i: &'ast ForeignItem) {
321 visit_foreign_item(self, i)
322 }
323 #[cfg(feature = "full")]
324 fn visit_foreign_item_fn(&mut self, i: &'ast ForeignItemFn) {
325 visit_foreign_item_fn(self, i)
326 }
327 #[cfg(feature = "full")]
David Tolnay435c1782018-08-24 16:15:44 -0400328 fn visit_foreign_item_macro(&mut self, i: &'ast ForeignItemMacro) {
329 visit_foreign_item_macro(self, i)
330 }
331 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700332 fn visit_foreign_item_static(&mut self, i: &'ast ForeignItemStatic) {
333 visit_foreign_item_static(self, i)
334 }
335 #[cfg(feature = "full")]
336 fn visit_foreign_item_type(&mut self, i: &'ast ForeignItemType) {
337 visit_foreign_item_type(self, i)
338 }
339 #[cfg(feature = "full")]
340 fn visit_foreign_item_verbatim(&mut self, i: &'ast ForeignItemVerbatim) {
341 visit_foreign_item_verbatim(self, i)
342 }
David Tolnay440fe582019-02-15 20:23:14 -0800343 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700344 fn visit_generic_argument(&mut self, i: &'ast GenericArgument) {
345 visit_generic_argument(self, i)
346 }
David Tolnay8c81f622018-07-31 23:34:35 -0700347 #[cfg(feature = "full")]
348 fn visit_generic_method_argument(&mut self, i: &'ast GenericMethodArgument) {
349 visit_generic_method_argument(self, i)
350 }
David Tolnay440fe582019-02-15 20:23:14 -0800351 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700352 fn visit_generic_param(&mut self, i: &'ast GenericParam) {
353 visit_generic_param(self, i)
354 }
David Tolnay440fe582019-02-15 20:23:14 -0800355 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700356 fn visit_generics(&mut self, i: &'ast Generics) {
357 visit_generics(self, i)
358 }
David Tolnay8c81f622018-07-31 23:34:35 -0700359 #[cfg(feature = "full")]
360 fn visit_impl_item(&mut self, i: &'ast ImplItem) {
361 visit_impl_item(self, i)
362 }
363 #[cfg(feature = "full")]
364 fn visit_impl_item_const(&mut self, i: &'ast ImplItemConst) {
365 visit_impl_item_const(self, i)
366 }
367 #[cfg(feature = "full")]
David Tolnaybb82ef02018-08-24 20:15:45 -0400368 fn visit_impl_item_existential(&mut self, i: &'ast ImplItemExistential) {
369 visit_impl_item_existential(self, i)
370 }
371 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700372 fn visit_impl_item_macro(&mut self, i: &'ast ImplItemMacro) {
373 visit_impl_item_macro(self, i)
374 }
375 #[cfg(feature = "full")]
376 fn visit_impl_item_method(&mut self, i: &'ast ImplItemMethod) {
377 visit_impl_item_method(self, i)
378 }
379 #[cfg(feature = "full")]
380 fn visit_impl_item_type(&mut self, i: &'ast ImplItemType) {
381 visit_impl_item_type(self, i)
382 }
383 #[cfg(feature = "full")]
384 fn visit_impl_item_verbatim(&mut self, i: &'ast ImplItemVerbatim) {
385 visit_impl_item_verbatim(self, i)
386 }
David Tolnay440fe582019-02-15 20:23:14 -0800387 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700388 fn visit_index(&mut self, i: &'ast Index) {
389 visit_index(self, i)
390 }
391 #[cfg(feature = "full")]
392 fn visit_item(&mut self, i: &'ast Item) {
393 visit_item(self, i)
394 }
395 #[cfg(feature = "full")]
396 fn visit_item_const(&mut self, i: &'ast ItemConst) {
397 visit_item_const(self, i)
398 }
399 #[cfg(feature = "full")]
400 fn visit_item_enum(&mut self, i: &'ast ItemEnum) {
401 visit_item_enum(self, i)
402 }
403 #[cfg(feature = "full")]
David Tolnaybb82ef02018-08-24 20:15:45 -0400404 fn visit_item_existential(&mut self, i: &'ast ItemExistential) {
405 visit_item_existential(self, i)
406 }
407 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700408 fn visit_item_extern_crate(&mut self, i: &'ast ItemExternCrate) {
409 visit_item_extern_crate(self, i)
410 }
411 #[cfg(feature = "full")]
412 fn visit_item_fn(&mut self, i: &'ast ItemFn) {
413 visit_item_fn(self, i)
414 }
415 #[cfg(feature = "full")]
416 fn visit_item_foreign_mod(&mut self, i: &'ast ItemForeignMod) {
417 visit_item_foreign_mod(self, i)
418 }
419 #[cfg(feature = "full")]
420 fn visit_item_impl(&mut self, i: &'ast ItemImpl) {
421 visit_item_impl(self, i)
422 }
423 #[cfg(feature = "full")]
424 fn visit_item_macro(&mut self, i: &'ast ItemMacro) {
425 visit_item_macro(self, i)
426 }
427 #[cfg(feature = "full")]
428 fn visit_item_macro2(&mut self, i: &'ast ItemMacro2) {
429 visit_item_macro2(self, i)
430 }
431 #[cfg(feature = "full")]
432 fn visit_item_mod(&mut self, i: &'ast ItemMod) {
433 visit_item_mod(self, i)
434 }
435 #[cfg(feature = "full")]
436 fn visit_item_static(&mut self, i: &'ast ItemStatic) {
437 visit_item_static(self, i)
438 }
439 #[cfg(feature = "full")]
440 fn visit_item_struct(&mut self, i: &'ast ItemStruct) {
441 visit_item_struct(self, i)
442 }
443 #[cfg(feature = "full")]
444 fn visit_item_trait(&mut self, i: &'ast ItemTrait) {
445 visit_item_trait(self, i)
446 }
447 #[cfg(feature = "full")]
David Tolnayc6b04dd2018-08-30 23:22:51 -0700448 fn visit_item_trait_alias(&mut self, i: &'ast ItemTraitAlias) {
449 visit_item_trait_alias(self, i)
450 }
451 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700452 fn visit_item_type(&mut self, i: &'ast ItemType) {
453 visit_item_type(self, i)
454 }
455 #[cfg(feature = "full")]
456 fn visit_item_union(&mut self, i: &'ast ItemUnion) {
457 visit_item_union(self, i)
458 }
459 #[cfg(feature = "full")]
460 fn visit_item_use(&mut self, i: &'ast ItemUse) {
461 visit_item_use(self, i)
462 }
463 #[cfg(feature = "full")]
464 fn visit_item_verbatim(&mut self, i: &'ast ItemVerbatim) {
465 visit_item_verbatim(self, i)
466 }
David Tolnay8c81f622018-07-31 23:34:35 -0700467 #[cfg(feature = "full")]
468 fn visit_label(&mut self, i: &'ast Label) {
469 visit_label(self, i)
470 }
David Tolnay8c81f622018-07-31 23:34:35 -0700471 fn visit_lifetime(&mut self, i: &'ast Lifetime) {
472 visit_lifetime(self, i)
473 }
David Tolnay440fe582019-02-15 20:23:14 -0800474 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700475 fn visit_lifetime_def(&mut self, i: &'ast LifetimeDef) {
476 visit_lifetime_def(self, i)
477 }
David Tolnay440fe582019-02-15 20:23:14 -0800478 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700479 fn visit_lit(&mut self, i: &'ast Lit) {
480 visit_lit(self, i)
481 }
David Tolnay440fe582019-02-15 20:23:14 -0800482 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700483 fn visit_lit_bool(&mut self, i: &'ast LitBool) {
484 visit_lit_bool(self, i)
485 }
David Tolnay440fe582019-02-15 20:23:14 -0800486 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700487 fn visit_lit_byte(&mut self, i: &'ast LitByte) {
488 visit_lit_byte(self, i)
489 }
David Tolnay440fe582019-02-15 20:23:14 -0800490 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700491 fn visit_lit_byte_str(&mut self, i: &'ast LitByteStr) {
492 visit_lit_byte_str(self, i)
493 }
David Tolnay440fe582019-02-15 20:23:14 -0800494 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700495 fn visit_lit_char(&mut self, i: &'ast LitChar) {
496 visit_lit_char(self, i)
497 }
David Tolnay440fe582019-02-15 20:23:14 -0800498 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700499 fn visit_lit_float(&mut self, i: &'ast LitFloat) {
500 visit_lit_float(self, i)
501 }
David Tolnay440fe582019-02-15 20:23:14 -0800502 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700503 fn visit_lit_int(&mut self, i: &'ast LitInt) {
504 visit_lit_int(self, i)
505 }
David Tolnay440fe582019-02-15 20:23:14 -0800506 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700507 fn visit_lit_str(&mut self, i: &'ast LitStr) {
508 visit_lit_str(self, i)
509 }
David Tolnay440fe582019-02-15 20:23:14 -0800510 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700511 fn visit_lit_verbatim(&mut self, i: &'ast LitVerbatim) {
512 visit_lit_verbatim(self, i)
513 }
David Tolnay8c81f622018-07-31 23:34:35 -0700514 #[cfg(feature = "full")]
515 fn visit_local(&mut self, i: &'ast Local) {
516 visit_local(self, i)
517 }
David Tolnay440fe582019-02-15 20:23:14 -0800518 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700519 fn visit_macro(&mut self, i: &'ast Macro) {
520 visit_macro(self, i)
521 }
David Tolnay440fe582019-02-15 20:23:14 -0800522 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700523 fn visit_macro_delimiter(&mut self, i: &'ast MacroDelimiter) {
524 visit_macro_delimiter(self, i)
525 }
David Tolnay440fe582019-02-15 20:23:14 -0800526 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700527 fn visit_member(&mut self, i: &'ast Member) {
528 visit_member(self, i)
529 }
David Tolnay440fe582019-02-15 20:23:14 -0800530 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700531 fn visit_meta(&mut self, i: &'ast Meta) {
532 visit_meta(self, i)
533 }
David Tolnay440fe582019-02-15 20:23:14 -0800534 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700535 fn visit_meta_list(&mut self, i: &'ast MetaList) {
536 visit_meta_list(self, i)
537 }
David Tolnay440fe582019-02-15 20:23:14 -0800538 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700539 fn visit_meta_name_value(&mut self, i: &'ast MetaNameValue) {
540 visit_meta_name_value(self, i)
541 }
542 #[cfg(feature = "full")]
543 fn visit_method_sig(&mut self, i: &'ast MethodSig) {
544 visit_method_sig(self, i)
545 }
David Tolnay8c81f622018-07-31 23:34:35 -0700546 #[cfg(feature = "full")]
547 fn visit_method_turbofish(&mut self, i: &'ast MethodTurbofish) {
548 visit_method_turbofish(self, i)
549 }
David Tolnay440fe582019-02-15 20:23:14 -0800550 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700551 fn visit_nested_meta(&mut self, i: &'ast NestedMeta) {
552 visit_nested_meta(self, i)
553 }
David Tolnay440fe582019-02-15 20:23:14 -0800554 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700555 fn visit_parenthesized_generic_arguments(&mut self, i: &'ast ParenthesizedGenericArguments) {
556 visit_parenthesized_generic_arguments(self, i)
557 }
David Tolnay8c81f622018-07-31 23:34:35 -0700558 #[cfg(feature = "full")]
559 fn visit_pat(&mut self, i: &'ast Pat) {
560 visit_pat(self, i)
561 }
David Tolnay8c81f622018-07-31 23:34:35 -0700562 #[cfg(feature = "full")]
563 fn visit_pat_box(&mut self, i: &'ast PatBox) {
564 visit_pat_box(self, i)
565 }
David Tolnay8c81f622018-07-31 23:34:35 -0700566 #[cfg(feature = "full")]
567 fn visit_pat_ident(&mut self, i: &'ast PatIdent) {
568 visit_pat_ident(self, i)
569 }
David Tolnay8c81f622018-07-31 23:34:35 -0700570 #[cfg(feature = "full")]
571 fn visit_pat_lit(&mut self, i: &'ast PatLit) {
572 visit_pat_lit(self, i)
573 }
David Tolnay8c81f622018-07-31 23:34:35 -0700574 #[cfg(feature = "full")]
575 fn visit_pat_macro(&mut self, i: &'ast PatMacro) {
576 visit_pat_macro(self, i)
577 }
David Tolnay8c81f622018-07-31 23:34:35 -0700578 #[cfg(feature = "full")]
579 fn visit_pat_path(&mut self, i: &'ast PatPath) {
580 visit_pat_path(self, i)
581 }
David Tolnay8c81f622018-07-31 23:34:35 -0700582 #[cfg(feature = "full")]
583 fn visit_pat_range(&mut self, i: &'ast PatRange) {
584 visit_pat_range(self, i)
585 }
David Tolnay8c81f622018-07-31 23:34:35 -0700586 #[cfg(feature = "full")]
587 fn visit_pat_ref(&mut self, i: &'ast PatRef) {
588 visit_pat_ref(self, i)
589 }
David Tolnay8c81f622018-07-31 23:34:35 -0700590 #[cfg(feature = "full")]
591 fn visit_pat_slice(&mut self, i: &'ast PatSlice) {
592 visit_pat_slice(self, i)
593 }
David Tolnay8c81f622018-07-31 23:34:35 -0700594 #[cfg(feature = "full")]
595 fn visit_pat_struct(&mut self, i: &'ast PatStruct) {
596 visit_pat_struct(self, i)
597 }
David Tolnay8c81f622018-07-31 23:34:35 -0700598 #[cfg(feature = "full")]
599 fn visit_pat_tuple(&mut self, i: &'ast PatTuple) {
600 visit_pat_tuple(self, i)
601 }
David Tolnay8c81f622018-07-31 23:34:35 -0700602 #[cfg(feature = "full")]
603 fn visit_pat_tuple_struct(&mut self, i: &'ast PatTupleStruct) {
604 visit_pat_tuple_struct(self, i)
605 }
David Tolnay8c81f622018-07-31 23:34:35 -0700606 #[cfg(feature = "full")]
607 fn visit_pat_verbatim(&mut self, i: &'ast PatVerbatim) {
608 visit_pat_verbatim(self, i)
609 }
David Tolnay8c81f622018-07-31 23:34:35 -0700610 #[cfg(feature = "full")]
611 fn visit_pat_wild(&mut self, i: &'ast PatWild) {
612 visit_pat_wild(self, i)
613 }
David Tolnay440fe582019-02-15 20:23:14 -0800614 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700615 fn visit_path(&mut self, i: &'ast Path) {
616 visit_path(self, i)
617 }
David Tolnay440fe582019-02-15 20:23:14 -0800618 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700619 fn visit_path_arguments(&mut self, i: &'ast PathArguments) {
620 visit_path_arguments(self, i)
621 }
David Tolnay440fe582019-02-15 20:23:14 -0800622 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700623 fn visit_path_segment(&mut self, i: &'ast PathSegment) {
624 visit_path_segment(self, i)
625 }
David Tolnay440fe582019-02-15 20:23:14 -0800626 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700627 fn visit_predicate_eq(&mut self, i: &'ast PredicateEq) {
628 visit_predicate_eq(self, i)
629 }
David Tolnay440fe582019-02-15 20:23:14 -0800630 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700631 fn visit_predicate_lifetime(&mut self, i: &'ast PredicateLifetime) {
632 visit_predicate_lifetime(self, i)
633 }
David Tolnay440fe582019-02-15 20:23:14 -0800634 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700635 fn visit_predicate_type(&mut self, i: &'ast PredicateType) {
636 visit_predicate_type(self, i)
637 }
David Tolnay440fe582019-02-15 20:23:14 -0800638 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700639 fn visit_qself(&mut self, i: &'ast QSelf) {
640 visit_qself(self, i)
641 }
David Tolnay8c81f622018-07-31 23:34:35 -0700642 #[cfg(feature = "full")]
643 fn visit_range_limits(&mut self, i: &'ast RangeLimits) {
644 visit_range_limits(self, i)
645 }
David Tolnay440fe582019-02-15 20:23:14 -0800646 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700647 fn visit_return_type(&mut self, i: &'ast ReturnType) {
648 visit_return_type(self, i)
649 }
David Tolnay8c81f622018-07-31 23:34:35 -0700650 #[cfg(feature = "full")]
651 fn visit_stmt(&mut self, i: &'ast Stmt) {
652 visit_stmt(self, i)
653 }
David Tolnay440fe582019-02-15 20:23:14 -0800654 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700655 fn visit_trait_bound(&mut self, i: &'ast TraitBound) {
656 visit_trait_bound(self, i)
657 }
David Tolnay440fe582019-02-15 20:23:14 -0800658 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700659 fn visit_trait_bound_modifier(&mut self, i: &'ast TraitBoundModifier) {
660 visit_trait_bound_modifier(self, i)
661 }
662 #[cfg(feature = "full")]
663 fn visit_trait_item(&mut self, i: &'ast TraitItem) {
664 visit_trait_item(self, i)
665 }
666 #[cfg(feature = "full")]
667 fn visit_trait_item_const(&mut self, i: &'ast TraitItemConst) {
668 visit_trait_item_const(self, i)
669 }
670 #[cfg(feature = "full")]
671 fn visit_trait_item_macro(&mut self, i: &'ast TraitItemMacro) {
672 visit_trait_item_macro(self, i)
673 }
674 #[cfg(feature = "full")]
675 fn visit_trait_item_method(&mut self, i: &'ast TraitItemMethod) {
676 visit_trait_item_method(self, i)
677 }
678 #[cfg(feature = "full")]
679 fn visit_trait_item_type(&mut self, i: &'ast TraitItemType) {
680 visit_trait_item_type(self, i)
681 }
682 #[cfg(feature = "full")]
683 fn visit_trait_item_verbatim(&mut self, i: &'ast TraitItemVerbatim) {
684 visit_trait_item_verbatim(self, i)
685 }
David Tolnay440fe582019-02-15 20:23:14 -0800686 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700687 fn visit_type(&mut self, i: &'ast Type) {
688 visit_type(self, i)
689 }
David Tolnay440fe582019-02-15 20:23:14 -0800690 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700691 fn visit_type_array(&mut self, i: &'ast TypeArray) {
692 visit_type_array(self, i)
693 }
David Tolnay440fe582019-02-15 20:23:14 -0800694 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700695 fn visit_type_bare_fn(&mut self, i: &'ast TypeBareFn) {
696 visit_type_bare_fn(self, i)
697 }
David Tolnay440fe582019-02-15 20:23:14 -0800698 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700699 fn visit_type_group(&mut self, i: &'ast TypeGroup) {
700 visit_type_group(self, i)
701 }
David Tolnay440fe582019-02-15 20:23:14 -0800702 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700703 fn visit_type_impl_trait(&mut self, i: &'ast TypeImplTrait) {
704 visit_type_impl_trait(self, i)
705 }
David Tolnay440fe582019-02-15 20:23:14 -0800706 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700707 fn visit_type_infer(&mut self, i: &'ast TypeInfer) {
708 visit_type_infer(self, i)
709 }
David Tolnay440fe582019-02-15 20:23:14 -0800710 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700711 fn visit_type_macro(&mut self, i: &'ast TypeMacro) {
712 visit_type_macro(self, i)
713 }
David Tolnay440fe582019-02-15 20:23:14 -0800714 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700715 fn visit_type_never(&mut self, i: &'ast TypeNever) {
716 visit_type_never(self, i)
717 }
David Tolnay440fe582019-02-15 20:23:14 -0800718 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700719 fn visit_type_param(&mut self, i: &'ast TypeParam) {
720 visit_type_param(self, i)
721 }
David Tolnay440fe582019-02-15 20:23:14 -0800722 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700723 fn visit_type_param_bound(&mut self, i: &'ast TypeParamBound) {
724 visit_type_param_bound(self, i)
725 }
David Tolnay440fe582019-02-15 20:23:14 -0800726 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700727 fn visit_type_paren(&mut self, i: &'ast TypeParen) {
728 visit_type_paren(self, i)
729 }
David Tolnay440fe582019-02-15 20:23:14 -0800730 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700731 fn visit_type_path(&mut self, i: &'ast TypePath) {
732 visit_type_path(self, i)
733 }
David Tolnay440fe582019-02-15 20:23:14 -0800734 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700735 fn visit_type_ptr(&mut self, i: &'ast TypePtr) {
736 visit_type_ptr(self, i)
737 }
David Tolnay440fe582019-02-15 20:23:14 -0800738 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700739 fn visit_type_reference(&mut self, i: &'ast TypeReference) {
740 visit_type_reference(self, i)
741 }
David Tolnay440fe582019-02-15 20:23:14 -0800742 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700743 fn visit_type_slice(&mut self, i: &'ast TypeSlice) {
744 visit_type_slice(self, i)
745 }
David Tolnay440fe582019-02-15 20:23:14 -0800746 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700747 fn visit_type_trait_object(&mut self, i: &'ast TypeTraitObject) {
748 visit_type_trait_object(self, i)
749 }
David Tolnay440fe582019-02-15 20:23:14 -0800750 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700751 fn visit_type_tuple(&mut self, i: &'ast TypeTuple) {
752 visit_type_tuple(self, i)
753 }
David Tolnay440fe582019-02-15 20:23:14 -0800754 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700755 fn visit_type_verbatim(&mut self, i: &'ast TypeVerbatim) {
756 visit_type_verbatim(self, i)
757 }
David Tolnay440fe582019-02-15 20:23:14 -0800758 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700759 fn visit_un_op(&mut self, i: &'ast UnOp) {
760 visit_un_op(self, i)
761 }
762 #[cfg(feature = "full")]
763 fn visit_use_glob(&mut self, i: &'ast UseGlob) {
764 visit_use_glob(self, i)
765 }
766 #[cfg(feature = "full")]
767 fn visit_use_group(&mut self, i: &'ast UseGroup) {
768 visit_use_group(self, i)
769 }
770 #[cfg(feature = "full")]
771 fn visit_use_name(&mut self, i: &'ast UseName) {
772 visit_use_name(self, i)
773 }
774 #[cfg(feature = "full")]
775 fn visit_use_path(&mut self, i: &'ast UsePath) {
776 visit_use_path(self, i)
777 }
778 #[cfg(feature = "full")]
779 fn visit_use_rename(&mut self, i: &'ast UseRename) {
780 visit_use_rename(self, i)
781 }
782 #[cfg(feature = "full")]
783 fn visit_use_tree(&mut self, i: &'ast UseTree) {
784 visit_use_tree(self, i)
785 }
David Tolnay440fe582019-02-15 20:23:14 -0800786 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700787 fn visit_variant(&mut self, i: &'ast Variant) {
788 visit_variant(self, i)
789 }
David Tolnay440fe582019-02-15 20:23:14 -0800790 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700791 fn visit_vis_crate(&mut self, i: &'ast VisCrate) {
792 visit_vis_crate(self, i)
793 }
David Tolnay440fe582019-02-15 20:23:14 -0800794 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700795 fn visit_vis_public(&mut self, i: &'ast VisPublic) {
796 visit_vis_public(self, i)
797 }
David Tolnay440fe582019-02-15 20:23:14 -0800798 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700799 fn visit_vis_restricted(&mut self, i: &'ast VisRestricted) {
800 visit_vis_restricted(self, i)
801 }
David Tolnay440fe582019-02-15 20:23:14 -0800802 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700803 fn visit_visibility(&mut self, i: &'ast Visibility) {
804 visit_visibility(self, i)
805 }
David Tolnay440fe582019-02-15 20:23:14 -0800806 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700807 fn visit_where_clause(&mut self, i: &'ast WhereClause) {
808 visit_where_clause(self, i)
809 }
David Tolnay440fe582019-02-15 20:23:14 -0800810 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700811 fn visit_where_predicate(&mut self, i: &'ast WherePredicate) {
812 visit_where_predicate(self, i)
813 }
Carl Lerchecbf7cc12019-02-15 14:09:31 -0800814 fn visit_span(&mut self, i: &'ast Span) {
815 visit_span(self, i)
816 }
817 fn visit_ident(&mut self, i: &'ast Ident) {
818 visit_ident(self, i)
819 }
Nika Layzell27726662017-10-24 23:16:35 -0400820}
David Tolnay440fe582019-02-15 20:23:14 -0800821#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800822pub fn visit_abi<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Abi) {
David Tolnay7ac699c2018-08-24 14:00:58 -0400823 tokens_helper(_visitor, &_i.extern_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -0700824 if let Some(ref it) = _i.name {
825 _visitor.visit_lit_str(it)
826 };
Nika Layzell27726662017-10-24 23:16:35 -0400827}
David Tolnay440fe582019-02-15 20:23:14 -0800828#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700829pub fn visit_angle_bracketed_generic_arguments<'ast, V: Visit<'ast> + ?Sized>(
830 _visitor: &mut V,
831 _i: &'ast AngleBracketedGenericArguments,
832) {
833 if let Some(ref it) = _i.colon2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -0400834 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -0700835 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400836 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700837 for el in Punctuated::pairs(&_i.args) {
838 let it = el.value();
839 _visitor.visit_generic_argument(it)
840 }
David Tolnay7ac699c2018-08-24 14:00:58 -0400841 tokens_helper(_visitor, &_i.gt_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400842}
David Tolnay8c81f622018-07-31 23:34:35 -0700843#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800844pub fn visit_arg_captured<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ArgCaptured) {
David Tolnay8c81f622018-07-31 23:34:35 -0700845 _visitor.visit_pat(&_i.pat);
David Tolnay7ac699c2018-08-24 14:00:58 -0400846 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700847 _visitor.visit_type(&_i.ty);
Nika Layzell27726662017-10-24 23:16:35 -0400848}
David Tolnay8c81f622018-07-31 23:34:35 -0700849#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800850pub fn visit_arg_self<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ArgSelf) {
David Tolnay8c81f622018-07-31 23:34:35 -0700851 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -0400852 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -0700853 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400854 tokens_helper(_visitor, &_i.self_token.span);
Nika Layzell27726662017-10-24 23:16:35 -0400855}
David Tolnay8c81f622018-07-31 23:34:35 -0700856#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800857pub fn visit_arg_self_ref<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ArgSelfRef) {
David Tolnay7ac699c2018-08-24 14:00:58 -0400858 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700859 if let Some(ref it) = _i.lifetime {
860 _visitor.visit_lifetime(it)
861 };
862 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -0400863 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -0700864 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400865 tokens_helper(_visitor, &_i.self_token.span);
Nika Layzell27726662017-10-24 23:16:35 -0400866}
David Tolnay8c81f622018-07-31 23:34:35 -0700867#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800868pub fn visit_arm<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Arm) {
David Tolnay8c81f622018-07-31 23:34:35 -0700869 for it in &_i.attrs {
870 _visitor.visit_attribute(it)
871 }
872 if let Some(ref it) = _i.leading_vert {
David Tolnay7ac699c2018-08-24 14:00:58 -0400873 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -0700874 };
875 for el in Punctuated::pairs(&_i.pats) {
876 let it = el.value();
877 _visitor.visit_pat(it)
878 }
879 if let Some(ref it) = _i.guard {
David Tolnay7ac699c2018-08-24 14:00:58 -0400880 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -0700881 _visitor.visit_expr(&*(it).1);
882 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400883 tokens_helper(_visitor, &_i.fat_arrow_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700884 _visitor.visit_expr(&*_i.body);
885 if let Some(ref it) = _i.comma {
David Tolnay7ac699c2018-08-24 14:00:58 -0400886 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -0700887 };
Nika Layzell27726662017-10-24 23:16:35 -0400888}
David Tolnay440fe582019-02-15 20:23:14 -0800889#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800890pub fn visit_attr_style<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast AttrStyle) {
Nika Layzell27726662017-10-24 23:16:35 -0400891 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -0700892 AttrStyle::Outer => {}
893 AttrStyle::Inner(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400894 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400895 }
896 }
897}
David Tolnay440fe582019-02-15 20:23:14 -0800898#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800899pub fn visit_attribute<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Attribute) {
David Tolnay7ac699c2018-08-24 14:00:58 -0400900 tokens_helper(_visitor, &_i.pound_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700901 _visitor.visit_attr_style(&_i.style);
David Tolnay7ac699c2018-08-24 14:00:58 -0400902 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -0700903 _visitor.visit_path(&_i.path);
David Tolnay6af48992018-08-01 11:16:28 -0700904 skip!(_i.tts);
Nika Layzell27726662017-10-24 23:16:35 -0400905}
David Tolnay440fe582019-02-15 20:23:14 -0800906#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800907pub fn visit_bare_fn_arg<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast BareFnArg) {
David Tolnay8c81f622018-07-31 23:34:35 -0700908 if let Some(ref it) = _i.name {
909 _visitor.visit_bare_fn_arg_name(&(it).0);
David Tolnay7ac699c2018-08-24 14:00:58 -0400910 tokens_helper(_visitor, &(it).1.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700911 };
912 _visitor.visit_type(&_i.ty);
Nika Layzell27726662017-10-24 23:16:35 -0400913}
David Tolnay440fe582019-02-15 20:23:14 -0800914#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700915pub fn visit_bare_fn_arg_name<'ast, V: Visit<'ast> + ?Sized>(
916 _visitor: &mut V,
917 _i: &'ast BareFnArgName,
918) {
Nika Layzell27726662017-10-24 23:16:35 -0400919 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -0700920 BareFnArgName::Named(ref _binding_0) => {
Alex Crichtond261d092018-05-18 13:47:35 -0700921 _visitor.visit_ident(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -0400922 }
David Tolnay8c81f622018-07-31 23:34:35 -0700923 BareFnArgName::Wild(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400924 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400925 }
926 }
927}
David Tolnay440fe582019-02-15 20:23:14 -0800928#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800929pub fn visit_bin_op<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast BinOp) {
Nika Layzell27726662017-10-24 23:16:35 -0400930 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -0700931 BinOp::Add(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400932 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400933 }
David Tolnay8c81f622018-07-31 23:34:35 -0700934 BinOp::Sub(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400935 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400936 }
David Tolnay8c81f622018-07-31 23:34:35 -0700937 BinOp::Mul(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400938 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400939 }
David Tolnay8c81f622018-07-31 23:34:35 -0700940 BinOp::Div(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400941 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400942 }
David Tolnay8c81f622018-07-31 23:34:35 -0700943 BinOp::Rem(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400944 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400945 }
David Tolnay8c81f622018-07-31 23:34:35 -0700946 BinOp::And(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400947 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400948 }
David Tolnay8c81f622018-07-31 23:34:35 -0700949 BinOp::Or(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400950 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400951 }
David Tolnay8c81f622018-07-31 23:34:35 -0700952 BinOp::BitXor(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400953 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400954 }
David Tolnay8c81f622018-07-31 23:34:35 -0700955 BinOp::BitAnd(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400956 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400957 }
David Tolnay8c81f622018-07-31 23:34:35 -0700958 BinOp::BitOr(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400959 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400960 }
David Tolnay8c81f622018-07-31 23:34:35 -0700961 BinOp::Shl(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400962 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400963 }
David Tolnay8c81f622018-07-31 23:34:35 -0700964 BinOp::Shr(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400965 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400966 }
David Tolnay8c81f622018-07-31 23:34:35 -0700967 BinOp::Eq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400968 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400969 }
David Tolnay8c81f622018-07-31 23:34:35 -0700970 BinOp::Lt(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400971 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400972 }
David Tolnay8c81f622018-07-31 23:34:35 -0700973 BinOp::Le(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400974 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400975 }
David Tolnay8c81f622018-07-31 23:34:35 -0700976 BinOp::Ne(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400977 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400978 }
David Tolnay8c81f622018-07-31 23:34:35 -0700979 BinOp::Ge(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400980 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400981 }
David Tolnay8c81f622018-07-31 23:34:35 -0700982 BinOp::Gt(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400983 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400984 }
David Tolnay8c81f622018-07-31 23:34:35 -0700985 BinOp::AddEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400986 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400987 }
David Tolnay8c81f622018-07-31 23:34:35 -0700988 BinOp::SubEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400989 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400990 }
David Tolnay8c81f622018-07-31 23:34:35 -0700991 BinOp::MulEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400992 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400993 }
David Tolnay8c81f622018-07-31 23:34:35 -0700994 BinOp::DivEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400995 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400996 }
David Tolnay8c81f622018-07-31 23:34:35 -0700997 BinOp::RemEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400998 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400999 }
David Tolnay8c81f622018-07-31 23:34:35 -07001000 BinOp::BitXorEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001001 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001002 }
David Tolnay8c81f622018-07-31 23:34:35 -07001003 BinOp::BitAndEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001004 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001005 }
David Tolnay8c81f622018-07-31 23:34:35 -07001006 BinOp::BitOrEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001007 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001008 }
David Tolnay8c81f622018-07-31 23:34:35 -07001009 BinOp::ShlEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001010 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001011 }
David Tolnay8c81f622018-07-31 23:34:35 -07001012 BinOp::ShrEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001013 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001014 }
1015 }
1016}
David Tolnay440fe582019-02-15 20:23:14 -08001017#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001018pub fn visit_binding<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Binding) {
David Tolnay8c81f622018-07-31 23:34:35 -07001019 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001020 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001021 _visitor.visit_type(&_i.ty);
David Tolnay506e43a2017-12-29 11:34:36 -05001022}
David Tolnay8c81f622018-07-31 23:34:35 -07001023#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001024pub fn visit_block<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Block) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001025 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001026 for it in &_i.stmts {
1027 _visitor.visit_stmt(it)
1028 }
Nika Layzell27726662017-10-24 23:16:35 -04001029}
David Tolnay440fe582019-02-15 20:23:14 -08001030#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001031pub fn visit_bound_lifetimes<'ast, V: Visit<'ast> + ?Sized>(
1032 _visitor: &mut V,
1033 _i: &'ast BoundLifetimes,
1034) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001035 tokens_helper(_visitor, &_i.for_token.span);
1036 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001037 for el in Punctuated::pairs(&_i.lifetimes) {
1038 let it = el.value();
1039 _visitor.visit_lifetime_def(it)
1040 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001041 tokens_helper(_visitor, &_i.gt_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001042}
David Tolnay440fe582019-02-15 20:23:14 -08001043#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001044pub fn visit_const_param<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ConstParam) {
David Tolnay8c81f622018-07-31 23:34:35 -07001045 for it in &_i.attrs {
1046 _visitor.visit_attribute(it)
1047 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001048 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001049 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001050 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001051 _visitor.visit_type(&_i.ty);
1052 if let Some(ref it) = _i.eq_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001053 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001054 };
1055 if let Some(ref it) = _i.default {
1056 _visitor.visit_expr(it)
1057 };
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001058}
David Tolnay440fe582019-02-15 20:23:14 -08001059#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay9d0882a2018-09-01 19:49:14 -07001060pub fn visit_constraint<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Constraint) {
1061 _visitor.visit_ident(&_i.ident);
1062 tokens_helper(_visitor, &_i.colon_token.spans);
1063 for el in Punctuated::pairs(&_i.bounds) {
1064 let it = el.value();
1065 _visitor.visit_type_param_bound(it)
1066 }
1067}
David Tolnay8c81f622018-07-31 23:34:35 -07001068#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001069pub fn visit_data<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Data) {
David Tolnaye3d41b72017-12-31 15:24:00 -05001070 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001071 Data::Struct(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05001072 _visitor.visit_data_struct(_binding_0);
1073 }
David Tolnay8c81f622018-07-31 23:34:35 -07001074 Data::Enum(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05001075 _visitor.visit_data_enum(_binding_0);
1076 }
David Tolnay8c81f622018-07-31 23:34:35 -07001077 Data::Union(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05001078 _visitor.visit_data_union(_binding_0);
1079 }
1080 }
1081}
David Tolnay8c81f622018-07-31 23:34:35 -07001082#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001083pub fn visit_data_enum<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataEnum) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001084 tokens_helper(_visitor, &_i.enum_token.span);
1085 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001086 for el in Punctuated::pairs(&_i.variants) {
1087 let it = el.value();
1088 _visitor.visit_variant(it)
1089 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001090}
David Tolnay8c81f622018-07-31 23:34:35 -07001091#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001092pub fn visit_data_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataStruct) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001093 tokens_helper(_visitor, &_i.struct_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001094 _visitor.visit_fields(&_i.fields);
1095 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001096 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001097 };
David Tolnaye3d41b72017-12-31 15:24:00 -05001098}
David Tolnay8c81f622018-07-31 23:34:35 -07001099#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001100pub fn visit_data_union<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataUnion) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001101 tokens_helper(_visitor, &_i.union_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001102 _visitor.visit_fields_named(&_i.fields);
David Tolnaye3d41b72017-12-31 15:24:00 -05001103}
David Tolnay8c81f622018-07-31 23:34:35 -07001104#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001105pub fn visit_derive_input<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DeriveInput) {
David Tolnay8c81f622018-07-31 23:34:35 -07001106 for it in &_i.attrs {
1107 _visitor.visit_attribute(it)
1108 }
1109 _visitor.visit_visibility(&_i.vis);
1110 _visitor.visit_ident(&_i.ident);
1111 _visitor.visit_generics(&_i.generics);
1112 _visitor.visit_data(&_i.data);
Nika Layzell27726662017-10-24 23:16:35 -04001113}
David Tolnay440fe582019-02-15 20:23:14 -08001114#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001115pub fn visit_expr<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Expr) {
Nika Layzell27726662017-10-24 23:16:35 -04001116 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001117 Expr::Box(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001118 full!(_visitor.visit_expr_box(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001119 }
David Tolnay8c81f622018-07-31 23:34:35 -07001120 Expr::InPlace(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001121 full!(_visitor.visit_expr_in_place(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001122 }
David Tolnay8c81f622018-07-31 23:34:35 -07001123 Expr::Array(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001124 full!(_visitor.visit_expr_array(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001125 }
David Tolnay8c81f622018-07-31 23:34:35 -07001126 Expr::Call(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001127 _visitor.visit_expr_call(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001128 }
David Tolnay8c81f622018-07-31 23:34:35 -07001129 Expr::MethodCall(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001130 full!(_visitor.visit_expr_method_call(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001131 }
David Tolnay8c81f622018-07-31 23:34:35 -07001132 Expr::Tuple(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001133 full!(_visitor.visit_expr_tuple(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001134 }
David Tolnay8c81f622018-07-31 23:34:35 -07001135 Expr::Binary(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001136 _visitor.visit_expr_binary(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001137 }
David Tolnay8c81f622018-07-31 23:34:35 -07001138 Expr::Unary(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001139 _visitor.visit_expr_unary(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001140 }
David Tolnay8c81f622018-07-31 23:34:35 -07001141 Expr::Lit(ref _binding_0) => {
David Tolnay8c91b882017-12-28 23:04:32 -05001142 _visitor.visit_expr_lit(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001143 }
David Tolnay8c81f622018-07-31 23:34:35 -07001144 Expr::Cast(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001145 _visitor.visit_expr_cast(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001146 }
David Tolnay8c81f622018-07-31 23:34:35 -07001147 Expr::Type(ref _binding_0) => {
David Tolnay0cf94f22017-12-28 23:46:26 -05001148 full!(_visitor.visit_expr_type(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001149 }
David Tolnay9c119122018-09-01 18:47:02 -07001150 Expr::Let(ref _binding_0) => {
1151 full!(_visitor.visit_expr_let(_binding_0));
1152 }
David Tolnay8c81f622018-07-31 23:34:35 -07001153 Expr::If(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001154 full!(_visitor.visit_expr_if(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001155 }
David Tolnay8c81f622018-07-31 23:34:35 -07001156 Expr::While(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001157 full!(_visitor.visit_expr_while(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001158 }
David Tolnay8c81f622018-07-31 23:34:35 -07001159 Expr::ForLoop(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001160 full!(_visitor.visit_expr_for_loop(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001161 }
David Tolnay8c81f622018-07-31 23:34:35 -07001162 Expr::Loop(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001163 full!(_visitor.visit_expr_loop(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001164 }
David Tolnay8c81f622018-07-31 23:34:35 -07001165 Expr::Match(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001166 full!(_visitor.visit_expr_match(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001167 }
David Tolnay8c81f622018-07-31 23:34:35 -07001168 Expr::Closure(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001169 full!(_visitor.visit_expr_closure(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001170 }
David Tolnay8c81f622018-07-31 23:34:35 -07001171 Expr::Unsafe(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001172 full!(_visitor.visit_expr_unsafe(_binding_0));
Nika Layzell640832a2017-12-04 13:37:09 -05001173 }
David Tolnay8c81f622018-07-31 23:34:35 -07001174 Expr::Block(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001175 full!(_visitor.visit_expr_block(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001176 }
David Tolnay8c81f622018-07-31 23:34:35 -07001177 Expr::Assign(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001178 full!(_visitor.visit_expr_assign(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001179 }
David Tolnay8c81f622018-07-31 23:34:35 -07001180 Expr::AssignOp(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001181 full!(_visitor.visit_expr_assign_op(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001182 }
David Tolnay8c81f622018-07-31 23:34:35 -07001183 Expr::Field(ref _binding_0) => {
David Tolnayd093fa92018-06-30 10:23:25 -07001184 _visitor.visit_expr_field(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001185 }
David Tolnay8c81f622018-07-31 23:34:35 -07001186 Expr::Index(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001187 _visitor.visit_expr_index(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001188 }
David Tolnay8c81f622018-07-31 23:34:35 -07001189 Expr::Range(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001190 full!(_visitor.visit_expr_range(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001191 }
David Tolnay8c81f622018-07-31 23:34:35 -07001192 Expr::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001193 _visitor.visit_expr_path(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001194 }
David Tolnay8c81f622018-07-31 23:34:35 -07001195 Expr::Reference(ref _binding_0) => {
David Tolnay00674ba2018-03-31 18:14:11 +02001196 full!(_visitor.visit_expr_reference(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001197 }
David Tolnay8c81f622018-07-31 23:34:35 -07001198 Expr::Break(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001199 full!(_visitor.visit_expr_break(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001200 }
David Tolnay8c81f622018-07-31 23:34:35 -07001201 Expr::Continue(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001202 full!(_visitor.visit_expr_continue(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001203 }
David Tolnay8c81f622018-07-31 23:34:35 -07001204 Expr::Return(ref _binding_0) => {
David Tolnayc246cd32017-12-28 23:14:32 -05001205 full!(_visitor.visit_expr_return(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001206 }
David Tolnay8c81f622018-07-31 23:34:35 -07001207 Expr::Macro(ref _binding_0) => {
David Tolnay8c91b882017-12-28 23:04:32 -05001208 full!(_visitor.visit_expr_macro(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001209 }
David Tolnay8c81f622018-07-31 23:34:35 -07001210 Expr::Struct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001211 full!(_visitor.visit_expr_struct(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001212 }
David Tolnay8c81f622018-07-31 23:34:35 -07001213 Expr::Repeat(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001214 full!(_visitor.visit_expr_repeat(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001215 }
David Tolnay8c81f622018-07-31 23:34:35 -07001216 Expr::Paren(ref _binding_0) => {
David Tolnay81ab4f62018-01-27 19:02:51 -08001217 _visitor.visit_expr_paren(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001218 }
David Tolnay8c81f622018-07-31 23:34:35 -07001219 Expr::Group(ref _binding_0) => {
David Tolnaye98775f2017-12-28 23:17:00 -05001220 full!(_visitor.visit_expr_group(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001221 }
David Tolnay8c81f622018-07-31 23:34:35 -07001222 Expr::Try(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001223 full!(_visitor.visit_expr_try(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001224 }
David Tolnay02a9c6f2018-08-24 18:58:45 -04001225 Expr::Async(ref _binding_0) => {
1226 full!(_visitor.visit_expr_async(_binding_0));
1227 }
David Tolnayfb2dd4b2018-08-24 16:45:34 -04001228 Expr::TryBlock(ref _binding_0) => {
1229 full!(_visitor.visit_expr_try_block(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001230 }
David Tolnay8c81f622018-07-31 23:34:35 -07001231 Expr::Yield(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001232 full!(_visitor.visit_expr_yield(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001233 }
David Tolnay8c81f622018-07-31 23:34:35 -07001234 Expr::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05001235 _visitor.visit_expr_verbatim(_binding_0);
1236 }
Nika Layzell27726662017-10-24 23:16:35 -04001237 }
1238}
David Tolnay8c81f622018-07-31 23:34:35 -07001239#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001240pub fn visit_expr_array<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprArray) {
David Tolnay8c81f622018-07-31 23:34:35 -07001241 for it in &_i.attrs {
1242 _visitor.visit_attribute(it)
1243 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001244 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001245 for el in Punctuated::pairs(&_i.elems) {
1246 let it = el.value();
1247 _visitor.visit_expr(it)
David Tolnaye3d41b72017-12-31 15:24:00 -05001248 }
1249}
David Tolnay8c81f622018-07-31 23:34:35 -07001250#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001251pub fn visit_expr_assign<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprAssign) {
1252 for it in &_i.attrs {
1253 _visitor.visit_attribute(it)
1254 }
1255 _visitor.visit_expr(&*_i.left);
David Tolnay7ac699c2018-08-24 14:00:58 -04001256 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001257 _visitor.visit_expr(&*_i.right);
1258}
1259#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001260pub fn visit_expr_assign_op<'ast, V: Visit<'ast> + ?Sized>(
1261 _visitor: &mut V,
1262 _i: &'ast ExprAssignOp,
1263) {
1264 for it in &_i.attrs {
1265 _visitor.visit_attribute(it)
1266 }
1267 _visitor.visit_expr(&*_i.left);
1268 _visitor.visit_bin_op(&_i.op);
1269 _visitor.visit_expr(&*_i.right);
1270}
David Tolnay02a9c6f2018-08-24 18:58:45 -04001271#[cfg(feature = "full")]
David Tolnay02a9c6f2018-08-24 18:58:45 -04001272pub fn visit_expr_async<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprAsync) {
1273 for it in &_i.attrs {
1274 _visitor.visit_attribute(it)
1275 }
1276 tokens_helper(_visitor, &_i.async_token.span);
1277 if let Some(ref it) = _i.capture {
1278 tokens_helper(_visitor, &it.span)
1279 };
1280 _visitor.visit_block(&_i.block);
1281}
David Tolnay440fe582019-02-15 20:23:14 -08001282#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001283pub fn visit_expr_binary<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBinary) {
1284 for it in &_i.attrs {
1285 _visitor.visit_attribute(it)
1286 }
1287 _visitor.visit_expr(&*_i.left);
1288 _visitor.visit_bin_op(&_i.op);
1289 _visitor.visit_expr(&*_i.right);
1290}
1291#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001292pub fn visit_expr_block<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBlock) {
1293 for it in &_i.attrs {
1294 _visitor.visit_attribute(it)
1295 }
David Tolnay1d8e9962018-08-24 19:04:20 -04001296 if let Some(ref it) = _i.label {
1297 _visitor.visit_label(it)
1298 };
David Tolnay8c81f622018-07-31 23:34:35 -07001299 _visitor.visit_block(&_i.block);
1300}
1301#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001302pub fn visit_expr_box<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBox) {
1303 for it in &_i.attrs {
1304 _visitor.visit_attribute(it)
1305 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001306 tokens_helper(_visitor, &_i.box_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001307 _visitor.visit_expr(&*_i.expr);
1308}
1309#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001310pub fn visit_expr_break<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBreak) {
1311 for it in &_i.attrs {
1312 _visitor.visit_attribute(it)
1313 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001314 tokens_helper(_visitor, &_i.break_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001315 if let Some(ref it) = _i.label {
1316 _visitor.visit_lifetime(it)
1317 };
1318 if let Some(ref it) = _i.expr {
1319 _visitor.visit_expr(&**it)
1320 };
1321}
David Tolnay440fe582019-02-15 20:23:14 -08001322#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001323pub fn visit_expr_call<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprCall) {
1324 for it in &_i.attrs {
1325 _visitor.visit_attribute(it)
1326 }
1327 _visitor.visit_expr(&*_i.func);
David Tolnay7ac699c2018-08-24 14:00:58 -04001328 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001329 for el in Punctuated::pairs(&_i.args) {
1330 let it = el.value();
1331 _visitor.visit_expr(it)
1332 }
1333}
David Tolnay440fe582019-02-15 20:23:14 -08001334#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001335pub fn visit_expr_cast<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprCast) {
1336 for it in &_i.attrs {
1337 _visitor.visit_attribute(it)
1338 }
1339 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001340 tokens_helper(_visitor, &_i.as_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001341 _visitor.visit_type(&*_i.ty);
1342}
1343#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001344pub fn visit_expr_closure<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprClosure) {
1345 for it in &_i.attrs {
1346 _visitor.visit_attribute(it)
1347 }
Yusuke Sasaki4e5d9662018-07-21 02:49:47 +09001348 if let Some(ref it) = _i.asyncness {
1349 tokens_helper(_visitor, &it.span)
1350 };
David Tolnay8c81f622018-07-31 23:34:35 -07001351 if let Some(ref it) = _i.movability {
David Tolnay7ac699c2018-08-24 14:00:58 -04001352 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001353 };
1354 if let Some(ref it) = _i.capture {
David Tolnay7ac699c2018-08-24 14:00:58 -04001355 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001356 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001357 tokens_helper(_visitor, &_i.or1_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001358 for el in Punctuated::pairs(&_i.inputs) {
1359 let it = el.value();
1360 _visitor.visit_fn_arg(it)
1361 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001362 tokens_helper(_visitor, &_i.or2_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001363 _visitor.visit_return_type(&_i.output);
1364 _visitor.visit_expr(&*_i.body);
1365}
1366#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001367pub fn visit_expr_continue<'ast, V: Visit<'ast> + ?Sized>(
1368 _visitor: &mut V,
1369 _i: &'ast ExprContinue,
1370) {
1371 for it in &_i.attrs {
1372 _visitor.visit_attribute(it)
1373 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001374 tokens_helper(_visitor, &_i.continue_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001375 if let Some(ref it) = _i.label {
1376 _visitor.visit_lifetime(it)
1377 };
1378}
David Tolnay440fe582019-02-15 20:23:14 -08001379#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001380pub fn visit_expr_field<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprField) {
1381 for it in &_i.attrs {
1382 _visitor.visit_attribute(it)
1383 }
1384 _visitor.visit_expr(&*_i.base);
David Tolnay7ac699c2018-08-24 14:00:58 -04001385 tokens_helper(_visitor, &_i.dot_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001386 _visitor.visit_member(&_i.member);
1387}
1388#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001389pub fn visit_expr_for_loop<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprForLoop) {
1390 for it in &_i.attrs {
1391 _visitor.visit_attribute(it)
1392 }
1393 if let Some(ref it) = _i.label {
1394 _visitor.visit_label(it)
1395 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001396 tokens_helper(_visitor, &_i.for_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001397 _visitor.visit_pat(&*_i.pat);
David Tolnay7ac699c2018-08-24 14:00:58 -04001398 tokens_helper(_visitor, &_i.in_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001399 _visitor.visit_expr(&*_i.expr);
1400 _visitor.visit_block(&_i.body);
1401}
1402#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001403pub fn visit_expr_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprGroup) {
1404 for it in &_i.attrs {
1405 _visitor.visit_attribute(it)
1406 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001407 tokens_helper(_visitor, &_i.group_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001408 _visitor.visit_expr(&*_i.expr);
1409}
1410#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001411pub fn visit_expr_if<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprIf) {
1412 for it in &_i.attrs {
1413 _visitor.visit_attribute(it)
1414 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001415 tokens_helper(_visitor, &_i.if_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001416 _visitor.visit_expr(&*_i.cond);
1417 _visitor.visit_block(&_i.then_branch);
1418 if let Some(ref it) = _i.else_branch {
David Tolnay7ac699c2018-08-24 14:00:58 -04001419 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001420 _visitor.visit_expr(&*(it).1);
1421 };
1422}
1423#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001424pub fn visit_expr_in_place<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprInPlace) {
1425 for it in &_i.attrs {
1426 _visitor.visit_attribute(it)
1427 }
1428 _visitor.visit_expr(&*_i.place);
David Tolnay7ac699c2018-08-24 14:00:58 -04001429 tokens_helper(_visitor, &_i.arrow_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001430 _visitor.visit_expr(&*_i.value);
1431}
David Tolnay440fe582019-02-15 20:23:14 -08001432#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001433pub fn visit_expr_index<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprIndex) {
1434 for it in &_i.attrs {
1435 _visitor.visit_attribute(it)
1436 }
1437 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001438 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001439 _visitor.visit_expr(&*_i.index);
1440}
David Tolnay9c119122018-09-01 18:47:02 -07001441#[cfg(feature = "full")]
David Tolnay9c119122018-09-01 18:47:02 -07001442pub fn visit_expr_let<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprLet) {
1443 for it in &_i.attrs {
1444 _visitor.visit_attribute(it)
1445 }
1446 tokens_helper(_visitor, &_i.let_token.span);
1447 for el in Punctuated::pairs(&_i.pats) {
1448 let it = el.value();
1449 _visitor.visit_pat(it)
1450 }
1451 tokens_helper(_visitor, &_i.eq_token.spans);
1452 _visitor.visit_expr(&*_i.expr);
1453}
David Tolnay440fe582019-02-15 20:23:14 -08001454#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001455pub fn visit_expr_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprLit) {
1456 for it in &_i.attrs {
1457 _visitor.visit_attribute(it)
1458 }
1459 _visitor.visit_lit(&_i.lit);
1460}
1461#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001462pub fn visit_expr_loop<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprLoop) {
1463 for it in &_i.attrs {
1464 _visitor.visit_attribute(it)
1465 }
1466 if let Some(ref it) = _i.label {
1467 _visitor.visit_label(it)
1468 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001469 tokens_helper(_visitor, &_i.loop_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001470 _visitor.visit_block(&_i.body);
1471}
1472#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001473pub fn visit_expr_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprMacro) {
1474 for it in &_i.attrs {
1475 _visitor.visit_attribute(it)
1476 }
1477 _visitor.visit_macro(&_i.mac);
1478}
1479#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001480pub fn visit_expr_match<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprMatch) {
1481 for it in &_i.attrs {
1482 _visitor.visit_attribute(it)
1483 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001484 tokens_helper(_visitor, &_i.match_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001485 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001486 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001487 for it in &_i.arms {
1488 _visitor.visit_arm(it)
1489 }
1490}
1491#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001492pub fn visit_expr_method_call<'ast, V: Visit<'ast> + ?Sized>(
1493 _visitor: &mut V,
1494 _i: &'ast ExprMethodCall,
1495) {
1496 for it in &_i.attrs {
1497 _visitor.visit_attribute(it)
1498 }
1499 _visitor.visit_expr(&*_i.receiver);
David Tolnay7ac699c2018-08-24 14:00:58 -04001500 tokens_helper(_visitor, &_i.dot_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001501 _visitor.visit_ident(&_i.method);
1502 if let Some(ref it) = _i.turbofish {
1503 _visitor.visit_method_turbofish(it)
1504 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001505 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001506 for el in Punctuated::pairs(&_i.args) {
1507 let it = el.value();
1508 _visitor.visit_expr(it)
1509 }
1510}
David Tolnay440fe582019-02-15 20:23:14 -08001511#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001512pub fn visit_expr_paren<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprParen) {
1513 for it in &_i.attrs {
1514 _visitor.visit_attribute(it)
1515 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001516 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001517 _visitor.visit_expr(&*_i.expr);
1518}
David Tolnay440fe582019-02-15 20:23:14 -08001519#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001520pub fn visit_expr_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprPath) {
1521 for it in &_i.attrs {
1522 _visitor.visit_attribute(it)
1523 }
1524 if let Some(ref it) = _i.qself {
1525 _visitor.visit_qself(it)
1526 };
1527 _visitor.visit_path(&_i.path);
1528}
1529#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001530pub fn visit_expr_range<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprRange) {
1531 for it in &_i.attrs {
1532 _visitor.visit_attribute(it)
1533 }
1534 if let Some(ref it) = _i.from {
1535 _visitor.visit_expr(&**it)
1536 };
1537 _visitor.visit_range_limits(&_i.limits);
1538 if let Some(ref it) = _i.to {
1539 _visitor.visit_expr(&**it)
1540 };
1541}
1542#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001543pub fn visit_expr_reference<'ast, V: Visit<'ast> + ?Sized>(
1544 _visitor: &mut V,
1545 _i: &'ast ExprReference,
1546) {
1547 for it in &_i.attrs {
1548 _visitor.visit_attribute(it)
1549 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001550 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001551 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04001552 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001553 };
1554 _visitor.visit_expr(&*_i.expr);
1555}
1556#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001557pub fn visit_expr_repeat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprRepeat) {
1558 for it in &_i.attrs {
1559 _visitor.visit_attribute(it)
1560 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001561 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001562 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001563 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001564 _visitor.visit_expr(&*_i.len);
1565}
1566#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001567pub fn visit_expr_return<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprReturn) {
1568 for it in &_i.attrs {
1569 _visitor.visit_attribute(it)
1570 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001571 tokens_helper(_visitor, &_i.return_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001572 if let Some(ref it) = _i.expr {
1573 _visitor.visit_expr(&**it)
1574 };
1575}
1576#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001577pub fn visit_expr_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprStruct) {
1578 for it in &_i.attrs {
1579 _visitor.visit_attribute(it)
1580 }
1581 _visitor.visit_path(&_i.path);
David Tolnay7ac699c2018-08-24 14:00:58 -04001582 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001583 for el in Punctuated::pairs(&_i.fields) {
1584 let it = el.value();
1585 _visitor.visit_field_value(it)
1586 }
1587 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001588 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001589 };
1590 if let Some(ref it) = _i.rest {
1591 _visitor.visit_expr(&**it)
1592 };
1593}
1594#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001595pub fn visit_expr_try<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprTry) {
1596 for it in &_i.attrs {
1597 _visitor.visit_attribute(it)
1598 }
1599 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001600 tokens_helper(_visitor, &_i.question_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001601}
1602#[cfg(feature = "full")]
David Tolnayfb2dd4b2018-08-24 16:45:34 -04001603pub fn visit_expr_try_block<'ast, V: Visit<'ast> + ?Sized>(
1604 _visitor: &mut V,
1605 _i: &'ast ExprTryBlock,
1606) {
1607 for it in &_i.attrs {
1608 _visitor.visit_attribute(it)
1609 }
1610 tokens_helper(_visitor, &_i.try_token.span);
1611 _visitor.visit_block(&_i.block);
1612}
1613#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001614pub fn visit_expr_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprTuple) {
1615 for it in &_i.attrs {
1616 _visitor.visit_attribute(it)
1617 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001618 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001619 for el in Punctuated::pairs(&_i.elems) {
1620 let it = el.value();
1621 _visitor.visit_expr(it)
1622 }
1623}
1624#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001625pub fn visit_expr_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprType) {
1626 for it in &_i.attrs {
1627 _visitor.visit_attribute(it)
1628 }
1629 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001630 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001631 _visitor.visit_type(&*_i.ty);
1632}
David Tolnay440fe582019-02-15 20:23:14 -08001633#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001634pub fn visit_expr_unary<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprUnary) {
1635 for it in &_i.attrs {
1636 _visitor.visit_attribute(it)
1637 }
1638 _visitor.visit_un_op(&_i.op);
1639 _visitor.visit_expr(&*_i.expr);
1640}
1641#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001642pub fn visit_expr_unsafe<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprUnsafe) {
1643 for it in &_i.attrs {
1644 _visitor.visit_attribute(it)
1645 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001646 tokens_helper(_visitor, &_i.unsafe_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001647 _visitor.visit_block(&_i.block);
1648}
David Tolnay440fe582019-02-15 20:23:14 -08001649#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001650pub fn visit_expr_verbatim<'ast, V: Visit<'ast> + ?Sized>(
1651 _visitor: &mut V,
1652 _i: &'ast ExprVerbatim,
1653) {
David Tolnay6af48992018-08-01 11:16:28 -07001654 skip!(_i.tts);
David Tolnay8c81f622018-07-31 23:34:35 -07001655}
1656#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001657pub fn visit_expr_while<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprWhile) {
1658 for it in &_i.attrs {
1659 _visitor.visit_attribute(it)
1660 }
1661 if let Some(ref it) = _i.label {
1662 _visitor.visit_label(it)
1663 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001664 tokens_helper(_visitor, &_i.while_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001665 _visitor.visit_expr(&*_i.cond);
1666 _visitor.visit_block(&_i.body);
1667}
1668#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001669pub fn visit_expr_yield<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprYield) {
1670 for it in &_i.attrs {
1671 _visitor.visit_attribute(it)
1672 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001673 tokens_helper(_visitor, &_i.yield_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001674 if let Some(ref it) = _i.expr {
1675 _visitor.visit_expr(&**it)
1676 };
1677}
David Tolnay440fe582019-02-15 20:23:14 -08001678#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001679pub fn visit_field<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Field) {
1680 for it in &_i.attrs {
1681 _visitor.visit_attribute(it)
1682 }
1683 _visitor.visit_visibility(&_i.vis);
1684 if let Some(ref it) = _i.ident {
1685 _visitor.visit_ident(it)
1686 };
1687 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001688 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001689 };
1690 _visitor.visit_type(&_i.ty);
1691}
David Tolnay8c81f622018-07-31 23:34:35 -07001692#[cfg(feature = "full")]
1693pub fn visit_field_pat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldPat) {
1694 for it in &_i.attrs {
1695 _visitor.visit_attribute(it)
1696 }
1697 _visitor.visit_member(&_i.member);
1698 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001699 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001700 };
1701 _visitor.visit_pat(&*_i.pat);
1702}
David Tolnay8c81f622018-07-31 23:34:35 -07001703#[cfg(feature = "full")]
1704pub fn visit_field_value<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldValue) {
1705 for it in &_i.attrs {
1706 _visitor.visit_attribute(it)
1707 }
1708 _visitor.visit_member(&_i.member);
1709 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001710 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001711 };
1712 _visitor.visit_expr(&_i.expr);
1713}
David Tolnay440fe582019-02-15 20:23:14 -08001714#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001715pub fn visit_fields<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Fields) {
1716 match *_i {
1717 Fields::Named(ref _binding_0) => {
1718 _visitor.visit_fields_named(_binding_0);
1719 }
1720 Fields::Unnamed(ref _binding_0) => {
1721 _visitor.visit_fields_unnamed(_binding_0);
1722 }
1723 Fields::Unit => {}
1724 }
1725}
David Tolnay440fe582019-02-15 20:23:14 -08001726#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001727pub fn visit_fields_named<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldsNamed) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001728 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001729 for el in Punctuated::pairs(&_i.named) {
1730 let it = el.value();
1731 _visitor.visit_field(it)
1732 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001733}
David Tolnay440fe582019-02-15 20:23:14 -08001734#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001735pub fn visit_fields_unnamed<'ast, V: Visit<'ast> + ?Sized>(
1736 _visitor: &mut V,
1737 _i: &'ast FieldsUnnamed,
1738) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001739 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001740 for el in Punctuated::pairs(&_i.unnamed) {
1741 let it = el.value();
1742 _visitor.visit_field(it)
1743 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001744}
David Tolnay8c81f622018-07-31 23:34:35 -07001745#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001746pub fn visit_file<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast File) {
David Tolnay6af48992018-08-01 11:16:28 -07001747 skip!(_i.shebang);
David Tolnay8c81f622018-07-31 23:34:35 -07001748 for it in &_i.attrs {
1749 _visitor.visit_attribute(it)
1750 }
1751 for it in &_i.items {
1752 _visitor.visit_item(it)
1753 }
Nika Layzell27726662017-10-24 23:16:35 -04001754}
David Tolnay8c81f622018-07-31 23:34:35 -07001755#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001756pub fn visit_fn_arg<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FnArg) {
Nika Layzell27726662017-10-24 23:16:35 -04001757 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001758 FnArg::SelfRef(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001759 _visitor.visit_arg_self_ref(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001760 }
David Tolnay8c81f622018-07-31 23:34:35 -07001761 FnArg::SelfValue(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001762 _visitor.visit_arg_self(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001763 }
David Tolnay8c81f622018-07-31 23:34:35 -07001764 FnArg::Captured(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001765 _visitor.visit_arg_captured(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001766 }
David Tolnay8c81f622018-07-31 23:34:35 -07001767 FnArg::Inferred(ref _binding_0) => {
David Tolnay80ed55f2017-12-27 22:54:40 -05001768 _visitor.visit_pat(_binding_0);
1769 }
David Tolnay8c81f622018-07-31 23:34:35 -07001770 FnArg::Ignored(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001771 _visitor.visit_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001772 }
1773 }
1774}
David Tolnay8c81f622018-07-31 23:34:35 -07001775#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001776pub fn visit_fn_decl<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FnDecl) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001777 tokens_helper(_visitor, &_i.fn_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001778 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04001779 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001780 for el in Punctuated::pairs(&_i.inputs) {
1781 let it = el.value();
1782 _visitor.visit_fn_arg(it)
1783 }
1784 if let Some(ref it) = _i.variadic {
David Tolnay7ac699c2018-08-24 14:00:58 -04001785 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001786 };
1787 _visitor.visit_return_type(&_i.output);
Nika Layzell27726662017-10-24 23:16:35 -04001788}
David Tolnay8c81f622018-07-31 23:34:35 -07001789#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001790pub fn visit_foreign_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ForeignItem) {
Nika Layzell27726662017-10-24 23:16:35 -04001791 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001792 ForeignItem::Fn(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001793 _visitor.visit_foreign_item_fn(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001794 }
David Tolnay8c81f622018-07-31 23:34:35 -07001795 ForeignItem::Static(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001796 _visitor.visit_foreign_item_static(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001797 }
David Tolnay8c81f622018-07-31 23:34:35 -07001798 ForeignItem::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001799 _visitor.visit_foreign_item_type(_binding_0);
David Tolnay199bcbb2017-11-12 10:33:52 -08001800 }
David Tolnay435c1782018-08-24 16:15:44 -04001801 ForeignItem::Macro(ref _binding_0) => {
1802 _visitor.visit_foreign_item_macro(_binding_0);
1803 }
David Tolnay8c81f622018-07-31 23:34:35 -07001804 ForeignItem::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05001805 _visitor.visit_foreign_item_verbatim(_binding_0);
1806 }
Nika Layzell27726662017-10-24 23:16:35 -04001807 }
1808}
David Tolnay8c81f622018-07-31 23:34:35 -07001809#[cfg(feature = "full")]
1810pub fn visit_foreign_item_fn<'ast, V: Visit<'ast> + ?Sized>(
1811 _visitor: &mut V,
1812 _i: &'ast ForeignItemFn,
1813) {
1814 for it in &_i.attrs {
1815 _visitor.visit_attribute(it)
1816 }
1817 _visitor.visit_visibility(&_i.vis);
1818 _visitor.visit_ident(&_i.ident);
1819 _visitor.visit_fn_decl(&*_i.decl);
David Tolnay7ac699c2018-08-24 14:00:58 -04001820 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay8894f602017-11-11 12:11:04 -08001821}
David Tolnay8c81f622018-07-31 23:34:35 -07001822#[cfg(feature = "full")]
David Tolnay435c1782018-08-24 16:15:44 -04001823pub fn visit_foreign_item_macro<'ast, V: Visit<'ast> + ?Sized>(
1824 _visitor: &mut V,
1825 _i: &'ast ForeignItemMacro,
1826) {
1827 for it in &_i.attrs {
1828 _visitor.visit_attribute(it)
1829 }
1830 _visitor.visit_macro(&_i.mac);
1831 if let Some(ref it) = _i.semi_token {
1832 tokens_helper(_visitor, &it.spans)
1833 };
1834}
1835#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001836pub fn visit_foreign_item_static<'ast, V: Visit<'ast> + ?Sized>(
1837 _visitor: &mut V,
1838 _i: &'ast ForeignItemStatic,
1839) {
1840 for it in &_i.attrs {
1841 _visitor.visit_attribute(it)
1842 }
1843 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04001844 tokens_helper(_visitor, &_i.static_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001845 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04001846 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001847 };
1848 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001849 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001850 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04001851 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001852}
David Tolnay8c81f622018-07-31 23:34:35 -07001853#[cfg(feature = "full")]
1854pub fn visit_foreign_item_type<'ast, V: Visit<'ast> + ?Sized>(
1855 _visitor: &mut V,
1856 _i: &'ast ForeignItemType,
1857) {
1858 for it in &_i.attrs {
1859 _visitor.visit_attribute(it)
1860 }
1861 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04001862 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001863 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001864 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay199bcbb2017-11-12 10:33:52 -08001865}
David Tolnay8c81f622018-07-31 23:34:35 -07001866#[cfg(feature = "full")]
1867pub fn visit_foreign_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
1868 _visitor: &mut V,
1869 _i: &'ast ForeignItemVerbatim,
1870) {
David Tolnay6af48992018-08-01 11:16:28 -07001871 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05001872}
David Tolnay440fe582019-02-15 20:23:14 -08001873#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001874pub fn visit_generic_argument<'ast, V: Visit<'ast> + ?Sized>(
1875 _visitor: &mut V,
1876 _i: &'ast GenericArgument,
1877) {
Nika Layzell357885a2017-12-04 15:47:07 -05001878 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001879 GenericArgument::Lifetime(ref _binding_0) => {
David Tolnay4ba63a02017-12-28 15:53:05 -05001880 _visitor.visit_lifetime(_binding_0);
Nika Layzell357885a2017-12-04 15:47:07 -05001881 }
David Tolnay8c81f622018-07-31 23:34:35 -07001882 GenericArgument::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001883 _visitor.visit_type(_binding_0);
Nika Layzell357885a2017-12-04 15:47:07 -05001884 }
David Tolnay8c81f622018-07-31 23:34:35 -07001885 GenericArgument::Binding(ref _binding_0) => {
David Tolnay506e43a2017-12-29 11:34:36 -05001886 _visitor.visit_binding(_binding_0);
Nika Layzell357885a2017-12-04 15:47:07 -05001887 }
David Tolnay9d0882a2018-09-01 19:49:14 -07001888 GenericArgument::Constraint(ref _binding_0) => {
1889 _visitor.visit_constraint(_binding_0);
1890 }
David Tolnay8c81f622018-07-31 23:34:35 -07001891 GenericArgument::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001892 _visitor.visit_expr(_binding_0);
Nika Layzellc680e612017-12-04 19:07:20 -05001893 }
Nika Layzell357885a2017-12-04 15:47:07 -05001894 }
1895}
David Tolnay8c81f622018-07-31 23:34:35 -07001896#[cfg(feature = "full")]
1897pub fn visit_generic_method_argument<'ast, V: Visit<'ast> + ?Sized>(
1898 _visitor: &mut V,
1899 _i: &'ast GenericMethodArgument,
1900) {
David Tolnayd60cfec2017-12-29 00:21:38 -05001901 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001902 GenericMethodArgument::Type(ref _binding_0) => {
David Tolnayd60cfec2017-12-29 00:21:38 -05001903 _visitor.visit_type(_binding_0);
1904 }
David Tolnay8c81f622018-07-31 23:34:35 -07001905 GenericMethodArgument::Const(ref _binding_0) => {
David Tolnayd60cfec2017-12-29 00:21:38 -05001906 _visitor.visit_expr(_binding_0);
1907 }
1908 }
1909}
David Tolnay440fe582019-02-15 20:23:14 -08001910#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001911pub fn visit_generic_param<'ast, V: Visit<'ast> + ?Sized>(
1912 _visitor: &mut V,
1913 _i: &'ast GenericParam,
1914) {
David Tolnayc2f1aba2017-11-12 20:29:22 -08001915 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001916 GenericParam::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001917 _visitor.visit_type_param(_binding_0);
David Tolnayc2f1aba2017-11-12 20:29:22 -08001918 }
David Tolnay8c81f622018-07-31 23:34:35 -07001919 GenericParam::Lifetime(ref _binding_0) => {
David Tolnay517f3692018-01-01 20:17:23 -08001920 _visitor.visit_lifetime_def(_binding_0);
1921 }
David Tolnay8c81f622018-07-31 23:34:35 -07001922 GenericParam::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001923 _visitor.visit_const_param(_binding_0);
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001924 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08001925 }
1926}
David Tolnay440fe582019-02-15 20:23:14 -08001927#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001928pub fn visit_generics<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Generics) {
David Tolnay8c81f622018-07-31 23:34:35 -07001929 if let Some(ref it) = _i.lt_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001930 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001931 };
1932 for el in Punctuated::pairs(&_i.params) {
1933 let it = el.value();
1934 _visitor.visit_generic_param(it)
1935 }
1936 if let Some(ref it) = _i.gt_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001937 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001938 };
1939 if let Some(ref it) = _i.where_clause {
1940 _visitor.visit_where_clause(it)
1941 };
Nika Layzell27726662017-10-24 23:16:35 -04001942}
David Tolnay8c81f622018-07-31 23:34:35 -07001943#[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 Tolnay440fe582019-02-15 20:23:14 -08002061#[cfg(any(feature = "derive", feature = "full"))]
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 Tolnay440fe582019-02-15 20:23:14 -08002430#[cfg(any(feature = "derive", feature = "full"))]
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 Tolnay440fe582019-02-15 20:23:14 -08002444#[cfg(any(feature = "derive", feature = "full"))]
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 Tolnay440fe582019-02-15 20:23:14 -08002473#[cfg(any(feature = "derive", feature = "full"))]
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 Tolnay440fe582019-02-15 20:23:14 -08002478#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8964fff2019-02-15 14:34:51 -08002479pub fn visit_lit_byte<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitByte) {}
David Tolnay440fe582019-02-15 20:23:14 -08002480#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8964fff2019-02-15 14:34:51 -08002481pub fn visit_lit_byte_str<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitByteStr) {}
David Tolnay440fe582019-02-15 20:23:14 -08002482#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8964fff2019-02-15 14:34:51 -08002483pub fn visit_lit_char<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitChar) {}
David Tolnay440fe582019-02-15 20:23:14 -08002484#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8964fff2019-02-15 14:34:51 -08002485pub fn visit_lit_float<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitFloat) {}
David Tolnay440fe582019-02-15 20:23:14 -08002486#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8964fff2019-02-15 14:34:51 -08002487pub fn visit_lit_int<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitInt) {}
David Tolnay440fe582019-02-15 20:23:14 -08002488#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8964fff2019-02-15 14:34:51 -08002489pub fn visit_lit_str<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitStr) {}
David Tolnay440fe582019-02-15 20:23:14 -08002490#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002491pub fn visit_lit_verbatim<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitVerbatim) {
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(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002495pub fn visit_local<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Local) {
David Tolnay8c81f622018-07-31 23:34:35 -07002496 for it in &_i.attrs {
2497 _visitor.visit_attribute(it)
2498 }
David Tolnay7ac699c2018-08-24 14:00:58 -04002499 tokens_helper(_visitor, &_i.let_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002500 for el in Punctuated::pairs(&_i.pats) {
2501 let it = el.value();
2502 _visitor.visit_pat(it)
2503 }
2504 if let Some(ref it) = _i.ty {
David Tolnay7ac699c2018-08-24 14:00:58 -04002505 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002506 _visitor.visit_type(&*(it).1);
2507 };
2508 if let Some(ref it) = _i.init {
David Tolnay7ac699c2018-08-24 14:00:58 -04002509 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002510 _visitor.visit_expr(&*(it).1);
2511 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002512 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002513}
David Tolnay440fe582019-02-15 20:23:14 -08002514#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002515pub fn visit_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Macro) {
David Tolnay8c81f622018-07-31 23:34:35 -07002516 _visitor.visit_path(&_i.path);
David Tolnay7ac699c2018-08-24 14:00:58 -04002517 tokens_helper(_visitor, &_i.bang_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002518 _visitor.visit_macro_delimiter(&_i.delimiter);
David Tolnay6af48992018-08-01 11:16:28 -07002519 skip!(_i.tts);
David Tolnayab919512017-12-30 23:31:51 -05002520}
David Tolnay440fe582019-02-15 20:23:14 -08002521#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07002522pub fn visit_macro_delimiter<'ast, V: Visit<'ast> + ?Sized>(
2523 _visitor: &mut V,
2524 _i: &'ast MacroDelimiter,
2525) {
David Tolnayab919512017-12-30 23:31:51 -05002526 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002527 MacroDelimiter::Paren(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002528 tokens_helper(_visitor, &_binding_0.span);
David Tolnayab919512017-12-30 23:31:51 -05002529 }
David Tolnay8c81f622018-07-31 23:34:35 -07002530 MacroDelimiter::Brace(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002531 tokens_helper(_visitor, &_binding_0.span);
David Tolnayab919512017-12-30 23:31:51 -05002532 }
David Tolnay8c81f622018-07-31 23:34:35 -07002533 MacroDelimiter::Bracket(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002534 tokens_helper(_visitor, &_binding_0.span);
David Tolnayab919512017-12-30 23:31:51 -05002535 }
2536 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002537}
David Tolnay440fe582019-02-15 20:23:14 -08002538#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002539pub fn visit_member<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Member) {
David Tolnay85b69a42017-12-27 20:43:10 -05002540 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002541 Member::Named(ref _binding_0) => {
Alex Crichtond261d092018-05-18 13:47:35 -07002542 _visitor.visit_ident(_binding_0);
David Tolnay85b69a42017-12-27 20:43:10 -05002543 }
David Tolnay8c81f622018-07-31 23:34:35 -07002544 Member::Unnamed(ref _binding_0) => {
David Tolnay85b69a42017-12-27 20:43:10 -05002545 _visitor.visit_index(_binding_0);
2546 }
2547 }
2548}
David Tolnay440fe582019-02-15 20:23:14 -08002549#[cfg(any(feature = "derive", feature = "full"))]
David Tolnayaaadd782018-01-06 22:58:13 -08002550pub fn visit_meta<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Meta) {
Nika Layzell27726662017-10-24 23:16:35 -04002551 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002552 Meta::Word(ref _binding_0) => {
Alex Crichtond261d092018-05-18 13:47:35 -07002553 _visitor.visit_ident(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002554 }
David Tolnay8c81f622018-07-31 23:34:35 -07002555 Meta::List(ref _binding_0) => {
David Tolnayaaadd782018-01-06 22:58:13 -08002556 _visitor.visit_meta_list(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002557 }
David Tolnay8c81f622018-07-31 23:34:35 -07002558 Meta::NameValue(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002559 _visitor.visit_meta_name_value(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002560 }
2561 }
2562}
David Tolnay440fe582019-02-15 20:23:14 -08002563#[cfg(any(feature = "derive", feature = "full"))]
David Tolnayaaadd782018-01-06 22:58:13 -08002564pub fn visit_meta_list<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast MetaList) {
David Tolnay8c81f622018-07-31 23:34:35 -07002565 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002566 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002567 for el in Punctuated::pairs(&_i.nested) {
2568 let it = el.value();
2569 _visitor.visit_nested_meta(it)
2570 }
Nika Layzell27726662017-10-24 23:16:35 -04002571}
David Tolnay440fe582019-02-15 20:23:14 -08002572#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07002573pub fn visit_meta_name_value<'ast, V: Visit<'ast> + ?Sized>(
2574 _visitor: &mut V,
2575 _i: &'ast MetaNameValue,
2576) {
2577 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002578 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002579 _visitor.visit_lit(&_i.lit);
Nika Layzell27726662017-10-24 23:16:35 -04002580}
David Tolnay8c81f622018-07-31 23:34:35 -07002581#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002582pub fn visit_method_sig<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast MethodSig) {
David Tolnay8c81f622018-07-31 23:34:35 -07002583 if let Some(ref it) = _i.constness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002584 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002585 };
2586 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002587 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002588 };
Yusuke Sasakif00a3ef2018-07-20 22:08:42 +09002589 if let Some(ref it) = _i.asyncness {
2590 tokens_helper(_visitor, &it.span)
2591 };
David Tolnay8c81f622018-07-31 23:34:35 -07002592 if let Some(ref it) = _i.abi {
2593 _visitor.visit_abi(it)
2594 };
2595 _visitor.visit_ident(&_i.ident);
2596 _visitor.visit_fn_decl(&_i.decl);
Nika Layzell27726662017-10-24 23:16:35 -04002597}
David Tolnay8c81f622018-07-31 23:34:35 -07002598#[cfg(feature = "full")]
2599pub fn visit_method_turbofish<'ast, V: Visit<'ast> + ?Sized>(
2600 _visitor: &mut V,
2601 _i: &'ast MethodTurbofish,
2602) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002603 tokens_helper(_visitor, &_i.colon2_token.spans);
2604 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002605 for el in Punctuated::pairs(&_i.args) {
2606 let it = el.value();
2607 _visitor.visit_generic_method_argument(it)
2608 }
David Tolnay7ac699c2018-08-24 14:00:58 -04002609 tokens_helper(_visitor, &_i.gt_token.spans);
David Tolnayd60cfec2017-12-29 00:21:38 -05002610}
David Tolnay440fe582019-02-15 20:23:14 -08002611#[cfg(any(feature = "derive", feature = "full"))]
David Tolnayaaadd782018-01-06 22:58:13 -08002612pub fn visit_nested_meta<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast NestedMeta) {
Nika Layzell27726662017-10-24 23:16:35 -04002613 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002614 NestedMeta::Meta(ref _binding_0) => {
David Tolnayaaadd782018-01-06 22:58:13 -08002615 _visitor.visit_meta(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002616 }
David Tolnay8c81f622018-07-31 23:34:35 -07002617 NestedMeta::Literal(ref _binding_0) => {
David Tolnay4ba63a02017-12-28 15:53:05 -05002618 _visitor.visit_lit(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002619 }
2620 }
2621}
David Tolnay440fe582019-02-15 20:23:14 -08002622#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07002623pub fn visit_parenthesized_generic_arguments<'ast, V: Visit<'ast> + ?Sized>(
2624 _visitor: &mut V,
2625 _i: &'ast ParenthesizedGenericArguments,
2626) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002627 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002628 for el in Punctuated::pairs(&_i.inputs) {
2629 let it = el.value();
2630 _visitor.visit_type(it)
2631 }
2632 _visitor.visit_return_type(&_i.output);
Nika Layzell27726662017-10-24 23:16:35 -04002633}
David Tolnay8c81f622018-07-31 23:34:35 -07002634#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002635pub fn visit_pat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Pat) {
Nika Layzell27726662017-10-24 23:16:35 -04002636 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002637 Pat::Wild(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002638 _visitor.visit_pat_wild(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002639 }
David Tolnay8c81f622018-07-31 23:34:35 -07002640 Pat::Ident(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002641 _visitor.visit_pat_ident(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002642 }
David Tolnay8c81f622018-07-31 23:34:35 -07002643 Pat::Struct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002644 _visitor.visit_pat_struct(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002645 }
David Tolnay8c81f622018-07-31 23:34:35 -07002646 Pat::TupleStruct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002647 _visitor.visit_pat_tuple_struct(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002648 }
David Tolnay8c81f622018-07-31 23:34:35 -07002649 Pat::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002650 _visitor.visit_pat_path(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002651 }
David Tolnay8c81f622018-07-31 23:34:35 -07002652 Pat::Tuple(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002653 _visitor.visit_pat_tuple(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002654 }
David Tolnay8c81f622018-07-31 23:34:35 -07002655 Pat::Box(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002656 _visitor.visit_pat_box(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002657 }
David Tolnay8c81f622018-07-31 23:34:35 -07002658 Pat::Ref(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002659 _visitor.visit_pat_ref(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002660 }
David Tolnay8c81f622018-07-31 23:34:35 -07002661 Pat::Lit(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002662 _visitor.visit_pat_lit(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002663 }
David Tolnay8c81f622018-07-31 23:34:35 -07002664 Pat::Range(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002665 _visitor.visit_pat_range(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002666 }
David Tolnay8c81f622018-07-31 23:34:35 -07002667 Pat::Slice(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002668 _visitor.visit_pat_slice(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002669 }
David Tolnay8c81f622018-07-31 23:34:35 -07002670 Pat::Macro(ref _binding_0) => {
David Tolnay323279a2017-12-29 11:26:32 -05002671 _visitor.visit_pat_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002672 }
David Tolnay8c81f622018-07-31 23:34:35 -07002673 Pat::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002674 _visitor.visit_pat_verbatim(_binding_0);
2675 }
Nika Layzell27726662017-10-24 23:16:35 -04002676 }
2677}
David Tolnay8c81f622018-07-31 23:34:35 -07002678#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002679pub fn visit_pat_box<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatBox) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002680 tokens_helper(_visitor, &_i.box_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002681 _visitor.visit_pat(&*_i.pat);
Nika Layzell27726662017-10-24 23:16:35 -04002682}
David Tolnay8c81f622018-07-31 23:34:35 -07002683#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002684pub fn visit_pat_ident<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatIdent) {
David Tolnay8c81f622018-07-31 23:34:35 -07002685 if let Some(ref it) = _i.by_ref {
David Tolnay7ac699c2018-08-24 14:00:58 -04002686 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002687 };
2688 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04002689 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002690 };
2691 _visitor.visit_ident(&_i.ident);
2692 if let Some(ref it) = _i.subpat {
David Tolnay7ac699c2018-08-24 14:00:58 -04002693 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002694 _visitor.visit_pat(&*(it).1);
2695 };
Nika Layzell27726662017-10-24 23:16:35 -04002696}
David Tolnay8c81f622018-07-31 23:34:35 -07002697#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002698pub fn visit_pat_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatLit) {
David Tolnay8c81f622018-07-31 23:34:35 -07002699 _visitor.visit_expr(&*_i.expr);
Nika Layzell27726662017-10-24 23:16:35 -04002700}
David Tolnay8c81f622018-07-31 23:34:35 -07002701#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002702pub fn visit_pat_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatMacro) {
David Tolnay8c81f622018-07-31 23:34:35 -07002703 _visitor.visit_macro(&_i.mac);
David Tolnay323279a2017-12-29 11:26:32 -05002704}
David Tolnay8c81f622018-07-31 23:34:35 -07002705#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002706pub fn visit_pat_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatPath) {
David Tolnay8c81f622018-07-31 23:34:35 -07002707 if let Some(ref it) = _i.qself {
2708 _visitor.visit_qself(it)
2709 };
2710 _visitor.visit_path(&_i.path);
Nika Layzell27726662017-10-24 23:16:35 -04002711}
David Tolnay8c81f622018-07-31 23:34:35 -07002712#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002713pub fn visit_pat_range<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatRange) {
David Tolnay8c81f622018-07-31 23:34:35 -07002714 _visitor.visit_expr(&*_i.lo);
2715 _visitor.visit_range_limits(&_i.limits);
2716 _visitor.visit_expr(&*_i.hi);
Nika Layzell27726662017-10-24 23:16:35 -04002717}
David Tolnay8c81f622018-07-31 23:34:35 -07002718#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002719pub fn visit_pat_ref<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatRef) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002720 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002721 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04002722 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002723 };
2724 _visitor.visit_pat(&*_i.pat);
Nika Layzell27726662017-10-24 23:16:35 -04002725}
David Tolnay8c81f622018-07-31 23:34:35 -07002726#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002727pub fn visit_pat_slice<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatSlice) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002728 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002729 for el in Punctuated::pairs(&_i.front) {
2730 let it = el.value();
2731 _visitor.visit_pat(it)
2732 }
2733 if let Some(ref it) = _i.middle {
2734 _visitor.visit_pat(&**it)
2735 };
2736 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002737 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002738 };
2739 if let Some(ref it) = _i.comma_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002740 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002741 };
2742 for el in Punctuated::pairs(&_i.back) {
2743 let it = el.value();
2744 _visitor.visit_pat(it)
2745 }
Nika Layzell27726662017-10-24 23:16:35 -04002746}
David Tolnay8c81f622018-07-31 23:34:35 -07002747#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002748pub fn visit_pat_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatStruct) {
David Tolnay8c81f622018-07-31 23:34:35 -07002749 _visitor.visit_path(&_i.path);
David Tolnay7ac699c2018-08-24 14:00:58 -04002750 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002751 for el in Punctuated::pairs(&_i.fields) {
2752 let it = el.value();
2753 _visitor.visit_field_pat(it)
2754 }
2755 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002756 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002757 };
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_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatTuple) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002761 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002762 for el in Punctuated::pairs(&_i.front) {
2763 let it = el.value();
2764 _visitor.visit_pat(it)
2765 }
2766 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002767 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002768 };
2769 if let Some(ref it) = _i.comma_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002770 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002771 };
2772 for el in Punctuated::pairs(&_i.back) {
2773 let it = el.value();
2774 _visitor.visit_pat(it)
2775 }
Nika Layzell27726662017-10-24 23:16:35 -04002776}
David Tolnay8c81f622018-07-31 23:34:35 -07002777#[cfg(feature = "full")]
2778pub fn visit_pat_tuple_struct<'ast, V: Visit<'ast> + ?Sized>(
2779 _visitor: &mut V,
2780 _i: &'ast PatTupleStruct,
2781) {
2782 _visitor.visit_path(&_i.path);
2783 _visitor.visit_pat_tuple(&_i.pat);
Nika Layzell27726662017-10-24 23:16:35 -04002784}
David Tolnay8c81f622018-07-31 23:34:35 -07002785#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002786pub fn visit_pat_verbatim<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatVerbatim) {
David Tolnay6af48992018-08-01 11:16:28 -07002787 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05002788}
David Tolnay8c81f622018-07-31 23:34:35 -07002789#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002790pub fn visit_pat_wild<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatWild) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002791 tokens_helper(_visitor, &_i.underscore_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002792}
David Tolnay440fe582019-02-15 20:23:14 -08002793#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002794pub fn visit_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Path) {
David Tolnay8c81f622018-07-31 23:34:35 -07002795 if let Some(ref it) = _i.leading_colon {
David Tolnay7ac699c2018-08-24 14:00:58 -04002796 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002797 };
2798 for el in Punctuated::pairs(&_i.segments) {
2799 let it = el.value();
2800 _visitor.visit_path_segment(it)
2801 }
Nika Layzell27726662017-10-24 23:16:35 -04002802}
David Tolnay440fe582019-02-15 20:23:14 -08002803#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07002804pub fn visit_path_arguments<'ast, V: Visit<'ast> + ?Sized>(
2805 _visitor: &mut V,
2806 _i: &'ast PathArguments,
2807) {
Nika Layzellc08227a2017-12-04 16:30:17 -05002808 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002809 PathArguments::None => {}
2810 PathArguments::AngleBracketed(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002811 _visitor.visit_angle_bracketed_generic_arguments(_binding_0);
Nika Layzellc08227a2017-12-04 16:30:17 -05002812 }
David Tolnay8c81f622018-07-31 23:34:35 -07002813 PathArguments::Parenthesized(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002814 _visitor.visit_parenthesized_generic_arguments(_binding_0);
Nika Layzellc08227a2017-12-04 16:30:17 -05002815 }
2816 }
2817}
David Tolnay440fe582019-02-15 20:23:14 -08002818#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002819pub fn visit_path_segment<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PathSegment) {
David Tolnay8c81f622018-07-31 23:34:35 -07002820 _visitor.visit_ident(&_i.ident);
2821 _visitor.visit_path_arguments(&_i.arguments);
Nika Layzell27726662017-10-24 23:16:35 -04002822}
David Tolnay440fe582019-02-15 20:23:14 -08002823#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002824pub fn visit_predicate_eq<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PredicateEq) {
David Tolnay8c81f622018-07-31 23:34:35 -07002825 _visitor.visit_type(&_i.lhs_ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002826 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002827 _visitor.visit_type(&_i.rhs_ty);
David Tolnayd4add852018-01-01 20:13:24 -08002828}
David Tolnay440fe582019-02-15 20:23:14 -08002829#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07002830pub fn visit_predicate_lifetime<'ast, V: Visit<'ast> + ?Sized>(
2831 _visitor: &mut V,
2832 _i: &'ast PredicateLifetime,
2833) {
2834 _visitor.visit_lifetime(&_i.lifetime);
David Tolnay1b8e2852018-08-26 08:25:18 -04002835 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002836 for el in Punctuated::pairs(&_i.bounds) {
2837 let it = el.value();
2838 _visitor.visit_lifetime(it)
2839 }
David Tolnayd4add852018-01-01 20:13:24 -08002840}
David Tolnay440fe582019-02-15 20:23:14 -08002841#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07002842pub fn visit_predicate_type<'ast, V: Visit<'ast> + ?Sized>(
2843 _visitor: &mut V,
2844 _i: &'ast PredicateType,
2845) {
2846 if let Some(ref it) = _i.lifetimes {
2847 _visitor.visit_bound_lifetimes(it)
2848 };
2849 _visitor.visit_type(&_i.bounded_ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002850 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002851 for el in Punctuated::pairs(&_i.bounds) {
2852 let it = el.value();
2853 _visitor.visit_type_param_bound(it)
2854 }
David Tolnayd4add852018-01-01 20:13:24 -08002855}
David Tolnay440fe582019-02-15 20:23:14 -08002856#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002857pub fn visit_qself<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast QSelf) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002858 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002859 _visitor.visit_type(&*_i.ty);
David Tolnay6af48992018-08-01 11:16:28 -07002860 skip!(_i.position);
David Tolnay8c81f622018-07-31 23:34:35 -07002861 if let Some(ref it) = _i.as_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002862 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002863 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002864 tokens_helper(_visitor, &_i.gt_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002865}
David Tolnay8c81f622018-07-31 23:34:35 -07002866#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002867pub fn visit_range_limits<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast RangeLimits) {
Nika Layzell27726662017-10-24 23:16:35 -04002868 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002869 RangeLimits::HalfOpen(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002870 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002871 }
David Tolnay8c81f622018-07-31 23:34:35 -07002872 RangeLimits::Closed(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002873 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002874 }
2875 }
2876}
David Tolnay440fe582019-02-15 20:23:14 -08002877#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002878pub fn visit_return_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ReturnType) {
David Tolnayf93b90d2017-11-11 19:21:26 -08002879 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002880 ReturnType::Default => {}
2881 ReturnType::Type(ref _binding_0, ref _binding_1) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002882 tokens_helper(_visitor, &_binding_0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002883 _visitor.visit_type(&**_binding_1);
David Tolnayf93b90d2017-11-11 19:21:26 -08002884 }
2885 }
2886}
David Tolnay8c81f622018-07-31 23:34:35 -07002887#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002888pub fn visit_stmt<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Stmt) {
Nika Layzell27726662017-10-24 23:16:35 -04002889 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002890 Stmt::Local(ref _binding_0) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08002891 _visitor.visit_local(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002892 }
David Tolnay8c81f622018-07-31 23:34:35 -07002893 Stmt::Item(ref _binding_0) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08002894 _visitor.visit_item(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002895 }
David Tolnay8c81f622018-07-31 23:34:35 -07002896 Stmt::Expr(ref _binding_0) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08002897 _visitor.visit_expr(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002898 }
David Tolnay8c81f622018-07-31 23:34:35 -07002899 Stmt::Semi(ref _binding_0, ref _binding_1) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08002900 _visitor.visit_expr(_binding_0);
David Tolnay7ac699c2018-08-24 14:00:58 -04002901 tokens_helper(_visitor, &_binding_1.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002902 }
Nika Layzell27726662017-10-24 23:16:35 -04002903 }
2904}
David Tolnay440fe582019-02-15 20:23:14 -08002905#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002906pub fn visit_trait_bound<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TraitBound) {
David Tolnay8c81f622018-07-31 23:34:35 -07002907 if let Some(ref it) = _i.paren_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002908 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002909 };
2910 _visitor.visit_trait_bound_modifier(&_i.modifier);
2911 if let Some(ref it) = _i.lifetimes {
2912 _visitor.visit_bound_lifetimes(it)
2913 };
2914 _visitor.visit_path(&_i.path);
David Tolnay40fb8ce2018-01-02 10:53:46 -08002915}
David Tolnay440fe582019-02-15 20:23:14 -08002916#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07002917pub fn visit_trait_bound_modifier<'ast, V: Visit<'ast> + ?Sized>(
2918 _visitor: &mut V,
2919 _i: &'ast TraitBoundModifier,
2920) {
Nika Layzell27726662017-10-24 23:16:35 -04002921 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002922 TraitBoundModifier::None => {}
2923 TraitBoundModifier::Maybe(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002924 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002925 }
2926 }
2927}
David Tolnay8c81f622018-07-31 23:34:35 -07002928#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002929pub fn visit_trait_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TraitItem) {
Nika Layzell27726662017-10-24 23:16:35 -04002930 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002931 TraitItem::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002932 _visitor.visit_trait_item_const(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002933 }
David Tolnay8c81f622018-07-31 23:34:35 -07002934 TraitItem::Method(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002935 _visitor.visit_trait_item_method(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002936 }
David Tolnay8c81f622018-07-31 23:34:35 -07002937 TraitItem::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002938 _visitor.visit_trait_item_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002939 }
David Tolnay8c81f622018-07-31 23:34:35 -07002940 TraitItem::Macro(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002941 _visitor.visit_trait_item_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002942 }
David Tolnay8c81f622018-07-31 23:34:35 -07002943 TraitItem::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002944 _visitor.visit_trait_item_verbatim(_binding_0);
2945 }
Nika Layzell27726662017-10-24 23:16:35 -04002946 }
2947}
David Tolnay8c81f622018-07-31 23:34:35 -07002948#[cfg(feature = "full")]
2949pub fn visit_trait_item_const<'ast, V: Visit<'ast> + ?Sized>(
2950 _visitor: &mut V,
2951 _i: &'ast TraitItemConst,
2952) {
2953 for it in &_i.attrs {
2954 _visitor.visit_attribute(it)
2955 }
David Tolnay7ac699c2018-08-24 14:00:58 -04002956 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002957 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002958 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002959 _visitor.visit_type(&_i.ty);
2960 if let Some(ref it) = _i.default {
David Tolnay7ac699c2018-08-24 14:00:58 -04002961 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002962 _visitor.visit_expr(&(it).1);
2963 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002964 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnayda705bd2017-11-10 21:58:05 -08002965}
David Tolnay8c81f622018-07-31 23:34:35 -07002966#[cfg(feature = "full")]
2967pub fn visit_trait_item_macro<'ast, V: Visit<'ast> + ?Sized>(
2968 _visitor: &mut V,
2969 _i: &'ast TraitItemMacro,
2970) {
2971 for it in &_i.attrs {
2972 _visitor.visit_attribute(it)
2973 }
2974 _visitor.visit_macro(&_i.mac);
2975 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002976 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002977 };
David Tolnayda705bd2017-11-10 21:58:05 -08002978}
David Tolnay8c81f622018-07-31 23:34:35 -07002979#[cfg(feature = "full")]
2980pub fn visit_trait_item_method<'ast, V: Visit<'ast> + ?Sized>(
2981 _visitor: &mut V,
2982 _i: &'ast TraitItemMethod,
2983) {
2984 for it in &_i.attrs {
2985 _visitor.visit_attribute(it)
2986 }
2987 _visitor.visit_method_sig(&_i.sig);
2988 if let Some(ref it) = _i.default {
2989 _visitor.visit_block(it)
2990 };
2991 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002992 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002993 };
Nika Layzell27726662017-10-24 23:16:35 -04002994}
David Tolnay8c81f622018-07-31 23:34:35 -07002995#[cfg(feature = "full")]
2996pub fn visit_trait_item_type<'ast, V: Visit<'ast> + ?Sized>(
2997 _visitor: &mut V,
2998 _i: &'ast TraitItemType,
2999) {
3000 for it in &_i.attrs {
3001 _visitor.visit_attribute(it)
3002 }
David Tolnay7ac699c2018-08-24 14:00:58 -04003003 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003004 _visitor.visit_ident(&_i.ident);
3005 _visitor.visit_generics(&_i.generics);
3006 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003007 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003008 };
3009 for el in Punctuated::pairs(&_i.bounds) {
3010 let it = el.value();
3011 _visitor.visit_type_param_bound(it)
3012 }
3013 if let Some(ref it) = _i.default {
David Tolnay7ac699c2018-08-24 14:00:58 -04003014 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003015 _visitor.visit_type(&(it).1);
3016 };
David Tolnay7ac699c2018-08-24 14:00:58 -04003017 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003018}
David Tolnay8c81f622018-07-31 23:34:35 -07003019#[cfg(feature = "full")]
3020pub fn visit_trait_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
3021 _visitor: &mut V,
3022 _i: &'ast TraitItemVerbatim,
3023) {
David Tolnay6af48992018-08-01 11:16:28 -07003024 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05003025}
David Tolnay440fe582019-02-15 20:23:14 -08003026#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003027pub fn visit_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Type) {
Nika Layzell27726662017-10-24 23:16:35 -04003028 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003029 Type::Slice(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003030 _visitor.visit_type_slice(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003031 }
David Tolnay8c81f622018-07-31 23:34:35 -07003032 Type::Array(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003033 _visitor.visit_type_array(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003034 }
David Tolnay8c81f622018-07-31 23:34:35 -07003035 Type::Ptr(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003036 _visitor.visit_type_ptr(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003037 }
David Tolnay8c81f622018-07-31 23:34:35 -07003038 Type::Reference(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003039 _visitor.visit_type_reference(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003040 }
David Tolnay8c81f622018-07-31 23:34:35 -07003041 Type::BareFn(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003042 _visitor.visit_type_bare_fn(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003043 }
David Tolnay8c81f622018-07-31 23:34:35 -07003044 Type::Never(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003045 _visitor.visit_type_never(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003046 }
David Tolnay8c81f622018-07-31 23:34:35 -07003047 Type::Tuple(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003048 _visitor.visit_type_tuple(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003049 }
David Tolnay8c81f622018-07-31 23:34:35 -07003050 Type::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003051 _visitor.visit_type_path(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003052 }
David Tolnay8c81f622018-07-31 23:34:35 -07003053 Type::TraitObject(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003054 _visitor.visit_type_trait_object(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003055 }
David Tolnay8c81f622018-07-31 23:34:35 -07003056 Type::ImplTrait(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003057 _visitor.visit_type_impl_trait(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003058 }
David Tolnay8c81f622018-07-31 23:34:35 -07003059 Type::Paren(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003060 _visitor.visit_type_paren(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003061 }
David Tolnay8c81f622018-07-31 23:34:35 -07003062 Type::Group(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003063 _visitor.visit_type_group(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003064 }
David Tolnay8c81f622018-07-31 23:34:35 -07003065 Type::Infer(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003066 _visitor.visit_type_infer(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003067 }
David Tolnay8c81f622018-07-31 23:34:35 -07003068 Type::Macro(ref _binding_0) => {
David Tolnay323279a2017-12-29 11:26:32 -05003069 _visitor.visit_type_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003070 }
David Tolnay8c81f622018-07-31 23:34:35 -07003071 Type::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05003072 _visitor.visit_type_verbatim(_binding_0);
3073 }
Nika Layzell27726662017-10-24 23:16:35 -04003074 }
3075}
David Tolnay440fe582019-02-15 20:23:14 -08003076#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003077pub fn visit_type_array<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeArray) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003078 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003079 _visitor.visit_type(&*_i.elem);
David Tolnay7ac699c2018-08-24 14:00:58 -04003080 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003081 _visitor.visit_expr(&_i.len);
Nika Layzell27726662017-10-24 23:16:35 -04003082}
David Tolnay440fe582019-02-15 20:23:14 -08003083#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003084pub fn visit_type_bare_fn<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeBareFn) {
David Tolnay3779bb72018-08-26 18:46:07 -07003085 if let Some(ref it) = _i.lifetimes {
3086 _visitor.visit_bound_lifetimes(it)
3087 };
David Tolnay8c81f622018-07-31 23:34:35 -07003088 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04003089 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003090 };
3091 if let Some(ref it) = _i.abi {
3092 _visitor.visit_abi(it)
3093 };
David Tolnay7ac699c2018-08-24 14:00:58 -04003094 tokens_helper(_visitor, &_i.fn_token.span);
David Tolnay7ac699c2018-08-24 14:00:58 -04003095 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003096 for el in Punctuated::pairs(&_i.inputs) {
3097 let it = el.value();
3098 _visitor.visit_bare_fn_arg(it)
3099 }
3100 if let Some(ref it) = _i.variadic {
David Tolnay7ac699c2018-08-24 14:00:58 -04003101 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003102 };
3103 _visitor.visit_return_type(&_i.output);
Nika Layzell27726662017-10-24 23:16:35 -04003104}
David Tolnay440fe582019-02-15 20:23:14 -08003105#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003106pub fn visit_type_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeGroup) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003107 tokens_helper(_visitor, &_i.group_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003108 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003109}
David Tolnay440fe582019-02-15 20:23:14 -08003110#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07003111pub fn visit_type_impl_trait<'ast, V: Visit<'ast> + ?Sized>(
3112 _visitor: &mut V,
3113 _i: &'ast TypeImplTrait,
3114) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003115 tokens_helper(_visitor, &_i.impl_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003116 for el in Punctuated::pairs(&_i.bounds) {
3117 let it = el.value();
3118 _visitor.visit_type_param_bound(it)
3119 }
Nika Layzell27726662017-10-24 23:16:35 -04003120}
David Tolnay440fe582019-02-15 20:23:14 -08003121#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003122pub fn visit_type_infer<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeInfer) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003123 tokens_helper(_visitor, &_i.underscore_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003124}
David Tolnay440fe582019-02-15 20:23:14 -08003125#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003126pub fn visit_type_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeMacro) {
David Tolnay8c81f622018-07-31 23:34:35 -07003127 _visitor.visit_macro(&_i.mac);
David Tolnay323279a2017-12-29 11:26:32 -05003128}
David Tolnay440fe582019-02-15 20:23:14 -08003129#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003130pub fn visit_type_never<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeNever) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003131 tokens_helper(_visitor, &_i.bang_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003132}
David Tolnay440fe582019-02-15 20:23:14 -08003133#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003134pub fn visit_type_param<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeParam) {
David Tolnay8c81f622018-07-31 23:34:35 -07003135 for it in &_i.attrs {
3136 _visitor.visit_attribute(it)
3137 }
3138 _visitor.visit_ident(&_i.ident);
3139 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003140 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003141 };
3142 for el in Punctuated::pairs(&_i.bounds) {
3143 let it = el.value();
3144 _visitor.visit_type_param_bound(it)
3145 }
3146 if let Some(ref it) = _i.eq_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003147 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003148 };
3149 if let Some(ref it) = _i.default {
3150 _visitor.visit_type(it)
3151 };
Nika Layzell27726662017-10-24 23:16:35 -04003152}
David Tolnay440fe582019-02-15 20:23:14 -08003153#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07003154pub fn visit_type_param_bound<'ast, V: Visit<'ast> + ?Sized>(
3155 _visitor: &mut V,
3156 _i: &'ast TypeParamBound,
3157) {
Nika Layzell27726662017-10-24 23:16:35 -04003158 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003159 TypeParamBound::Trait(ref _binding_0) => {
David Tolnay40fb8ce2018-01-02 10:53:46 -08003160 _visitor.visit_trait_bound(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003161 }
David Tolnay8c81f622018-07-31 23:34:35 -07003162 TypeParamBound::Lifetime(ref _binding_0) => {
David Tolnay4ba63a02017-12-28 15:53:05 -05003163 _visitor.visit_lifetime(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003164 }
3165 }
3166}
David Tolnay440fe582019-02-15 20:23:14 -08003167#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003168pub fn visit_type_paren<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeParen) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003169 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003170 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003171}
David Tolnay440fe582019-02-15 20:23:14 -08003172#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003173pub fn visit_type_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypePath) {
David Tolnay8c81f622018-07-31 23:34:35 -07003174 if let Some(ref it) = _i.qself {
3175 _visitor.visit_qself(it)
3176 };
3177 _visitor.visit_path(&_i.path);
Nika Layzell27726662017-10-24 23:16:35 -04003178}
David Tolnay440fe582019-02-15 20:23:14 -08003179#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003180pub fn visit_type_ptr<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypePtr) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003181 tokens_helper(_visitor, &_i.star_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003182 if let Some(ref it) = _i.const_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003183 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003184 };
3185 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04003186 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003187 };
3188 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003189}
David Tolnay440fe582019-02-15 20:23:14 -08003190#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07003191pub fn visit_type_reference<'ast, V: Visit<'ast> + ?Sized>(
3192 _visitor: &mut V,
3193 _i: &'ast TypeReference,
3194) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003195 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003196 if let Some(ref it) = _i.lifetime {
3197 _visitor.visit_lifetime(it)
3198 };
3199 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04003200 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003201 };
3202 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003203}
David Tolnay440fe582019-02-15 20:23:14 -08003204#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003205pub fn visit_type_slice<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeSlice) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003206 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003207 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003208}
David Tolnay440fe582019-02-15 20:23:14 -08003209#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07003210pub fn visit_type_trait_object<'ast, V: Visit<'ast> + ?Sized>(
3211 _visitor: &mut V,
3212 _i: &'ast TypeTraitObject,
3213) {
3214 if let Some(ref it) = _i.dyn_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003215 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003216 };
3217 for el in Punctuated::pairs(&_i.bounds) {
3218 let it = el.value();
3219 _visitor.visit_type_param_bound(it)
3220 }
Nika Layzell27726662017-10-24 23:16:35 -04003221}
David Tolnay440fe582019-02-15 20:23:14 -08003222#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003223pub fn visit_type_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeTuple) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003224 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003225 for el in Punctuated::pairs(&_i.elems) {
3226 let it = el.value();
3227 _visitor.visit_type(it)
3228 }
Nika Layzell27726662017-10-24 23:16:35 -04003229}
David Tolnay440fe582019-02-15 20:23:14 -08003230#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07003231pub fn visit_type_verbatim<'ast, V: Visit<'ast> + ?Sized>(
3232 _visitor: &mut V,
3233 _i: &'ast TypeVerbatim,
3234) {
David Tolnay6af48992018-08-01 11:16:28 -07003235 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05003236}
David Tolnay440fe582019-02-15 20:23:14 -08003237#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003238pub fn visit_un_op<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UnOp) {
Nika Layzell27726662017-10-24 23:16:35 -04003239 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003240 UnOp::Deref(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003241 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003242 }
David Tolnay8c81f622018-07-31 23:34:35 -07003243 UnOp::Not(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003244 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003245 }
David Tolnay8c81f622018-07-31 23:34:35 -07003246 UnOp::Neg(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003247 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003248 }
3249 }
3250}
David Tolnay8c81f622018-07-31 23:34:35 -07003251#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003252pub fn visit_use_glob<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseGlob) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003253 tokens_helper(_visitor, &_i.star_token.spans);
David Tolnay5f332a92017-12-26 00:42:45 -05003254}
David Tolnay8c81f622018-07-31 23:34:35 -07003255#[cfg(feature = "full")]
David Tolnayd97a7d22018-03-31 19:17:01 +02003256pub fn visit_use_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseGroup) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003257 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003258 for el in Punctuated::pairs(&_i.items) {
3259 let it = el.value();
3260 _visitor.visit_use_tree(it)
3261 }
David Tolnay5f332a92017-12-26 00:42:45 -05003262}
David Tolnay8c81f622018-07-31 23:34:35 -07003263#[cfg(feature = "full")]
David Tolnayd97a7d22018-03-31 19:17:01 +02003264pub fn visit_use_name<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseName) {
David Tolnay8c81f622018-07-31 23:34:35 -07003265 _visitor.visit_ident(&_i.ident);
David Tolnayd97a7d22018-03-31 19:17:01 +02003266}
David Tolnay8c81f622018-07-31 23:34:35 -07003267#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003268pub fn visit_use_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UsePath) {
David Tolnay8c81f622018-07-31 23:34:35 -07003269 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04003270 tokens_helper(_visitor, &_i.colon2_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003271 _visitor.visit_use_tree(&*_i.tree);
David Tolnayd97a7d22018-03-31 19:17:01 +02003272}
David Tolnay8c81f622018-07-31 23:34:35 -07003273#[cfg(feature = "full")]
David Tolnayd97a7d22018-03-31 19:17:01 +02003274pub fn visit_use_rename<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseRename) {
David Tolnay8c81f622018-07-31 23:34:35 -07003275 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04003276 tokens_helper(_visitor, &_i.as_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003277 _visitor.visit_ident(&_i.rename);
David Tolnay5f332a92017-12-26 00:42:45 -05003278}
David Tolnay8c81f622018-07-31 23:34:35 -07003279#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003280pub fn visit_use_tree<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseTree) {
David Tolnay5f332a92017-12-26 00:42:45 -05003281 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003282 UseTree::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003283 _visitor.visit_use_path(_binding_0);
David Tolnay5f332a92017-12-26 00:42:45 -05003284 }
David Tolnay8c81f622018-07-31 23:34:35 -07003285 UseTree::Name(ref _binding_0) => {
David Tolnayd97a7d22018-03-31 19:17:01 +02003286 _visitor.visit_use_name(_binding_0);
3287 }
David Tolnay8c81f622018-07-31 23:34:35 -07003288 UseTree::Rename(ref _binding_0) => {
David Tolnayd97a7d22018-03-31 19:17:01 +02003289 _visitor.visit_use_rename(_binding_0);
3290 }
David Tolnay8c81f622018-07-31 23:34:35 -07003291 UseTree::Glob(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003292 _visitor.visit_use_glob(_binding_0);
David Tolnay5f332a92017-12-26 00:42:45 -05003293 }
David Tolnay8c81f622018-07-31 23:34:35 -07003294 UseTree::Group(ref _binding_0) => {
David Tolnayd97a7d22018-03-31 19:17:01 +02003295 _visitor.visit_use_group(_binding_0);
David Tolnay5f332a92017-12-26 00:42:45 -05003296 }
3297 }
3298}
David Tolnay440fe582019-02-15 20:23:14 -08003299#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003300pub fn visit_variant<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Variant) {
David Tolnay8c81f622018-07-31 23:34:35 -07003301 for it in &_i.attrs {
3302 _visitor.visit_attribute(it)
3303 }
3304 _visitor.visit_ident(&_i.ident);
3305 _visitor.visit_fields(&_i.fields);
3306 if let Some(ref it) = _i.discriminant {
David Tolnay7ac699c2018-08-24 14:00:58 -04003307 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003308 _visitor.visit_expr(&(it).1);
3309 };
Nika Layzell27726662017-10-24 23:16:35 -04003310}
David Tolnay440fe582019-02-15 20:23:14 -08003311#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003312pub fn visit_vis_crate<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast VisCrate) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003313 tokens_helper(_visitor, &_i.crate_token.span);
Nika Layzell27726662017-10-24 23:16:35 -04003314}
David Tolnay440fe582019-02-15 20:23:14 -08003315#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003316pub fn visit_vis_public<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast VisPublic) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003317 tokens_helper(_visitor, &_i.pub_token.span);
Nika Layzell27726662017-10-24 23:16:35 -04003318}
David Tolnay440fe582019-02-15 20:23:14 -08003319#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07003320pub fn visit_vis_restricted<'ast, V: Visit<'ast> + ?Sized>(
3321 _visitor: &mut V,
3322 _i: &'ast VisRestricted,
3323) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003324 tokens_helper(_visitor, &_i.pub_token.span);
3325 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003326 if let Some(ref it) = _i.in_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003327 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003328 };
3329 _visitor.visit_path(&*_i.path);
Nika Layzell27726662017-10-24 23:16:35 -04003330}
David Tolnay440fe582019-02-15 20:23:14 -08003331#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003332pub fn visit_visibility<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Visibility) {
Nika Layzell27726662017-10-24 23:16:35 -04003333 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003334 Visibility::Public(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003335 _visitor.visit_vis_public(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003336 }
David Tolnay8c81f622018-07-31 23:34:35 -07003337 Visibility::Crate(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003338 _visitor.visit_vis_crate(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003339 }
David Tolnay8c81f622018-07-31 23:34:35 -07003340 Visibility::Restricted(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003341 _visitor.visit_vis_restricted(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003342 }
David Tolnay8c81f622018-07-31 23:34:35 -07003343 Visibility::Inherited => {}
Nika Layzell27726662017-10-24 23:16:35 -04003344 }
3345}
David Tolnay440fe582019-02-15 20:23:14 -08003346#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003347pub fn visit_where_clause<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast WhereClause) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003348 tokens_helper(_visitor, &_i.where_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003349 for el in Punctuated::pairs(&_i.predicates) {
3350 let it = el.value();
3351 _visitor.visit_where_predicate(it)
3352 }
Nika Layzell27726662017-10-24 23:16:35 -04003353}
David Tolnay440fe582019-02-15 20:23:14 -08003354#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07003355pub fn visit_where_predicate<'ast, V: Visit<'ast> + ?Sized>(
3356 _visitor: &mut V,
3357 _i: &'ast WherePredicate,
3358) {
Nika Layzell27726662017-10-24 23:16:35 -04003359 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003360 WherePredicate::Type(ref _binding_0) => {
David Tolnayd4add852018-01-01 20:13:24 -08003361 _visitor.visit_predicate_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003362 }
David Tolnay8c81f622018-07-31 23:34:35 -07003363 WherePredicate::Lifetime(ref _binding_0) => {
David Tolnayd4add852018-01-01 20:13:24 -08003364 _visitor.visit_predicate_lifetime(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003365 }
David Tolnay8c81f622018-07-31 23:34:35 -07003366 WherePredicate::Eq(ref _binding_0) => {
David Tolnayd4add852018-01-01 20:13:24 -08003367 _visitor.visit_predicate_eq(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003368 }
3369 }
3370}
Carl Lerchecbf7cc12019-02-15 14:09:31 -08003371pub fn visit_span<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Span) {}
3372pub fn visit_ident<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Ident) {}