blob: e449a0b9d625865feac77262b0c34f98c7d0df57 [file] [log] [blame]
Nika Layzell27726662017-10-24 23:16:35 -04001// THIS FILE IS AUTOMATICALLY GENERATED; DO NOT EDIT
2
David Tolnayc1f55792018-11-21 01:39:42 -08003#![cfg_attr(feature = "cargo-clippy", allow(trivially_copy_pass_by_ref))]
David Tolnay0a0d78c2018-01-05 15:24:01 -08004#[cfg(any(feature = "full", feature = "derive"))]
David Tolnaycc0f0372017-12-28 19:11:04 -05005use gen::helper::visit::*;
David Tolnay8c81f622018-07-31 23:34:35 -07006use proc_macro2::Span;
7#[cfg(any(feature = "full", feature = "derive"))]
8use punctuated::Punctuated;
9use *;
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040010#[cfg(feature = "full")]
11macro_rules! full {
David Tolnay280202f2018-08-02 00:29:54 -070012 ($e:expr) => {
David Tolnay8c81f622018-07-31 23:34:35 -070013 $e
14 };
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040015}
David Tolnay0a0d78c2018-01-05 15:24:01 -080016#[cfg(all(feature = "derive", not(feature = "full")))]
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040017macro_rules! full {
David Tolnay280202f2018-08-02 00:29:54 -070018 ($e:expr) => {
David Tolnay8c81f622018-07-31 23:34:35 -070019 unreachable!()
20 };
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040021}
David Tolnay6af48992018-08-01 11:16:28 -070022#[cfg(any(feature = "full", feature = "derive"))]
23macro_rules! skip {
David Tolnay280202f2018-08-02 00:29:54 -070024 ($($tt:tt)*) => {};
David Tolnay6af48992018-08-01 11:16:28 -070025}
David Tolnay53160352019-02-07 23:36:17 +010026/// Syntax tree traversal to walk a shared borrow of a syntax tree.
27///
28/// See the [module documentation] for details.
29///
30/// [module documentation]: index.html
31///
32/// *This trait is available if Syn is built with the `"visit"` feature.*
David Tolnay4b4c4b62018-01-06 13:48:05 -080033pub trait Visit<'ast> {
David Tolnay440fe582019-02-15 20:23:14 -080034 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -070035 fn visit_abi(&mut self, i: &'ast Abi) {
36 visit_abi(self, i)
37 }
David Tolnay440fe582019-02-15 20:23:14 -080038 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -070039 fn visit_angle_bracketed_generic_arguments(&mut self, i: &'ast AngleBracketedGenericArguments) {
40 visit_angle_bracketed_generic_arguments(self, i)
41 }
42 #[cfg(feature = "full")]
43 fn visit_arg_captured(&mut self, i: &'ast ArgCaptured) {
44 visit_arg_captured(self, i)
45 }
46 #[cfg(feature = "full")]
47 fn visit_arg_self(&mut self, i: &'ast ArgSelf) {
48 visit_arg_self(self, i)
49 }
50 #[cfg(feature = "full")]
51 fn visit_arg_self_ref(&mut self, i: &'ast ArgSelfRef) {
52 visit_arg_self_ref(self, i)
53 }
David Tolnay8c81f622018-07-31 23:34:35 -070054 #[cfg(feature = "full")]
55 fn visit_arm(&mut self, i: &'ast Arm) {
56 visit_arm(self, i)
57 }
David Tolnay440fe582019-02-15 20:23:14 -080058 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -070059 fn visit_attr_style(&mut self, i: &'ast AttrStyle) {
60 visit_attr_style(self, i)
61 }
David Tolnay440fe582019-02-15 20:23:14 -080062 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -070063 fn visit_attribute(&mut self, i: &'ast Attribute) {
64 visit_attribute(self, i)
65 }
David Tolnay440fe582019-02-15 20:23:14 -080066 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -070067 fn visit_bare_fn_arg(&mut self, i: &'ast BareFnArg) {
68 visit_bare_fn_arg(self, i)
69 }
David Tolnay440fe582019-02-15 20:23:14 -080070 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -070071 fn visit_bare_fn_arg_name(&mut self, i: &'ast BareFnArgName) {
72 visit_bare_fn_arg_name(self, i)
73 }
David Tolnay440fe582019-02-15 20:23:14 -080074 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -070075 fn visit_bin_op(&mut self, i: &'ast BinOp) {
76 visit_bin_op(self, i)
77 }
David Tolnay440fe582019-02-15 20:23:14 -080078 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -070079 fn visit_binding(&mut self, i: &'ast Binding) {
80 visit_binding(self, i)
81 }
David Tolnay8c81f622018-07-31 23:34:35 -070082 #[cfg(feature = "full")]
83 fn visit_block(&mut self, i: &'ast Block) {
84 visit_block(self, i)
85 }
David Tolnay440fe582019-02-15 20:23:14 -080086 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -070087 fn visit_bound_lifetimes(&mut self, i: &'ast BoundLifetimes) {
88 visit_bound_lifetimes(self, i)
89 }
David Tolnay440fe582019-02-15 20:23:14 -080090 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -070091 fn visit_const_param(&mut self, i: &'ast ConstParam) {
92 visit_const_param(self, i)
93 }
David Tolnay440fe582019-02-15 20:23:14 -080094 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay9d0882a2018-09-01 19:49:14 -070095 fn visit_constraint(&mut self, i: &'ast Constraint) {
96 visit_constraint(self, i)
97 }
David Tolnay8c81f622018-07-31 23:34:35 -070098 #[cfg(feature = "derive")]
99 fn visit_data(&mut self, i: &'ast Data) {
100 visit_data(self, i)
101 }
102 #[cfg(feature = "derive")]
103 fn visit_data_enum(&mut self, i: &'ast DataEnum) {
104 visit_data_enum(self, i)
105 }
106 #[cfg(feature = "derive")]
107 fn visit_data_struct(&mut self, i: &'ast DataStruct) {
108 visit_data_struct(self, i)
109 }
110 #[cfg(feature = "derive")]
111 fn visit_data_union(&mut self, i: &'ast DataUnion) {
112 visit_data_union(self, i)
113 }
114 #[cfg(feature = "derive")]
115 fn visit_derive_input(&mut self, i: &'ast DeriveInput) {
116 visit_derive_input(self, i)
117 }
David Tolnay440fe582019-02-15 20:23:14 -0800118 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700119 fn visit_expr(&mut self, i: &'ast Expr) {
120 visit_expr(self, i)
121 }
122 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700123 fn visit_expr_array(&mut self, i: &'ast ExprArray) {
124 visit_expr_array(self, i)
125 }
126 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700127 fn visit_expr_assign(&mut self, i: &'ast ExprAssign) {
128 visit_expr_assign(self, i)
129 }
130 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700131 fn visit_expr_assign_op(&mut self, i: &'ast ExprAssignOp) {
132 visit_expr_assign_op(self, i)
133 }
David Tolnay02a9c6f2018-08-24 18:58:45 -0400134 #[cfg(feature = "full")]
David Tolnay02a9c6f2018-08-24 18:58:45 -0400135 fn visit_expr_async(&mut self, i: &'ast ExprAsync) {
136 visit_expr_async(self, i)
137 }
David Tolnay440fe582019-02-15 20:23:14 -0800138 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700139 fn visit_expr_binary(&mut self, i: &'ast ExprBinary) {
140 visit_expr_binary(self, i)
141 }
142 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700143 fn visit_expr_block(&mut self, i: &'ast ExprBlock) {
144 visit_expr_block(self, i)
145 }
146 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700147 fn visit_expr_box(&mut self, i: &'ast ExprBox) {
148 visit_expr_box(self, i)
149 }
150 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700151 fn visit_expr_break(&mut self, i: &'ast ExprBreak) {
152 visit_expr_break(self, i)
153 }
David Tolnay440fe582019-02-15 20:23:14 -0800154 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700155 fn visit_expr_call(&mut self, i: &'ast ExprCall) {
156 visit_expr_call(self, i)
157 }
David Tolnay440fe582019-02-15 20:23:14 -0800158 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700159 fn visit_expr_cast(&mut self, i: &'ast ExprCast) {
160 visit_expr_cast(self, i)
161 }
162 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700163 fn visit_expr_closure(&mut self, i: &'ast ExprClosure) {
164 visit_expr_closure(self, i)
165 }
166 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700167 fn visit_expr_continue(&mut self, i: &'ast ExprContinue) {
168 visit_expr_continue(self, i)
169 }
David Tolnay440fe582019-02-15 20:23:14 -0800170 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700171 fn visit_expr_field(&mut self, i: &'ast ExprField) {
172 visit_expr_field(self, i)
173 }
174 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700175 fn visit_expr_for_loop(&mut self, i: &'ast ExprForLoop) {
176 visit_expr_for_loop(self, i)
177 }
178 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700179 fn visit_expr_group(&mut self, i: &'ast ExprGroup) {
180 visit_expr_group(self, i)
181 }
182 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700183 fn visit_expr_if(&mut self, i: &'ast ExprIf) {
184 visit_expr_if(self, i)
185 }
186 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700187 fn visit_expr_in_place(&mut self, i: &'ast ExprInPlace) {
188 visit_expr_in_place(self, i)
189 }
David Tolnay440fe582019-02-15 20:23:14 -0800190 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700191 fn visit_expr_index(&mut self, i: &'ast ExprIndex) {
192 visit_expr_index(self, i)
193 }
David Tolnay9c119122018-09-01 18:47:02 -0700194 #[cfg(feature = "full")]
David Tolnay9c119122018-09-01 18:47:02 -0700195 fn visit_expr_let(&mut self, i: &'ast ExprLet) {
196 visit_expr_let(self, i)
197 }
David Tolnay440fe582019-02-15 20:23:14 -0800198 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700199 fn visit_expr_lit(&mut self, i: &'ast ExprLit) {
200 visit_expr_lit(self, i)
201 }
202 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700203 fn visit_expr_loop(&mut self, i: &'ast ExprLoop) {
204 visit_expr_loop(self, i)
205 }
206 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700207 fn visit_expr_macro(&mut self, i: &'ast ExprMacro) {
208 visit_expr_macro(self, i)
209 }
210 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700211 fn visit_expr_match(&mut self, i: &'ast ExprMatch) {
212 visit_expr_match(self, i)
213 }
214 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700215 fn visit_expr_method_call(&mut self, i: &'ast ExprMethodCall) {
216 visit_expr_method_call(self, i)
217 }
David Tolnay440fe582019-02-15 20:23:14 -0800218 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700219 fn visit_expr_paren(&mut self, i: &'ast ExprParen) {
220 visit_expr_paren(self, i)
221 }
David Tolnay440fe582019-02-15 20:23:14 -0800222 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700223 fn visit_expr_path(&mut self, i: &'ast ExprPath) {
224 visit_expr_path(self, i)
225 }
226 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700227 fn visit_expr_range(&mut self, i: &'ast ExprRange) {
228 visit_expr_range(self, i)
229 }
230 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700231 fn visit_expr_reference(&mut self, i: &'ast ExprReference) {
232 visit_expr_reference(self, i)
233 }
234 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700235 fn visit_expr_repeat(&mut self, i: &'ast ExprRepeat) {
236 visit_expr_repeat(self, i)
237 }
238 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700239 fn visit_expr_return(&mut self, i: &'ast ExprReturn) {
240 visit_expr_return(self, i)
241 }
242 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700243 fn visit_expr_struct(&mut self, i: &'ast ExprStruct) {
244 visit_expr_struct(self, i)
245 }
246 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700247 fn visit_expr_try(&mut self, i: &'ast ExprTry) {
248 visit_expr_try(self, i)
249 }
250 #[cfg(feature = "full")]
David Tolnayfb2dd4b2018-08-24 16:45:34 -0400251 fn visit_expr_try_block(&mut self, i: &'ast ExprTryBlock) {
252 visit_expr_try_block(self, i)
253 }
254 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700255 fn visit_expr_tuple(&mut self, i: &'ast ExprTuple) {
256 visit_expr_tuple(self, i)
257 }
258 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700259 fn visit_expr_type(&mut self, i: &'ast ExprType) {
260 visit_expr_type(self, i)
261 }
David Tolnay440fe582019-02-15 20:23:14 -0800262 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700263 fn visit_expr_unary(&mut self, i: &'ast ExprUnary) {
264 visit_expr_unary(self, i)
265 }
266 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700267 fn visit_expr_unsafe(&mut self, i: &'ast ExprUnsafe) {
268 visit_expr_unsafe(self, i)
269 }
David Tolnay440fe582019-02-15 20:23:14 -0800270 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700271 fn visit_expr_verbatim(&mut self, i: &'ast ExprVerbatim) {
272 visit_expr_verbatim(self, i)
273 }
274 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700275 fn visit_expr_while(&mut self, i: &'ast ExprWhile) {
276 visit_expr_while(self, i)
277 }
278 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700279 fn visit_expr_yield(&mut self, i: &'ast ExprYield) {
280 visit_expr_yield(self, i)
281 }
David Tolnay440fe582019-02-15 20:23:14 -0800282 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700283 fn visit_field(&mut self, i: &'ast Field) {
284 visit_field(self, i)
285 }
David Tolnay8c81f622018-07-31 23:34:35 -0700286 #[cfg(feature = "full")]
287 fn visit_field_pat(&mut self, i: &'ast FieldPat) {
288 visit_field_pat(self, i)
289 }
David Tolnay8c81f622018-07-31 23:34:35 -0700290 #[cfg(feature = "full")]
291 fn visit_field_value(&mut self, i: &'ast FieldValue) {
292 visit_field_value(self, i)
293 }
David Tolnay440fe582019-02-15 20:23:14 -0800294 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700295 fn visit_fields(&mut self, i: &'ast Fields) {
296 visit_fields(self, i)
297 }
David Tolnay440fe582019-02-15 20:23:14 -0800298 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700299 fn visit_fields_named(&mut self, i: &'ast FieldsNamed) {
300 visit_fields_named(self, i)
301 }
David Tolnay440fe582019-02-15 20:23:14 -0800302 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700303 fn visit_fields_unnamed(&mut self, i: &'ast FieldsUnnamed) {
304 visit_fields_unnamed(self, i)
305 }
306 #[cfg(feature = "full")]
307 fn visit_file(&mut self, i: &'ast File) {
308 visit_file(self, i)
309 }
310 #[cfg(feature = "full")]
311 fn visit_fn_arg(&mut self, i: &'ast FnArg) {
312 visit_fn_arg(self, i)
313 }
314 #[cfg(feature = "full")]
315 fn visit_fn_decl(&mut self, i: &'ast FnDecl) {
316 visit_fn_decl(self, i)
317 }
318 #[cfg(feature = "full")]
319 fn visit_foreign_item(&mut self, i: &'ast ForeignItem) {
320 visit_foreign_item(self, i)
321 }
322 #[cfg(feature = "full")]
323 fn visit_foreign_item_fn(&mut self, i: &'ast ForeignItemFn) {
324 visit_foreign_item_fn(self, i)
325 }
326 #[cfg(feature = "full")]
David Tolnay435c1782018-08-24 16:15:44 -0400327 fn visit_foreign_item_macro(&mut self, i: &'ast ForeignItemMacro) {
328 visit_foreign_item_macro(self, i)
329 }
330 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700331 fn visit_foreign_item_static(&mut self, i: &'ast ForeignItemStatic) {
332 visit_foreign_item_static(self, i)
333 }
334 #[cfg(feature = "full")]
335 fn visit_foreign_item_type(&mut self, i: &'ast ForeignItemType) {
336 visit_foreign_item_type(self, i)
337 }
338 #[cfg(feature = "full")]
339 fn visit_foreign_item_verbatim(&mut self, i: &'ast ForeignItemVerbatim) {
340 visit_foreign_item_verbatim(self, i)
341 }
David Tolnay440fe582019-02-15 20:23:14 -0800342 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700343 fn visit_generic_argument(&mut self, i: &'ast GenericArgument) {
344 visit_generic_argument(self, i)
345 }
David Tolnay8c81f622018-07-31 23:34:35 -0700346 #[cfg(feature = "full")]
347 fn visit_generic_method_argument(&mut self, i: &'ast GenericMethodArgument) {
348 visit_generic_method_argument(self, i)
349 }
David Tolnay440fe582019-02-15 20:23:14 -0800350 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700351 fn visit_generic_param(&mut self, i: &'ast GenericParam) {
352 visit_generic_param(self, i)
353 }
David Tolnay440fe582019-02-15 20:23:14 -0800354 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700355 fn visit_generics(&mut self, i: &'ast Generics) {
356 visit_generics(self, i)
357 }
David Tolnay8c81f622018-07-31 23:34:35 -0700358 #[cfg(feature = "full")]
359 fn visit_impl_item(&mut self, i: &'ast ImplItem) {
360 visit_impl_item(self, i)
361 }
362 #[cfg(feature = "full")]
363 fn visit_impl_item_const(&mut self, i: &'ast ImplItemConst) {
364 visit_impl_item_const(self, i)
365 }
366 #[cfg(feature = "full")]
David Tolnaybb82ef02018-08-24 20:15:45 -0400367 fn visit_impl_item_existential(&mut self, i: &'ast ImplItemExistential) {
368 visit_impl_item_existential(self, i)
369 }
370 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700371 fn visit_impl_item_macro(&mut self, i: &'ast ImplItemMacro) {
372 visit_impl_item_macro(self, i)
373 }
374 #[cfg(feature = "full")]
375 fn visit_impl_item_method(&mut self, i: &'ast ImplItemMethod) {
376 visit_impl_item_method(self, i)
377 }
378 #[cfg(feature = "full")]
379 fn visit_impl_item_type(&mut self, i: &'ast ImplItemType) {
380 visit_impl_item_type(self, i)
381 }
382 #[cfg(feature = "full")]
383 fn visit_impl_item_verbatim(&mut self, i: &'ast ImplItemVerbatim) {
384 visit_impl_item_verbatim(self, i)
385 }
David Tolnay440fe582019-02-15 20:23:14 -0800386 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700387 fn visit_index(&mut self, i: &'ast Index) {
388 visit_index(self, i)
389 }
390 #[cfg(feature = "full")]
391 fn visit_item(&mut self, i: &'ast Item) {
392 visit_item(self, i)
393 }
394 #[cfg(feature = "full")]
395 fn visit_item_const(&mut self, i: &'ast ItemConst) {
396 visit_item_const(self, i)
397 }
398 #[cfg(feature = "full")]
399 fn visit_item_enum(&mut self, i: &'ast ItemEnum) {
400 visit_item_enum(self, i)
401 }
402 #[cfg(feature = "full")]
David Tolnaybb82ef02018-08-24 20:15:45 -0400403 fn visit_item_existential(&mut self, i: &'ast ItemExistential) {
404 visit_item_existential(self, i)
405 }
406 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700407 fn visit_item_extern_crate(&mut self, i: &'ast ItemExternCrate) {
408 visit_item_extern_crate(self, i)
409 }
410 #[cfg(feature = "full")]
411 fn visit_item_fn(&mut self, i: &'ast ItemFn) {
412 visit_item_fn(self, i)
413 }
414 #[cfg(feature = "full")]
415 fn visit_item_foreign_mod(&mut self, i: &'ast ItemForeignMod) {
416 visit_item_foreign_mod(self, i)
417 }
418 #[cfg(feature = "full")]
419 fn visit_item_impl(&mut self, i: &'ast ItemImpl) {
420 visit_item_impl(self, i)
421 }
422 #[cfg(feature = "full")]
423 fn visit_item_macro(&mut self, i: &'ast ItemMacro) {
424 visit_item_macro(self, i)
425 }
426 #[cfg(feature = "full")]
427 fn visit_item_macro2(&mut self, i: &'ast ItemMacro2) {
428 visit_item_macro2(self, i)
429 }
430 #[cfg(feature = "full")]
431 fn visit_item_mod(&mut self, i: &'ast ItemMod) {
432 visit_item_mod(self, i)
433 }
434 #[cfg(feature = "full")]
435 fn visit_item_static(&mut self, i: &'ast ItemStatic) {
436 visit_item_static(self, i)
437 }
438 #[cfg(feature = "full")]
439 fn visit_item_struct(&mut self, i: &'ast ItemStruct) {
440 visit_item_struct(self, i)
441 }
442 #[cfg(feature = "full")]
443 fn visit_item_trait(&mut self, i: &'ast ItemTrait) {
444 visit_item_trait(self, i)
445 }
446 #[cfg(feature = "full")]
David Tolnayc6b04dd2018-08-30 23:22:51 -0700447 fn visit_item_trait_alias(&mut self, i: &'ast ItemTraitAlias) {
448 visit_item_trait_alias(self, i)
449 }
450 #[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -0700451 fn visit_item_type(&mut self, i: &'ast ItemType) {
452 visit_item_type(self, i)
453 }
454 #[cfg(feature = "full")]
455 fn visit_item_union(&mut self, i: &'ast ItemUnion) {
456 visit_item_union(self, i)
457 }
458 #[cfg(feature = "full")]
459 fn visit_item_use(&mut self, i: &'ast ItemUse) {
460 visit_item_use(self, i)
461 }
462 #[cfg(feature = "full")]
463 fn visit_item_verbatim(&mut self, i: &'ast ItemVerbatim) {
464 visit_item_verbatim(self, i)
465 }
David Tolnay8c81f622018-07-31 23:34:35 -0700466 #[cfg(feature = "full")]
467 fn visit_label(&mut self, i: &'ast Label) {
468 visit_label(self, i)
469 }
David Tolnay8c81f622018-07-31 23:34:35 -0700470 fn visit_lifetime(&mut self, i: &'ast Lifetime) {
471 visit_lifetime(self, i)
472 }
David Tolnay440fe582019-02-15 20:23:14 -0800473 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700474 fn visit_lifetime_def(&mut self, i: &'ast LifetimeDef) {
475 visit_lifetime_def(self, i)
476 }
David Tolnay440fe582019-02-15 20:23:14 -0800477 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700478 fn visit_lit(&mut self, i: &'ast Lit) {
479 visit_lit(self, i)
480 }
David Tolnay440fe582019-02-15 20:23:14 -0800481 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700482 fn visit_lit_bool(&mut self, i: &'ast LitBool) {
483 visit_lit_bool(self, i)
484 }
David Tolnay440fe582019-02-15 20:23:14 -0800485 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700486 fn visit_lit_byte(&mut self, i: &'ast LitByte) {
487 visit_lit_byte(self, i)
488 }
David Tolnay440fe582019-02-15 20:23:14 -0800489 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700490 fn visit_lit_byte_str(&mut self, i: &'ast LitByteStr) {
491 visit_lit_byte_str(self, i)
492 }
David Tolnay440fe582019-02-15 20:23:14 -0800493 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700494 fn visit_lit_char(&mut self, i: &'ast LitChar) {
495 visit_lit_char(self, i)
496 }
David Tolnay440fe582019-02-15 20:23:14 -0800497 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700498 fn visit_lit_float(&mut self, i: &'ast LitFloat) {
499 visit_lit_float(self, i)
500 }
David Tolnay440fe582019-02-15 20:23:14 -0800501 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700502 fn visit_lit_int(&mut self, i: &'ast LitInt) {
503 visit_lit_int(self, i)
504 }
David Tolnay440fe582019-02-15 20:23:14 -0800505 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700506 fn visit_lit_str(&mut self, i: &'ast LitStr) {
507 visit_lit_str(self, i)
508 }
David Tolnay440fe582019-02-15 20:23:14 -0800509 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700510 fn visit_lit_verbatim(&mut self, i: &'ast LitVerbatim) {
511 visit_lit_verbatim(self, i)
512 }
David Tolnay8c81f622018-07-31 23:34:35 -0700513 #[cfg(feature = "full")]
514 fn visit_local(&mut self, i: &'ast Local) {
515 visit_local(self, i)
516 }
David Tolnay440fe582019-02-15 20:23:14 -0800517 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700518 fn visit_macro(&mut self, i: &'ast Macro) {
519 visit_macro(self, i)
520 }
David Tolnay440fe582019-02-15 20:23:14 -0800521 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700522 fn visit_macro_delimiter(&mut self, i: &'ast MacroDelimiter) {
523 visit_macro_delimiter(self, i)
524 }
David Tolnay440fe582019-02-15 20:23:14 -0800525 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700526 fn visit_member(&mut self, i: &'ast Member) {
527 visit_member(self, i)
528 }
David Tolnay440fe582019-02-15 20:23:14 -0800529 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700530 fn visit_meta(&mut self, i: &'ast Meta) {
531 visit_meta(self, i)
532 }
David Tolnay440fe582019-02-15 20:23:14 -0800533 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700534 fn visit_meta_list(&mut self, i: &'ast MetaList) {
535 visit_meta_list(self, i)
536 }
David Tolnay440fe582019-02-15 20:23:14 -0800537 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700538 fn visit_meta_name_value(&mut self, i: &'ast MetaNameValue) {
539 visit_meta_name_value(self, i)
540 }
541 #[cfg(feature = "full")]
542 fn visit_method_sig(&mut self, i: &'ast MethodSig) {
543 visit_method_sig(self, i)
544 }
David Tolnay8c81f622018-07-31 23:34:35 -0700545 #[cfg(feature = "full")]
546 fn visit_method_turbofish(&mut self, i: &'ast MethodTurbofish) {
547 visit_method_turbofish(self, i)
548 }
David Tolnay440fe582019-02-15 20:23:14 -0800549 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700550 fn visit_nested_meta(&mut self, i: &'ast NestedMeta) {
551 visit_nested_meta(self, i)
552 }
David Tolnay440fe582019-02-15 20:23:14 -0800553 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700554 fn visit_parenthesized_generic_arguments(&mut self, i: &'ast ParenthesizedGenericArguments) {
555 visit_parenthesized_generic_arguments(self, i)
556 }
David Tolnay8c81f622018-07-31 23:34:35 -0700557 #[cfg(feature = "full")]
558 fn visit_pat(&mut self, i: &'ast Pat) {
559 visit_pat(self, i)
560 }
David Tolnay8c81f622018-07-31 23:34:35 -0700561 #[cfg(feature = "full")]
562 fn visit_pat_box(&mut self, i: &'ast PatBox) {
563 visit_pat_box(self, i)
564 }
David Tolnay8c81f622018-07-31 23:34:35 -0700565 #[cfg(feature = "full")]
566 fn visit_pat_ident(&mut self, i: &'ast PatIdent) {
567 visit_pat_ident(self, i)
568 }
David Tolnay8c81f622018-07-31 23:34:35 -0700569 #[cfg(feature = "full")]
570 fn visit_pat_lit(&mut self, i: &'ast PatLit) {
571 visit_pat_lit(self, i)
572 }
David Tolnay8c81f622018-07-31 23:34:35 -0700573 #[cfg(feature = "full")]
574 fn visit_pat_macro(&mut self, i: &'ast PatMacro) {
575 visit_pat_macro(self, i)
576 }
David Tolnay8c81f622018-07-31 23:34:35 -0700577 #[cfg(feature = "full")]
578 fn visit_pat_path(&mut self, i: &'ast PatPath) {
579 visit_pat_path(self, i)
580 }
David Tolnay8c81f622018-07-31 23:34:35 -0700581 #[cfg(feature = "full")]
582 fn visit_pat_range(&mut self, i: &'ast PatRange) {
583 visit_pat_range(self, i)
584 }
David Tolnay8c81f622018-07-31 23:34:35 -0700585 #[cfg(feature = "full")]
586 fn visit_pat_ref(&mut self, i: &'ast PatRef) {
587 visit_pat_ref(self, i)
588 }
David Tolnay8c81f622018-07-31 23:34:35 -0700589 #[cfg(feature = "full")]
590 fn visit_pat_slice(&mut self, i: &'ast PatSlice) {
591 visit_pat_slice(self, i)
592 }
David Tolnay8c81f622018-07-31 23:34:35 -0700593 #[cfg(feature = "full")]
594 fn visit_pat_struct(&mut self, i: &'ast PatStruct) {
595 visit_pat_struct(self, i)
596 }
David Tolnay8c81f622018-07-31 23:34:35 -0700597 #[cfg(feature = "full")]
598 fn visit_pat_tuple(&mut self, i: &'ast PatTuple) {
599 visit_pat_tuple(self, i)
600 }
David Tolnay8c81f622018-07-31 23:34:35 -0700601 #[cfg(feature = "full")]
602 fn visit_pat_tuple_struct(&mut self, i: &'ast PatTupleStruct) {
603 visit_pat_tuple_struct(self, i)
604 }
David Tolnay8c81f622018-07-31 23:34:35 -0700605 #[cfg(feature = "full")]
606 fn visit_pat_verbatim(&mut self, i: &'ast PatVerbatim) {
607 visit_pat_verbatim(self, i)
608 }
David Tolnay8c81f622018-07-31 23:34:35 -0700609 #[cfg(feature = "full")]
610 fn visit_pat_wild(&mut self, i: &'ast PatWild) {
611 visit_pat_wild(self, i)
612 }
David Tolnay440fe582019-02-15 20:23:14 -0800613 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700614 fn visit_path(&mut self, i: &'ast Path) {
615 visit_path(self, i)
616 }
David Tolnay440fe582019-02-15 20:23:14 -0800617 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700618 fn visit_path_arguments(&mut self, i: &'ast PathArguments) {
619 visit_path_arguments(self, i)
620 }
David Tolnay440fe582019-02-15 20:23:14 -0800621 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700622 fn visit_path_segment(&mut self, i: &'ast PathSegment) {
623 visit_path_segment(self, i)
624 }
David Tolnay440fe582019-02-15 20:23:14 -0800625 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700626 fn visit_predicate_eq(&mut self, i: &'ast PredicateEq) {
627 visit_predicate_eq(self, i)
628 }
David Tolnay440fe582019-02-15 20:23:14 -0800629 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700630 fn visit_predicate_lifetime(&mut self, i: &'ast PredicateLifetime) {
631 visit_predicate_lifetime(self, i)
632 }
David Tolnay440fe582019-02-15 20:23:14 -0800633 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700634 fn visit_predicate_type(&mut self, i: &'ast PredicateType) {
635 visit_predicate_type(self, i)
636 }
David Tolnay440fe582019-02-15 20:23:14 -0800637 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700638 fn visit_qself(&mut self, i: &'ast QSelf) {
639 visit_qself(self, i)
640 }
David Tolnay8c81f622018-07-31 23:34:35 -0700641 #[cfg(feature = "full")]
642 fn visit_range_limits(&mut self, i: &'ast RangeLimits) {
643 visit_range_limits(self, i)
644 }
David Tolnay440fe582019-02-15 20:23:14 -0800645 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700646 fn visit_return_type(&mut self, i: &'ast ReturnType) {
647 visit_return_type(self, i)
648 }
David Tolnay8c81f622018-07-31 23:34:35 -0700649 #[cfg(feature = "full")]
650 fn visit_stmt(&mut self, i: &'ast Stmt) {
651 visit_stmt(self, i)
652 }
David Tolnay440fe582019-02-15 20:23:14 -0800653 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700654 fn visit_trait_bound(&mut self, i: &'ast TraitBound) {
655 visit_trait_bound(self, i)
656 }
David Tolnay440fe582019-02-15 20:23:14 -0800657 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700658 fn visit_trait_bound_modifier(&mut self, i: &'ast TraitBoundModifier) {
659 visit_trait_bound_modifier(self, i)
660 }
661 #[cfg(feature = "full")]
662 fn visit_trait_item(&mut self, i: &'ast TraitItem) {
663 visit_trait_item(self, i)
664 }
665 #[cfg(feature = "full")]
666 fn visit_trait_item_const(&mut self, i: &'ast TraitItemConst) {
667 visit_trait_item_const(self, i)
668 }
669 #[cfg(feature = "full")]
670 fn visit_trait_item_macro(&mut self, i: &'ast TraitItemMacro) {
671 visit_trait_item_macro(self, i)
672 }
673 #[cfg(feature = "full")]
674 fn visit_trait_item_method(&mut self, i: &'ast TraitItemMethod) {
675 visit_trait_item_method(self, i)
676 }
677 #[cfg(feature = "full")]
678 fn visit_trait_item_type(&mut self, i: &'ast TraitItemType) {
679 visit_trait_item_type(self, i)
680 }
681 #[cfg(feature = "full")]
682 fn visit_trait_item_verbatim(&mut self, i: &'ast TraitItemVerbatim) {
683 visit_trait_item_verbatim(self, i)
684 }
David Tolnay440fe582019-02-15 20:23:14 -0800685 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700686 fn visit_type(&mut self, i: &'ast Type) {
687 visit_type(self, i)
688 }
David Tolnay440fe582019-02-15 20:23:14 -0800689 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700690 fn visit_type_array(&mut self, i: &'ast TypeArray) {
691 visit_type_array(self, i)
692 }
David Tolnay440fe582019-02-15 20:23:14 -0800693 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700694 fn visit_type_bare_fn(&mut self, i: &'ast TypeBareFn) {
695 visit_type_bare_fn(self, i)
696 }
David Tolnay440fe582019-02-15 20:23:14 -0800697 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700698 fn visit_type_group(&mut self, i: &'ast TypeGroup) {
699 visit_type_group(self, i)
700 }
David Tolnay440fe582019-02-15 20:23:14 -0800701 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700702 fn visit_type_impl_trait(&mut self, i: &'ast TypeImplTrait) {
703 visit_type_impl_trait(self, i)
704 }
David Tolnay440fe582019-02-15 20:23:14 -0800705 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700706 fn visit_type_infer(&mut self, i: &'ast TypeInfer) {
707 visit_type_infer(self, i)
708 }
David Tolnay440fe582019-02-15 20:23:14 -0800709 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700710 fn visit_type_macro(&mut self, i: &'ast TypeMacro) {
711 visit_type_macro(self, i)
712 }
David Tolnay440fe582019-02-15 20:23:14 -0800713 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700714 fn visit_type_never(&mut self, i: &'ast TypeNever) {
715 visit_type_never(self, i)
716 }
David Tolnay440fe582019-02-15 20:23:14 -0800717 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700718 fn visit_type_param(&mut self, i: &'ast TypeParam) {
719 visit_type_param(self, i)
720 }
David Tolnay440fe582019-02-15 20:23:14 -0800721 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700722 fn visit_type_param_bound(&mut self, i: &'ast TypeParamBound) {
723 visit_type_param_bound(self, i)
724 }
David Tolnay440fe582019-02-15 20:23:14 -0800725 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700726 fn visit_type_paren(&mut self, i: &'ast TypeParen) {
727 visit_type_paren(self, i)
728 }
David Tolnay440fe582019-02-15 20:23:14 -0800729 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700730 fn visit_type_path(&mut self, i: &'ast TypePath) {
731 visit_type_path(self, i)
732 }
David Tolnay440fe582019-02-15 20:23:14 -0800733 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700734 fn visit_type_ptr(&mut self, i: &'ast TypePtr) {
735 visit_type_ptr(self, i)
736 }
David Tolnay440fe582019-02-15 20:23:14 -0800737 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700738 fn visit_type_reference(&mut self, i: &'ast TypeReference) {
739 visit_type_reference(self, i)
740 }
David Tolnay440fe582019-02-15 20:23:14 -0800741 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700742 fn visit_type_slice(&mut self, i: &'ast TypeSlice) {
743 visit_type_slice(self, i)
744 }
David Tolnay440fe582019-02-15 20:23:14 -0800745 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700746 fn visit_type_trait_object(&mut self, i: &'ast TypeTraitObject) {
747 visit_type_trait_object(self, i)
748 }
David Tolnay440fe582019-02-15 20:23:14 -0800749 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700750 fn visit_type_tuple(&mut self, i: &'ast TypeTuple) {
751 visit_type_tuple(self, i)
752 }
David Tolnay440fe582019-02-15 20:23:14 -0800753 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700754 fn visit_type_verbatim(&mut self, i: &'ast TypeVerbatim) {
755 visit_type_verbatim(self, i)
756 }
David Tolnay440fe582019-02-15 20:23:14 -0800757 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700758 fn visit_un_op(&mut self, i: &'ast UnOp) {
759 visit_un_op(self, i)
760 }
761 #[cfg(feature = "full")]
762 fn visit_use_glob(&mut self, i: &'ast UseGlob) {
763 visit_use_glob(self, i)
764 }
765 #[cfg(feature = "full")]
766 fn visit_use_group(&mut self, i: &'ast UseGroup) {
767 visit_use_group(self, i)
768 }
769 #[cfg(feature = "full")]
770 fn visit_use_name(&mut self, i: &'ast UseName) {
771 visit_use_name(self, i)
772 }
773 #[cfg(feature = "full")]
774 fn visit_use_path(&mut self, i: &'ast UsePath) {
775 visit_use_path(self, i)
776 }
777 #[cfg(feature = "full")]
778 fn visit_use_rename(&mut self, i: &'ast UseRename) {
779 visit_use_rename(self, i)
780 }
781 #[cfg(feature = "full")]
782 fn visit_use_tree(&mut self, i: &'ast UseTree) {
783 visit_use_tree(self, i)
784 }
David Tolnay440fe582019-02-15 20:23:14 -0800785 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700786 fn visit_variant(&mut self, i: &'ast Variant) {
787 visit_variant(self, i)
788 }
David Tolnay440fe582019-02-15 20:23:14 -0800789 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700790 fn visit_vis_crate(&mut self, i: &'ast VisCrate) {
791 visit_vis_crate(self, i)
792 }
David Tolnay440fe582019-02-15 20:23:14 -0800793 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700794 fn visit_vis_public(&mut self, i: &'ast VisPublic) {
795 visit_vis_public(self, i)
796 }
David Tolnay440fe582019-02-15 20:23:14 -0800797 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700798 fn visit_vis_restricted(&mut self, i: &'ast VisRestricted) {
799 visit_vis_restricted(self, i)
800 }
David Tolnay440fe582019-02-15 20:23:14 -0800801 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700802 fn visit_visibility(&mut self, i: &'ast Visibility) {
803 visit_visibility(self, i)
804 }
David Tolnay440fe582019-02-15 20:23:14 -0800805 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700806 fn visit_where_clause(&mut self, i: &'ast WhereClause) {
807 visit_where_clause(self, i)
808 }
David Tolnay440fe582019-02-15 20:23:14 -0800809 #[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700810 fn visit_where_predicate(&mut self, i: &'ast WherePredicate) {
811 visit_where_predicate(self, i)
812 }
Carl Lerchecbf7cc12019-02-15 14:09:31 -0800813 fn visit_span(&mut self, i: &'ast Span) {
814 visit_span(self, i)
815 }
816 fn visit_ident(&mut self, i: &'ast Ident) {
817 visit_ident(self, i)
818 }
Nika Layzell27726662017-10-24 23:16:35 -0400819}
David Tolnay440fe582019-02-15 20:23:14 -0800820#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800821pub fn visit_abi<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Abi) {
David Tolnay7ac699c2018-08-24 14:00:58 -0400822 tokens_helper(_visitor, &_i.extern_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -0700823 if let Some(ref it) = _i.name {
824 _visitor.visit_lit_str(it)
825 };
Nika Layzell27726662017-10-24 23:16:35 -0400826}
David Tolnay440fe582019-02-15 20:23:14 -0800827#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700828pub fn visit_angle_bracketed_generic_arguments<'ast, V: Visit<'ast> + ?Sized>(
829 _visitor: &mut V,
830 _i: &'ast AngleBracketedGenericArguments,
831) {
832 if let Some(ref it) = _i.colon2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -0400833 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -0700834 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400835 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700836 for el in Punctuated::pairs(&_i.args) {
837 let it = el.value();
838 _visitor.visit_generic_argument(it)
839 }
David Tolnay7ac699c2018-08-24 14:00:58 -0400840 tokens_helper(_visitor, &_i.gt_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400841}
David Tolnay8c81f622018-07-31 23:34:35 -0700842#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800843pub fn visit_arg_captured<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ArgCaptured) {
David Tolnay8c81f622018-07-31 23:34:35 -0700844 _visitor.visit_pat(&_i.pat);
David Tolnay7ac699c2018-08-24 14:00:58 -0400845 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700846 _visitor.visit_type(&_i.ty);
Nika Layzell27726662017-10-24 23:16:35 -0400847}
David Tolnay8c81f622018-07-31 23:34:35 -0700848#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800849pub fn visit_arg_self<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ArgSelf) {
David Tolnay8c81f622018-07-31 23:34:35 -0700850 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -0400851 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -0700852 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400853 tokens_helper(_visitor, &_i.self_token.span);
Nika Layzell27726662017-10-24 23:16:35 -0400854}
David Tolnay8c81f622018-07-31 23:34:35 -0700855#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800856pub fn visit_arg_self_ref<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ArgSelfRef) {
David Tolnay7ac699c2018-08-24 14:00:58 -0400857 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700858 if let Some(ref it) = _i.lifetime {
859 _visitor.visit_lifetime(it)
860 };
861 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -0400862 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -0700863 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400864 tokens_helper(_visitor, &_i.self_token.span);
Nika Layzell27726662017-10-24 23:16:35 -0400865}
David Tolnay8c81f622018-07-31 23:34:35 -0700866#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800867pub fn visit_arm<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Arm) {
David Tolnay8c81f622018-07-31 23:34:35 -0700868 for it in &_i.attrs {
869 _visitor.visit_attribute(it)
870 }
871 if let Some(ref it) = _i.leading_vert {
David Tolnay7ac699c2018-08-24 14:00:58 -0400872 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -0700873 };
874 for el in Punctuated::pairs(&_i.pats) {
875 let it = el.value();
876 _visitor.visit_pat(it)
877 }
878 if let Some(ref it) = _i.guard {
David Tolnay7ac699c2018-08-24 14:00:58 -0400879 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -0700880 _visitor.visit_expr(&*(it).1);
881 };
David Tolnay7ac699c2018-08-24 14:00:58 -0400882 tokens_helper(_visitor, &_i.fat_arrow_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700883 _visitor.visit_expr(&*_i.body);
884 if let Some(ref it) = _i.comma {
David Tolnay7ac699c2018-08-24 14:00:58 -0400885 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -0700886 };
Nika Layzell27726662017-10-24 23:16:35 -0400887}
David Tolnay440fe582019-02-15 20:23:14 -0800888#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800889pub fn visit_attr_style<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast AttrStyle) {
Nika Layzell27726662017-10-24 23:16:35 -0400890 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -0700891 AttrStyle::Outer => {}
892 AttrStyle::Inner(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400893 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400894 }
895 }
896}
David Tolnay440fe582019-02-15 20:23:14 -0800897#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800898pub fn visit_attribute<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Attribute) {
David Tolnay7ac699c2018-08-24 14:00:58 -0400899 tokens_helper(_visitor, &_i.pound_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700900 _visitor.visit_attr_style(&_i.style);
David Tolnay7ac699c2018-08-24 14:00:58 -0400901 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -0700902 _visitor.visit_path(&_i.path);
David Tolnay6af48992018-08-01 11:16:28 -0700903 skip!(_i.tts);
Nika Layzell27726662017-10-24 23:16:35 -0400904}
David Tolnay440fe582019-02-15 20:23:14 -0800905#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800906pub fn visit_bare_fn_arg<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast BareFnArg) {
David Tolnay8c81f622018-07-31 23:34:35 -0700907 if let Some(ref it) = _i.name {
908 _visitor.visit_bare_fn_arg_name(&(it).0);
David Tolnay7ac699c2018-08-24 14:00:58 -0400909 tokens_helper(_visitor, &(it).1.spans);
David Tolnay8c81f622018-07-31 23:34:35 -0700910 };
911 _visitor.visit_type(&_i.ty);
Nika Layzell27726662017-10-24 23:16:35 -0400912}
David Tolnay440fe582019-02-15 20:23:14 -0800913#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -0700914pub fn visit_bare_fn_arg_name<'ast, V: Visit<'ast> + ?Sized>(
915 _visitor: &mut V,
916 _i: &'ast BareFnArgName,
917) {
Nika Layzell27726662017-10-24 23:16:35 -0400918 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -0700919 BareFnArgName::Named(ref _binding_0) => {
Alex Crichtond261d092018-05-18 13:47:35 -0700920 _visitor.visit_ident(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -0400921 }
David Tolnay8c81f622018-07-31 23:34:35 -0700922 BareFnArgName::Wild(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400923 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400924 }
925 }
926}
David Tolnay440fe582019-02-15 20:23:14 -0800927#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800928pub fn visit_bin_op<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast BinOp) {
Nika Layzell27726662017-10-24 23:16:35 -0400929 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -0700930 BinOp::Add(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400931 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400932 }
David Tolnay8c81f622018-07-31 23:34:35 -0700933 BinOp::Sub(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400934 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400935 }
David Tolnay8c81f622018-07-31 23:34:35 -0700936 BinOp::Mul(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400937 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400938 }
David Tolnay8c81f622018-07-31 23:34:35 -0700939 BinOp::Div(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400940 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400941 }
David Tolnay8c81f622018-07-31 23:34:35 -0700942 BinOp::Rem(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400943 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400944 }
David Tolnay8c81f622018-07-31 23:34:35 -0700945 BinOp::And(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400946 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400947 }
David Tolnay8c81f622018-07-31 23:34:35 -0700948 BinOp::Or(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400949 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400950 }
David Tolnay8c81f622018-07-31 23:34:35 -0700951 BinOp::BitXor(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400952 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400953 }
David Tolnay8c81f622018-07-31 23:34:35 -0700954 BinOp::BitAnd(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400955 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400956 }
David Tolnay8c81f622018-07-31 23:34:35 -0700957 BinOp::BitOr(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400958 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400959 }
David Tolnay8c81f622018-07-31 23:34:35 -0700960 BinOp::Shl(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400961 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400962 }
David Tolnay8c81f622018-07-31 23:34:35 -0700963 BinOp::Shr(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400964 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400965 }
David Tolnay8c81f622018-07-31 23:34:35 -0700966 BinOp::Eq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400967 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400968 }
David Tolnay8c81f622018-07-31 23:34:35 -0700969 BinOp::Lt(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400970 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400971 }
David Tolnay8c81f622018-07-31 23:34:35 -0700972 BinOp::Le(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400973 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400974 }
David Tolnay8c81f622018-07-31 23:34:35 -0700975 BinOp::Ne(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400976 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400977 }
David Tolnay8c81f622018-07-31 23:34:35 -0700978 BinOp::Ge(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400979 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400980 }
David Tolnay8c81f622018-07-31 23:34:35 -0700981 BinOp::Gt(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400982 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400983 }
David Tolnay8c81f622018-07-31 23:34:35 -0700984 BinOp::AddEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400985 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400986 }
David Tolnay8c81f622018-07-31 23:34:35 -0700987 BinOp::SubEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400988 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400989 }
David Tolnay8c81f622018-07-31 23:34:35 -0700990 BinOp::MulEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400991 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400992 }
David Tolnay8c81f622018-07-31 23:34:35 -0700993 BinOp::DivEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400994 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400995 }
David Tolnay8c81f622018-07-31 23:34:35 -0700996 BinOp::RemEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -0400997 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -0400998 }
David Tolnay8c81f622018-07-31 23:34:35 -0700999 BinOp::BitXorEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001000 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001001 }
David Tolnay8c81f622018-07-31 23:34:35 -07001002 BinOp::BitAndEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001003 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001004 }
David Tolnay8c81f622018-07-31 23:34:35 -07001005 BinOp::BitOrEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001006 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001007 }
David Tolnay8c81f622018-07-31 23:34:35 -07001008 BinOp::ShlEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001009 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001010 }
David Tolnay8c81f622018-07-31 23:34:35 -07001011 BinOp::ShrEq(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04001012 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001013 }
1014 }
1015}
David Tolnay440fe582019-02-15 20:23:14 -08001016#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001017pub fn visit_binding<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Binding) {
David Tolnay8c81f622018-07-31 23:34:35 -07001018 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001019 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001020 _visitor.visit_type(&_i.ty);
David Tolnay506e43a2017-12-29 11:34:36 -05001021}
David Tolnay8c81f622018-07-31 23:34:35 -07001022#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001023pub fn visit_block<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Block) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001024 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001025 for it in &_i.stmts {
1026 _visitor.visit_stmt(it)
1027 }
Nika Layzell27726662017-10-24 23:16:35 -04001028}
David Tolnay440fe582019-02-15 20:23:14 -08001029#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001030pub fn visit_bound_lifetimes<'ast, V: Visit<'ast> + ?Sized>(
1031 _visitor: &mut V,
1032 _i: &'ast BoundLifetimes,
1033) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001034 tokens_helper(_visitor, &_i.for_token.span);
1035 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001036 for el in Punctuated::pairs(&_i.lifetimes) {
1037 let it = el.value();
1038 _visitor.visit_lifetime_def(it)
1039 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001040 tokens_helper(_visitor, &_i.gt_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001041}
David Tolnay440fe582019-02-15 20:23:14 -08001042#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001043pub fn visit_const_param<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ConstParam) {
David Tolnay8c81f622018-07-31 23:34:35 -07001044 for it in &_i.attrs {
1045 _visitor.visit_attribute(it)
1046 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001047 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001048 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001049 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001050 _visitor.visit_type(&_i.ty);
1051 if let Some(ref it) = _i.eq_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001052 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001053 };
1054 if let Some(ref it) = _i.default {
1055 _visitor.visit_expr(it)
1056 };
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001057}
David Tolnay440fe582019-02-15 20:23:14 -08001058#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay9d0882a2018-09-01 19:49:14 -07001059pub fn visit_constraint<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Constraint) {
1060 _visitor.visit_ident(&_i.ident);
1061 tokens_helper(_visitor, &_i.colon_token.spans);
1062 for el in Punctuated::pairs(&_i.bounds) {
1063 let it = el.value();
1064 _visitor.visit_type_param_bound(it)
1065 }
1066}
David Tolnay8c81f622018-07-31 23:34:35 -07001067#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001068pub fn visit_data<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Data) {
David Tolnaye3d41b72017-12-31 15:24:00 -05001069 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001070 Data::Struct(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05001071 _visitor.visit_data_struct(_binding_0);
1072 }
David Tolnay8c81f622018-07-31 23:34:35 -07001073 Data::Enum(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05001074 _visitor.visit_data_enum(_binding_0);
1075 }
David Tolnay8c81f622018-07-31 23:34:35 -07001076 Data::Union(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05001077 _visitor.visit_data_union(_binding_0);
1078 }
1079 }
1080}
David Tolnay8c81f622018-07-31 23:34:35 -07001081#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001082pub fn visit_data_enum<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataEnum) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001083 tokens_helper(_visitor, &_i.enum_token.span);
1084 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001085 for el in Punctuated::pairs(&_i.variants) {
1086 let it = el.value();
1087 _visitor.visit_variant(it)
1088 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001089}
David Tolnay8c81f622018-07-31 23:34:35 -07001090#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001091pub fn visit_data_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataStruct) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001092 tokens_helper(_visitor, &_i.struct_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001093 _visitor.visit_fields(&_i.fields);
1094 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001095 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001096 };
David Tolnaye3d41b72017-12-31 15:24:00 -05001097}
David Tolnay8c81f622018-07-31 23:34:35 -07001098#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001099pub fn visit_data_union<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataUnion) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001100 tokens_helper(_visitor, &_i.union_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001101 _visitor.visit_fields_named(&_i.fields);
David Tolnaye3d41b72017-12-31 15:24:00 -05001102}
David Tolnay8c81f622018-07-31 23:34:35 -07001103#[cfg(feature = "derive")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001104pub fn visit_derive_input<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DeriveInput) {
David Tolnay8c81f622018-07-31 23:34:35 -07001105 for it in &_i.attrs {
1106 _visitor.visit_attribute(it)
1107 }
1108 _visitor.visit_visibility(&_i.vis);
1109 _visitor.visit_ident(&_i.ident);
1110 _visitor.visit_generics(&_i.generics);
1111 _visitor.visit_data(&_i.data);
Nika Layzell27726662017-10-24 23:16:35 -04001112}
David Tolnay440fe582019-02-15 20:23:14 -08001113#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001114pub fn visit_expr<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Expr) {
Nika Layzell27726662017-10-24 23:16:35 -04001115 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001116 Expr::Box(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001117 full!(_visitor.visit_expr_box(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001118 }
David Tolnay8c81f622018-07-31 23:34:35 -07001119 Expr::InPlace(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001120 full!(_visitor.visit_expr_in_place(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001121 }
David Tolnay8c81f622018-07-31 23:34:35 -07001122 Expr::Array(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001123 full!(_visitor.visit_expr_array(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001124 }
David Tolnay8c81f622018-07-31 23:34:35 -07001125 Expr::Call(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001126 _visitor.visit_expr_call(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001127 }
David Tolnay8c81f622018-07-31 23:34:35 -07001128 Expr::MethodCall(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001129 full!(_visitor.visit_expr_method_call(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001130 }
David Tolnay8c81f622018-07-31 23:34:35 -07001131 Expr::Tuple(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001132 full!(_visitor.visit_expr_tuple(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001133 }
David Tolnay8c81f622018-07-31 23:34:35 -07001134 Expr::Binary(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001135 _visitor.visit_expr_binary(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001136 }
David Tolnay8c81f622018-07-31 23:34:35 -07001137 Expr::Unary(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001138 _visitor.visit_expr_unary(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001139 }
David Tolnay8c81f622018-07-31 23:34:35 -07001140 Expr::Lit(ref _binding_0) => {
David Tolnay8c91b882017-12-28 23:04:32 -05001141 _visitor.visit_expr_lit(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001142 }
David Tolnay8c81f622018-07-31 23:34:35 -07001143 Expr::Cast(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001144 _visitor.visit_expr_cast(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001145 }
David Tolnay8c81f622018-07-31 23:34:35 -07001146 Expr::Type(ref _binding_0) => {
David Tolnay0cf94f22017-12-28 23:46:26 -05001147 full!(_visitor.visit_expr_type(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001148 }
David Tolnay9c119122018-09-01 18:47:02 -07001149 Expr::Let(ref _binding_0) => {
1150 full!(_visitor.visit_expr_let(_binding_0));
1151 }
David Tolnay8c81f622018-07-31 23:34:35 -07001152 Expr::If(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001153 full!(_visitor.visit_expr_if(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001154 }
David Tolnay8c81f622018-07-31 23:34:35 -07001155 Expr::While(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001156 full!(_visitor.visit_expr_while(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001157 }
David Tolnay8c81f622018-07-31 23:34:35 -07001158 Expr::ForLoop(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001159 full!(_visitor.visit_expr_for_loop(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001160 }
David Tolnay8c81f622018-07-31 23:34:35 -07001161 Expr::Loop(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001162 full!(_visitor.visit_expr_loop(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001163 }
David Tolnay8c81f622018-07-31 23:34:35 -07001164 Expr::Match(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001165 full!(_visitor.visit_expr_match(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001166 }
David Tolnay8c81f622018-07-31 23:34:35 -07001167 Expr::Closure(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001168 full!(_visitor.visit_expr_closure(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001169 }
David Tolnay8c81f622018-07-31 23:34:35 -07001170 Expr::Unsafe(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001171 full!(_visitor.visit_expr_unsafe(_binding_0));
Nika Layzell640832a2017-12-04 13:37:09 -05001172 }
David Tolnay8c81f622018-07-31 23:34:35 -07001173 Expr::Block(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001174 full!(_visitor.visit_expr_block(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001175 }
David Tolnay8c81f622018-07-31 23:34:35 -07001176 Expr::Assign(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001177 full!(_visitor.visit_expr_assign(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001178 }
David Tolnay8c81f622018-07-31 23:34:35 -07001179 Expr::AssignOp(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001180 full!(_visitor.visit_expr_assign_op(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001181 }
David Tolnay8c81f622018-07-31 23:34:35 -07001182 Expr::Field(ref _binding_0) => {
David Tolnayd093fa92018-06-30 10:23:25 -07001183 _visitor.visit_expr_field(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001184 }
David Tolnay8c81f622018-07-31 23:34:35 -07001185 Expr::Index(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001186 _visitor.visit_expr_index(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001187 }
David Tolnay8c81f622018-07-31 23:34:35 -07001188 Expr::Range(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001189 full!(_visitor.visit_expr_range(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001190 }
David Tolnay8c81f622018-07-31 23:34:35 -07001191 Expr::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001192 _visitor.visit_expr_path(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001193 }
David Tolnay8c81f622018-07-31 23:34:35 -07001194 Expr::Reference(ref _binding_0) => {
David Tolnay00674ba2018-03-31 18:14:11 +02001195 full!(_visitor.visit_expr_reference(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001196 }
David Tolnay8c81f622018-07-31 23:34:35 -07001197 Expr::Break(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001198 full!(_visitor.visit_expr_break(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001199 }
David Tolnay8c81f622018-07-31 23:34:35 -07001200 Expr::Continue(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001201 full!(_visitor.visit_expr_continue(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001202 }
David Tolnay8c81f622018-07-31 23:34:35 -07001203 Expr::Return(ref _binding_0) => {
David Tolnayc246cd32017-12-28 23:14:32 -05001204 full!(_visitor.visit_expr_return(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001205 }
David Tolnay8c81f622018-07-31 23:34:35 -07001206 Expr::Macro(ref _binding_0) => {
David Tolnay8c91b882017-12-28 23:04:32 -05001207 full!(_visitor.visit_expr_macro(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001208 }
David Tolnay8c81f622018-07-31 23:34:35 -07001209 Expr::Struct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001210 full!(_visitor.visit_expr_struct(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001211 }
David Tolnay8c81f622018-07-31 23:34:35 -07001212 Expr::Repeat(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001213 full!(_visitor.visit_expr_repeat(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001214 }
David Tolnay8c81f622018-07-31 23:34:35 -07001215 Expr::Paren(ref _binding_0) => {
David Tolnay81ab4f62018-01-27 19:02:51 -08001216 _visitor.visit_expr_paren(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001217 }
David Tolnay8c81f622018-07-31 23:34:35 -07001218 Expr::Group(ref _binding_0) => {
David Tolnaye98775f2017-12-28 23:17:00 -05001219 full!(_visitor.visit_expr_group(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001220 }
David Tolnay8c81f622018-07-31 23:34:35 -07001221 Expr::Try(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001222 full!(_visitor.visit_expr_try(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001223 }
David Tolnay02a9c6f2018-08-24 18:58:45 -04001224 Expr::Async(ref _binding_0) => {
1225 full!(_visitor.visit_expr_async(_binding_0));
1226 }
David Tolnayfb2dd4b2018-08-24 16:45:34 -04001227 Expr::TryBlock(ref _binding_0) => {
1228 full!(_visitor.visit_expr_try_block(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001229 }
David Tolnay8c81f622018-07-31 23:34:35 -07001230 Expr::Yield(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001231 full!(_visitor.visit_expr_yield(_binding_0));
Nika Layzell27726662017-10-24 23:16:35 -04001232 }
David Tolnay8c81f622018-07-31 23:34:35 -07001233 Expr::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05001234 _visitor.visit_expr_verbatim(_binding_0);
1235 }
Nika Layzell27726662017-10-24 23:16:35 -04001236 }
1237}
David Tolnay8c81f622018-07-31 23:34:35 -07001238#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001239pub fn visit_expr_array<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprArray) {
David Tolnay8c81f622018-07-31 23:34:35 -07001240 for it in &_i.attrs {
1241 _visitor.visit_attribute(it)
1242 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001243 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001244 for el in Punctuated::pairs(&_i.elems) {
1245 let it = el.value();
1246 _visitor.visit_expr(it)
David Tolnaye3d41b72017-12-31 15:24:00 -05001247 }
1248}
David Tolnay8c81f622018-07-31 23:34:35 -07001249#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001250pub fn visit_expr_assign<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprAssign) {
1251 for it in &_i.attrs {
1252 _visitor.visit_attribute(it)
1253 }
1254 _visitor.visit_expr(&*_i.left);
David Tolnay7ac699c2018-08-24 14:00:58 -04001255 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001256 _visitor.visit_expr(&*_i.right);
1257}
1258#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001259pub fn visit_expr_assign_op<'ast, V: Visit<'ast> + ?Sized>(
1260 _visitor: &mut V,
1261 _i: &'ast ExprAssignOp,
1262) {
1263 for it in &_i.attrs {
1264 _visitor.visit_attribute(it)
1265 }
1266 _visitor.visit_expr(&*_i.left);
1267 _visitor.visit_bin_op(&_i.op);
1268 _visitor.visit_expr(&*_i.right);
1269}
David Tolnay02a9c6f2018-08-24 18:58:45 -04001270#[cfg(feature = "full")]
David Tolnay02a9c6f2018-08-24 18:58:45 -04001271pub fn visit_expr_async<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprAsync) {
1272 for it in &_i.attrs {
1273 _visitor.visit_attribute(it)
1274 }
1275 tokens_helper(_visitor, &_i.async_token.span);
1276 if let Some(ref it) = _i.capture {
1277 tokens_helper(_visitor, &it.span)
1278 };
1279 _visitor.visit_block(&_i.block);
1280}
David Tolnay440fe582019-02-15 20:23:14 -08001281#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001282pub fn visit_expr_binary<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBinary) {
1283 for it in &_i.attrs {
1284 _visitor.visit_attribute(it)
1285 }
1286 _visitor.visit_expr(&*_i.left);
1287 _visitor.visit_bin_op(&_i.op);
1288 _visitor.visit_expr(&*_i.right);
1289}
1290#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001291pub fn visit_expr_block<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBlock) {
1292 for it in &_i.attrs {
1293 _visitor.visit_attribute(it)
1294 }
David Tolnay1d8e9962018-08-24 19:04:20 -04001295 if let Some(ref it) = _i.label {
1296 _visitor.visit_label(it)
1297 };
David Tolnay8c81f622018-07-31 23:34:35 -07001298 _visitor.visit_block(&_i.block);
1299}
1300#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001301pub fn visit_expr_box<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBox) {
1302 for it in &_i.attrs {
1303 _visitor.visit_attribute(it)
1304 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001305 tokens_helper(_visitor, &_i.box_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001306 _visitor.visit_expr(&*_i.expr);
1307}
1308#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001309pub fn visit_expr_break<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBreak) {
1310 for it in &_i.attrs {
1311 _visitor.visit_attribute(it)
1312 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001313 tokens_helper(_visitor, &_i.break_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001314 if let Some(ref it) = _i.label {
1315 _visitor.visit_lifetime(it)
1316 };
1317 if let Some(ref it) = _i.expr {
1318 _visitor.visit_expr(&**it)
1319 };
1320}
David Tolnay440fe582019-02-15 20:23:14 -08001321#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001322pub fn visit_expr_call<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprCall) {
1323 for it in &_i.attrs {
1324 _visitor.visit_attribute(it)
1325 }
1326 _visitor.visit_expr(&*_i.func);
David Tolnay7ac699c2018-08-24 14:00:58 -04001327 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001328 for el in Punctuated::pairs(&_i.args) {
1329 let it = el.value();
1330 _visitor.visit_expr(it)
1331 }
1332}
David Tolnay440fe582019-02-15 20:23:14 -08001333#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001334pub fn visit_expr_cast<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprCast) {
1335 for it in &_i.attrs {
1336 _visitor.visit_attribute(it)
1337 }
1338 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001339 tokens_helper(_visitor, &_i.as_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001340 _visitor.visit_type(&*_i.ty);
1341}
1342#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001343pub fn visit_expr_closure<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprClosure) {
1344 for it in &_i.attrs {
1345 _visitor.visit_attribute(it)
1346 }
Yusuke Sasaki4e5d9662018-07-21 02:49:47 +09001347 if let Some(ref it) = _i.asyncness {
1348 tokens_helper(_visitor, &it.span)
1349 };
David Tolnay8c81f622018-07-31 23:34:35 -07001350 if let Some(ref it) = _i.movability {
David Tolnay7ac699c2018-08-24 14:00:58 -04001351 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001352 };
1353 if let Some(ref it) = _i.capture {
David Tolnay7ac699c2018-08-24 14:00:58 -04001354 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001355 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001356 tokens_helper(_visitor, &_i.or1_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001357 for el in Punctuated::pairs(&_i.inputs) {
1358 let it = el.value();
1359 _visitor.visit_fn_arg(it)
1360 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001361 tokens_helper(_visitor, &_i.or2_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001362 _visitor.visit_return_type(&_i.output);
1363 _visitor.visit_expr(&*_i.body);
1364}
1365#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001366pub fn visit_expr_continue<'ast, V: Visit<'ast> + ?Sized>(
1367 _visitor: &mut V,
1368 _i: &'ast ExprContinue,
1369) {
1370 for it in &_i.attrs {
1371 _visitor.visit_attribute(it)
1372 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001373 tokens_helper(_visitor, &_i.continue_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001374 if let Some(ref it) = _i.label {
1375 _visitor.visit_lifetime(it)
1376 };
1377}
David Tolnay440fe582019-02-15 20:23:14 -08001378#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001379pub fn visit_expr_field<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprField) {
1380 for it in &_i.attrs {
1381 _visitor.visit_attribute(it)
1382 }
1383 _visitor.visit_expr(&*_i.base);
David Tolnay7ac699c2018-08-24 14:00:58 -04001384 tokens_helper(_visitor, &_i.dot_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001385 _visitor.visit_member(&_i.member);
1386}
1387#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001388pub fn visit_expr_for_loop<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprForLoop) {
1389 for it in &_i.attrs {
1390 _visitor.visit_attribute(it)
1391 }
1392 if let Some(ref it) = _i.label {
1393 _visitor.visit_label(it)
1394 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001395 tokens_helper(_visitor, &_i.for_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001396 _visitor.visit_pat(&*_i.pat);
David Tolnay7ac699c2018-08-24 14:00:58 -04001397 tokens_helper(_visitor, &_i.in_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001398 _visitor.visit_expr(&*_i.expr);
1399 _visitor.visit_block(&_i.body);
1400}
1401#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001402pub fn visit_expr_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprGroup) {
1403 for it in &_i.attrs {
1404 _visitor.visit_attribute(it)
1405 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001406 tokens_helper(_visitor, &_i.group_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001407 _visitor.visit_expr(&*_i.expr);
1408}
1409#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001410pub fn visit_expr_if<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprIf) {
1411 for it in &_i.attrs {
1412 _visitor.visit_attribute(it)
1413 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001414 tokens_helper(_visitor, &_i.if_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001415 _visitor.visit_expr(&*_i.cond);
1416 _visitor.visit_block(&_i.then_branch);
1417 if let Some(ref it) = _i.else_branch {
David Tolnay7ac699c2018-08-24 14:00:58 -04001418 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001419 _visitor.visit_expr(&*(it).1);
1420 };
1421}
1422#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001423pub fn visit_expr_in_place<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprInPlace) {
1424 for it in &_i.attrs {
1425 _visitor.visit_attribute(it)
1426 }
1427 _visitor.visit_expr(&*_i.place);
David Tolnay7ac699c2018-08-24 14:00:58 -04001428 tokens_helper(_visitor, &_i.arrow_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001429 _visitor.visit_expr(&*_i.value);
1430}
David Tolnay440fe582019-02-15 20:23:14 -08001431#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001432pub fn visit_expr_index<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprIndex) {
1433 for it in &_i.attrs {
1434 _visitor.visit_attribute(it)
1435 }
1436 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001437 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001438 _visitor.visit_expr(&*_i.index);
1439}
David Tolnay9c119122018-09-01 18:47:02 -07001440#[cfg(feature = "full")]
David Tolnay9c119122018-09-01 18:47:02 -07001441pub fn visit_expr_let<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprLet) {
1442 for it in &_i.attrs {
1443 _visitor.visit_attribute(it)
1444 }
1445 tokens_helper(_visitor, &_i.let_token.span);
1446 for el in Punctuated::pairs(&_i.pats) {
1447 let it = el.value();
1448 _visitor.visit_pat(it)
1449 }
1450 tokens_helper(_visitor, &_i.eq_token.spans);
1451 _visitor.visit_expr(&*_i.expr);
1452}
David Tolnay440fe582019-02-15 20:23:14 -08001453#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001454pub fn visit_expr_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprLit) {
1455 for it in &_i.attrs {
1456 _visitor.visit_attribute(it)
1457 }
1458 _visitor.visit_lit(&_i.lit);
1459}
1460#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001461pub fn visit_expr_loop<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprLoop) {
1462 for it in &_i.attrs {
1463 _visitor.visit_attribute(it)
1464 }
1465 if let Some(ref it) = _i.label {
1466 _visitor.visit_label(it)
1467 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001468 tokens_helper(_visitor, &_i.loop_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001469 _visitor.visit_block(&_i.body);
1470}
1471#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001472pub fn visit_expr_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprMacro) {
1473 for it in &_i.attrs {
1474 _visitor.visit_attribute(it)
1475 }
1476 _visitor.visit_macro(&_i.mac);
1477}
1478#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001479pub fn visit_expr_match<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprMatch) {
1480 for it in &_i.attrs {
1481 _visitor.visit_attribute(it)
1482 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001483 tokens_helper(_visitor, &_i.match_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001484 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001485 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001486 for it in &_i.arms {
1487 _visitor.visit_arm(it)
1488 }
1489}
1490#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001491pub fn visit_expr_method_call<'ast, V: Visit<'ast> + ?Sized>(
1492 _visitor: &mut V,
1493 _i: &'ast ExprMethodCall,
1494) {
1495 for it in &_i.attrs {
1496 _visitor.visit_attribute(it)
1497 }
1498 _visitor.visit_expr(&*_i.receiver);
David Tolnay7ac699c2018-08-24 14:00:58 -04001499 tokens_helper(_visitor, &_i.dot_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001500 _visitor.visit_ident(&_i.method);
1501 if let Some(ref it) = _i.turbofish {
1502 _visitor.visit_method_turbofish(it)
1503 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001504 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001505 for el in Punctuated::pairs(&_i.args) {
1506 let it = el.value();
1507 _visitor.visit_expr(it)
1508 }
1509}
David Tolnay440fe582019-02-15 20:23:14 -08001510#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001511pub fn visit_expr_paren<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprParen) {
1512 for it in &_i.attrs {
1513 _visitor.visit_attribute(it)
1514 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001515 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001516 _visitor.visit_expr(&*_i.expr);
1517}
David Tolnay440fe582019-02-15 20:23:14 -08001518#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001519pub fn visit_expr_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprPath) {
1520 for it in &_i.attrs {
1521 _visitor.visit_attribute(it)
1522 }
1523 if let Some(ref it) = _i.qself {
1524 _visitor.visit_qself(it)
1525 };
1526 _visitor.visit_path(&_i.path);
1527}
1528#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001529pub fn visit_expr_range<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprRange) {
1530 for it in &_i.attrs {
1531 _visitor.visit_attribute(it)
1532 }
1533 if let Some(ref it) = _i.from {
1534 _visitor.visit_expr(&**it)
1535 };
1536 _visitor.visit_range_limits(&_i.limits);
1537 if let Some(ref it) = _i.to {
1538 _visitor.visit_expr(&**it)
1539 };
1540}
1541#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001542pub fn visit_expr_reference<'ast, V: Visit<'ast> + ?Sized>(
1543 _visitor: &mut V,
1544 _i: &'ast ExprReference,
1545) {
1546 for it in &_i.attrs {
1547 _visitor.visit_attribute(it)
1548 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001549 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001550 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04001551 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001552 };
1553 _visitor.visit_expr(&*_i.expr);
1554}
1555#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001556pub fn visit_expr_repeat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprRepeat) {
1557 for it in &_i.attrs {
1558 _visitor.visit_attribute(it)
1559 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001560 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001561 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001562 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001563 _visitor.visit_expr(&*_i.len);
1564}
1565#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001566pub fn visit_expr_return<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprReturn) {
1567 for it in &_i.attrs {
1568 _visitor.visit_attribute(it)
1569 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001570 tokens_helper(_visitor, &_i.return_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001571 if let Some(ref it) = _i.expr {
1572 _visitor.visit_expr(&**it)
1573 };
1574}
1575#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001576pub fn visit_expr_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprStruct) {
1577 for it in &_i.attrs {
1578 _visitor.visit_attribute(it)
1579 }
1580 _visitor.visit_path(&_i.path);
David Tolnay7ac699c2018-08-24 14:00:58 -04001581 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001582 for el in Punctuated::pairs(&_i.fields) {
1583 let it = el.value();
1584 _visitor.visit_field_value(it)
1585 }
1586 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001587 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001588 };
1589 if let Some(ref it) = _i.rest {
1590 _visitor.visit_expr(&**it)
1591 };
1592}
1593#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001594pub fn visit_expr_try<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprTry) {
1595 for it in &_i.attrs {
1596 _visitor.visit_attribute(it)
1597 }
1598 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001599 tokens_helper(_visitor, &_i.question_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001600}
1601#[cfg(feature = "full")]
David Tolnayfb2dd4b2018-08-24 16:45:34 -04001602pub fn visit_expr_try_block<'ast, V: Visit<'ast> + ?Sized>(
1603 _visitor: &mut V,
1604 _i: &'ast ExprTryBlock,
1605) {
1606 for it in &_i.attrs {
1607 _visitor.visit_attribute(it)
1608 }
1609 tokens_helper(_visitor, &_i.try_token.span);
1610 _visitor.visit_block(&_i.block);
1611}
1612#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001613pub fn visit_expr_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprTuple) {
1614 for it in &_i.attrs {
1615 _visitor.visit_attribute(it)
1616 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001617 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001618 for el in Punctuated::pairs(&_i.elems) {
1619 let it = el.value();
1620 _visitor.visit_expr(it)
1621 }
1622}
1623#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001624pub fn visit_expr_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprType) {
1625 for it in &_i.attrs {
1626 _visitor.visit_attribute(it)
1627 }
1628 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001629 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001630 _visitor.visit_type(&*_i.ty);
1631}
David Tolnay440fe582019-02-15 20:23:14 -08001632#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001633pub fn visit_expr_unary<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprUnary) {
1634 for it in &_i.attrs {
1635 _visitor.visit_attribute(it)
1636 }
1637 _visitor.visit_un_op(&_i.op);
1638 _visitor.visit_expr(&*_i.expr);
1639}
1640#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001641pub fn visit_expr_unsafe<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprUnsafe) {
1642 for it in &_i.attrs {
1643 _visitor.visit_attribute(it)
1644 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001645 tokens_helper(_visitor, &_i.unsafe_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001646 _visitor.visit_block(&_i.block);
1647}
David Tolnay440fe582019-02-15 20:23:14 -08001648#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001649pub fn visit_expr_verbatim<'ast, V: Visit<'ast> + ?Sized>(
1650 _visitor: &mut V,
1651 _i: &'ast ExprVerbatim,
1652) {
David Tolnay6af48992018-08-01 11:16:28 -07001653 skip!(_i.tts);
David Tolnay8c81f622018-07-31 23:34:35 -07001654}
1655#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001656pub fn visit_expr_while<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprWhile) {
1657 for it in &_i.attrs {
1658 _visitor.visit_attribute(it)
1659 }
1660 if let Some(ref it) = _i.label {
1661 _visitor.visit_label(it)
1662 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001663 tokens_helper(_visitor, &_i.while_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001664 _visitor.visit_expr(&*_i.cond);
1665 _visitor.visit_block(&_i.body);
1666}
1667#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001668pub fn visit_expr_yield<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprYield) {
1669 for it in &_i.attrs {
1670 _visitor.visit_attribute(it)
1671 }
David Tolnay7ac699c2018-08-24 14:00:58 -04001672 tokens_helper(_visitor, &_i.yield_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001673 if let Some(ref it) = _i.expr {
1674 _visitor.visit_expr(&**it)
1675 };
1676}
David Tolnay440fe582019-02-15 20:23:14 -08001677#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001678pub fn visit_field<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Field) {
1679 for it in &_i.attrs {
1680 _visitor.visit_attribute(it)
1681 }
1682 _visitor.visit_visibility(&_i.vis);
1683 if let Some(ref it) = _i.ident {
1684 _visitor.visit_ident(it)
1685 };
1686 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001687 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001688 };
1689 _visitor.visit_type(&_i.ty);
1690}
David Tolnay8c81f622018-07-31 23:34:35 -07001691#[cfg(feature = "full")]
1692pub fn visit_field_pat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldPat) {
1693 for it in &_i.attrs {
1694 _visitor.visit_attribute(it)
1695 }
1696 _visitor.visit_member(&_i.member);
1697 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001698 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001699 };
1700 _visitor.visit_pat(&*_i.pat);
1701}
David Tolnay8c81f622018-07-31 23:34:35 -07001702#[cfg(feature = "full")]
1703pub fn visit_field_value<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldValue) {
1704 for it in &_i.attrs {
1705 _visitor.visit_attribute(it)
1706 }
1707 _visitor.visit_member(&_i.member);
1708 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001709 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001710 };
1711 _visitor.visit_expr(&_i.expr);
1712}
David Tolnay440fe582019-02-15 20:23:14 -08001713#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001714pub fn visit_fields<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Fields) {
1715 match *_i {
1716 Fields::Named(ref _binding_0) => {
1717 _visitor.visit_fields_named(_binding_0);
1718 }
1719 Fields::Unnamed(ref _binding_0) => {
1720 _visitor.visit_fields_unnamed(_binding_0);
1721 }
1722 Fields::Unit => {}
1723 }
1724}
David Tolnay440fe582019-02-15 20:23:14 -08001725#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001726pub fn visit_fields_named<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldsNamed) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001727 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001728 for el in Punctuated::pairs(&_i.named) {
1729 let it = el.value();
1730 _visitor.visit_field(it)
1731 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001732}
David Tolnay440fe582019-02-15 20:23:14 -08001733#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001734pub fn visit_fields_unnamed<'ast, V: Visit<'ast> + ?Sized>(
1735 _visitor: &mut V,
1736 _i: &'ast FieldsUnnamed,
1737) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001738 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001739 for el in Punctuated::pairs(&_i.unnamed) {
1740 let it = el.value();
1741 _visitor.visit_field(it)
1742 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001743}
David Tolnay8c81f622018-07-31 23:34:35 -07001744#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001745pub fn visit_file<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast File) {
David Tolnay6af48992018-08-01 11:16:28 -07001746 skip!(_i.shebang);
David Tolnay8c81f622018-07-31 23:34:35 -07001747 for it in &_i.attrs {
1748 _visitor.visit_attribute(it)
1749 }
1750 for it in &_i.items {
1751 _visitor.visit_item(it)
1752 }
Nika Layzell27726662017-10-24 23:16:35 -04001753}
David Tolnay8c81f622018-07-31 23:34:35 -07001754#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001755pub fn visit_fn_arg<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FnArg) {
Nika Layzell27726662017-10-24 23:16:35 -04001756 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001757 FnArg::SelfRef(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001758 _visitor.visit_arg_self_ref(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001759 }
David Tolnay8c81f622018-07-31 23:34:35 -07001760 FnArg::SelfValue(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001761 _visitor.visit_arg_self(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001762 }
David Tolnay8c81f622018-07-31 23:34:35 -07001763 FnArg::Captured(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001764 _visitor.visit_arg_captured(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001765 }
David Tolnay8c81f622018-07-31 23:34:35 -07001766 FnArg::Inferred(ref _binding_0) => {
David Tolnay80ed55f2017-12-27 22:54:40 -05001767 _visitor.visit_pat(_binding_0);
1768 }
David Tolnay8c81f622018-07-31 23:34:35 -07001769 FnArg::Ignored(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001770 _visitor.visit_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001771 }
1772 }
1773}
David Tolnay8c81f622018-07-31 23:34:35 -07001774#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001775pub fn visit_fn_decl<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FnDecl) {
David Tolnay7ac699c2018-08-24 14:00:58 -04001776 tokens_helper(_visitor, &_i.fn_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001777 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04001778 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001779 for el in Punctuated::pairs(&_i.inputs) {
1780 let it = el.value();
1781 _visitor.visit_fn_arg(it)
1782 }
1783 if let Some(ref it) = _i.variadic {
David Tolnay7ac699c2018-08-24 14:00:58 -04001784 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001785 };
1786 _visitor.visit_return_type(&_i.output);
Nika Layzell27726662017-10-24 23:16:35 -04001787}
David Tolnay8c81f622018-07-31 23:34:35 -07001788#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001789pub fn visit_foreign_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ForeignItem) {
Nika Layzell27726662017-10-24 23:16:35 -04001790 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001791 ForeignItem::Fn(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001792 _visitor.visit_foreign_item_fn(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001793 }
David Tolnay8c81f622018-07-31 23:34:35 -07001794 ForeignItem::Static(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001795 _visitor.visit_foreign_item_static(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001796 }
David Tolnay8c81f622018-07-31 23:34:35 -07001797 ForeignItem::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001798 _visitor.visit_foreign_item_type(_binding_0);
David Tolnay199bcbb2017-11-12 10:33:52 -08001799 }
David Tolnay435c1782018-08-24 16:15:44 -04001800 ForeignItem::Macro(ref _binding_0) => {
1801 _visitor.visit_foreign_item_macro(_binding_0);
1802 }
David Tolnay8c81f622018-07-31 23:34:35 -07001803 ForeignItem::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05001804 _visitor.visit_foreign_item_verbatim(_binding_0);
1805 }
Nika Layzell27726662017-10-24 23:16:35 -04001806 }
1807}
David Tolnay8c81f622018-07-31 23:34:35 -07001808#[cfg(feature = "full")]
1809pub fn visit_foreign_item_fn<'ast, V: Visit<'ast> + ?Sized>(
1810 _visitor: &mut V,
1811 _i: &'ast ForeignItemFn,
1812) {
1813 for it in &_i.attrs {
1814 _visitor.visit_attribute(it)
1815 }
1816 _visitor.visit_visibility(&_i.vis);
1817 _visitor.visit_ident(&_i.ident);
1818 _visitor.visit_fn_decl(&*_i.decl);
David Tolnay7ac699c2018-08-24 14:00:58 -04001819 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay8894f602017-11-11 12:11:04 -08001820}
David Tolnay8c81f622018-07-31 23:34:35 -07001821#[cfg(feature = "full")]
David Tolnay435c1782018-08-24 16:15:44 -04001822pub fn visit_foreign_item_macro<'ast, V: Visit<'ast> + ?Sized>(
1823 _visitor: &mut V,
1824 _i: &'ast ForeignItemMacro,
1825) {
1826 for it in &_i.attrs {
1827 _visitor.visit_attribute(it)
1828 }
1829 _visitor.visit_macro(&_i.mac);
1830 if let Some(ref it) = _i.semi_token {
1831 tokens_helper(_visitor, &it.spans)
1832 };
1833}
1834#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07001835pub fn visit_foreign_item_static<'ast, V: Visit<'ast> + ?Sized>(
1836 _visitor: &mut V,
1837 _i: &'ast ForeignItemStatic,
1838) {
1839 for it in &_i.attrs {
1840 _visitor.visit_attribute(it)
1841 }
1842 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04001843 tokens_helper(_visitor, &_i.static_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001844 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04001845 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001846 };
1847 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001848 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001849 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04001850 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04001851}
David Tolnay8c81f622018-07-31 23:34:35 -07001852#[cfg(feature = "full")]
1853pub fn visit_foreign_item_type<'ast, V: Visit<'ast> + ?Sized>(
1854 _visitor: &mut V,
1855 _i: &'ast ForeignItemType,
1856) {
1857 for it in &_i.attrs {
1858 _visitor.visit_attribute(it)
1859 }
1860 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04001861 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001862 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001863 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay199bcbb2017-11-12 10:33:52 -08001864}
David Tolnay8c81f622018-07-31 23:34:35 -07001865#[cfg(feature = "full")]
1866pub fn visit_foreign_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
1867 _visitor: &mut V,
1868 _i: &'ast ForeignItemVerbatim,
1869) {
David Tolnay6af48992018-08-01 11:16:28 -07001870 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05001871}
David Tolnay440fe582019-02-15 20:23:14 -08001872#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001873pub fn visit_generic_argument<'ast, V: Visit<'ast> + ?Sized>(
1874 _visitor: &mut V,
1875 _i: &'ast GenericArgument,
1876) {
Nika Layzell357885a2017-12-04 15:47:07 -05001877 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001878 GenericArgument::Lifetime(ref _binding_0) => {
David Tolnay4ba63a02017-12-28 15:53:05 -05001879 _visitor.visit_lifetime(_binding_0);
Nika Layzell357885a2017-12-04 15:47:07 -05001880 }
David Tolnay8c81f622018-07-31 23:34:35 -07001881 GenericArgument::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001882 _visitor.visit_type(_binding_0);
Nika Layzell357885a2017-12-04 15:47:07 -05001883 }
David Tolnay8c81f622018-07-31 23:34:35 -07001884 GenericArgument::Binding(ref _binding_0) => {
David Tolnay506e43a2017-12-29 11:34:36 -05001885 _visitor.visit_binding(_binding_0);
Nika Layzell357885a2017-12-04 15:47:07 -05001886 }
David Tolnay9d0882a2018-09-01 19:49:14 -07001887 GenericArgument::Constraint(ref _binding_0) => {
1888 _visitor.visit_constraint(_binding_0);
1889 }
David Tolnay8c81f622018-07-31 23:34:35 -07001890 GenericArgument::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001891 _visitor.visit_expr(_binding_0);
Nika Layzellc680e612017-12-04 19:07:20 -05001892 }
Nika Layzell357885a2017-12-04 15:47:07 -05001893 }
1894}
David Tolnay8c81f622018-07-31 23:34:35 -07001895#[cfg(feature = "full")]
1896pub fn visit_generic_method_argument<'ast, V: Visit<'ast> + ?Sized>(
1897 _visitor: &mut V,
1898 _i: &'ast GenericMethodArgument,
1899) {
David Tolnayd60cfec2017-12-29 00:21:38 -05001900 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001901 GenericMethodArgument::Type(ref _binding_0) => {
David Tolnayd60cfec2017-12-29 00:21:38 -05001902 _visitor.visit_type(_binding_0);
1903 }
David Tolnay8c81f622018-07-31 23:34:35 -07001904 GenericMethodArgument::Const(ref _binding_0) => {
David Tolnayd60cfec2017-12-29 00:21:38 -05001905 _visitor.visit_expr(_binding_0);
1906 }
1907 }
1908}
David Tolnay440fe582019-02-15 20:23:14 -08001909#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07001910pub fn visit_generic_param<'ast, V: Visit<'ast> + ?Sized>(
1911 _visitor: &mut V,
1912 _i: &'ast GenericParam,
1913) {
David Tolnayc2f1aba2017-11-12 20:29:22 -08001914 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001915 GenericParam::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001916 _visitor.visit_type_param(_binding_0);
David Tolnayc2f1aba2017-11-12 20:29:22 -08001917 }
David Tolnay8c81f622018-07-31 23:34:35 -07001918 GenericParam::Lifetime(ref _binding_0) => {
David Tolnay517f3692018-01-01 20:17:23 -08001919 _visitor.visit_lifetime_def(_binding_0);
1920 }
David Tolnay8c81f622018-07-31 23:34:35 -07001921 GenericParam::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001922 _visitor.visit_const_param(_binding_0);
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001923 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08001924 }
1925}
David Tolnay440fe582019-02-15 20:23:14 -08001926#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001927pub fn visit_generics<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Generics) {
David Tolnay8c81f622018-07-31 23:34:35 -07001928 if let Some(ref it) = _i.lt_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001929 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001930 };
1931 for el in Punctuated::pairs(&_i.params) {
1932 let it = el.value();
1933 _visitor.visit_generic_param(it)
1934 }
1935 if let Some(ref it) = _i.gt_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04001936 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07001937 };
1938 if let Some(ref it) = _i.where_clause {
1939 _visitor.visit_where_clause(it)
1940 };
Nika Layzell27726662017-10-24 23:16:35 -04001941}
David Tolnay8c81f622018-07-31 23:34:35 -07001942#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001943pub fn visit_impl_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ImplItem) {
Nika Layzell27726662017-10-24 23:16:35 -04001944 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07001945 ImplItem::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001946 _visitor.visit_impl_item_const(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001947 }
David Tolnay8c81f622018-07-31 23:34:35 -07001948 ImplItem::Method(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001949 _visitor.visit_impl_item_method(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001950 }
David Tolnay8c81f622018-07-31 23:34:35 -07001951 ImplItem::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001952 _visitor.visit_impl_item_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001953 }
David Tolnaybb82ef02018-08-24 20:15:45 -04001954 ImplItem::Existential(ref _binding_0) => {
1955 _visitor.visit_impl_item_existential(_binding_0);
1956 }
David Tolnay8c81f622018-07-31 23:34:35 -07001957 ImplItem::Macro(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05001958 _visitor.visit_impl_item_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04001959 }
David Tolnay8c81f622018-07-31 23:34:35 -07001960 ImplItem::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05001961 _visitor.visit_impl_item_verbatim(_binding_0);
1962 }
Nika Layzell27726662017-10-24 23:16:35 -04001963 }
1964}
David Tolnay8c81f622018-07-31 23:34:35 -07001965#[cfg(feature = "full")]
1966pub fn visit_impl_item_const<'ast, V: Visit<'ast> + ?Sized>(
1967 _visitor: &mut V,
1968 _i: &'ast ImplItemConst,
1969) {
1970 for it in &_i.attrs {
1971 _visitor.visit_attribute(it)
1972 }
1973 _visitor.visit_visibility(&_i.vis);
1974 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04001975 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07001976 };
David Tolnay7ac699c2018-08-24 14:00:58 -04001977 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07001978 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04001979 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001980 _visitor.visit_type(&_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04001981 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07001982 _visitor.visit_expr(&_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04001983 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay857628c2017-11-11 12:25:31 -08001984}
David Tolnay8c81f622018-07-31 23:34:35 -07001985#[cfg(feature = "full")]
David Tolnaybb82ef02018-08-24 20:15:45 -04001986pub fn visit_impl_item_existential<'ast, V: Visit<'ast> + ?Sized>(
1987 _visitor: &mut V,
1988 _i: &'ast ImplItemExistential,
1989) {
1990 for it in &_i.attrs {
1991 _visitor.visit_attribute(it)
1992 }
1993 tokens_helper(_visitor, &_i.existential_token.span);
1994 tokens_helper(_visitor, &_i.type_token.span);
1995 _visitor.visit_ident(&_i.ident);
1996 _visitor.visit_generics(&_i.generics);
1997 if let Some(ref it) = _i.colon_token {
1998 tokens_helper(_visitor, &it.spans)
1999 };
2000 for el in Punctuated::pairs(&_i.bounds) {
2001 let it = el.value();
2002 _visitor.visit_type_param_bound(it)
2003 }
2004 tokens_helper(_visitor, &_i.semi_token.spans);
2005}
2006#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07002007pub fn visit_impl_item_macro<'ast, V: Visit<'ast> + ?Sized>(
2008 _visitor: &mut V,
2009 _i: &'ast ImplItemMacro,
2010) {
2011 for it in &_i.attrs {
2012 _visitor.visit_attribute(it)
2013 }
2014 _visitor.visit_macro(&_i.mac);
2015 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002016 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002017 };
David Tolnay857628c2017-11-11 12:25:31 -08002018}
David Tolnay8c81f622018-07-31 23:34:35 -07002019#[cfg(feature = "full")]
2020pub fn visit_impl_item_method<'ast, V: Visit<'ast> + ?Sized>(
2021 _visitor: &mut V,
2022 _i: &'ast ImplItemMethod,
2023) {
2024 for it in &_i.attrs {
2025 _visitor.visit_attribute(it)
2026 }
2027 _visitor.visit_visibility(&_i.vis);
2028 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002029 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002030 };
2031 _visitor.visit_method_sig(&_i.sig);
2032 _visitor.visit_block(&_i.block);
Nika Layzell27726662017-10-24 23:16:35 -04002033}
David Tolnay8c81f622018-07-31 23:34:35 -07002034#[cfg(feature = "full")]
2035pub fn visit_impl_item_type<'ast, V: Visit<'ast> + ?Sized>(
2036 _visitor: &mut V,
2037 _i: &'ast ImplItemType,
2038) {
2039 for it in &_i.attrs {
2040 _visitor.visit_attribute(it)
2041 }
2042 _visitor.visit_visibility(&_i.vis);
2043 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002044 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002045 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002046 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002047 _visitor.visit_ident(&_i.ident);
2048 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04002049 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002050 _visitor.visit_type(&_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002051 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002052}
David Tolnay8c81f622018-07-31 23:34:35 -07002053#[cfg(feature = "full")]
2054pub fn visit_impl_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
2055 _visitor: &mut V,
2056 _i: &'ast ImplItemVerbatim,
2057) {
David Tolnay6af48992018-08-01 11:16:28 -07002058 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05002059}
David Tolnay440fe582019-02-15 20:23:14 -08002060#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002061pub fn visit_index<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Index) {
David Tolnay6af48992018-08-01 11:16:28 -07002062 skip!(_i.index);
David Tolnay8c81f622018-07-31 23:34:35 -07002063 _visitor.visit_span(&_i.span);
David Tolnay85b69a42017-12-27 20:43:10 -05002064}
David Tolnay8c81f622018-07-31 23:34:35 -07002065#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002066pub fn visit_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Item) {
Nika Layzell27726662017-10-24 23:16:35 -04002067 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002068 Item::ExternCrate(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002069 _visitor.visit_item_extern_crate(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002070 }
David Tolnay8c81f622018-07-31 23:34:35 -07002071 Item::Use(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002072 _visitor.visit_item_use(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002073 }
David Tolnay8c81f622018-07-31 23:34:35 -07002074 Item::Static(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002075 _visitor.visit_item_static(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002076 }
David Tolnay8c81f622018-07-31 23:34:35 -07002077 Item::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002078 _visitor.visit_item_const(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002079 }
David Tolnay8c81f622018-07-31 23:34:35 -07002080 Item::Fn(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002081 _visitor.visit_item_fn(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002082 }
David Tolnay8c81f622018-07-31 23:34:35 -07002083 Item::Mod(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002084 _visitor.visit_item_mod(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002085 }
David Tolnay8c81f622018-07-31 23:34:35 -07002086 Item::ForeignMod(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002087 _visitor.visit_item_foreign_mod(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002088 }
David Tolnay8c81f622018-07-31 23:34:35 -07002089 Item::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002090 _visitor.visit_item_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002091 }
David Tolnaybb82ef02018-08-24 20:15:45 -04002092 Item::Existential(ref _binding_0) => {
2093 _visitor.visit_item_existential(_binding_0);
2094 }
David Tolnay8c81f622018-07-31 23:34:35 -07002095 Item::Struct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002096 _visitor.visit_item_struct(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002097 }
David Tolnay8c81f622018-07-31 23:34:35 -07002098 Item::Enum(ref _binding_0) => {
David Tolnaye3d41b72017-12-31 15:24:00 -05002099 _visitor.visit_item_enum(_binding_0);
2100 }
David Tolnay8c81f622018-07-31 23:34:35 -07002101 Item::Union(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002102 _visitor.visit_item_union(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002103 }
David Tolnay8c81f622018-07-31 23:34:35 -07002104 Item::Trait(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002105 _visitor.visit_item_trait(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002106 }
David Tolnayc6b04dd2018-08-30 23:22:51 -07002107 Item::TraitAlias(ref _binding_0) => {
2108 _visitor.visit_item_trait_alias(_binding_0);
2109 }
David Tolnay8c81f622018-07-31 23:34:35 -07002110 Item::Impl(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002111 _visitor.visit_item_impl(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002112 }
David Tolnay8c81f622018-07-31 23:34:35 -07002113 Item::Macro(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002114 _visitor.visit_item_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002115 }
David Tolnay8c81f622018-07-31 23:34:35 -07002116 Item::Macro2(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002117 _visitor.visit_item_macro2(_binding_0);
David Tolnay500d8322017-12-18 00:32:51 -08002118 }
David Tolnay8c81f622018-07-31 23:34:35 -07002119 Item::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002120 _visitor.visit_item_verbatim(_binding_0);
2121 }
Nika Layzell27726662017-10-24 23:16:35 -04002122 }
2123}
David Tolnay8c81f622018-07-31 23:34:35 -07002124#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002125pub fn visit_item_const<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemConst) {
David Tolnay8c81f622018-07-31 23:34:35 -07002126 for it in &_i.attrs {
2127 _visitor.visit_attribute(it)
2128 }
2129 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002130 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002131 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002132 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002133 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002134 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002135 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04002136 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnayc6b55bc2017-11-09 22:48:38 -08002137}
David Tolnay8c81f622018-07-31 23:34:35 -07002138#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002139pub fn visit_item_enum<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemEnum) {
David Tolnay8c81f622018-07-31 23:34:35 -07002140 for it in &_i.attrs {
2141 _visitor.visit_attribute(it)
2142 }
2143 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002144 tokens_helper(_visitor, &_i.enum_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002145 _visitor.visit_ident(&_i.ident);
2146 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04002147 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002148 for el in Punctuated::pairs(&_i.variants) {
2149 let it = el.value();
2150 _visitor.visit_variant(it)
2151 }
David Tolnayc6b55bc2017-11-09 22:48:38 -08002152}
David Tolnay8c81f622018-07-31 23:34:35 -07002153#[cfg(feature = "full")]
David Tolnaybb82ef02018-08-24 20:15:45 -04002154pub fn visit_item_existential<'ast, V: Visit<'ast> + ?Sized>(
2155 _visitor: &mut V,
2156 _i: &'ast ItemExistential,
2157) {
2158 for it in &_i.attrs {
2159 _visitor.visit_attribute(it)
2160 }
2161 _visitor.visit_visibility(&_i.vis);
2162 tokens_helper(_visitor, &_i.existential_token.span);
2163 tokens_helper(_visitor, &_i.type_token.span);
2164 _visitor.visit_ident(&_i.ident);
2165 _visitor.visit_generics(&_i.generics);
2166 if let Some(ref it) = _i.colon_token {
2167 tokens_helper(_visitor, &it.spans)
2168 };
2169 for el in Punctuated::pairs(&_i.bounds) {
2170 let it = el.value();
2171 _visitor.visit_type_param_bound(it)
2172 }
2173 tokens_helper(_visitor, &_i.semi_token.spans);
2174}
2175#[cfg(feature = "full")]
David Tolnay8c81f622018-07-31 23:34:35 -07002176pub fn visit_item_extern_crate<'ast, V: Visit<'ast> + ?Sized>(
2177 _visitor: &mut V,
2178 _i: &'ast ItemExternCrate,
2179) {
2180 for it in &_i.attrs {
2181 _visitor.visit_attribute(it)
2182 }
2183 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002184 tokens_helper(_visitor, &_i.extern_token.span);
2185 tokens_helper(_visitor, &_i.crate_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002186 _visitor.visit_ident(&_i.ident);
2187 if let Some(ref it) = _i.rename {
David Tolnay7ac699c2018-08-24 14:00:58 -04002188 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002189 _visitor.visit_ident(&(it).1);
2190 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002191 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnayc6b55bc2017-11-09 22:48:38 -08002192}
David Tolnay8c81f622018-07-31 23:34:35 -07002193#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002194pub fn visit_item_fn<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemFn) {
David Tolnay8c81f622018-07-31 23:34:35 -07002195 for it in &_i.attrs {
2196 _visitor.visit_attribute(it)
2197 }
2198 _visitor.visit_visibility(&_i.vis);
2199 if let Some(ref it) = _i.constness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002200 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002201 };
2202 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002203 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002204 };
Yusuke Sasakif00a3ef2018-07-20 22:08:42 +09002205 if let Some(ref it) = _i.asyncness {
2206 tokens_helper(_visitor, &it.span)
2207 };
David Tolnay8c81f622018-07-31 23:34:35 -07002208 if let Some(ref it) = _i.abi {
2209 _visitor.visit_abi(it)
2210 };
2211 _visitor.visit_ident(&_i.ident);
2212 _visitor.visit_fn_decl(&*_i.decl);
2213 _visitor.visit_block(&*_i.block);
David Tolnayc6b55bc2017-11-09 22:48:38 -08002214}
David Tolnay8c81f622018-07-31 23:34:35 -07002215#[cfg(feature = "full")]
2216pub fn visit_item_foreign_mod<'ast, V: Visit<'ast> + ?Sized>(
2217 _visitor: &mut V,
2218 _i: &'ast ItemForeignMod,
2219) {
2220 for it in &_i.attrs {
2221 _visitor.visit_attribute(it)
2222 }
2223 _visitor.visit_abi(&_i.abi);
David Tolnay7ac699c2018-08-24 14:00:58 -04002224 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002225 for it in &_i.items {
2226 _visitor.visit_foreign_item(it)
2227 }
David Tolnayc6b55bc2017-11-09 22:48:38 -08002228}
David Tolnay8c81f622018-07-31 23:34:35 -07002229#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002230pub fn visit_item_impl<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemImpl) {
David Tolnay8c81f622018-07-31 23:34:35 -07002231 for it in &_i.attrs {
2232 _visitor.visit_attribute(it)
2233 }
2234 if let Some(ref it) = _i.defaultness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002235 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002236 };
2237 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002238 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002239 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002240 tokens_helper(_visitor, &_i.impl_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002241 _visitor.visit_generics(&_i.generics);
2242 if let Some(ref it) = _i.trait_ {
2243 if let Some(ref it) = (it).0 {
David Tolnay7ac699c2018-08-24 14:00:58 -04002244 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002245 };
2246 _visitor.visit_path(&(it).1);
David Tolnay7ac699c2018-08-24 14:00:58 -04002247 tokens_helper(_visitor, &(it).2.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002248 };
2249 _visitor.visit_type(&*_i.self_ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002250 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002251 for it in &_i.items {
2252 _visitor.visit_impl_item(it)
2253 }
David Tolnayc6b55bc2017-11-09 22:48:38 -08002254}
David Tolnay8c81f622018-07-31 23:34:35 -07002255#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002256pub fn visit_item_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemMacro) {
David Tolnay8c81f622018-07-31 23:34:35 -07002257 for it in &_i.attrs {
2258 _visitor.visit_attribute(it)
2259 }
2260 if let Some(ref it) = _i.ident {
2261 _visitor.visit_ident(it)
2262 };
2263 _visitor.visit_macro(&_i.mac);
2264 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002265 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002266 };
David Tolnayc6b55bc2017-11-09 22:48:38 -08002267}
David Tolnay8c81f622018-07-31 23:34:35 -07002268#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002269pub fn visit_item_macro2<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemMacro2) {
David Tolnay8c81f622018-07-31 23:34:35 -07002270 for it in &_i.attrs {
2271 _visitor.visit_attribute(it)
2272 }
2273 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002274 tokens_helper(_visitor, &_i.macro_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002275 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002276 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay6af48992018-08-01 11:16:28 -07002277 skip!(_i.args);
David Tolnay7ac699c2018-08-24 14:00:58 -04002278 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay6af48992018-08-01 11:16:28 -07002279 skip!(_i.body);
David Tolnay500d8322017-12-18 00:32:51 -08002280}
David Tolnay8c81f622018-07-31 23:34:35 -07002281#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002282pub fn visit_item_mod<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemMod) {
David Tolnay8c81f622018-07-31 23:34:35 -07002283 for it in &_i.attrs {
2284 _visitor.visit_attribute(it)
2285 }
2286 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002287 tokens_helper(_visitor, &_i.mod_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002288 _visitor.visit_ident(&_i.ident);
2289 if let Some(ref it) = _i.content {
David Tolnay7ac699c2018-08-24 14:00:58 -04002290 tokens_helper(_visitor, &(it).0.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002291 for it in &(it).1 {
2292 _visitor.visit_item(it)
2293 }
2294 };
2295 if let Some(ref it) = _i.semi {
David Tolnay7ac699c2018-08-24 14:00:58 -04002296 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002297 };
Nika Layzell27726662017-10-24 23:16:35 -04002298}
David Tolnay8c81f622018-07-31 23:34:35 -07002299#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002300pub fn visit_item_static<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemStatic) {
David Tolnay8c81f622018-07-31 23:34:35 -07002301 for it in &_i.attrs {
2302 _visitor.visit_attribute(it)
2303 }
2304 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002305 tokens_helper(_visitor, &_i.static_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002306 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04002307 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002308 };
2309 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002310 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002311 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002312 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002313 _visitor.visit_expr(&*_i.expr);
David Tolnay7ac699c2018-08-24 14:00:58 -04002314 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002315}
David Tolnay8c81f622018-07-31 23:34:35 -07002316#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002317pub fn visit_item_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemStruct) {
David Tolnay8c81f622018-07-31 23:34:35 -07002318 for it in &_i.attrs {
2319 _visitor.visit_attribute(it)
2320 }
2321 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002322 tokens_helper(_visitor, &_i.struct_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002323 _visitor.visit_ident(&_i.ident);
2324 _visitor.visit_generics(&_i.generics);
2325 _visitor.visit_fields(&_i.fields);
2326 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002327 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002328 };
Nika Layzell27726662017-10-24 23:16:35 -04002329}
David Tolnay8c81f622018-07-31 23:34:35 -07002330#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002331pub fn visit_item_trait<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemTrait) {
David Tolnay8c81f622018-07-31 23:34:35 -07002332 for it in &_i.attrs {
2333 _visitor.visit_attribute(it)
2334 }
2335 _visitor.visit_visibility(&_i.vis);
2336 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002337 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002338 };
2339 if let Some(ref it) = _i.auto_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002340 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002341 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002342 tokens_helper(_visitor, &_i.trait_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002343 _visitor.visit_ident(&_i.ident);
2344 _visitor.visit_generics(&_i.generics);
2345 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002346 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002347 };
2348 for el in Punctuated::pairs(&_i.supertraits) {
2349 let it = el.value();
2350 _visitor.visit_type_param_bound(it)
2351 }
David Tolnay7ac699c2018-08-24 14:00:58 -04002352 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002353 for it in &_i.items {
2354 _visitor.visit_trait_item(it)
2355 }
Nika Layzell27726662017-10-24 23:16:35 -04002356}
David Tolnay8c81f622018-07-31 23:34:35 -07002357#[cfg(feature = "full")]
David Tolnayc6b04dd2018-08-30 23:22:51 -07002358pub fn visit_item_trait_alias<'ast, V: Visit<'ast> + ?Sized>(
2359 _visitor: &mut V,
2360 _i: &'ast ItemTraitAlias,
2361) {
2362 for it in &_i.attrs {
2363 _visitor.visit_attribute(it)
2364 }
2365 _visitor.visit_visibility(&_i.vis);
2366 tokens_helper(_visitor, &_i.trait_token.span);
2367 _visitor.visit_ident(&_i.ident);
2368 _visitor.visit_generics(&_i.generics);
2369 tokens_helper(_visitor, &_i.eq_token.spans);
2370 for el in Punctuated::pairs(&_i.bounds) {
2371 let it = el.value();
2372 _visitor.visit_type_param_bound(it)
2373 }
2374 tokens_helper(_visitor, &_i.semi_token.spans);
2375}
2376#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002377pub fn visit_item_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemType) {
David Tolnay8c81f622018-07-31 23:34:35 -07002378 for it in &_i.attrs {
2379 _visitor.visit_attribute(it)
2380 }
2381 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002382 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002383 _visitor.visit_ident(&_i.ident);
2384 _visitor.visit_generics(&_i.generics);
David Tolnay7ac699c2018-08-24 14:00:58 -04002385 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002386 _visitor.visit_type(&*_i.ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002387 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002388}
David Tolnay8c81f622018-07-31 23:34:35 -07002389#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002390pub fn visit_item_union<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemUnion) {
David Tolnay8c81f622018-07-31 23:34:35 -07002391 for it in &_i.attrs {
2392 _visitor.visit_attribute(it)
2393 }
2394 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002395 tokens_helper(_visitor, &_i.union_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002396 _visitor.visit_ident(&_i.ident);
2397 _visitor.visit_generics(&_i.generics);
2398 _visitor.visit_fields_named(&_i.fields);
Nika Layzell27726662017-10-24 23:16:35 -04002399}
David Tolnay8c81f622018-07-31 23:34:35 -07002400#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002401pub fn visit_item_use<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemUse) {
David Tolnay8c81f622018-07-31 23:34:35 -07002402 for it in &_i.attrs {
2403 _visitor.visit_attribute(it)
2404 }
2405 _visitor.visit_visibility(&_i.vis);
David Tolnay7ac699c2018-08-24 14:00:58 -04002406 tokens_helper(_visitor, &_i.use_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002407 if let Some(ref it) = _i.leading_colon {
David Tolnay7ac699c2018-08-24 14:00:58 -04002408 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002409 };
2410 _visitor.visit_use_tree(&_i.tree);
David Tolnay7ac699c2018-08-24 14:00:58 -04002411 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002412}
David Tolnay8c81f622018-07-31 23:34:35 -07002413#[cfg(feature = "full")]
2414pub fn visit_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
2415 _visitor: &mut V,
2416 _i: &'ast ItemVerbatim,
2417) {
David Tolnay6af48992018-08-01 11:16:28 -07002418 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05002419}
David Tolnay8c81f622018-07-31 23:34:35 -07002420#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002421pub fn visit_label<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Label) {
David Tolnay8c81f622018-07-31 23:34:35 -07002422 _visitor.visit_lifetime(&_i.name);
David Tolnay7ac699c2018-08-24 14:00:58 -04002423 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnaybcd498f2017-12-29 12:02:33 -05002424}
David Tolnay4b4c4b62018-01-06 13:48:05 -08002425pub fn visit_lifetime<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Lifetime) {
David Tolnay17f63892018-08-31 10:36:32 -07002426 _visitor.visit_span(&_i.apostrophe);
David Tolnay8c81f622018-07-31 23:34:35 -07002427 _visitor.visit_ident(&_i.ident);
David Tolnay4ba63a02017-12-28 15:53:05 -05002428}
David Tolnay440fe582019-02-15 20:23:14 -08002429#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002430pub fn visit_lifetime_def<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LifetimeDef) {
David Tolnay8c81f622018-07-31 23:34:35 -07002431 for it in &_i.attrs {
2432 _visitor.visit_attribute(it)
2433 }
2434 _visitor.visit_lifetime(&_i.lifetime);
2435 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002436 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002437 };
2438 for el in Punctuated::pairs(&_i.bounds) {
2439 let it = el.value();
2440 _visitor.visit_lifetime(it)
2441 }
David Tolnay4ba63a02017-12-28 15:53:05 -05002442}
David Tolnay440fe582019-02-15 20:23:14 -08002443#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002444pub fn visit_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Lit) {
David Tolnay360efd22018-01-04 23:35:26 -08002445 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002446 Lit::Str(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002447 _visitor.visit_lit_str(_binding_0);
2448 }
David Tolnay8c81f622018-07-31 23:34:35 -07002449 Lit::ByteStr(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002450 _visitor.visit_lit_byte_str(_binding_0);
2451 }
David Tolnay8c81f622018-07-31 23:34:35 -07002452 Lit::Byte(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002453 _visitor.visit_lit_byte(_binding_0);
2454 }
David Tolnay8c81f622018-07-31 23:34:35 -07002455 Lit::Char(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002456 _visitor.visit_lit_char(_binding_0);
2457 }
David Tolnay8c81f622018-07-31 23:34:35 -07002458 Lit::Int(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002459 _visitor.visit_lit_int(_binding_0);
2460 }
David Tolnay8c81f622018-07-31 23:34:35 -07002461 Lit::Float(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002462 _visitor.visit_lit_float(_binding_0);
2463 }
David Tolnay8c81f622018-07-31 23:34:35 -07002464 Lit::Bool(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002465 _visitor.visit_lit_bool(_binding_0);
2466 }
David Tolnay8c81f622018-07-31 23:34:35 -07002467 Lit::Verbatim(ref _binding_0) => {
David Tolnay360efd22018-01-04 23:35:26 -08002468 _visitor.visit_lit_verbatim(_binding_0);
2469 }
2470 }
2471}
David Tolnay440fe582019-02-15 20:23:14 -08002472#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002473pub fn visit_lit_bool<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitBool) {
David Tolnay6af48992018-08-01 11:16:28 -07002474 skip!(_i.value);
David Tolnay8c81f622018-07-31 23:34:35 -07002475 _visitor.visit_span(&_i.span);
Nika Layzell27726662017-10-24 23:16:35 -04002476}
David Tolnay440fe582019-02-15 20:23:14 -08002477#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8964fff2019-02-15 14:34:51 -08002478pub fn visit_lit_byte<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitByte) {}
David Tolnay440fe582019-02-15 20:23:14 -08002479#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8964fff2019-02-15 14:34:51 -08002480pub fn visit_lit_byte_str<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitByteStr) {}
David Tolnay440fe582019-02-15 20:23:14 -08002481#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8964fff2019-02-15 14:34:51 -08002482pub fn visit_lit_char<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitChar) {}
David Tolnay440fe582019-02-15 20:23:14 -08002483#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8964fff2019-02-15 14:34:51 -08002484pub fn visit_lit_float<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitFloat) {}
David Tolnay440fe582019-02-15 20:23:14 -08002485#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8964fff2019-02-15 14:34:51 -08002486pub fn visit_lit_int<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitInt) {}
David Tolnay440fe582019-02-15 20:23:14 -08002487#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8964fff2019-02-15 14:34:51 -08002488pub fn visit_lit_str<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitStr) {}
David Tolnay440fe582019-02-15 20:23:14 -08002489#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002490pub fn visit_lit_verbatim<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitVerbatim) {
David Tolnay6af48992018-08-01 11:16:28 -07002491 skip!(_i.token);
David Tolnay360efd22018-01-04 23:35:26 -08002492}
David Tolnay8c81f622018-07-31 23:34:35 -07002493#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002494pub fn visit_local<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Local) {
David Tolnay8c81f622018-07-31 23:34:35 -07002495 for it in &_i.attrs {
2496 _visitor.visit_attribute(it)
2497 }
David Tolnay7ac699c2018-08-24 14:00:58 -04002498 tokens_helper(_visitor, &_i.let_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002499 for el in Punctuated::pairs(&_i.pats) {
2500 let it = el.value();
2501 _visitor.visit_pat(it)
2502 }
2503 if let Some(ref it) = _i.ty {
David Tolnay7ac699c2018-08-24 14:00:58 -04002504 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002505 _visitor.visit_type(&*(it).1);
2506 };
2507 if let Some(ref it) = _i.init {
David Tolnay7ac699c2018-08-24 14:00:58 -04002508 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002509 _visitor.visit_expr(&*(it).1);
2510 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002511 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002512}
David Tolnay440fe582019-02-15 20:23:14 -08002513#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002514pub fn visit_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Macro) {
David Tolnay8c81f622018-07-31 23:34:35 -07002515 _visitor.visit_path(&_i.path);
David Tolnay7ac699c2018-08-24 14:00:58 -04002516 tokens_helper(_visitor, &_i.bang_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002517 _visitor.visit_macro_delimiter(&_i.delimiter);
David Tolnay6af48992018-08-01 11:16:28 -07002518 skip!(_i.tts);
David Tolnayab919512017-12-30 23:31:51 -05002519}
David Tolnay440fe582019-02-15 20:23:14 -08002520#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07002521pub fn visit_macro_delimiter<'ast, V: Visit<'ast> + ?Sized>(
2522 _visitor: &mut V,
2523 _i: &'ast MacroDelimiter,
2524) {
David Tolnayab919512017-12-30 23:31:51 -05002525 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002526 MacroDelimiter::Paren(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002527 tokens_helper(_visitor, &_binding_0.span);
David Tolnayab919512017-12-30 23:31:51 -05002528 }
David Tolnay8c81f622018-07-31 23:34:35 -07002529 MacroDelimiter::Brace(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002530 tokens_helper(_visitor, &_binding_0.span);
David Tolnayab919512017-12-30 23:31:51 -05002531 }
David Tolnay8c81f622018-07-31 23:34:35 -07002532 MacroDelimiter::Bracket(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002533 tokens_helper(_visitor, &_binding_0.span);
David Tolnayab919512017-12-30 23:31:51 -05002534 }
2535 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002536}
David Tolnay440fe582019-02-15 20:23:14 -08002537#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002538pub fn visit_member<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Member) {
David Tolnay85b69a42017-12-27 20:43:10 -05002539 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002540 Member::Named(ref _binding_0) => {
Alex Crichtond261d092018-05-18 13:47:35 -07002541 _visitor.visit_ident(_binding_0);
David Tolnay85b69a42017-12-27 20:43:10 -05002542 }
David Tolnay8c81f622018-07-31 23:34:35 -07002543 Member::Unnamed(ref _binding_0) => {
David Tolnay85b69a42017-12-27 20:43:10 -05002544 _visitor.visit_index(_binding_0);
2545 }
2546 }
2547}
David Tolnay440fe582019-02-15 20:23:14 -08002548#[cfg(any(feature = "derive", feature = "full"))]
David Tolnayaaadd782018-01-06 22:58:13 -08002549pub fn visit_meta<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Meta) {
Nika Layzell27726662017-10-24 23:16:35 -04002550 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002551 Meta::Word(ref _binding_0) => {
Alex Crichtond261d092018-05-18 13:47:35 -07002552 _visitor.visit_ident(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002553 }
David Tolnay8c81f622018-07-31 23:34:35 -07002554 Meta::List(ref _binding_0) => {
David Tolnayaaadd782018-01-06 22:58:13 -08002555 _visitor.visit_meta_list(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002556 }
David Tolnay8c81f622018-07-31 23:34:35 -07002557 Meta::NameValue(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002558 _visitor.visit_meta_name_value(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002559 }
2560 }
2561}
David Tolnay440fe582019-02-15 20:23:14 -08002562#[cfg(any(feature = "derive", feature = "full"))]
David Tolnayaaadd782018-01-06 22:58:13 -08002563pub fn visit_meta_list<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast MetaList) {
David Tolnay8c81f622018-07-31 23:34:35 -07002564 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002565 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002566 for el in Punctuated::pairs(&_i.nested) {
2567 let it = el.value();
2568 _visitor.visit_nested_meta(it)
2569 }
Nika Layzell27726662017-10-24 23:16:35 -04002570}
David Tolnay440fe582019-02-15 20:23:14 -08002571#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07002572pub fn visit_meta_name_value<'ast, V: Visit<'ast> + ?Sized>(
2573 _visitor: &mut V,
2574 _i: &'ast MetaNameValue,
2575) {
2576 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002577 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002578 _visitor.visit_lit(&_i.lit);
Nika Layzell27726662017-10-24 23:16:35 -04002579}
David Tolnay8c81f622018-07-31 23:34:35 -07002580#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002581pub fn visit_method_sig<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast MethodSig) {
David Tolnay8c81f622018-07-31 23:34:35 -07002582 if let Some(ref it) = _i.constness {
David Tolnay7ac699c2018-08-24 14:00:58 -04002583 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002584 };
2585 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04002586 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002587 };
Yusuke Sasakif00a3ef2018-07-20 22:08:42 +09002588 if let Some(ref it) = _i.asyncness {
2589 tokens_helper(_visitor, &it.span)
2590 };
David Tolnay8c81f622018-07-31 23:34:35 -07002591 if let Some(ref it) = _i.abi {
2592 _visitor.visit_abi(it)
2593 };
2594 _visitor.visit_ident(&_i.ident);
2595 _visitor.visit_fn_decl(&_i.decl);
Nika Layzell27726662017-10-24 23:16:35 -04002596}
David Tolnay8c81f622018-07-31 23:34:35 -07002597#[cfg(feature = "full")]
2598pub fn visit_method_turbofish<'ast, V: Visit<'ast> + ?Sized>(
2599 _visitor: &mut V,
2600 _i: &'ast MethodTurbofish,
2601) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002602 tokens_helper(_visitor, &_i.colon2_token.spans);
2603 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002604 for el in Punctuated::pairs(&_i.args) {
2605 let it = el.value();
2606 _visitor.visit_generic_method_argument(it)
2607 }
David Tolnay7ac699c2018-08-24 14:00:58 -04002608 tokens_helper(_visitor, &_i.gt_token.spans);
David Tolnayd60cfec2017-12-29 00:21:38 -05002609}
David Tolnay440fe582019-02-15 20:23:14 -08002610#[cfg(any(feature = "derive", feature = "full"))]
David Tolnayaaadd782018-01-06 22:58:13 -08002611pub fn visit_nested_meta<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast NestedMeta) {
Nika Layzell27726662017-10-24 23:16:35 -04002612 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002613 NestedMeta::Meta(ref _binding_0) => {
David Tolnayaaadd782018-01-06 22:58:13 -08002614 _visitor.visit_meta(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002615 }
David Tolnay8c81f622018-07-31 23:34:35 -07002616 NestedMeta::Literal(ref _binding_0) => {
David Tolnay4ba63a02017-12-28 15:53:05 -05002617 _visitor.visit_lit(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002618 }
2619 }
2620}
David Tolnay440fe582019-02-15 20:23:14 -08002621#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07002622pub fn visit_parenthesized_generic_arguments<'ast, V: Visit<'ast> + ?Sized>(
2623 _visitor: &mut V,
2624 _i: &'ast ParenthesizedGenericArguments,
2625) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002626 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002627 for el in Punctuated::pairs(&_i.inputs) {
2628 let it = el.value();
2629 _visitor.visit_type(it)
2630 }
2631 _visitor.visit_return_type(&_i.output);
Nika Layzell27726662017-10-24 23:16:35 -04002632}
David Tolnay8c81f622018-07-31 23:34:35 -07002633#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002634pub fn visit_pat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Pat) {
Nika Layzell27726662017-10-24 23:16:35 -04002635 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002636 Pat::Wild(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002637 _visitor.visit_pat_wild(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002638 }
David Tolnay8c81f622018-07-31 23:34:35 -07002639 Pat::Ident(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002640 _visitor.visit_pat_ident(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002641 }
David Tolnay8c81f622018-07-31 23:34:35 -07002642 Pat::Struct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002643 _visitor.visit_pat_struct(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002644 }
David Tolnay8c81f622018-07-31 23:34:35 -07002645 Pat::TupleStruct(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002646 _visitor.visit_pat_tuple_struct(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002647 }
David Tolnay8c81f622018-07-31 23:34:35 -07002648 Pat::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002649 _visitor.visit_pat_path(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002650 }
David Tolnay8c81f622018-07-31 23:34:35 -07002651 Pat::Tuple(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002652 _visitor.visit_pat_tuple(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002653 }
David Tolnay8c81f622018-07-31 23:34:35 -07002654 Pat::Box(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002655 _visitor.visit_pat_box(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002656 }
David Tolnay8c81f622018-07-31 23:34:35 -07002657 Pat::Ref(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002658 _visitor.visit_pat_ref(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002659 }
David Tolnay8c81f622018-07-31 23:34:35 -07002660 Pat::Lit(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002661 _visitor.visit_pat_lit(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002662 }
David Tolnay8c81f622018-07-31 23:34:35 -07002663 Pat::Range(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002664 _visitor.visit_pat_range(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002665 }
David Tolnay8c81f622018-07-31 23:34:35 -07002666 Pat::Slice(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002667 _visitor.visit_pat_slice(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002668 }
David Tolnay8c81f622018-07-31 23:34:35 -07002669 Pat::Macro(ref _binding_0) => {
David Tolnay323279a2017-12-29 11:26:32 -05002670 _visitor.visit_pat_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002671 }
David Tolnay8c81f622018-07-31 23:34:35 -07002672 Pat::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002673 _visitor.visit_pat_verbatim(_binding_0);
2674 }
Nika Layzell27726662017-10-24 23:16:35 -04002675 }
2676}
David Tolnay8c81f622018-07-31 23:34:35 -07002677#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002678pub fn visit_pat_box<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatBox) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002679 tokens_helper(_visitor, &_i.box_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002680 _visitor.visit_pat(&*_i.pat);
Nika Layzell27726662017-10-24 23:16:35 -04002681}
David Tolnay8c81f622018-07-31 23:34:35 -07002682#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002683pub fn visit_pat_ident<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatIdent) {
David Tolnay8c81f622018-07-31 23:34:35 -07002684 if let Some(ref it) = _i.by_ref {
David Tolnay7ac699c2018-08-24 14:00:58 -04002685 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002686 };
2687 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04002688 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002689 };
2690 _visitor.visit_ident(&_i.ident);
2691 if let Some(ref it) = _i.subpat {
David Tolnay7ac699c2018-08-24 14:00:58 -04002692 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002693 _visitor.visit_pat(&*(it).1);
2694 };
Nika Layzell27726662017-10-24 23:16:35 -04002695}
David Tolnay8c81f622018-07-31 23:34:35 -07002696#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002697pub fn visit_pat_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatLit) {
David Tolnay8c81f622018-07-31 23:34:35 -07002698 _visitor.visit_expr(&*_i.expr);
Nika Layzell27726662017-10-24 23:16:35 -04002699}
David Tolnay8c81f622018-07-31 23:34:35 -07002700#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002701pub fn visit_pat_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatMacro) {
David Tolnay8c81f622018-07-31 23:34:35 -07002702 _visitor.visit_macro(&_i.mac);
David Tolnay323279a2017-12-29 11:26:32 -05002703}
David Tolnay8c81f622018-07-31 23:34:35 -07002704#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002705pub fn visit_pat_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatPath) {
David Tolnay8c81f622018-07-31 23:34:35 -07002706 if let Some(ref it) = _i.qself {
2707 _visitor.visit_qself(it)
2708 };
2709 _visitor.visit_path(&_i.path);
Nika Layzell27726662017-10-24 23:16:35 -04002710}
David Tolnay8c81f622018-07-31 23:34:35 -07002711#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002712pub fn visit_pat_range<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatRange) {
David Tolnay8c81f622018-07-31 23:34:35 -07002713 _visitor.visit_expr(&*_i.lo);
2714 _visitor.visit_range_limits(&_i.limits);
2715 _visitor.visit_expr(&*_i.hi);
Nika Layzell27726662017-10-24 23:16:35 -04002716}
David Tolnay8c81f622018-07-31 23:34:35 -07002717#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002718pub fn visit_pat_ref<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatRef) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002719 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002720 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04002721 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002722 };
2723 _visitor.visit_pat(&*_i.pat);
Nika Layzell27726662017-10-24 23:16:35 -04002724}
David Tolnay8c81f622018-07-31 23:34:35 -07002725#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002726pub fn visit_pat_slice<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatSlice) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002727 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002728 for el in Punctuated::pairs(&_i.front) {
2729 let it = el.value();
2730 _visitor.visit_pat(it)
2731 }
2732 if let Some(ref it) = _i.middle {
2733 _visitor.visit_pat(&**it)
2734 };
2735 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002736 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002737 };
2738 if let Some(ref it) = _i.comma_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002739 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002740 };
2741 for el in Punctuated::pairs(&_i.back) {
2742 let it = el.value();
2743 _visitor.visit_pat(it)
2744 }
Nika Layzell27726662017-10-24 23:16:35 -04002745}
David Tolnay8c81f622018-07-31 23:34:35 -07002746#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002747pub fn visit_pat_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatStruct) {
David Tolnay8c81f622018-07-31 23:34:35 -07002748 _visitor.visit_path(&_i.path);
David Tolnay7ac699c2018-08-24 14:00:58 -04002749 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002750 for el in Punctuated::pairs(&_i.fields) {
2751 let it = el.value();
2752 _visitor.visit_field_pat(it)
2753 }
2754 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002755 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002756 };
Nika Layzell27726662017-10-24 23:16:35 -04002757}
David Tolnay8c81f622018-07-31 23:34:35 -07002758#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002759pub fn visit_pat_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatTuple) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002760 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002761 for el in Punctuated::pairs(&_i.front) {
2762 let it = el.value();
2763 _visitor.visit_pat(it)
2764 }
2765 if let Some(ref it) = _i.dot2_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002766 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002767 };
2768 if let Some(ref it) = _i.comma_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002769 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002770 };
2771 for el in Punctuated::pairs(&_i.back) {
2772 let it = el.value();
2773 _visitor.visit_pat(it)
2774 }
Nika Layzell27726662017-10-24 23:16:35 -04002775}
David Tolnay8c81f622018-07-31 23:34:35 -07002776#[cfg(feature = "full")]
2777pub fn visit_pat_tuple_struct<'ast, V: Visit<'ast> + ?Sized>(
2778 _visitor: &mut V,
2779 _i: &'ast PatTupleStruct,
2780) {
2781 _visitor.visit_path(&_i.path);
2782 _visitor.visit_pat_tuple(&_i.pat);
Nika Layzell27726662017-10-24 23:16:35 -04002783}
David Tolnay8c81f622018-07-31 23:34:35 -07002784#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002785pub fn visit_pat_verbatim<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatVerbatim) {
David Tolnay6af48992018-08-01 11:16:28 -07002786 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05002787}
David Tolnay8c81f622018-07-31 23:34:35 -07002788#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002789pub fn visit_pat_wild<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatWild) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002790 tokens_helper(_visitor, &_i.underscore_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002791}
David Tolnay440fe582019-02-15 20:23:14 -08002792#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002793pub fn visit_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Path) {
David Tolnay8c81f622018-07-31 23:34:35 -07002794 if let Some(ref it) = _i.leading_colon {
David Tolnay7ac699c2018-08-24 14:00:58 -04002795 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002796 };
2797 for el in Punctuated::pairs(&_i.segments) {
2798 let it = el.value();
2799 _visitor.visit_path_segment(it)
2800 }
Nika Layzell27726662017-10-24 23:16:35 -04002801}
David Tolnay440fe582019-02-15 20:23:14 -08002802#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07002803pub fn visit_path_arguments<'ast, V: Visit<'ast> + ?Sized>(
2804 _visitor: &mut V,
2805 _i: &'ast PathArguments,
2806) {
Nika Layzellc08227a2017-12-04 16:30:17 -05002807 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002808 PathArguments::None => {}
2809 PathArguments::AngleBracketed(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002810 _visitor.visit_angle_bracketed_generic_arguments(_binding_0);
Nika Layzellc08227a2017-12-04 16:30:17 -05002811 }
David Tolnay8c81f622018-07-31 23:34:35 -07002812 PathArguments::Parenthesized(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002813 _visitor.visit_parenthesized_generic_arguments(_binding_0);
Nika Layzellc08227a2017-12-04 16:30:17 -05002814 }
2815 }
2816}
David Tolnay440fe582019-02-15 20:23:14 -08002817#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002818pub fn visit_path_segment<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PathSegment) {
David Tolnay8c81f622018-07-31 23:34:35 -07002819 _visitor.visit_ident(&_i.ident);
2820 _visitor.visit_path_arguments(&_i.arguments);
Nika Layzell27726662017-10-24 23:16:35 -04002821}
David Tolnay440fe582019-02-15 20:23:14 -08002822#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002823pub fn visit_predicate_eq<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PredicateEq) {
David Tolnay8c81f622018-07-31 23:34:35 -07002824 _visitor.visit_type(&_i.lhs_ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002825 tokens_helper(_visitor, &_i.eq_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002826 _visitor.visit_type(&_i.rhs_ty);
David Tolnayd4add852018-01-01 20:13:24 -08002827}
David Tolnay440fe582019-02-15 20:23:14 -08002828#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07002829pub fn visit_predicate_lifetime<'ast, V: Visit<'ast> + ?Sized>(
2830 _visitor: &mut V,
2831 _i: &'ast PredicateLifetime,
2832) {
2833 _visitor.visit_lifetime(&_i.lifetime);
David Tolnay1b8e2852018-08-26 08:25:18 -04002834 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002835 for el in Punctuated::pairs(&_i.bounds) {
2836 let it = el.value();
2837 _visitor.visit_lifetime(it)
2838 }
David Tolnayd4add852018-01-01 20:13:24 -08002839}
David Tolnay440fe582019-02-15 20:23:14 -08002840#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07002841pub fn visit_predicate_type<'ast, V: Visit<'ast> + ?Sized>(
2842 _visitor: &mut V,
2843 _i: &'ast PredicateType,
2844) {
2845 if let Some(ref it) = _i.lifetimes {
2846 _visitor.visit_bound_lifetimes(it)
2847 };
2848 _visitor.visit_type(&_i.bounded_ty);
David Tolnay7ac699c2018-08-24 14:00:58 -04002849 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002850 for el in Punctuated::pairs(&_i.bounds) {
2851 let it = el.value();
2852 _visitor.visit_type_param_bound(it)
2853 }
David Tolnayd4add852018-01-01 20:13:24 -08002854}
David Tolnay440fe582019-02-15 20:23:14 -08002855#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002856pub fn visit_qself<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast QSelf) {
David Tolnay7ac699c2018-08-24 14:00:58 -04002857 tokens_helper(_visitor, &_i.lt_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002858 _visitor.visit_type(&*_i.ty);
David Tolnay6af48992018-08-01 11:16:28 -07002859 skip!(_i.position);
David Tolnay8c81f622018-07-31 23:34:35 -07002860 if let Some(ref it) = _i.as_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002861 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002862 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002863 tokens_helper(_visitor, &_i.gt_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002864}
David Tolnay8c81f622018-07-31 23:34:35 -07002865#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002866pub fn visit_range_limits<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast RangeLimits) {
Nika Layzell27726662017-10-24 23:16:35 -04002867 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002868 RangeLimits::HalfOpen(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002869 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002870 }
David Tolnay8c81f622018-07-31 23:34:35 -07002871 RangeLimits::Closed(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002872 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002873 }
2874 }
2875}
David Tolnay440fe582019-02-15 20:23:14 -08002876#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002877pub fn visit_return_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ReturnType) {
David Tolnayf93b90d2017-11-11 19:21:26 -08002878 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002879 ReturnType::Default => {}
2880 ReturnType::Type(ref _binding_0, ref _binding_1) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002881 tokens_helper(_visitor, &_binding_0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002882 _visitor.visit_type(&**_binding_1);
David Tolnayf93b90d2017-11-11 19:21:26 -08002883 }
2884 }
2885}
David Tolnay8c81f622018-07-31 23:34:35 -07002886#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002887pub fn visit_stmt<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Stmt) {
Nika Layzell27726662017-10-24 23:16:35 -04002888 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002889 Stmt::Local(ref _binding_0) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08002890 _visitor.visit_local(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002891 }
David Tolnay8c81f622018-07-31 23:34:35 -07002892 Stmt::Item(ref _binding_0) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08002893 _visitor.visit_item(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002894 }
David Tolnay8c81f622018-07-31 23:34:35 -07002895 Stmt::Expr(ref _binding_0) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08002896 _visitor.visit_expr(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002897 }
David Tolnay8c81f622018-07-31 23:34:35 -07002898 Stmt::Semi(ref _binding_0, ref _binding_1) => {
David Tolnay1f0b7b82018-01-06 16:07:14 -08002899 _visitor.visit_expr(_binding_0);
David Tolnay7ac699c2018-08-24 14:00:58 -04002900 tokens_helper(_visitor, &_binding_1.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002901 }
Nika Layzell27726662017-10-24 23:16:35 -04002902 }
2903}
David Tolnay440fe582019-02-15 20:23:14 -08002904#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002905pub fn visit_trait_bound<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TraitBound) {
David Tolnay8c81f622018-07-31 23:34:35 -07002906 if let Some(ref it) = _i.paren_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002907 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07002908 };
2909 _visitor.visit_trait_bound_modifier(&_i.modifier);
2910 if let Some(ref it) = _i.lifetimes {
2911 _visitor.visit_bound_lifetimes(it)
2912 };
2913 _visitor.visit_path(&_i.path);
David Tolnay40fb8ce2018-01-02 10:53:46 -08002914}
David Tolnay440fe582019-02-15 20:23:14 -08002915#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07002916pub fn visit_trait_bound_modifier<'ast, V: Visit<'ast> + ?Sized>(
2917 _visitor: &mut V,
2918 _i: &'ast TraitBoundModifier,
2919) {
Nika Layzell27726662017-10-24 23:16:35 -04002920 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002921 TraitBoundModifier::None => {}
2922 TraitBoundModifier::Maybe(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04002923 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04002924 }
2925 }
2926}
David Tolnay8c81f622018-07-31 23:34:35 -07002927#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002928pub fn visit_trait_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TraitItem) {
Nika Layzell27726662017-10-24 23:16:35 -04002929 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07002930 TraitItem::Const(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002931 _visitor.visit_trait_item_const(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002932 }
David Tolnay8c81f622018-07-31 23:34:35 -07002933 TraitItem::Method(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002934 _visitor.visit_trait_item_method(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002935 }
David Tolnay8c81f622018-07-31 23:34:35 -07002936 TraitItem::Type(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002937 _visitor.visit_trait_item_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002938 }
David Tolnay8c81f622018-07-31 23:34:35 -07002939 TraitItem::Macro(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05002940 _visitor.visit_trait_item_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04002941 }
David Tolnay8c81f622018-07-31 23:34:35 -07002942 TraitItem::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05002943 _visitor.visit_trait_item_verbatim(_binding_0);
2944 }
Nika Layzell27726662017-10-24 23:16:35 -04002945 }
2946}
David Tolnay8c81f622018-07-31 23:34:35 -07002947#[cfg(feature = "full")]
2948pub fn visit_trait_item_const<'ast, V: Visit<'ast> + ?Sized>(
2949 _visitor: &mut V,
2950 _i: &'ast TraitItemConst,
2951) {
2952 for it in &_i.attrs {
2953 _visitor.visit_attribute(it)
2954 }
David Tolnay7ac699c2018-08-24 14:00:58 -04002955 tokens_helper(_visitor, &_i.const_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07002956 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04002957 tokens_helper(_visitor, &_i.colon_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002958 _visitor.visit_type(&_i.ty);
2959 if let Some(ref it) = _i.default {
David Tolnay7ac699c2018-08-24 14:00:58 -04002960 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07002961 _visitor.visit_expr(&(it).1);
2962 };
David Tolnay7ac699c2018-08-24 14:00:58 -04002963 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnayda705bd2017-11-10 21:58:05 -08002964}
David Tolnay8c81f622018-07-31 23:34:35 -07002965#[cfg(feature = "full")]
2966pub fn visit_trait_item_macro<'ast, V: Visit<'ast> + ?Sized>(
2967 _visitor: &mut V,
2968 _i: &'ast TraitItemMacro,
2969) {
2970 for it in &_i.attrs {
2971 _visitor.visit_attribute(it)
2972 }
2973 _visitor.visit_macro(&_i.mac);
2974 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002975 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002976 };
David Tolnayda705bd2017-11-10 21:58:05 -08002977}
David Tolnay8c81f622018-07-31 23:34:35 -07002978#[cfg(feature = "full")]
2979pub fn visit_trait_item_method<'ast, V: Visit<'ast> + ?Sized>(
2980 _visitor: &mut V,
2981 _i: &'ast TraitItemMethod,
2982) {
2983 for it in &_i.attrs {
2984 _visitor.visit_attribute(it)
2985 }
2986 _visitor.visit_method_sig(&_i.sig);
2987 if let Some(ref it) = _i.default {
2988 _visitor.visit_block(it)
2989 };
2990 if let Some(ref it) = _i.semi_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04002991 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07002992 };
Nika Layzell27726662017-10-24 23:16:35 -04002993}
David Tolnay8c81f622018-07-31 23:34:35 -07002994#[cfg(feature = "full")]
2995pub fn visit_trait_item_type<'ast, V: Visit<'ast> + ?Sized>(
2996 _visitor: &mut V,
2997 _i: &'ast TraitItemType,
2998) {
2999 for it in &_i.attrs {
3000 _visitor.visit_attribute(it)
3001 }
David Tolnay7ac699c2018-08-24 14:00:58 -04003002 tokens_helper(_visitor, &_i.type_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003003 _visitor.visit_ident(&_i.ident);
3004 _visitor.visit_generics(&_i.generics);
3005 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003006 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003007 };
3008 for el in Punctuated::pairs(&_i.bounds) {
3009 let it = el.value();
3010 _visitor.visit_type_param_bound(it)
3011 }
3012 if let Some(ref it) = _i.default {
David Tolnay7ac699c2018-08-24 14:00:58 -04003013 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003014 _visitor.visit_type(&(it).1);
3015 };
David Tolnay7ac699c2018-08-24 14:00:58 -04003016 tokens_helper(_visitor, &_i.semi_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003017}
David Tolnay8c81f622018-07-31 23:34:35 -07003018#[cfg(feature = "full")]
3019pub fn visit_trait_item_verbatim<'ast, V: Visit<'ast> + ?Sized>(
3020 _visitor: &mut V,
3021 _i: &'ast TraitItemVerbatim,
3022) {
David Tolnay6af48992018-08-01 11:16:28 -07003023 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05003024}
David Tolnay440fe582019-02-15 20:23:14 -08003025#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003026pub fn visit_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Type) {
Nika Layzell27726662017-10-24 23:16:35 -04003027 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003028 Type::Slice(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003029 _visitor.visit_type_slice(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003030 }
David Tolnay8c81f622018-07-31 23:34:35 -07003031 Type::Array(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003032 _visitor.visit_type_array(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003033 }
David Tolnay8c81f622018-07-31 23:34:35 -07003034 Type::Ptr(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003035 _visitor.visit_type_ptr(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003036 }
David Tolnay8c81f622018-07-31 23:34:35 -07003037 Type::Reference(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003038 _visitor.visit_type_reference(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003039 }
David Tolnay8c81f622018-07-31 23:34:35 -07003040 Type::BareFn(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003041 _visitor.visit_type_bare_fn(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003042 }
David Tolnay8c81f622018-07-31 23:34:35 -07003043 Type::Never(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003044 _visitor.visit_type_never(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003045 }
David Tolnay8c81f622018-07-31 23:34:35 -07003046 Type::Tuple(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003047 _visitor.visit_type_tuple(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003048 }
David Tolnay8c81f622018-07-31 23:34:35 -07003049 Type::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003050 _visitor.visit_type_path(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003051 }
David Tolnay8c81f622018-07-31 23:34:35 -07003052 Type::TraitObject(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003053 _visitor.visit_type_trait_object(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003054 }
David Tolnay8c81f622018-07-31 23:34:35 -07003055 Type::ImplTrait(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003056 _visitor.visit_type_impl_trait(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003057 }
David Tolnay8c81f622018-07-31 23:34:35 -07003058 Type::Paren(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003059 _visitor.visit_type_paren(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003060 }
David Tolnay8c81f622018-07-31 23:34:35 -07003061 Type::Group(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003062 _visitor.visit_type_group(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003063 }
David Tolnay8c81f622018-07-31 23:34:35 -07003064 Type::Infer(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003065 _visitor.visit_type_infer(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003066 }
David Tolnay8c81f622018-07-31 23:34:35 -07003067 Type::Macro(ref _binding_0) => {
David Tolnay323279a2017-12-29 11:26:32 -05003068 _visitor.visit_type_macro(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003069 }
David Tolnay8c81f622018-07-31 23:34:35 -07003070 Type::Verbatim(ref _binding_0) => {
David Tolnay2ae520a2017-12-29 11:19:50 -05003071 _visitor.visit_type_verbatim(_binding_0);
3072 }
Nika Layzell27726662017-10-24 23:16:35 -04003073 }
3074}
David Tolnay440fe582019-02-15 20:23:14 -08003075#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003076pub fn visit_type_array<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeArray) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003077 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003078 _visitor.visit_type(&*_i.elem);
David Tolnay7ac699c2018-08-24 14:00:58 -04003079 tokens_helper(_visitor, &_i.semi_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003080 _visitor.visit_expr(&_i.len);
Nika Layzell27726662017-10-24 23:16:35 -04003081}
David Tolnay440fe582019-02-15 20:23:14 -08003082#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003083pub fn visit_type_bare_fn<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeBareFn) {
David Tolnay3779bb72018-08-26 18:46:07 -07003084 if let Some(ref it) = _i.lifetimes {
3085 _visitor.visit_bound_lifetimes(it)
3086 };
David Tolnay8c81f622018-07-31 23:34:35 -07003087 if let Some(ref it) = _i.unsafety {
David Tolnay7ac699c2018-08-24 14:00:58 -04003088 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003089 };
3090 if let Some(ref it) = _i.abi {
3091 _visitor.visit_abi(it)
3092 };
David Tolnay7ac699c2018-08-24 14:00:58 -04003093 tokens_helper(_visitor, &_i.fn_token.span);
David Tolnay7ac699c2018-08-24 14:00:58 -04003094 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003095 for el in Punctuated::pairs(&_i.inputs) {
3096 let it = el.value();
3097 _visitor.visit_bare_fn_arg(it)
3098 }
3099 if let Some(ref it) = _i.variadic {
David Tolnay7ac699c2018-08-24 14:00:58 -04003100 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003101 };
3102 _visitor.visit_return_type(&_i.output);
Nika Layzell27726662017-10-24 23:16:35 -04003103}
David Tolnay440fe582019-02-15 20:23:14 -08003104#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003105pub fn visit_type_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeGroup) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003106 tokens_helper(_visitor, &_i.group_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003107 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003108}
David Tolnay440fe582019-02-15 20:23:14 -08003109#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07003110pub fn visit_type_impl_trait<'ast, V: Visit<'ast> + ?Sized>(
3111 _visitor: &mut V,
3112 _i: &'ast TypeImplTrait,
3113) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003114 tokens_helper(_visitor, &_i.impl_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003115 for el in Punctuated::pairs(&_i.bounds) {
3116 let it = el.value();
3117 _visitor.visit_type_param_bound(it)
3118 }
Nika Layzell27726662017-10-24 23:16:35 -04003119}
David Tolnay440fe582019-02-15 20:23:14 -08003120#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003121pub fn visit_type_infer<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeInfer) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003122 tokens_helper(_visitor, &_i.underscore_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003123}
David Tolnay440fe582019-02-15 20:23:14 -08003124#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003125pub fn visit_type_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeMacro) {
David Tolnay8c81f622018-07-31 23:34:35 -07003126 _visitor.visit_macro(&_i.mac);
David Tolnay323279a2017-12-29 11:26:32 -05003127}
David Tolnay440fe582019-02-15 20:23:14 -08003128#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003129pub fn visit_type_never<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeNever) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003130 tokens_helper(_visitor, &_i.bang_token.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003131}
David Tolnay440fe582019-02-15 20:23:14 -08003132#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003133pub fn visit_type_param<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeParam) {
David Tolnay8c81f622018-07-31 23:34:35 -07003134 for it in &_i.attrs {
3135 _visitor.visit_attribute(it)
3136 }
3137 _visitor.visit_ident(&_i.ident);
3138 if let Some(ref it) = _i.colon_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003139 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003140 };
3141 for el in Punctuated::pairs(&_i.bounds) {
3142 let it = el.value();
3143 _visitor.visit_type_param_bound(it)
3144 }
3145 if let Some(ref it) = _i.eq_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003146 tokens_helper(_visitor, &it.spans)
David Tolnay8c81f622018-07-31 23:34:35 -07003147 };
3148 if let Some(ref it) = _i.default {
3149 _visitor.visit_type(it)
3150 };
Nika Layzell27726662017-10-24 23:16:35 -04003151}
David Tolnay440fe582019-02-15 20:23:14 -08003152#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07003153pub fn visit_type_param_bound<'ast, V: Visit<'ast> + ?Sized>(
3154 _visitor: &mut V,
3155 _i: &'ast TypeParamBound,
3156) {
Nika Layzell27726662017-10-24 23:16:35 -04003157 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003158 TypeParamBound::Trait(ref _binding_0) => {
David Tolnay40fb8ce2018-01-02 10:53:46 -08003159 _visitor.visit_trait_bound(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003160 }
David Tolnay8c81f622018-07-31 23:34:35 -07003161 TypeParamBound::Lifetime(ref _binding_0) => {
David Tolnay4ba63a02017-12-28 15:53:05 -05003162 _visitor.visit_lifetime(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003163 }
3164 }
3165}
David Tolnay440fe582019-02-15 20:23:14 -08003166#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003167pub fn visit_type_paren<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeParen) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003168 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003169 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003170}
David Tolnay440fe582019-02-15 20:23:14 -08003171#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003172pub fn visit_type_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypePath) {
David Tolnay8c81f622018-07-31 23:34:35 -07003173 if let Some(ref it) = _i.qself {
3174 _visitor.visit_qself(it)
3175 };
3176 _visitor.visit_path(&_i.path);
Nika Layzell27726662017-10-24 23:16:35 -04003177}
David Tolnay440fe582019-02-15 20:23:14 -08003178#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003179pub fn visit_type_ptr<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypePtr) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003180 tokens_helper(_visitor, &_i.star_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003181 if let Some(ref it) = _i.const_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003182 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003183 };
3184 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04003185 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003186 };
3187 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003188}
David Tolnay440fe582019-02-15 20:23:14 -08003189#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07003190pub fn visit_type_reference<'ast, V: Visit<'ast> + ?Sized>(
3191 _visitor: &mut V,
3192 _i: &'ast TypeReference,
3193) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003194 tokens_helper(_visitor, &_i.and_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003195 if let Some(ref it) = _i.lifetime {
3196 _visitor.visit_lifetime(it)
3197 };
3198 if let Some(ref it) = _i.mutability {
David Tolnay7ac699c2018-08-24 14:00:58 -04003199 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003200 };
3201 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003202}
David Tolnay440fe582019-02-15 20:23:14 -08003203#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003204pub fn visit_type_slice<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeSlice) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003205 tokens_helper(_visitor, &_i.bracket_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003206 _visitor.visit_type(&*_i.elem);
Nika Layzell27726662017-10-24 23:16:35 -04003207}
David Tolnay440fe582019-02-15 20:23:14 -08003208#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07003209pub fn visit_type_trait_object<'ast, V: Visit<'ast> + ?Sized>(
3210 _visitor: &mut V,
3211 _i: &'ast TypeTraitObject,
3212) {
3213 if let Some(ref it) = _i.dyn_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003214 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003215 };
3216 for el in Punctuated::pairs(&_i.bounds) {
3217 let it = el.value();
3218 _visitor.visit_type_param_bound(it)
3219 }
Nika Layzell27726662017-10-24 23:16:35 -04003220}
David Tolnay440fe582019-02-15 20:23:14 -08003221#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003222pub fn visit_type_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeTuple) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003223 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003224 for el in Punctuated::pairs(&_i.elems) {
3225 let it = el.value();
3226 _visitor.visit_type(it)
3227 }
Nika Layzell27726662017-10-24 23:16:35 -04003228}
David Tolnay440fe582019-02-15 20:23:14 -08003229#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07003230pub fn visit_type_verbatim<'ast, V: Visit<'ast> + ?Sized>(
3231 _visitor: &mut V,
3232 _i: &'ast TypeVerbatim,
3233) {
David Tolnay6af48992018-08-01 11:16:28 -07003234 skip!(_i.tts);
David Tolnay2ae520a2017-12-29 11:19:50 -05003235}
David Tolnay440fe582019-02-15 20:23:14 -08003236#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003237pub fn visit_un_op<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UnOp) {
Nika Layzell27726662017-10-24 23:16:35 -04003238 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003239 UnOp::Deref(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003240 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003241 }
David Tolnay8c81f622018-07-31 23:34:35 -07003242 UnOp::Not(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003243 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003244 }
David Tolnay8c81f622018-07-31 23:34:35 -07003245 UnOp::Neg(ref _binding_0) => {
David Tolnay7ac699c2018-08-24 14:00:58 -04003246 tokens_helper(_visitor, &_binding_0.spans);
Nika Layzell27726662017-10-24 23:16:35 -04003247 }
3248 }
3249}
David Tolnay8c81f622018-07-31 23:34:35 -07003250#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003251pub fn visit_use_glob<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseGlob) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003252 tokens_helper(_visitor, &_i.star_token.spans);
David Tolnay5f332a92017-12-26 00:42:45 -05003253}
David Tolnay8c81f622018-07-31 23:34:35 -07003254#[cfg(feature = "full")]
David Tolnayd97a7d22018-03-31 19:17:01 +02003255pub fn visit_use_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseGroup) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003256 tokens_helper(_visitor, &_i.brace_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003257 for el in Punctuated::pairs(&_i.items) {
3258 let it = el.value();
3259 _visitor.visit_use_tree(it)
3260 }
David Tolnay5f332a92017-12-26 00:42:45 -05003261}
David Tolnay8c81f622018-07-31 23:34:35 -07003262#[cfg(feature = "full")]
David Tolnayd97a7d22018-03-31 19:17:01 +02003263pub fn visit_use_name<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseName) {
David Tolnay8c81f622018-07-31 23:34:35 -07003264 _visitor.visit_ident(&_i.ident);
David Tolnayd97a7d22018-03-31 19:17:01 +02003265}
David Tolnay8c81f622018-07-31 23:34:35 -07003266#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003267pub fn visit_use_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UsePath) {
David Tolnay8c81f622018-07-31 23:34:35 -07003268 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04003269 tokens_helper(_visitor, &_i.colon2_token.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003270 _visitor.visit_use_tree(&*_i.tree);
David Tolnayd97a7d22018-03-31 19:17:01 +02003271}
David Tolnay8c81f622018-07-31 23:34:35 -07003272#[cfg(feature = "full")]
David Tolnayd97a7d22018-03-31 19:17:01 +02003273pub fn visit_use_rename<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseRename) {
David Tolnay8c81f622018-07-31 23:34:35 -07003274 _visitor.visit_ident(&_i.ident);
David Tolnay7ac699c2018-08-24 14:00:58 -04003275 tokens_helper(_visitor, &_i.as_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003276 _visitor.visit_ident(&_i.rename);
David Tolnay5f332a92017-12-26 00:42:45 -05003277}
David Tolnay8c81f622018-07-31 23:34:35 -07003278#[cfg(feature = "full")]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003279pub fn visit_use_tree<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseTree) {
David Tolnay5f332a92017-12-26 00:42:45 -05003280 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003281 UseTree::Path(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003282 _visitor.visit_use_path(_binding_0);
David Tolnay5f332a92017-12-26 00:42:45 -05003283 }
David Tolnay8c81f622018-07-31 23:34:35 -07003284 UseTree::Name(ref _binding_0) => {
David Tolnayd97a7d22018-03-31 19:17:01 +02003285 _visitor.visit_use_name(_binding_0);
3286 }
David Tolnay8c81f622018-07-31 23:34:35 -07003287 UseTree::Rename(ref _binding_0) => {
David Tolnayd97a7d22018-03-31 19:17:01 +02003288 _visitor.visit_use_rename(_binding_0);
3289 }
David Tolnay8c81f622018-07-31 23:34:35 -07003290 UseTree::Glob(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003291 _visitor.visit_use_glob(_binding_0);
David Tolnay5f332a92017-12-26 00:42:45 -05003292 }
David Tolnay8c81f622018-07-31 23:34:35 -07003293 UseTree::Group(ref _binding_0) => {
David Tolnayd97a7d22018-03-31 19:17:01 +02003294 _visitor.visit_use_group(_binding_0);
David Tolnay5f332a92017-12-26 00:42:45 -05003295 }
3296 }
3297}
David Tolnay440fe582019-02-15 20:23:14 -08003298#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003299pub fn visit_variant<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Variant) {
David Tolnay8c81f622018-07-31 23:34:35 -07003300 for it in &_i.attrs {
3301 _visitor.visit_attribute(it)
3302 }
3303 _visitor.visit_ident(&_i.ident);
3304 _visitor.visit_fields(&_i.fields);
3305 if let Some(ref it) = _i.discriminant {
David Tolnay7ac699c2018-08-24 14:00:58 -04003306 tokens_helper(_visitor, &(it).0.spans);
David Tolnay8c81f622018-07-31 23:34:35 -07003307 _visitor.visit_expr(&(it).1);
3308 };
Nika Layzell27726662017-10-24 23:16:35 -04003309}
David Tolnay440fe582019-02-15 20:23:14 -08003310#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003311pub fn visit_vis_crate<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast VisCrate) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003312 tokens_helper(_visitor, &_i.crate_token.span);
Nika Layzell27726662017-10-24 23:16:35 -04003313}
David Tolnay440fe582019-02-15 20:23:14 -08003314#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003315pub fn visit_vis_public<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast VisPublic) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003316 tokens_helper(_visitor, &_i.pub_token.span);
Nika Layzell27726662017-10-24 23:16:35 -04003317}
David Tolnay440fe582019-02-15 20:23:14 -08003318#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07003319pub fn visit_vis_restricted<'ast, V: Visit<'ast> + ?Sized>(
3320 _visitor: &mut V,
3321 _i: &'ast VisRestricted,
3322) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003323 tokens_helper(_visitor, &_i.pub_token.span);
3324 tokens_helper(_visitor, &_i.paren_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003325 if let Some(ref it) = _i.in_token {
David Tolnay7ac699c2018-08-24 14:00:58 -04003326 tokens_helper(_visitor, &it.span)
David Tolnay8c81f622018-07-31 23:34:35 -07003327 };
3328 _visitor.visit_path(&*_i.path);
Nika Layzell27726662017-10-24 23:16:35 -04003329}
David Tolnay440fe582019-02-15 20:23:14 -08003330#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003331pub fn visit_visibility<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Visibility) {
Nika Layzell27726662017-10-24 23:16:35 -04003332 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003333 Visibility::Public(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003334 _visitor.visit_vis_public(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003335 }
David Tolnay8c81f622018-07-31 23:34:35 -07003336 Visibility::Crate(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003337 _visitor.visit_vis_crate(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003338 }
David Tolnay8c81f622018-07-31 23:34:35 -07003339 Visibility::Restricted(ref _binding_0) => {
David Tolnayf0d63bf2017-12-26 12:29:47 -05003340 _visitor.visit_vis_restricted(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003341 }
David Tolnay8c81f622018-07-31 23:34:35 -07003342 Visibility::Inherited => {}
Nika Layzell27726662017-10-24 23:16:35 -04003343 }
3344}
David Tolnay440fe582019-02-15 20:23:14 -08003345#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay4b4c4b62018-01-06 13:48:05 -08003346pub fn visit_where_clause<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast WhereClause) {
David Tolnay7ac699c2018-08-24 14:00:58 -04003347 tokens_helper(_visitor, &_i.where_token.span);
David Tolnay8c81f622018-07-31 23:34:35 -07003348 for el in Punctuated::pairs(&_i.predicates) {
3349 let it = el.value();
3350 _visitor.visit_where_predicate(it)
3351 }
Nika Layzell27726662017-10-24 23:16:35 -04003352}
David Tolnay440fe582019-02-15 20:23:14 -08003353#[cfg(any(feature = "derive", feature = "full"))]
David Tolnay8c81f622018-07-31 23:34:35 -07003354pub fn visit_where_predicate<'ast, V: Visit<'ast> + ?Sized>(
3355 _visitor: &mut V,
3356 _i: &'ast WherePredicate,
3357) {
Nika Layzell27726662017-10-24 23:16:35 -04003358 match *_i {
David Tolnay8c81f622018-07-31 23:34:35 -07003359 WherePredicate::Type(ref _binding_0) => {
David Tolnayd4add852018-01-01 20:13:24 -08003360 _visitor.visit_predicate_type(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003361 }
David Tolnay8c81f622018-07-31 23:34:35 -07003362 WherePredicate::Lifetime(ref _binding_0) => {
David Tolnayd4add852018-01-01 20:13:24 -08003363 _visitor.visit_predicate_lifetime(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003364 }
David Tolnay8c81f622018-07-31 23:34:35 -07003365 WherePredicate::Eq(ref _binding_0) => {
David Tolnayd4add852018-01-01 20:13:24 -08003366 _visitor.visit_predicate_eq(_binding_0);
Nika Layzell27726662017-10-24 23:16:35 -04003367 }
3368 }
3369}
Carl Lerchecbf7cc12019-02-15 14:09:31 -08003370pub fn visit_span<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Span) {}
3371pub fn visit_ident<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Ident) {}