Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1 | // THIS FILE IS AUTOMATICALLY GENERATED; DO NOT EDIT |
| 2 | |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 3 | #![cfg_attr(feature = "cargo-clippy", allow(match_same_arms))] |
David Tolnay | 0a0d78c | 2018-01-05 15:24:01 -0800 | [diff] [blame] | 4 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | cc0f037 | 2017-12-28 19:11:04 -0500 | [diff] [blame] | 5 | use gen::helper::visit::*; |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 6 | use proc_macro2::Span; |
| 7 | #[cfg(any(feature = "full", feature = "derive"))] |
| 8 | use punctuated::Punctuated; |
| 9 | use *; |
Nika Layzell | 4ab8d6e | 2017-10-26 09:45:49 -0400 | [diff] [blame] | 10 | #[cfg(feature = "full")] |
| 11 | macro_rules! full { |
David Tolnay | 6af4899 | 2018-08-01 11:16:28 -0700 | [diff] [blame] | 12 | ( $ e : expr ) => { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 13 | $e |
| 14 | }; |
Nika Layzell | 4ab8d6e | 2017-10-26 09:45:49 -0400 | [diff] [blame] | 15 | } |
David Tolnay | 0a0d78c | 2018-01-05 15:24:01 -0800 | [diff] [blame] | 16 | #[cfg(all(feature = "derive", not(feature = "full")))] |
Nika Layzell | 4ab8d6e | 2017-10-26 09:45:49 -0400 | [diff] [blame] | 17 | macro_rules! full { |
David Tolnay | 6af4899 | 2018-08-01 11:16:28 -0700 | [diff] [blame] | 18 | ( $ e : expr ) => { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 19 | unreachable!() |
| 20 | }; |
Nika Layzell | 4ab8d6e | 2017-10-26 09:45:49 -0400 | [diff] [blame] | 21 | } |
David Tolnay | 6af4899 | 2018-08-01 11:16:28 -0700 | [diff] [blame] | 22 | #[cfg(any(feature = "full", feature = "derive"))] |
| 23 | macro_rules! skip { |
| 24 | ( $ ( $ tt : tt ) * ) => {}; |
| 25 | } |
| 26 | #[doc = r" Syntax tree traversal to walk a shared borrow of a syntax tree."] |
| 27 | #[doc = r""] |
| 28 | #[doc = r" See the [module documentation] for details."] |
| 29 | #[doc = r""] |
| 30 | #[doc = r" [module documentation]: index.html"] |
| 31 | #[doc = r""] |
| 32 | #[doc = r#" *This trait is available if Syn is built with the `"visit"` feature.*"#] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 33 | pub trait Visit<'ast> { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 34 | #[cfg(any(feature = "full", feature = "derive"))] |
| 35 | fn visit_abi(&mut self, i: &'ast Abi) { |
| 36 | visit_abi(self, i) |
| 37 | } |
| 38 | #[cfg(any(feature = "full", feature = "derive"))] |
| 39 | fn visit_angle_bracketed_generic_arguments(&mut self, i: &'ast AngleBracketedGenericArguments) { |
| 40 | visit_angle_bracketed_generic_arguments(self, i) |
| 41 | } |
| 42 | #[cfg(feature = "full")] |
| 43 | fn visit_arg_captured(&mut self, i: &'ast ArgCaptured) { |
| 44 | visit_arg_captured(self, i) |
| 45 | } |
| 46 | #[cfg(feature = "full")] |
| 47 | fn visit_arg_self(&mut self, i: &'ast ArgSelf) { |
| 48 | visit_arg_self(self, i) |
| 49 | } |
| 50 | #[cfg(feature = "full")] |
| 51 | fn visit_arg_self_ref(&mut self, i: &'ast ArgSelfRef) { |
| 52 | visit_arg_self_ref(self, i) |
| 53 | } |
| 54 | #[cfg(any(feature = "full", feature = "derive"))] |
| 55 | #[cfg(feature = "full")] |
| 56 | fn visit_arm(&mut self, i: &'ast Arm) { |
| 57 | visit_arm(self, i) |
| 58 | } |
| 59 | #[cfg(any(feature = "full", feature = "derive"))] |
| 60 | fn visit_attr_style(&mut self, i: &'ast AttrStyle) { |
| 61 | visit_attr_style(self, i) |
| 62 | } |
| 63 | #[cfg(any(feature = "full", feature = "derive"))] |
| 64 | fn visit_attribute(&mut self, i: &'ast Attribute) { |
| 65 | visit_attribute(self, i) |
| 66 | } |
| 67 | #[cfg(any(feature = "full", feature = "derive"))] |
| 68 | fn visit_bare_fn_arg(&mut self, i: &'ast BareFnArg) { |
| 69 | visit_bare_fn_arg(self, i) |
| 70 | } |
| 71 | #[cfg(any(feature = "full", feature = "derive"))] |
| 72 | fn visit_bare_fn_arg_name(&mut self, i: &'ast BareFnArgName) { |
| 73 | visit_bare_fn_arg_name(self, i) |
| 74 | } |
| 75 | #[cfg(any(feature = "full", feature = "derive"))] |
| 76 | fn visit_bin_op(&mut self, i: &'ast BinOp) { |
| 77 | visit_bin_op(self, i) |
| 78 | } |
| 79 | #[cfg(any(feature = "full", feature = "derive"))] |
| 80 | fn visit_binding(&mut self, i: &'ast Binding) { |
| 81 | visit_binding(self, i) |
| 82 | } |
| 83 | #[cfg(any(feature = "full", feature = "derive"))] |
| 84 | #[cfg(feature = "full")] |
| 85 | fn visit_block(&mut self, i: &'ast Block) { |
| 86 | visit_block(self, i) |
| 87 | } |
| 88 | #[cfg(any(feature = "full", feature = "derive"))] |
| 89 | fn visit_bound_lifetimes(&mut self, i: &'ast BoundLifetimes) { |
| 90 | visit_bound_lifetimes(self, i) |
| 91 | } |
| 92 | #[cfg(any(feature = "full", feature = "derive"))] |
| 93 | fn visit_const_param(&mut self, i: &'ast ConstParam) { |
| 94 | visit_const_param(self, i) |
| 95 | } |
| 96 | #[cfg(feature = "derive")] |
| 97 | fn visit_data(&mut self, i: &'ast Data) { |
| 98 | visit_data(self, i) |
| 99 | } |
| 100 | #[cfg(feature = "derive")] |
| 101 | fn visit_data_enum(&mut self, i: &'ast DataEnum) { |
| 102 | visit_data_enum(self, i) |
| 103 | } |
| 104 | #[cfg(feature = "derive")] |
| 105 | fn visit_data_struct(&mut self, i: &'ast DataStruct) { |
| 106 | visit_data_struct(self, i) |
| 107 | } |
| 108 | #[cfg(feature = "derive")] |
| 109 | fn visit_data_union(&mut self, i: &'ast DataUnion) { |
| 110 | visit_data_union(self, i) |
| 111 | } |
| 112 | #[cfg(feature = "derive")] |
| 113 | fn visit_derive_input(&mut self, i: &'ast DeriveInput) { |
| 114 | visit_derive_input(self, i) |
| 115 | } |
| 116 | #[cfg(any(feature = "full", feature = "derive"))] |
| 117 | fn visit_expr(&mut self, i: &'ast Expr) { |
| 118 | visit_expr(self, i) |
| 119 | } |
| 120 | #[cfg(feature = "full")] |
| 121 | #[cfg(any(feature = "full", feature = "derive"))] |
| 122 | fn visit_expr_array(&mut self, i: &'ast ExprArray) { |
| 123 | visit_expr_array(self, i) |
| 124 | } |
| 125 | #[cfg(feature = "full")] |
| 126 | #[cfg(any(feature = "full", feature = "derive"))] |
| 127 | fn visit_expr_assign(&mut self, i: &'ast ExprAssign) { |
| 128 | visit_expr_assign(self, i) |
| 129 | } |
| 130 | #[cfg(feature = "full")] |
| 131 | #[cfg(any(feature = "full", feature = "derive"))] |
| 132 | fn visit_expr_assign_op(&mut self, i: &'ast ExprAssignOp) { |
| 133 | visit_expr_assign_op(self, i) |
| 134 | } |
| 135 | #[cfg(any(feature = "full", feature = "derive"))] |
| 136 | fn visit_expr_binary(&mut self, i: &'ast ExprBinary) { |
| 137 | visit_expr_binary(self, i) |
| 138 | } |
| 139 | #[cfg(feature = "full")] |
| 140 | #[cfg(any(feature = "full", feature = "derive"))] |
| 141 | fn visit_expr_block(&mut self, i: &'ast ExprBlock) { |
| 142 | visit_expr_block(self, i) |
| 143 | } |
| 144 | #[cfg(feature = "full")] |
| 145 | #[cfg(any(feature = "full", feature = "derive"))] |
| 146 | fn visit_expr_box(&mut self, i: &'ast ExprBox) { |
| 147 | visit_expr_box(self, i) |
| 148 | } |
| 149 | #[cfg(feature = "full")] |
| 150 | #[cfg(any(feature = "full", feature = "derive"))] |
| 151 | fn visit_expr_break(&mut self, i: &'ast ExprBreak) { |
| 152 | visit_expr_break(self, i) |
| 153 | } |
| 154 | #[cfg(any(feature = "full", feature = "derive"))] |
| 155 | fn visit_expr_call(&mut self, i: &'ast ExprCall) { |
| 156 | visit_expr_call(self, i) |
| 157 | } |
| 158 | #[cfg(any(feature = "full", feature = "derive"))] |
| 159 | fn visit_expr_cast(&mut self, i: &'ast ExprCast) { |
| 160 | visit_expr_cast(self, i) |
| 161 | } |
| 162 | #[cfg(feature = "full")] |
| 163 | #[cfg(any(feature = "full", feature = "derive"))] |
| 164 | fn visit_expr_catch(&mut self, i: &'ast ExprCatch) { |
| 165 | visit_expr_catch(self, i) |
| 166 | } |
| 167 | #[cfg(feature = "full")] |
| 168 | #[cfg(any(feature = "full", feature = "derive"))] |
| 169 | fn visit_expr_closure(&mut self, i: &'ast ExprClosure) { |
| 170 | visit_expr_closure(self, i) |
| 171 | } |
| 172 | #[cfg(feature = "full")] |
| 173 | #[cfg(any(feature = "full", feature = "derive"))] |
| 174 | fn visit_expr_continue(&mut self, i: &'ast ExprContinue) { |
| 175 | visit_expr_continue(self, i) |
| 176 | } |
| 177 | #[cfg(any(feature = "full", feature = "derive"))] |
| 178 | fn visit_expr_field(&mut self, i: &'ast ExprField) { |
| 179 | visit_expr_field(self, i) |
| 180 | } |
| 181 | #[cfg(feature = "full")] |
| 182 | #[cfg(any(feature = "full", feature = "derive"))] |
| 183 | fn visit_expr_for_loop(&mut self, i: &'ast ExprForLoop) { |
| 184 | visit_expr_for_loop(self, i) |
| 185 | } |
| 186 | #[cfg(feature = "full")] |
| 187 | #[cfg(any(feature = "full", feature = "derive"))] |
| 188 | fn visit_expr_group(&mut self, i: &'ast ExprGroup) { |
| 189 | visit_expr_group(self, i) |
| 190 | } |
| 191 | #[cfg(feature = "full")] |
| 192 | #[cfg(any(feature = "full", feature = "derive"))] |
| 193 | fn visit_expr_if(&mut self, i: &'ast ExprIf) { |
| 194 | visit_expr_if(self, i) |
| 195 | } |
| 196 | #[cfg(feature = "full")] |
| 197 | #[cfg(any(feature = "full", feature = "derive"))] |
| 198 | fn visit_expr_if_let(&mut self, i: &'ast ExprIfLet) { |
| 199 | visit_expr_if_let(self, i) |
| 200 | } |
| 201 | #[cfg(feature = "full")] |
| 202 | #[cfg(any(feature = "full", feature = "derive"))] |
| 203 | fn visit_expr_in_place(&mut self, i: &'ast ExprInPlace) { |
| 204 | visit_expr_in_place(self, i) |
| 205 | } |
| 206 | #[cfg(any(feature = "full", feature = "derive"))] |
| 207 | fn visit_expr_index(&mut self, i: &'ast ExprIndex) { |
| 208 | visit_expr_index(self, i) |
| 209 | } |
| 210 | #[cfg(any(feature = "full", feature = "derive"))] |
| 211 | fn visit_expr_lit(&mut self, i: &'ast ExprLit) { |
| 212 | visit_expr_lit(self, i) |
| 213 | } |
| 214 | #[cfg(feature = "full")] |
| 215 | #[cfg(any(feature = "full", feature = "derive"))] |
| 216 | fn visit_expr_loop(&mut self, i: &'ast ExprLoop) { |
| 217 | visit_expr_loop(self, i) |
| 218 | } |
| 219 | #[cfg(feature = "full")] |
| 220 | #[cfg(any(feature = "full", feature = "derive"))] |
| 221 | fn visit_expr_macro(&mut self, i: &'ast ExprMacro) { |
| 222 | visit_expr_macro(self, i) |
| 223 | } |
| 224 | #[cfg(feature = "full")] |
| 225 | #[cfg(any(feature = "full", feature = "derive"))] |
| 226 | fn visit_expr_match(&mut self, i: &'ast ExprMatch) { |
| 227 | visit_expr_match(self, i) |
| 228 | } |
| 229 | #[cfg(feature = "full")] |
| 230 | #[cfg(any(feature = "full", feature = "derive"))] |
| 231 | fn visit_expr_method_call(&mut self, i: &'ast ExprMethodCall) { |
| 232 | visit_expr_method_call(self, i) |
| 233 | } |
| 234 | #[cfg(any(feature = "full", feature = "derive"))] |
| 235 | fn visit_expr_paren(&mut self, i: &'ast ExprParen) { |
| 236 | visit_expr_paren(self, i) |
| 237 | } |
| 238 | #[cfg(any(feature = "full", feature = "derive"))] |
| 239 | fn visit_expr_path(&mut self, i: &'ast ExprPath) { |
| 240 | visit_expr_path(self, i) |
| 241 | } |
| 242 | #[cfg(feature = "full")] |
| 243 | #[cfg(any(feature = "full", feature = "derive"))] |
| 244 | fn visit_expr_range(&mut self, i: &'ast ExprRange) { |
| 245 | visit_expr_range(self, i) |
| 246 | } |
| 247 | #[cfg(feature = "full")] |
| 248 | #[cfg(any(feature = "full", feature = "derive"))] |
| 249 | fn visit_expr_reference(&mut self, i: &'ast ExprReference) { |
| 250 | visit_expr_reference(self, i) |
| 251 | } |
| 252 | #[cfg(feature = "full")] |
| 253 | #[cfg(any(feature = "full", feature = "derive"))] |
| 254 | fn visit_expr_repeat(&mut self, i: &'ast ExprRepeat) { |
| 255 | visit_expr_repeat(self, i) |
| 256 | } |
| 257 | #[cfg(feature = "full")] |
| 258 | #[cfg(any(feature = "full", feature = "derive"))] |
| 259 | fn visit_expr_return(&mut self, i: &'ast ExprReturn) { |
| 260 | visit_expr_return(self, i) |
| 261 | } |
| 262 | #[cfg(feature = "full")] |
| 263 | #[cfg(any(feature = "full", feature = "derive"))] |
| 264 | fn visit_expr_struct(&mut self, i: &'ast ExprStruct) { |
| 265 | visit_expr_struct(self, i) |
| 266 | } |
| 267 | #[cfg(feature = "full")] |
| 268 | #[cfg(any(feature = "full", feature = "derive"))] |
| 269 | fn visit_expr_try(&mut self, i: &'ast ExprTry) { |
| 270 | visit_expr_try(self, i) |
| 271 | } |
| 272 | #[cfg(feature = "full")] |
| 273 | #[cfg(any(feature = "full", feature = "derive"))] |
| 274 | fn visit_expr_tuple(&mut self, i: &'ast ExprTuple) { |
| 275 | visit_expr_tuple(self, i) |
| 276 | } |
| 277 | #[cfg(feature = "full")] |
| 278 | #[cfg(any(feature = "full", feature = "derive"))] |
| 279 | fn visit_expr_type(&mut self, i: &'ast ExprType) { |
| 280 | visit_expr_type(self, i) |
| 281 | } |
| 282 | #[cfg(any(feature = "full", feature = "derive"))] |
| 283 | fn visit_expr_unary(&mut self, i: &'ast ExprUnary) { |
| 284 | visit_expr_unary(self, i) |
| 285 | } |
| 286 | #[cfg(feature = "full")] |
| 287 | #[cfg(any(feature = "full", feature = "derive"))] |
| 288 | fn visit_expr_unsafe(&mut self, i: &'ast ExprUnsafe) { |
| 289 | visit_expr_unsafe(self, i) |
| 290 | } |
| 291 | #[cfg(any(feature = "full", feature = "derive"))] |
| 292 | fn visit_expr_verbatim(&mut self, i: &'ast ExprVerbatim) { |
| 293 | visit_expr_verbatim(self, i) |
| 294 | } |
| 295 | #[cfg(feature = "full")] |
| 296 | #[cfg(any(feature = "full", feature = "derive"))] |
| 297 | fn visit_expr_while(&mut self, i: &'ast ExprWhile) { |
| 298 | visit_expr_while(self, i) |
| 299 | } |
| 300 | #[cfg(feature = "full")] |
| 301 | #[cfg(any(feature = "full", feature = "derive"))] |
| 302 | fn visit_expr_while_let(&mut self, i: &'ast ExprWhileLet) { |
| 303 | visit_expr_while_let(self, i) |
| 304 | } |
| 305 | #[cfg(feature = "full")] |
| 306 | #[cfg(any(feature = "full", feature = "derive"))] |
| 307 | fn visit_expr_yield(&mut self, i: &'ast ExprYield) { |
| 308 | visit_expr_yield(self, i) |
| 309 | } |
| 310 | #[cfg(any(feature = "full", feature = "derive"))] |
| 311 | fn visit_field(&mut self, i: &'ast Field) { |
| 312 | visit_field(self, i) |
| 313 | } |
| 314 | #[cfg(any(feature = "full", feature = "derive"))] |
| 315 | #[cfg(feature = "full")] |
| 316 | fn visit_field_pat(&mut self, i: &'ast FieldPat) { |
| 317 | visit_field_pat(self, i) |
| 318 | } |
| 319 | #[cfg(any(feature = "full", feature = "derive"))] |
| 320 | #[cfg(feature = "full")] |
| 321 | fn visit_field_value(&mut self, i: &'ast FieldValue) { |
| 322 | visit_field_value(self, i) |
| 323 | } |
| 324 | #[cfg(any(feature = "full", feature = "derive"))] |
| 325 | fn visit_fields(&mut self, i: &'ast Fields) { |
| 326 | visit_fields(self, i) |
| 327 | } |
| 328 | #[cfg(any(feature = "full", feature = "derive"))] |
| 329 | fn visit_fields_named(&mut self, i: &'ast FieldsNamed) { |
| 330 | visit_fields_named(self, i) |
| 331 | } |
| 332 | #[cfg(any(feature = "full", feature = "derive"))] |
| 333 | fn visit_fields_unnamed(&mut self, i: &'ast FieldsUnnamed) { |
| 334 | visit_fields_unnamed(self, i) |
| 335 | } |
| 336 | #[cfg(feature = "full")] |
| 337 | fn visit_file(&mut self, i: &'ast File) { |
| 338 | visit_file(self, i) |
| 339 | } |
| 340 | #[cfg(feature = "full")] |
| 341 | fn visit_fn_arg(&mut self, i: &'ast FnArg) { |
| 342 | visit_fn_arg(self, i) |
| 343 | } |
| 344 | #[cfg(feature = "full")] |
| 345 | fn visit_fn_decl(&mut self, i: &'ast FnDecl) { |
| 346 | visit_fn_decl(self, i) |
| 347 | } |
| 348 | #[cfg(feature = "full")] |
| 349 | fn visit_foreign_item(&mut self, i: &'ast ForeignItem) { |
| 350 | visit_foreign_item(self, i) |
| 351 | } |
| 352 | #[cfg(feature = "full")] |
| 353 | fn visit_foreign_item_fn(&mut self, i: &'ast ForeignItemFn) { |
| 354 | visit_foreign_item_fn(self, i) |
| 355 | } |
| 356 | #[cfg(feature = "full")] |
| 357 | fn visit_foreign_item_static(&mut self, i: &'ast ForeignItemStatic) { |
| 358 | visit_foreign_item_static(self, i) |
| 359 | } |
| 360 | #[cfg(feature = "full")] |
| 361 | fn visit_foreign_item_type(&mut self, i: &'ast ForeignItemType) { |
| 362 | visit_foreign_item_type(self, i) |
| 363 | } |
| 364 | #[cfg(feature = "full")] |
| 365 | fn visit_foreign_item_verbatim(&mut self, i: &'ast ForeignItemVerbatim) { |
| 366 | visit_foreign_item_verbatim(self, i) |
| 367 | } |
| 368 | #[cfg(any(feature = "full", feature = "derive"))] |
| 369 | fn visit_generic_argument(&mut self, i: &'ast GenericArgument) { |
| 370 | visit_generic_argument(self, i) |
| 371 | } |
| 372 | #[cfg(any(feature = "full", feature = "derive"))] |
| 373 | #[cfg(feature = "full")] |
| 374 | fn visit_generic_method_argument(&mut self, i: &'ast GenericMethodArgument) { |
| 375 | visit_generic_method_argument(self, i) |
| 376 | } |
| 377 | #[cfg(any(feature = "full", feature = "derive"))] |
| 378 | fn visit_generic_param(&mut self, i: &'ast GenericParam) { |
| 379 | visit_generic_param(self, i) |
| 380 | } |
| 381 | #[cfg(any(feature = "full", feature = "derive"))] |
| 382 | fn visit_generics(&mut self, i: &'ast Generics) { |
| 383 | visit_generics(self, i) |
| 384 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 385 | fn visit_ident(&mut self, i: &'ast Ident) { |
| 386 | visit_ident(self, i) |
| 387 | } |
| 388 | #[cfg(feature = "full")] |
| 389 | fn visit_impl_item(&mut self, i: &'ast ImplItem) { |
| 390 | visit_impl_item(self, i) |
| 391 | } |
| 392 | #[cfg(feature = "full")] |
| 393 | fn visit_impl_item_const(&mut self, i: &'ast ImplItemConst) { |
| 394 | visit_impl_item_const(self, i) |
| 395 | } |
| 396 | #[cfg(feature = "full")] |
| 397 | fn visit_impl_item_macro(&mut self, i: &'ast ImplItemMacro) { |
| 398 | visit_impl_item_macro(self, i) |
| 399 | } |
| 400 | #[cfg(feature = "full")] |
| 401 | fn visit_impl_item_method(&mut self, i: &'ast ImplItemMethod) { |
| 402 | visit_impl_item_method(self, i) |
| 403 | } |
| 404 | #[cfg(feature = "full")] |
| 405 | fn visit_impl_item_type(&mut self, i: &'ast ImplItemType) { |
| 406 | visit_impl_item_type(self, i) |
| 407 | } |
| 408 | #[cfg(feature = "full")] |
| 409 | fn visit_impl_item_verbatim(&mut self, i: &'ast ImplItemVerbatim) { |
| 410 | visit_impl_item_verbatim(self, i) |
| 411 | } |
| 412 | #[cfg(any(feature = "full", feature = "derive"))] |
| 413 | fn visit_index(&mut self, i: &'ast Index) { |
| 414 | visit_index(self, i) |
| 415 | } |
| 416 | #[cfg(feature = "full")] |
| 417 | fn visit_item(&mut self, i: &'ast Item) { |
| 418 | visit_item(self, i) |
| 419 | } |
| 420 | #[cfg(feature = "full")] |
| 421 | fn visit_item_const(&mut self, i: &'ast ItemConst) { |
| 422 | visit_item_const(self, i) |
| 423 | } |
| 424 | #[cfg(feature = "full")] |
| 425 | fn visit_item_enum(&mut self, i: &'ast ItemEnum) { |
| 426 | visit_item_enum(self, i) |
| 427 | } |
| 428 | #[cfg(feature = "full")] |
| 429 | fn visit_item_extern_crate(&mut self, i: &'ast ItemExternCrate) { |
| 430 | visit_item_extern_crate(self, i) |
| 431 | } |
| 432 | #[cfg(feature = "full")] |
| 433 | fn visit_item_fn(&mut self, i: &'ast ItemFn) { |
| 434 | visit_item_fn(self, i) |
| 435 | } |
| 436 | #[cfg(feature = "full")] |
| 437 | fn visit_item_foreign_mod(&mut self, i: &'ast ItemForeignMod) { |
| 438 | visit_item_foreign_mod(self, i) |
| 439 | } |
| 440 | #[cfg(feature = "full")] |
| 441 | fn visit_item_impl(&mut self, i: &'ast ItemImpl) { |
| 442 | visit_item_impl(self, i) |
| 443 | } |
| 444 | #[cfg(feature = "full")] |
| 445 | fn visit_item_macro(&mut self, i: &'ast ItemMacro) { |
| 446 | visit_item_macro(self, i) |
| 447 | } |
| 448 | #[cfg(feature = "full")] |
| 449 | fn visit_item_macro2(&mut self, i: &'ast ItemMacro2) { |
| 450 | visit_item_macro2(self, i) |
| 451 | } |
| 452 | #[cfg(feature = "full")] |
| 453 | fn visit_item_mod(&mut self, i: &'ast ItemMod) { |
| 454 | visit_item_mod(self, i) |
| 455 | } |
| 456 | #[cfg(feature = "full")] |
| 457 | fn visit_item_static(&mut self, i: &'ast ItemStatic) { |
| 458 | visit_item_static(self, i) |
| 459 | } |
| 460 | #[cfg(feature = "full")] |
| 461 | fn visit_item_struct(&mut self, i: &'ast ItemStruct) { |
| 462 | visit_item_struct(self, i) |
| 463 | } |
| 464 | #[cfg(feature = "full")] |
| 465 | fn visit_item_trait(&mut self, i: &'ast ItemTrait) { |
| 466 | visit_item_trait(self, i) |
| 467 | } |
| 468 | #[cfg(feature = "full")] |
| 469 | fn visit_item_type(&mut self, i: &'ast ItemType) { |
| 470 | visit_item_type(self, i) |
| 471 | } |
| 472 | #[cfg(feature = "full")] |
| 473 | fn visit_item_union(&mut self, i: &'ast ItemUnion) { |
| 474 | visit_item_union(self, i) |
| 475 | } |
| 476 | #[cfg(feature = "full")] |
| 477 | fn visit_item_use(&mut self, i: &'ast ItemUse) { |
| 478 | visit_item_use(self, i) |
| 479 | } |
| 480 | #[cfg(feature = "full")] |
| 481 | fn visit_item_verbatim(&mut self, i: &'ast ItemVerbatim) { |
| 482 | visit_item_verbatim(self, i) |
| 483 | } |
| 484 | #[cfg(any(feature = "full", feature = "derive"))] |
| 485 | #[cfg(feature = "full")] |
| 486 | fn visit_label(&mut self, i: &'ast Label) { |
| 487 | visit_label(self, i) |
| 488 | } |
| 489 | #[cfg(any(feature = "full", feature = "derive"))] |
| 490 | fn visit_lifetime(&mut self, i: &'ast Lifetime) { |
| 491 | visit_lifetime(self, i) |
| 492 | } |
| 493 | #[cfg(any(feature = "full", feature = "derive"))] |
| 494 | fn visit_lifetime_def(&mut self, i: &'ast LifetimeDef) { |
| 495 | visit_lifetime_def(self, i) |
| 496 | } |
| 497 | #[cfg(any(feature = "full", feature = "derive"))] |
| 498 | fn visit_lit(&mut self, i: &'ast Lit) { |
| 499 | visit_lit(self, i) |
| 500 | } |
| 501 | #[cfg(any(feature = "full", feature = "derive"))] |
| 502 | fn visit_lit_bool(&mut self, i: &'ast LitBool) { |
| 503 | visit_lit_bool(self, i) |
| 504 | } |
| 505 | #[cfg(any(feature = "full", feature = "derive"))] |
| 506 | fn visit_lit_byte(&mut self, i: &'ast LitByte) { |
| 507 | visit_lit_byte(self, i) |
| 508 | } |
| 509 | #[cfg(any(feature = "full", feature = "derive"))] |
| 510 | fn visit_lit_byte_str(&mut self, i: &'ast LitByteStr) { |
| 511 | visit_lit_byte_str(self, i) |
| 512 | } |
| 513 | #[cfg(any(feature = "full", feature = "derive"))] |
| 514 | fn visit_lit_char(&mut self, i: &'ast LitChar) { |
| 515 | visit_lit_char(self, i) |
| 516 | } |
| 517 | #[cfg(any(feature = "full", feature = "derive"))] |
| 518 | fn visit_lit_float(&mut self, i: &'ast LitFloat) { |
| 519 | visit_lit_float(self, i) |
| 520 | } |
| 521 | #[cfg(any(feature = "full", feature = "derive"))] |
| 522 | fn visit_lit_int(&mut self, i: &'ast LitInt) { |
| 523 | visit_lit_int(self, i) |
| 524 | } |
| 525 | #[cfg(any(feature = "full", feature = "derive"))] |
| 526 | fn visit_lit_str(&mut self, i: &'ast LitStr) { |
| 527 | visit_lit_str(self, i) |
| 528 | } |
| 529 | #[cfg(any(feature = "full", feature = "derive"))] |
| 530 | fn visit_lit_verbatim(&mut self, i: &'ast LitVerbatim) { |
| 531 | visit_lit_verbatim(self, i) |
| 532 | } |
| 533 | #[cfg(any(feature = "full", feature = "derive"))] |
| 534 | #[cfg(feature = "full")] |
| 535 | fn visit_local(&mut self, i: &'ast Local) { |
| 536 | visit_local(self, i) |
| 537 | } |
| 538 | #[cfg(any(feature = "full", feature = "derive"))] |
| 539 | fn visit_macro(&mut self, i: &'ast Macro) { |
| 540 | visit_macro(self, i) |
| 541 | } |
| 542 | #[cfg(any(feature = "full", feature = "derive"))] |
| 543 | fn visit_macro_delimiter(&mut self, i: &'ast MacroDelimiter) { |
| 544 | visit_macro_delimiter(self, i) |
| 545 | } |
| 546 | #[cfg(any(feature = "full", feature = "derive"))] |
| 547 | fn visit_member(&mut self, i: &'ast Member) { |
| 548 | visit_member(self, i) |
| 549 | } |
| 550 | #[cfg(any(feature = "full", feature = "derive"))] |
| 551 | fn visit_meta(&mut self, i: &'ast Meta) { |
| 552 | visit_meta(self, i) |
| 553 | } |
| 554 | #[cfg(any(feature = "full", feature = "derive"))] |
| 555 | fn visit_meta_list(&mut self, i: &'ast MetaList) { |
| 556 | visit_meta_list(self, i) |
| 557 | } |
| 558 | #[cfg(any(feature = "full", feature = "derive"))] |
| 559 | fn visit_meta_name_value(&mut self, i: &'ast MetaNameValue) { |
| 560 | visit_meta_name_value(self, i) |
| 561 | } |
| 562 | #[cfg(feature = "full")] |
| 563 | fn visit_method_sig(&mut self, i: &'ast MethodSig) { |
| 564 | visit_method_sig(self, i) |
| 565 | } |
| 566 | #[cfg(any(feature = "full", feature = "derive"))] |
| 567 | #[cfg(feature = "full")] |
| 568 | fn visit_method_turbofish(&mut self, i: &'ast MethodTurbofish) { |
| 569 | visit_method_turbofish(self, i) |
| 570 | } |
| 571 | #[cfg(any(feature = "full", feature = "derive"))] |
| 572 | fn visit_nested_meta(&mut self, i: &'ast NestedMeta) { |
| 573 | visit_nested_meta(self, i) |
| 574 | } |
| 575 | #[cfg(any(feature = "full", feature = "derive"))] |
| 576 | fn visit_parenthesized_generic_arguments(&mut self, i: &'ast ParenthesizedGenericArguments) { |
| 577 | visit_parenthesized_generic_arguments(self, i) |
| 578 | } |
| 579 | #[cfg(any(feature = "full", feature = "derive"))] |
| 580 | #[cfg(feature = "full")] |
| 581 | fn visit_pat(&mut self, i: &'ast Pat) { |
| 582 | visit_pat(self, i) |
| 583 | } |
| 584 | #[cfg(any(feature = "full", feature = "derive"))] |
| 585 | #[cfg(feature = "full")] |
| 586 | fn visit_pat_box(&mut self, i: &'ast PatBox) { |
| 587 | visit_pat_box(self, i) |
| 588 | } |
| 589 | #[cfg(any(feature = "full", feature = "derive"))] |
| 590 | #[cfg(feature = "full")] |
| 591 | fn visit_pat_ident(&mut self, i: &'ast PatIdent) { |
| 592 | visit_pat_ident(self, i) |
| 593 | } |
| 594 | #[cfg(any(feature = "full", feature = "derive"))] |
| 595 | #[cfg(feature = "full")] |
| 596 | fn visit_pat_lit(&mut self, i: &'ast PatLit) { |
| 597 | visit_pat_lit(self, i) |
| 598 | } |
| 599 | #[cfg(any(feature = "full", feature = "derive"))] |
| 600 | #[cfg(feature = "full")] |
| 601 | fn visit_pat_macro(&mut self, i: &'ast PatMacro) { |
| 602 | visit_pat_macro(self, i) |
| 603 | } |
| 604 | #[cfg(any(feature = "full", feature = "derive"))] |
| 605 | #[cfg(feature = "full")] |
| 606 | fn visit_pat_path(&mut self, i: &'ast PatPath) { |
| 607 | visit_pat_path(self, i) |
| 608 | } |
| 609 | #[cfg(any(feature = "full", feature = "derive"))] |
| 610 | #[cfg(feature = "full")] |
| 611 | fn visit_pat_range(&mut self, i: &'ast PatRange) { |
| 612 | visit_pat_range(self, i) |
| 613 | } |
| 614 | #[cfg(any(feature = "full", feature = "derive"))] |
| 615 | #[cfg(feature = "full")] |
| 616 | fn visit_pat_ref(&mut self, i: &'ast PatRef) { |
| 617 | visit_pat_ref(self, i) |
| 618 | } |
| 619 | #[cfg(any(feature = "full", feature = "derive"))] |
| 620 | #[cfg(feature = "full")] |
| 621 | fn visit_pat_slice(&mut self, i: &'ast PatSlice) { |
| 622 | visit_pat_slice(self, i) |
| 623 | } |
| 624 | #[cfg(any(feature = "full", feature = "derive"))] |
| 625 | #[cfg(feature = "full")] |
| 626 | fn visit_pat_struct(&mut self, i: &'ast PatStruct) { |
| 627 | visit_pat_struct(self, i) |
| 628 | } |
| 629 | #[cfg(any(feature = "full", feature = "derive"))] |
| 630 | #[cfg(feature = "full")] |
| 631 | fn visit_pat_tuple(&mut self, i: &'ast PatTuple) { |
| 632 | visit_pat_tuple(self, i) |
| 633 | } |
| 634 | #[cfg(any(feature = "full", feature = "derive"))] |
| 635 | #[cfg(feature = "full")] |
| 636 | fn visit_pat_tuple_struct(&mut self, i: &'ast PatTupleStruct) { |
| 637 | visit_pat_tuple_struct(self, i) |
| 638 | } |
| 639 | #[cfg(any(feature = "full", feature = "derive"))] |
| 640 | #[cfg(feature = "full")] |
| 641 | fn visit_pat_verbatim(&mut self, i: &'ast PatVerbatim) { |
| 642 | visit_pat_verbatim(self, i) |
| 643 | } |
| 644 | #[cfg(any(feature = "full", feature = "derive"))] |
| 645 | #[cfg(feature = "full")] |
| 646 | fn visit_pat_wild(&mut self, i: &'ast PatWild) { |
| 647 | visit_pat_wild(self, i) |
| 648 | } |
| 649 | #[cfg(any(feature = "full", feature = "derive"))] |
| 650 | fn visit_path(&mut self, i: &'ast Path) { |
| 651 | visit_path(self, i) |
| 652 | } |
| 653 | #[cfg(any(feature = "full", feature = "derive"))] |
| 654 | fn visit_path_arguments(&mut self, i: &'ast PathArguments) { |
| 655 | visit_path_arguments(self, i) |
| 656 | } |
| 657 | #[cfg(any(feature = "full", feature = "derive"))] |
| 658 | fn visit_path_segment(&mut self, i: &'ast PathSegment) { |
| 659 | visit_path_segment(self, i) |
| 660 | } |
| 661 | #[cfg(any(feature = "full", feature = "derive"))] |
| 662 | fn visit_predicate_eq(&mut self, i: &'ast PredicateEq) { |
| 663 | visit_predicate_eq(self, i) |
| 664 | } |
| 665 | #[cfg(any(feature = "full", feature = "derive"))] |
| 666 | fn visit_predicate_lifetime(&mut self, i: &'ast PredicateLifetime) { |
| 667 | visit_predicate_lifetime(self, i) |
| 668 | } |
| 669 | #[cfg(any(feature = "full", feature = "derive"))] |
| 670 | fn visit_predicate_type(&mut self, i: &'ast PredicateType) { |
| 671 | visit_predicate_type(self, i) |
| 672 | } |
| 673 | #[cfg(any(feature = "full", feature = "derive"))] |
| 674 | fn visit_qself(&mut self, i: &'ast QSelf) { |
| 675 | visit_qself(self, i) |
| 676 | } |
| 677 | #[cfg(any(feature = "full", feature = "derive"))] |
| 678 | #[cfg(feature = "full")] |
| 679 | fn visit_range_limits(&mut self, i: &'ast RangeLimits) { |
| 680 | visit_range_limits(self, i) |
| 681 | } |
| 682 | #[cfg(any(feature = "full", feature = "derive"))] |
| 683 | fn visit_return_type(&mut self, i: &'ast ReturnType) { |
| 684 | visit_return_type(self, i) |
| 685 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 686 | fn visit_span(&mut self, i: &'ast Span) { |
| 687 | visit_span(self, i) |
| 688 | } |
| 689 | #[cfg(any(feature = "full", feature = "derive"))] |
| 690 | #[cfg(feature = "full")] |
| 691 | fn visit_stmt(&mut self, i: &'ast Stmt) { |
| 692 | visit_stmt(self, i) |
| 693 | } |
| 694 | #[cfg(any(feature = "full", feature = "derive"))] |
| 695 | fn visit_trait_bound(&mut self, i: &'ast TraitBound) { |
| 696 | visit_trait_bound(self, i) |
| 697 | } |
| 698 | #[cfg(any(feature = "full", feature = "derive"))] |
| 699 | fn visit_trait_bound_modifier(&mut self, i: &'ast TraitBoundModifier) { |
| 700 | visit_trait_bound_modifier(self, i) |
| 701 | } |
| 702 | #[cfg(feature = "full")] |
| 703 | fn visit_trait_item(&mut self, i: &'ast TraitItem) { |
| 704 | visit_trait_item(self, i) |
| 705 | } |
| 706 | #[cfg(feature = "full")] |
| 707 | fn visit_trait_item_const(&mut self, i: &'ast TraitItemConst) { |
| 708 | visit_trait_item_const(self, i) |
| 709 | } |
| 710 | #[cfg(feature = "full")] |
| 711 | fn visit_trait_item_macro(&mut self, i: &'ast TraitItemMacro) { |
| 712 | visit_trait_item_macro(self, i) |
| 713 | } |
| 714 | #[cfg(feature = "full")] |
| 715 | fn visit_trait_item_method(&mut self, i: &'ast TraitItemMethod) { |
| 716 | visit_trait_item_method(self, i) |
| 717 | } |
| 718 | #[cfg(feature = "full")] |
| 719 | fn visit_trait_item_type(&mut self, i: &'ast TraitItemType) { |
| 720 | visit_trait_item_type(self, i) |
| 721 | } |
| 722 | #[cfg(feature = "full")] |
| 723 | fn visit_trait_item_verbatim(&mut self, i: &'ast TraitItemVerbatim) { |
| 724 | visit_trait_item_verbatim(self, i) |
| 725 | } |
| 726 | #[cfg(any(feature = "full", feature = "derive"))] |
| 727 | fn visit_type(&mut self, i: &'ast Type) { |
| 728 | visit_type(self, i) |
| 729 | } |
| 730 | #[cfg(any(feature = "full", feature = "derive"))] |
| 731 | fn visit_type_array(&mut self, i: &'ast TypeArray) { |
| 732 | visit_type_array(self, i) |
| 733 | } |
| 734 | #[cfg(any(feature = "full", feature = "derive"))] |
| 735 | fn visit_type_bare_fn(&mut self, i: &'ast TypeBareFn) { |
| 736 | visit_type_bare_fn(self, i) |
| 737 | } |
| 738 | #[cfg(any(feature = "full", feature = "derive"))] |
| 739 | fn visit_type_group(&mut self, i: &'ast TypeGroup) { |
| 740 | visit_type_group(self, i) |
| 741 | } |
| 742 | #[cfg(any(feature = "full", feature = "derive"))] |
| 743 | fn visit_type_impl_trait(&mut self, i: &'ast TypeImplTrait) { |
| 744 | visit_type_impl_trait(self, i) |
| 745 | } |
| 746 | #[cfg(any(feature = "full", feature = "derive"))] |
| 747 | fn visit_type_infer(&mut self, i: &'ast TypeInfer) { |
| 748 | visit_type_infer(self, i) |
| 749 | } |
| 750 | #[cfg(any(feature = "full", feature = "derive"))] |
| 751 | fn visit_type_macro(&mut self, i: &'ast TypeMacro) { |
| 752 | visit_type_macro(self, i) |
| 753 | } |
| 754 | #[cfg(any(feature = "full", feature = "derive"))] |
| 755 | fn visit_type_never(&mut self, i: &'ast TypeNever) { |
| 756 | visit_type_never(self, i) |
| 757 | } |
| 758 | #[cfg(any(feature = "full", feature = "derive"))] |
| 759 | fn visit_type_param(&mut self, i: &'ast TypeParam) { |
| 760 | visit_type_param(self, i) |
| 761 | } |
| 762 | #[cfg(any(feature = "full", feature = "derive"))] |
| 763 | fn visit_type_param_bound(&mut self, i: &'ast TypeParamBound) { |
| 764 | visit_type_param_bound(self, i) |
| 765 | } |
| 766 | #[cfg(any(feature = "full", feature = "derive"))] |
| 767 | fn visit_type_paren(&mut self, i: &'ast TypeParen) { |
| 768 | visit_type_paren(self, i) |
| 769 | } |
| 770 | #[cfg(any(feature = "full", feature = "derive"))] |
| 771 | fn visit_type_path(&mut self, i: &'ast TypePath) { |
| 772 | visit_type_path(self, i) |
| 773 | } |
| 774 | #[cfg(any(feature = "full", feature = "derive"))] |
| 775 | fn visit_type_ptr(&mut self, i: &'ast TypePtr) { |
| 776 | visit_type_ptr(self, i) |
| 777 | } |
| 778 | #[cfg(any(feature = "full", feature = "derive"))] |
| 779 | fn visit_type_reference(&mut self, i: &'ast TypeReference) { |
| 780 | visit_type_reference(self, i) |
| 781 | } |
| 782 | #[cfg(any(feature = "full", feature = "derive"))] |
| 783 | fn visit_type_slice(&mut self, i: &'ast TypeSlice) { |
| 784 | visit_type_slice(self, i) |
| 785 | } |
| 786 | #[cfg(any(feature = "full", feature = "derive"))] |
| 787 | fn visit_type_trait_object(&mut self, i: &'ast TypeTraitObject) { |
| 788 | visit_type_trait_object(self, i) |
| 789 | } |
| 790 | #[cfg(any(feature = "full", feature = "derive"))] |
| 791 | fn visit_type_tuple(&mut self, i: &'ast TypeTuple) { |
| 792 | visit_type_tuple(self, i) |
| 793 | } |
| 794 | #[cfg(any(feature = "full", feature = "derive"))] |
| 795 | fn visit_type_verbatim(&mut self, i: &'ast TypeVerbatim) { |
| 796 | visit_type_verbatim(self, i) |
| 797 | } |
| 798 | #[cfg(any(feature = "full", feature = "derive"))] |
| 799 | fn visit_un_op(&mut self, i: &'ast UnOp) { |
| 800 | visit_un_op(self, i) |
| 801 | } |
| 802 | #[cfg(feature = "full")] |
| 803 | fn visit_use_glob(&mut self, i: &'ast UseGlob) { |
| 804 | visit_use_glob(self, i) |
| 805 | } |
| 806 | #[cfg(feature = "full")] |
| 807 | fn visit_use_group(&mut self, i: &'ast UseGroup) { |
| 808 | visit_use_group(self, i) |
| 809 | } |
| 810 | #[cfg(feature = "full")] |
| 811 | fn visit_use_name(&mut self, i: &'ast UseName) { |
| 812 | visit_use_name(self, i) |
| 813 | } |
| 814 | #[cfg(feature = "full")] |
| 815 | fn visit_use_path(&mut self, i: &'ast UsePath) { |
| 816 | visit_use_path(self, i) |
| 817 | } |
| 818 | #[cfg(feature = "full")] |
| 819 | fn visit_use_rename(&mut self, i: &'ast UseRename) { |
| 820 | visit_use_rename(self, i) |
| 821 | } |
| 822 | #[cfg(feature = "full")] |
| 823 | fn visit_use_tree(&mut self, i: &'ast UseTree) { |
| 824 | visit_use_tree(self, i) |
| 825 | } |
| 826 | #[cfg(any(feature = "full", feature = "derive"))] |
| 827 | fn visit_variant(&mut self, i: &'ast Variant) { |
| 828 | visit_variant(self, i) |
| 829 | } |
| 830 | #[cfg(any(feature = "full", feature = "derive"))] |
| 831 | fn visit_vis_crate(&mut self, i: &'ast VisCrate) { |
| 832 | visit_vis_crate(self, i) |
| 833 | } |
| 834 | #[cfg(any(feature = "full", feature = "derive"))] |
| 835 | fn visit_vis_public(&mut self, i: &'ast VisPublic) { |
| 836 | visit_vis_public(self, i) |
| 837 | } |
| 838 | #[cfg(any(feature = "full", feature = "derive"))] |
| 839 | fn visit_vis_restricted(&mut self, i: &'ast VisRestricted) { |
| 840 | visit_vis_restricted(self, i) |
| 841 | } |
| 842 | #[cfg(any(feature = "full", feature = "derive"))] |
| 843 | fn visit_visibility(&mut self, i: &'ast Visibility) { |
| 844 | visit_visibility(self, i) |
| 845 | } |
| 846 | #[cfg(any(feature = "full", feature = "derive"))] |
| 847 | fn visit_where_clause(&mut self, i: &'ast WhereClause) { |
| 848 | visit_where_clause(self, i) |
| 849 | } |
| 850 | #[cfg(any(feature = "full", feature = "derive"))] |
| 851 | fn visit_where_predicate(&mut self, i: &'ast WherePredicate) { |
| 852 | visit_where_predicate(self, i) |
| 853 | } |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 854 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 855 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 856 | pub fn visit_abi<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Abi) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 857 | tokens_helper(_visitor, &(_i.extern_token).0); |
| 858 | if let Some(ref it) = _i.name { |
| 859 | _visitor.visit_lit_str(it) |
| 860 | }; |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 861 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 862 | #[cfg(any(feature = "full", feature = "derive"))] |
| 863 | pub fn visit_angle_bracketed_generic_arguments<'ast, V: Visit<'ast> + ?Sized>( |
| 864 | _visitor: &mut V, |
| 865 | _i: &'ast AngleBracketedGenericArguments, |
| 866 | ) { |
| 867 | if let Some(ref it) = _i.colon2_token { |
| 868 | tokens_helper(_visitor, &(it).0) |
| 869 | }; |
| 870 | tokens_helper(_visitor, &(_i.lt_token).0); |
| 871 | for el in Punctuated::pairs(&_i.args) { |
| 872 | let it = el.value(); |
| 873 | _visitor.visit_generic_argument(it) |
| 874 | } |
| 875 | tokens_helper(_visitor, &(_i.gt_token).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 876 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 877 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 878 | pub fn visit_arg_captured<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ArgCaptured) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 879 | _visitor.visit_pat(&_i.pat); |
| 880 | tokens_helper(_visitor, &(_i.colon_token).0); |
| 881 | _visitor.visit_type(&_i.ty); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 882 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 883 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 884 | pub fn visit_arg_self<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ArgSelf) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 885 | if let Some(ref it) = _i.mutability { |
| 886 | tokens_helper(_visitor, &(it).0) |
| 887 | }; |
| 888 | tokens_helper(_visitor, &(_i.self_token).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 889 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 890 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 891 | pub fn visit_arg_self_ref<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ArgSelfRef) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 892 | tokens_helper(_visitor, &(_i.and_token).0); |
| 893 | if let Some(ref it) = _i.lifetime { |
| 894 | _visitor.visit_lifetime(it) |
| 895 | }; |
| 896 | if let Some(ref it) = _i.mutability { |
| 897 | tokens_helper(_visitor, &(it).0) |
| 898 | }; |
| 899 | tokens_helper(_visitor, &(_i.self_token).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 900 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 901 | #[cfg(any(feature = "full", feature = "derive"))] |
| 902 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 903 | pub fn visit_arm<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Arm) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 904 | for it in &_i.attrs { |
| 905 | _visitor.visit_attribute(it) |
| 906 | } |
| 907 | if let Some(ref it) = _i.leading_vert { |
| 908 | tokens_helper(_visitor, &(it).0) |
| 909 | }; |
| 910 | for el in Punctuated::pairs(&_i.pats) { |
| 911 | let it = el.value(); |
| 912 | _visitor.visit_pat(it) |
| 913 | } |
| 914 | if let Some(ref it) = _i.guard { |
| 915 | tokens_helper(_visitor, &((it).0).0); |
| 916 | _visitor.visit_expr(&*(it).1); |
| 917 | }; |
| 918 | tokens_helper(_visitor, &(_i.fat_arrow_token).0); |
| 919 | _visitor.visit_expr(&*_i.body); |
| 920 | if let Some(ref it) = _i.comma { |
| 921 | tokens_helper(_visitor, &(it).0) |
| 922 | }; |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 923 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 924 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 925 | pub fn visit_attr_style<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast AttrStyle) { |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 926 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 927 | AttrStyle::Outer => {} |
| 928 | AttrStyle::Inner(ref _binding_0) => { |
David Tolnay | cc0f037 | 2017-12-28 19:11:04 -0500 | [diff] [blame] | 929 | tokens_helper(_visitor, &(_binding_0).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 930 | } |
| 931 | } |
| 932 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 933 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 934 | pub fn visit_attribute<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Attribute) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 935 | tokens_helper(_visitor, &(_i.pound_token).0); |
| 936 | _visitor.visit_attr_style(&_i.style); |
| 937 | tokens_helper(_visitor, &(_i.bracket_token).0); |
| 938 | _visitor.visit_path(&_i.path); |
David Tolnay | 6af4899 | 2018-08-01 11:16:28 -0700 | [diff] [blame] | 939 | skip!(_i.tts); |
| 940 | skip!(_i.is_sugared_doc); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 941 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 942 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 943 | pub fn visit_bare_fn_arg<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast BareFnArg) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 944 | if let Some(ref it) = _i.name { |
| 945 | _visitor.visit_bare_fn_arg_name(&(it).0); |
| 946 | tokens_helper(_visitor, &((it).1).0); |
| 947 | }; |
| 948 | _visitor.visit_type(&_i.ty); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 949 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 950 | #[cfg(any(feature = "full", feature = "derive"))] |
| 951 | pub fn visit_bare_fn_arg_name<'ast, V: Visit<'ast> + ?Sized>( |
| 952 | _visitor: &mut V, |
| 953 | _i: &'ast BareFnArgName, |
| 954 | ) { |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 955 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 956 | BareFnArgName::Named(ref _binding_0) => { |
Alex Crichton | d261d09 | 2018-05-18 13:47:35 -0700 | [diff] [blame] | 957 | _visitor.visit_ident(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 958 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 959 | BareFnArgName::Wild(ref _binding_0) => { |
David Tolnay | cc0f037 | 2017-12-28 19:11:04 -0500 | [diff] [blame] | 960 | tokens_helper(_visitor, &(_binding_0).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 961 | } |
| 962 | } |
| 963 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 964 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 965 | pub fn visit_bin_op<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast BinOp) { |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 966 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 967 | BinOp::Add(ref _binding_0) => { |
David Tolnay | cc0f037 | 2017-12-28 19:11:04 -0500 | [diff] [blame] | 968 | tokens_helper(_visitor, &(_binding_0).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 969 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 970 | BinOp::Sub(ref _binding_0) => { |
David Tolnay | cc0f037 | 2017-12-28 19:11:04 -0500 | [diff] [blame] | 971 | tokens_helper(_visitor, &(_binding_0).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 972 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 973 | BinOp::Mul(ref _binding_0) => { |
David Tolnay | cc0f037 | 2017-12-28 19:11:04 -0500 | [diff] [blame] | 974 | tokens_helper(_visitor, &(_binding_0).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 975 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 976 | BinOp::Div(ref _binding_0) => { |
David Tolnay | cc0f037 | 2017-12-28 19:11:04 -0500 | [diff] [blame] | 977 | tokens_helper(_visitor, &(_binding_0).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 978 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 979 | BinOp::Rem(ref _binding_0) => { |
David Tolnay | cc0f037 | 2017-12-28 19:11:04 -0500 | [diff] [blame] | 980 | tokens_helper(_visitor, &(_binding_0).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 981 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 982 | BinOp::And(ref _binding_0) => { |
David Tolnay | cc0f037 | 2017-12-28 19:11:04 -0500 | [diff] [blame] | 983 | tokens_helper(_visitor, &(_binding_0).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 984 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 985 | BinOp::Or(ref _binding_0) => { |
David Tolnay | cc0f037 | 2017-12-28 19:11:04 -0500 | [diff] [blame] | 986 | tokens_helper(_visitor, &(_binding_0).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 987 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 988 | BinOp::BitXor(ref _binding_0) => { |
David Tolnay | cc0f037 | 2017-12-28 19:11:04 -0500 | [diff] [blame] | 989 | tokens_helper(_visitor, &(_binding_0).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 990 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 991 | BinOp::BitAnd(ref _binding_0) => { |
David Tolnay | cc0f037 | 2017-12-28 19:11:04 -0500 | [diff] [blame] | 992 | tokens_helper(_visitor, &(_binding_0).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 993 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 994 | BinOp::BitOr(ref _binding_0) => { |
David Tolnay | cc0f037 | 2017-12-28 19:11:04 -0500 | [diff] [blame] | 995 | tokens_helper(_visitor, &(_binding_0).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 996 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 997 | BinOp::Shl(ref _binding_0) => { |
David Tolnay | cc0f037 | 2017-12-28 19:11:04 -0500 | [diff] [blame] | 998 | tokens_helper(_visitor, &(_binding_0).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 999 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1000 | BinOp::Shr(ref _binding_0) => { |
David Tolnay | cc0f037 | 2017-12-28 19:11:04 -0500 | [diff] [blame] | 1001 | tokens_helper(_visitor, &(_binding_0).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1002 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1003 | BinOp::Eq(ref _binding_0) => { |
David Tolnay | cc0f037 | 2017-12-28 19:11:04 -0500 | [diff] [blame] | 1004 | tokens_helper(_visitor, &(_binding_0).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1005 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1006 | BinOp::Lt(ref _binding_0) => { |
David Tolnay | cc0f037 | 2017-12-28 19:11:04 -0500 | [diff] [blame] | 1007 | tokens_helper(_visitor, &(_binding_0).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1008 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1009 | BinOp::Le(ref _binding_0) => { |
David Tolnay | cc0f037 | 2017-12-28 19:11:04 -0500 | [diff] [blame] | 1010 | tokens_helper(_visitor, &(_binding_0).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1011 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1012 | BinOp::Ne(ref _binding_0) => { |
David Tolnay | cc0f037 | 2017-12-28 19:11:04 -0500 | [diff] [blame] | 1013 | tokens_helper(_visitor, &(_binding_0).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1014 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1015 | BinOp::Ge(ref _binding_0) => { |
David Tolnay | cc0f037 | 2017-12-28 19:11:04 -0500 | [diff] [blame] | 1016 | tokens_helper(_visitor, &(_binding_0).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1017 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1018 | BinOp::Gt(ref _binding_0) => { |
David Tolnay | cc0f037 | 2017-12-28 19:11:04 -0500 | [diff] [blame] | 1019 | tokens_helper(_visitor, &(_binding_0).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1020 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1021 | BinOp::AddEq(ref _binding_0) => { |
David Tolnay | cc0f037 | 2017-12-28 19:11:04 -0500 | [diff] [blame] | 1022 | tokens_helper(_visitor, &(_binding_0).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1023 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1024 | BinOp::SubEq(ref _binding_0) => { |
David Tolnay | cc0f037 | 2017-12-28 19:11:04 -0500 | [diff] [blame] | 1025 | tokens_helper(_visitor, &(_binding_0).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1026 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1027 | BinOp::MulEq(ref _binding_0) => { |
David Tolnay | cc0f037 | 2017-12-28 19:11:04 -0500 | [diff] [blame] | 1028 | tokens_helper(_visitor, &(_binding_0).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1029 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1030 | BinOp::DivEq(ref _binding_0) => { |
David Tolnay | cc0f037 | 2017-12-28 19:11:04 -0500 | [diff] [blame] | 1031 | tokens_helper(_visitor, &(_binding_0).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1032 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1033 | BinOp::RemEq(ref _binding_0) => { |
David Tolnay | cc0f037 | 2017-12-28 19:11:04 -0500 | [diff] [blame] | 1034 | tokens_helper(_visitor, &(_binding_0).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1035 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1036 | BinOp::BitXorEq(ref _binding_0) => { |
David Tolnay | cc0f037 | 2017-12-28 19:11:04 -0500 | [diff] [blame] | 1037 | tokens_helper(_visitor, &(_binding_0).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1038 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1039 | BinOp::BitAndEq(ref _binding_0) => { |
David Tolnay | cc0f037 | 2017-12-28 19:11:04 -0500 | [diff] [blame] | 1040 | tokens_helper(_visitor, &(_binding_0).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1041 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1042 | BinOp::BitOrEq(ref _binding_0) => { |
David Tolnay | cc0f037 | 2017-12-28 19:11:04 -0500 | [diff] [blame] | 1043 | tokens_helper(_visitor, &(_binding_0).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1044 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1045 | BinOp::ShlEq(ref _binding_0) => { |
David Tolnay | cc0f037 | 2017-12-28 19:11:04 -0500 | [diff] [blame] | 1046 | tokens_helper(_visitor, &(_binding_0).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1047 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1048 | BinOp::ShrEq(ref _binding_0) => { |
David Tolnay | cc0f037 | 2017-12-28 19:11:04 -0500 | [diff] [blame] | 1049 | tokens_helper(_visitor, &(_binding_0).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1050 | } |
| 1051 | } |
| 1052 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1053 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 1054 | pub fn visit_binding<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Binding) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1055 | _visitor.visit_ident(&_i.ident); |
| 1056 | tokens_helper(_visitor, &(_i.eq_token).0); |
| 1057 | _visitor.visit_type(&_i.ty); |
David Tolnay | 506e43a | 2017-12-29 11:34:36 -0500 | [diff] [blame] | 1058 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1059 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1060 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 1061 | pub fn visit_block<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Block) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1062 | tokens_helper(_visitor, &(_i.brace_token).0); |
| 1063 | for it in &_i.stmts { |
| 1064 | _visitor.visit_stmt(it) |
| 1065 | } |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1066 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1067 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1068 | pub fn visit_bound_lifetimes<'ast, V: Visit<'ast> + ?Sized>( |
| 1069 | _visitor: &mut V, |
| 1070 | _i: &'ast BoundLifetimes, |
| 1071 | ) { |
| 1072 | tokens_helper(_visitor, &(_i.for_token).0); |
| 1073 | tokens_helper(_visitor, &(_i.lt_token).0); |
| 1074 | for el in Punctuated::pairs(&_i.lifetimes) { |
| 1075 | let it = el.value(); |
| 1076 | _visitor.visit_lifetime_def(it) |
| 1077 | } |
| 1078 | tokens_helper(_visitor, &(_i.gt_token).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1079 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1080 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 1081 | pub fn visit_const_param<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ConstParam) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1082 | for it in &_i.attrs { |
| 1083 | _visitor.visit_attribute(it) |
| 1084 | } |
| 1085 | tokens_helper(_visitor, &(_i.const_token).0); |
| 1086 | _visitor.visit_ident(&_i.ident); |
| 1087 | tokens_helper(_visitor, &(_i.colon_token).0); |
| 1088 | _visitor.visit_type(&_i.ty); |
| 1089 | if let Some(ref it) = _i.eq_token { |
| 1090 | tokens_helper(_visitor, &(it).0) |
| 1091 | }; |
| 1092 | if let Some(ref it) = _i.default { |
| 1093 | _visitor.visit_expr(it) |
| 1094 | }; |
Nika Layzell | f1fdc0b | 2017-12-04 19:58:32 -0500 | [diff] [blame] | 1095 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1096 | #[cfg(feature = "derive")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 1097 | pub fn visit_data<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Data) { |
David Tolnay | e3d41b7 | 2017-12-31 15:24:00 -0500 | [diff] [blame] | 1098 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1099 | Data::Struct(ref _binding_0) => { |
David Tolnay | e3d41b7 | 2017-12-31 15:24:00 -0500 | [diff] [blame] | 1100 | _visitor.visit_data_struct(_binding_0); |
| 1101 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1102 | Data::Enum(ref _binding_0) => { |
David Tolnay | e3d41b7 | 2017-12-31 15:24:00 -0500 | [diff] [blame] | 1103 | _visitor.visit_data_enum(_binding_0); |
| 1104 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1105 | Data::Union(ref _binding_0) => { |
David Tolnay | e3d41b7 | 2017-12-31 15:24:00 -0500 | [diff] [blame] | 1106 | _visitor.visit_data_union(_binding_0); |
| 1107 | } |
| 1108 | } |
| 1109 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1110 | #[cfg(feature = "derive")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 1111 | pub fn visit_data_enum<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataEnum) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1112 | tokens_helper(_visitor, &(_i.enum_token).0); |
| 1113 | tokens_helper(_visitor, &(_i.brace_token).0); |
| 1114 | for el in Punctuated::pairs(&_i.variants) { |
| 1115 | let it = el.value(); |
| 1116 | _visitor.visit_variant(it) |
| 1117 | } |
David Tolnay | e3d41b7 | 2017-12-31 15:24:00 -0500 | [diff] [blame] | 1118 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1119 | #[cfg(feature = "derive")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 1120 | pub fn visit_data_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataStruct) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1121 | tokens_helper(_visitor, &(_i.struct_token).0); |
| 1122 | _visitor.visit_fields(&_i.fields); |
| 1123 | if let Some(ref it) = _i.semi_token { |
| 1124 | tokens_helper(_visitor, &(it).0) |
| 1125 | }; |
David Tolnay | e3d41b7 | 2017-12-31 15:24:00 -0500 | [diff] [blame] | 1126 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1127 | #[cfg(feature = "derive")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 1128 | pub fn visit_data_union<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataUnion) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1129 | tokens_helper(_visitor, &(_i.union_token).0); |
| 1130 | _visitor.visit_fields_named(&_i.fields); |
David Tolnay | e3d41b7 | 2017-12-31 15:24:00 -0500 | [diff] [blame] | 1131 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1132 | #[cfg(feature = "derive")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 1133 | pub fn visit_derive_input<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DeriveInput) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1134 | for it in &_i.attrs { |
| 1135 | _visitor.visit_attribute(it) |
| 1136 | } |
| 1137 | _visitor.visit_visibility(&_i.vis); |
| 1138 | _visitor.visit_ident(&_i.ident); |
| 1139 | _visitor.visit_generics(&_i.generics); |
| 1140 | _visitor.visit_data(&_i.data); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1141 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1142 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 1143 | pub fn visit_expr<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Expr) { |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1144 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1145 | Expr::Box(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1146 | full!(_visitor.visit_expr_box(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1147 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1148 | Expr::InPlace(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1149 | full!(_visitor.visit_expr_in_place(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1150 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1151 | Expr::Array(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1152 | full!(_visitor.visit_expr_array(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1153 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1154 | Expr::Call(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1155 | _visitor.visit_expr_call(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1156 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1157 | Expr::MethodCall(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1158 | full!(_visitor.visit_expr_method_call(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1159 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1160 | Expr::Tuple(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1161 | full!(_visitor.visit_expr_tuple(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1162 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1163 | Expr::Binary(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1164 | _visitor.visit_expr_binary(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1165 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1166 | Expr::Unary(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1167 | _visitor.visit_expr_unary(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1168 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1169 | Expr::Lit(ref _binding_0) => { |
David Tolnay | 8c91b88 | 2017-12-28 23:04:32 -0500 | [diff] [blame] | 1170 | _visitor.visit_expr_lit(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1171 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1172 | Expr::Cast(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1173 | _visitor.visit_expr_cast(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1174 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1175 | Expr::Type(ref _binding_0) => { |
David Tolnay | 0cf94f2 | 2017-12-28 23:46:26 -0500 | [diff] [blame] | 1176 | full!(_visitor.visit_expr_type(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1177 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1178 | Expr::If(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1179 | full!(_visitor.visit_expr_if(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1180 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1181 | Expr::IfLet(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1182 | full!(_visitor.visit_expr_if_let(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1183 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1184 | Expr::While(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1185 | full!(_visitor.visit_expr_while(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1186 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1187 | Expr::WhileLet(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1188 | full!(_visitor.visit_expr_while_let(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1189 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1190 | Expr::ForLoop(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1191 | full!(_visitor.visit_expr_for_loop(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1192 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1193 | Expr::Loop(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1194 | full!(_visitor.visit_expr_loop(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1195 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1196 | Expr::Match(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1197 | full!(_visitor.visit_expr_match(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1198 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1199 | Expr::Closure(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1200 | full!(_visitor.visit_expr_closure(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1201 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1202 | Expr::Unsafe(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1203 | full!(_visitor.visit_expr_unsafe(_binding_0)); |
Nika Layzell | 640832a | 2017-12-04 13:37:09 -0500 | [diff] [blame] | 1204 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1205 | Expr::Block(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1206 | full!(_visitor.visit_expr_block(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1207 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1208 | Expr::Assign(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1209 | full!(_visitor.visit_expr_assign(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1210 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1211 | Expr::AssignOp(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1212 | full!(_visitor.visit_expr_assign_op(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1213 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1214 | Expr::Field(ref _binding_0) => { |
David Tolnay | d093fa9 | 2018-06-30 10:23:25 -0700 | [diff] [blame] | 1215 | _visitor.visit_expr_field(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1216 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1217 | Expr::Index(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1218 | _visitor.visit_expr_index(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1219 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1220 | Expr::Range(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1221 | full!(_visitor.visit_expr_range(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1222 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1223 | Expr::Path(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1224 | _visitor.visit_expr_path(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1225 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1226 | Expr::Reference(ref _binding_0) => { |
David Tolnay | 00674ba | 2018-03-31 18:14:11 +0200 | [diff] [blame] | 1227 | full!(_visitor.visit_expr_reference(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1228 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1229 | Expr::Break(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1230 | full!(_visitor.visit_expr_break(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1231 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1232 | Expr::Continue(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1233 | full!(_visitor.visit_expr_continue(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1234 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1235 | Expr::Return(ref _binding_0) => { |
David Tolnay | c246cd3 | 2017-12-28 23:14:32 -0500 | [diff] [blame] | 1236 | full!(_visitor.visit_expr_return(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1237 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1238 | Expr::Macro(ref _binding_0) => { |
David Tolnay | 8c91b88 | 2017-12-28 23:04:32 -0500 | [diff] [blame] | 1239 | full!(_visitor.visit_expr_macro(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1240 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1241 | Expr::Struct(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1242 | full!(_visitor.visit_expr_struct(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1243 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1244 | Expr::Repeat(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1245 | full!(_visitor.visit_expr_repeat(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1246 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1247 | Expr::Paren(ref _binding_0) => { |
David Tolnay | 81ab4f6 | 2018-01-27 19:02:51 -0800 | [diff] [blame] | 1248 | _visitor.visit_expr_paren(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1249 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1250 | Expr::Group(ref _binding_0) => { |
David Tolnay | e98775f | 2017-12-28 23:17:00 -0500 | [diff] [blame] | 1251 | full!(_visitor.visit_expr_group(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1252 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1253 | Expr::Try(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1254 | full!(_visitor.visit_expr_try(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1255 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1256 | Expr::Catch(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1257 | full!(_visitor.visit_expr_catch(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1258 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1259 | Expr::Yield(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1260 | full!(_visitor.visit_expr_yield(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1261 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1262 | Expr::Verbatim(ref _binding_0) => { |
David Tolnay | 2ae520a | 2017-12-29 11:19:50 -0500 | [diff] [blame] | 1263 | _visitor.visit_expr_verbatim(_binding_0); |
| 1264 | } |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1265 | } |
| 1266 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1267 | #[cfg(feature = "full")] |
| 1268 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 1269 | pub fn visit_expr_array<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprArray) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1270 | for it in &_i.attrs { |
| 1271 | _visitor.visit_attribute(it) |
| 1272 | } |
| 1273 | tokens_helper(_visitor, &(_i.bracket_token).0); |
| 1274 | for el in Punctuated::pairs(&_i.elems) { |
| 1275 | let it = el.value(); |
| 1276 | _visitor.visit_expr(it) |
David Tolnay | e3d41b7 | 2017-12-31 15:24:00 -0500 | [diff] [blame] | 1277 | } |
| 1278 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1279 | #[cfg(feature = "full")] |
| 1280 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1281 | pub fn visit_expr_assign<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprAssign) { |
| 1282 | for it in &_i.attrs { |
| 1283 | _visitor.visit_attribute(it) |
| 1284 | } |
| 1285 | _visitor.visit_expr(&*_i.left); |
| 1286 | tokens_helper(_visitor, &(_i.eq_token).0); |
| 1287 | _visitor.visit_expr(&*_i.right); |
| 1288 | } |
| 1289 | #[cfg(feature = "full")] |
| 1290 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1291 | pub fn visit_expr_assign_op<'ast, V: Visit<'ast> + ?Sized>( |
| 1292 | _visitor: &mut V, |
| 1293 | _i: &'ast ExprAssignOp, |
| 1294 | ) { |
| 1295 | for it in &_i.attrs { |
| 1296 | _visitor.visit_attribute(it) |
| 1297 | } |
| 1298 | _visitor.visit_expr(&*_i.left); |
| 1299 | _visitor.visit_bin_op(&_i.op); |
| 1300 | _visitor.visit_expr(&*_i.right); |
| 1301 | } |
| 1302 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1303 | pub fn visit_expr_binary<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBinary) { |
| 1304 | for it in &_i.attrs { |
| 1305 | _visitor.visit_attribute(it) |
| 1306 | } |
| 1307 | _visitor.visit_expr(&*_i.left); |
| 1308 | _visitor.visit_bin_op(&_i.op); |
| 1309 | _visitor.visit_expr(&*_i.right); |
| 1310 | } |
| 1311 | #[cfg(feature = "full")] |
| 1312 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1313 | pub fn visit_expr_block<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBlock) { |
| 1314 | for it in &_i.attrs { |
| 1315 | _visitor.visit_attribute(it) |
| 1316 | } |
| 1317 | _visitor.visit_block(&_i.block); |
| 1318 | } |
| 1319 | #[cfg(feature = "full")] |
| 1320 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1321 | pub fn visit_expr_box<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBox) { |
| 1322 | for it in &_i.attrs { |
| 1323 | _visitor.visit_attribute(it) |
| 1324 | } |
| 1325 | tokens_helper(_visitor, &(_i.box_token).0); |
| 1326 | _visitor.visit_expr(&*_i.expr); |
| 1327 | } |
| 1328 | #[cfg(feature = "full")] |
| 1329 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1330 | pub fn visit_expr_break<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBreak) { |
| 1331 | for it in &_i.attrs { |
| 1332 | _visitor.visit_attribute(it) |
| 1333 | } |
| 1334 | tokens_helper(_visitor, &(_i.break_token).0); |
| 1335 | if let Some(ref it) = _i.label { |
| 1336 | _visitor.visit_lifetime(it) |
| 1337 | }; |
| 1338 | if let Some(ref it) = _i.expr { |
| 1339 | _visitor.visit_expr(&**it) |
| 1340 | }; |
| 1341 | } |
| 1342 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1343 | pub fn visit_expr_call<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprCall) { |
| 1344 | for it in &_i.attrs { |
| 1345 | _visitor.visit_attribute(it) |
| 1346 | } |
| 1347 | _visitor.visit_expr(&*_i.func); |
| 1348 | tokens_helper(_visitor, &(_i.paren_token).0); |
| 1349 | for el in Punctuated::pairs(&_i.args) { |
| 1350 | let it = el.value(); |
| 1351 | _visitor.visit_expr(it) |
| 1352 | } |
| 1353 | } |
| 1354 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1355 | pub fn visit_expr_cast<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprCast) { |
| 1356 | for it in &_i.attrs { |
| 1357 | _visitor.visit_attribute(it) |
| 1358 | } |
| 1359 | _visitor.visit_expr(&*_i.expr); |
| 1360 | tokens_helper(_visitor, &(_i.as_token).0); |
| 1361 | _visitor.visit_type(&*_i.ty); |
| 1362 | } |
| 1363 | #[cfg(feature = "full")] |
| 1364 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1365 | pub fn visit_expr_catch<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprCatch) { |
| 1366 | for it in &_i.attrs { |
| 1367 | _visitor.visit_attribute(it) |
| 1368 | } |
| 1369 | tokens_helper(_visitor, &(_i.do_token).0); |
| 1370 | tokens_helper(_visitor, &(_i.catch_token).0); |
| 1371 | _visitor.visit_block(&_i.block); |
| 1372 | } |
| 1373 | #[cfg(feature = "full")] |
| 1374 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1375 | pub fn visit_expr_closure<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprClosure) { |
| 1376 | for it in &_i.attrs { |
| 1377 | _visitor.visit_attribute(it) |
| 1378 | } |
| 1379 | if let Some(ref it) = _i.movability { |
| 1380 | tokens_helper(_visitor, &(it).0) |
| 1381 | }; |
| 1382 | if let Some(ref it) = _i.capture { |
| 1383 | tokens_helper(_visitor, &(it).0) |
| 1384 | }; |
| 1385 | tokens_helper(_visitor, &(_i.or1_token).0); |
| 1386 | for el in Punctuated::pairs(&_i.inputs) { |
| 1387 | let it = el.value(); |
| 1388 | _visitor.visit_fn_arg(it) |
| 1389 | } |
| 1390 | tokens_helper(_visitor, &(_i.or2_token).0); |
| 1391 | _visitor.visit_return_type(&_i.output); |
| 1392 | _visitor.visit_expr(&*_i.body); |
| 1393 | } |
| 1394 | #[cfg(feature = "full")] |
| 1395 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1396 | pub fn visit_expr_continue<'ast, V: Visit<'ast> + ?Sized>( |
| 1397 | _visitor: &mut V, |
| 1398 | _i: &'ast ExprContinue, |
| 1399 | ) { |
| 1400 | for it in &_i.attrs { |
| 1401 | _visitor.visit_attribute(it) |
| 1402 | } |
| 1403 | tokens_helper(_visitor, &(_i.continue_token).0); |
| 1404 | if let Some(ref it) = _i.label { |
| 1405 | _visitor.visit_lifetime(it) |
| 1406 | }; |
| 1407 | } |
| 1408 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1409 | pub fn visit_expr_field<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprField) { |
| 1410 | for it in &_i.attrs { |
| 1411 | _visitor.visit_attribute(it) |
| 1412 | } |
| 1413 | _visitor.visit_expr(&*_i.base); |
| 1414 | tokens_helper(_visitor, &(_i.dot_token).0); |
| 1415 | _visitor.visit_member(&_i.member); |
| 1416 | } |
| 1417 | #[cfg(feature = "full")] |
| 1418 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1419 | pub fn visit_expr_for_loop<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprForLoop) { |
| 1420 | for it in &_i.attrs { |
| 1421 | _visitor.visit_attribute(it) |
| 1422 | } |
| 1423 | if let Some(ref it) = _i.label { |
| 1424 | _visitor.visit_label(it) |
| 1425 | }; |
| 1426 | tokens_helper(_visitor, &(_i.for_token).0); |
| 1427 | _visitor.visit_pat(&*_i.pat); |
| 1428 | tokens_helper(_visitor, &(_i.in_token).0); |
| 1429 | _visitor.visit_expr(&*_i.expr); |
| 1430 | _visitor.visit_block(&_i.body); |
| 1431 | } |
| 1432 | #[cfg(feature = "full")] |
| 1433 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1434 | pub fn visit_expr_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprGroup) { |
| 1435 | for it in &_i.attrs { |
| 1436 | _visitor.visit_attribute(it) |
| 1437 | } |
| 1438 | tokens_helper(_visitor, &(_i.group_token).0); |
| 1439 | _visitor.visit_expr(&*_i.expr); |
| 1440 | } |
| 1441 | #[cfg(feature = "full")] |
| 1442 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1443 | pub fn visit_expr_if<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprIf) { |
| 1444 | for it in &_i.attrs { |
| 1445 | _visitor.visit_attribute(it) |
| 1446 | } |
| 1447 | tokens_helper(_visitor, &(_i.if_token).0); |
| 1448 | _visitor.visit_expr(&*_i.cond); |
| 1449 | _visitor.visit_block(&_i.then_branch); |
| 1450 | if let Some(ref it) = _i.else_branch { |
| 1451 | tokens_helper(_visitor, &((it).0).0); |
| 1452 | _visitor.visit_expr(&*(it).1); |
| 1453 | }; |
| 1454 | } |
| 1455 | #[cfg(feature = "full")] |
| 1456 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1457 | pub fn visit_expr_if_let<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprIfLet) { |
| 1458 | for it in &_i.attrs { |
| 1459 | _visitor.visit_attribute(it) |
| 1460 | } |
| 1461 | tokens_helper(_visitor, &(_i.if_token).0); |
| 1462 | tokens_helper(_visitor, &(_i.let_token).0); |
| 1463 | for el in Punctuated::pairs(&_i.pats) { |
| 1464 | let it = el.value(); |
| 1465 | _visitor.visit_pat(it) |
| 1466 | } |
| 1467 | tokens_helper(_visitor, &(_i.eq_token).0); |
| 1468 | _visitor.visit_expr(&*_i.expr); |
| 1469 | _visitor.visit_block(&_i.then_branch); |
| 1470 | if let Some(ref it) = _i.else_branch { |
| 1471 | tokens_helper(_visitor, &((it).0).0); |
| 1472 | _visitor.visit_expr(&*(it).1); |
| 1473 | }; |
| 1474 | } |
| 1475 | #[cfg(feature = "full")] |
| 1476 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1477 | pub fn visit_expr_in_place<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprInPlace) { |
| 1478 | for it in &_i.attrs { |
| 1479 | _visitor.visit_attribute(it) |
| 1480 | } |
| 1481 | _visitor.visit_expr(&*_i.place); |
| 1482 | tokens_helper(_visitor, &(_i.arrow_token).0); |
| 1483 | _visitor.visit_expr(&*_i.value); |
| 1484 | } |
| 1485 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1486 | pub fn visit_expr_index<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprIndex) { |
| 1487 | for it in &_i.attrs { |
| 1488 | _visitor.visit_attribute(it) |
| 1489 | } |
| 1490 | _visitor.visit_expr(&*_i.expr); |
| 1491 | tokens_helper(_visitor, &(_i.bracket_token).0); |
| 1492 | _visitor.visit_expr(&*_i.index); |
| 1493 | } |
| 1494 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1495 | pub fn visit_expr_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprLit) { |
| 1496 | for it in &_i.attrs { |
| 1497 | _visitor.visit_attribute(it) |
| 1498 | } |
| 1499 | _visitor.visit_lit(&_i.lit); |
| 1500 | } |
| 1501 | #[cfg(feature = "full")] |
| 1502 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1503 | pub fn visit_expr_loop<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprLoop) { |
| 1504 | for it in &_i.attrs { |
| 1505 | _visitor.visit_attribute(it) |
| 1506 | } |
| 1507 | if let Some(ref it) = _i.label { |
| 1508 | _visitor.visit_label(it) |
| 1509 | }; |
| 1510 | tokens_helper(_visitor, &(_i.loop_token).0); |
| 1511 | _visitor.visit_block(&_i.body); |
| 1512 | } |
| 1513 | #[cfg(feature = "full")] |
| 1514 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1515 | pub fn visit_expr_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprMacro) { |
| 1516 | for it in &_i.attrs { |
| 1517 | _visitor.visit_attribute(it) |
| 1518 | } |
| 1519 | _visitor.visit_macro(&_i.mac); |
| 1520 | } |
| 1521 | #[cfg(feature = "full")] |
| 1522 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1523 | pub fn visit_expr_match<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprMatch) { |
| 1524 | for it in &_i.attrs { |
| 1525 | _visitor.visit_attribute(it) |
| 1526 | } |
| 1527 | tokens_helper(_visitor, &(_i.match_token).0); |
| 1528 | _visitor.visit_expr(&*_i.expr); |
| 1529 | tokens_helper(_visitor, &(_i.brace_token).0); |
| 1530 | for it in &_i.arms { |
| 1531 | _visitor.visit_arm(it) |
| 1532 | } |
| 1533 | } |
| 1534 | #[cfg(feature = "full")] |
| 1535 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1536 | pub fn visit_expr_method_call<'ast, V: Visit<'ast> + ?Sized>( |
| 1537 | _visitor: &mut V, |
| 1538 | _i: &'ast ExprMethodCall, |
| 1539 | ) { |
| 1540 | for it in &_i.attrs { |
| 1541 | _visitor.visit_attribute(it) |
| 1542 | } |
| 1543 | _visitor.visit_expr(&*_i.receiver); |
| 1544 | tokens_helper(_visitor, &(_i.dot_token).0); |
| 1545 | _visitor.visit_ident(&_i.method); |
| 1546 | if let Some(ref it) = _i.turbofish { |
| 1547 | _visitor.visit_method_turbofish(it) |
| 1548 | }; |
| 1549 | tokens_helper(_visitor, &(_i.paren_token).0); |
| 1550 | for el in Punctuated::pairs(&_i.args) { |
| 1551 | let it = el.value(); |
| 1552 | _visitor.visit_expr(it) |
| 1553 | } |
| 1554 | } |
| 1555 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1556 | pub fn visit_expr_paren<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprParen) { |
| 1557 | for it in &_i.attrs { |
| 1558 | _visitor.visit_attribute(it) |
| 1559 | } |
| 1560 | tokens_helper(_visitor, &(_i.paren_token).0); |
| 1561 | _visitor.visit_expr(&*_i.expr); |
| 1562 | } |
| 1563 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1564 | pub fn visit_expr_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprPath) { |
| 1565 | for it in &_i.attrs { |
| 1566 | _visitor.visit_attribute(it) |
| 1567 | } |
| 1568 | if let Some(ref it) = _i.qself { |
| 1569 | _visitor.visit_qself(it) |
| 1570 | }; |
| 1571 | _visitor.visit_path(&_i.path); |
| 1572 | } |
| 1573 | #[cfg(feature = "full")] |
| 1574 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1575 | pub fn visit_expr_range<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprRange) { |
| 1576 | for it in &_i.attrs { |
| 1577 | _visitor.visit_attribute(it) |
| 1578 | } |
| 1579 | if let Some(ref it) = _i.from { |
| 1580 | _visitor.visit_expr(&**it) |
| 1581 | }; |
| 1582 | _visitor.visit_range_limits(&_i.limits); |
| 1583 | if let Some(ref it) = _i.to { |
| 1584 | _visitor.visit_expr(&**it) |
| 1585 | }; |
| 1586 | } |
| 1587 | #[cfg(feature = "full")] |
| 1588 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1589 | pub fn visit_expr_reference<'ast, V: Visit<'ast> + ?Sized>( |
| 1590 | _visitor: &mut V, |
| 1591 | _i: &'ast ExprReference, |
| 1592 | ) { |
| 1593 | for it in &_i.attrs { |
| 1594 | _visitor.visit_attribute(it) |
| 1595 | } |
| 1596 | tokens_helper(_visitor, &(_i.and_token).0); |
| 1597 | if let Some(ref it) = _i.mutability { |
| 1598 | tokens_helper(_visitor, &(it).0) |
| 1599 | }; |
| 1600 | _visitor.visit_expr(&*_i.expr); |
| 1601 | } |
| 1602 | #[cfg(feature = "full")] |
| 1603 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1604 | pub fn visit_expr_repeat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprRepeat) { |
| 1605 | for it in &_i.attrs { |
| 1606 | _visitor.visit_attribute(it) |
| 1607 | } |
| 1608 | tokens_helper(_visitor, &(_i.bracket_token).0); |
| 1609 | _visitor.visit_expr(&*_i.expr); |
| 1610 | tokens_helper(_visitor, &(_i.semi_token).0); |
| 1611 | _visitor.visit_expr(&*_i.len); |
| 1612 | } |
| 1613 | #[cfg(feature = "full")] |
| 1614 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1615 | pub fn visit_expr_return<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprReturn) { |
| 1616 | for it in &_i.attrs { |
| 1617 | _visitor.visit_attribute(it) |
| 1618 | } |
| 1619 | tokens_helper(_visitor, &(_i.return_token).0); |
| 1620 | if let Some(ref it) = _i.expr { |
| 1621 | _visitor.visit_expr(&**it) |
| 1622 | }; |
| 1623 | } |
| 1624 | #[cfg(feature = "full")] |
| 1625 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1626 | pub fn visit_expr_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprStruct) { |
| 1627 | for it in &_i.attrs { |
| 1628 | _visitor.visit_attribute(it) |
| 1629 | } |
| 1630 | _visitor.visit_path(&_i.path); |
| 1631 | tokens_helper(_visitor, &(_i.brace_token).0); |
| 1632 | for el in Punctuated::pairs(&_i.fields) { |
| 1633 | let it = el.value(); |
| 1634 | _visitor.visit_field_value(it) |
| 1635 | } |
| 1636 | if let Some(ref it) = _i.dot2_token { |
| 1637 | tokens_helper(_visitor, &(it).0) |
| 1638 | }; |
| 1639 | if let Some(ref it) = _i.rest { |
| 1640 | _visitor.visit_expr(&**it) |
| 1641 | }; |
| 1642 | } |
| 1643 | #[cfg(feature = "full")] |
| 1644 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1645 | pub fn visit_expr_try<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprTry) { |
| 1646 | for it in &_i.attrs { |
| 1647 | _visitor.visit_attribute(it) |
| 1648 | } |
| 1649 | _visitor.visit_expr(&*_i.expr); |
| 1650 | tokens_helper(_visitor, &(_i.question_token).0); |
| 1651 | } |
| 1652 | #[cfg(feature = "full")] |
| 1653 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1654 | pub fn visit_expr_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprTuple) { |
| 1655 | for it in &_i.attrs { |
| 1656 | _visitor.visit_attribute(it) |
| 1657 | } |
| 1658 | tokens_helper(_visitor, &(_i.paren_token).0); |
| 1659 | for el in Punctuated::pairs(&_i.elems) { |
| 1660 | let it = el.value(); |
| 1661 | _visitor.visit_expr(it) |
| 1662 | } |
| 1663 | } |
| 1664 | #[cfg(feature = "full")] |
| 1665 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1666 | pub fn visit_expr_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprType) { |
| 1667 | for it in &_i.attrs { |
| 1668 | _visitor.visit_attribute(it) |
| 1669 | } |
| 1670 | _visitor.visit_expr(&*_i.expr); |
| 1671 | tokens_helper(_visitor, &(_i.colon_token).0); |
| 1672 | _visitor.visit_type(&*_i.ty); |
| 1673 | } |
| 1674 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1675 | pub fn visit_expr_unary<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprUnary) { |
| 1676 | for it in &_i.attrs { |
| 1677 | _visitor.visit_attribute(it) |
| 1678 | } |
| 1679 | _visitor.visit_un_op(&_i.op); |
| 1680 | _visitor.visit_expr(&*_i.expr); |
| 1681 | } |
| 1682 | #[cfg(feature = "full")] |
| 1683 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1684 | pub fn visit_expr_unsafe<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprUnsafe) { |
| 1685 | for it in &_i.attrs { |
| 1686 | _visitor.visit_attribute(it) |
| 1687 | } |
| 1688 | tokens_helper(_visitor, &(_i.unsafe_token).0); |
| 1689 | _visitor.visit_block(&_i.block); |
| 1690 | } |
| 1691 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1692 | pub fn visit_expr_verbatim<'ast, V: Visit<'ast> + ?Sized>( |
| 1693 | _visitor: &mut V, |
| 1694 | _i: &'ast ExprVerbatim, |
| 1695 | ) { |
David Tolnay | 6af4899 | 2018-08-01 11:16:28 -0700 | [diff] [blame] | 1696 | skip!(_i.tts); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1697 | } |
| 1698 | #[cfg(feature = "full")] |
| 1699 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1700 | pub fn visit_expr_while<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprWhile) { |
| 1701 | for it in &_i.attrs { |
| 1702 | _visitor.visit_attribute(it) |
| 1703 | } |
| 1704 | if let Some(ref it) = _i.label { |
| 1705 | _visitor.visit_label(it) |
| 1706 | }; |
| 1707 | tokens_helper(_visitor, &(_i.while_token).0); |
| 1708 | _visitor.visit_expr(&*_i.cond); |
| 1709 | _visitor.visit_block(&_i.body); |
| 1710 | } |
| 1711 | #[cfg(feature = "full")] |
| 1712 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1713 | pub fn visit_expr_while_let<'ast, V: Visit<'ast> + ?Sized>( |
| 1714 | _visitor: &mut V, |
| 1715 | _i: &'ast ExprWhileLet, |
| 1716 | ) { |
| 1717 | for it in &_i.attrs { |
| 1718 | _visitor.visit_attribute(it) |
| 1719 | } |
| 1720 | if let Some(ref it) = _i.label { |
| 1721 | _visitor.visit_label(it) |
| 1722 | }; |
| 1723 | tokens_helper(_visitor, &(_i.while_token).0); |
| 1724 | tokens_helper(_visitor, &(_i.let_token).0); |
| 1725 | for el in Punctuated::pairs(&_i.pats) { |
| 1726 | let it = el.value(); |
| 1727 | _visitor.visit_pat(it) |
| 1728 | } |
| 1729 | tokens_helper(_visitor, &(_i.eq_token).0); |
| 1730 | _visitor.visit_expr(&*_i.expr); |
| 1731 | _visitor.visit_block(&_i.body); |
| 1732 | } |
| 1733 | #[cfg(feature = "full")] |
| 1734 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1735 | pub fn visit_expr_yield<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprYield) { |
| 1736 | for it in &_i.attrs { |
| 1737 | _visitor.visit_attribute(it) |
| 1738 | } |
| 1739 | tokens_helper(_visitor, &(_i.yield_token).0); |
| 1740 | if let Some(ref it) = _i.expr { |
| 1741 | _visitor.visit_expr(&**it) |
| 1742 | }; |
| 1743 | } |
| 1744 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1745 | pub fn visit_field<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Field) { |
| 1746 | for it in &_i.attrs { |
| 1747 | _visitor.visit_attribute(it) |
| 1748 | } |
| 1749 | _visitor.visit_visibility(&_i.vis); |
| 1750 | if let Some(ref it) = _i.ident { |
| 1751 | _visitor.visit_ident(it) |
| 1752 | }; |
| 1753 | if let Some(ref it) = _i.colon_token { |
| 1754 | tokens_helper(_visitor, &(it).0) |
| 1755 | }; |
| 1756 | _visitor.visit_type(&_i.ty); |
| 1757 | } |
| 1758 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1759 | #[cfg(feature = "full")] |
| 1760 | pub fn visit_field_pat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldPat) { |
| 1761 | for it in &_i.attrs { |
| 1762 | _visitor.visit_attribute(it) |
| 1763 | } |
| 1764 | _visitor.visit_member(&_i.member); |
| 1765 | if let Some(ref it) = _i.colon_token { |
| 1766 | tokens_helper(_visitor, &(it).0) |
| 1767 | }; |
| 1768 | _visitor.visit_pat(&*_i.pat); |
| 1769 | } |
| 1770 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1771 | #[cfg(feature = "full")] |
| 1772 | pub fn visit_field_value<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldValue) { |
| 1773 | for it in &_i.attrs { |
| 1774 | _visitor.visit_attribute(it) |
| 1775 | } |
| 1776 | _visitor.visit_member(&_i.member); |
| 1777 | if let Some(ref it) = _i.colon_token { |
| 1778 | tokens_helper(_visitor, &(it).0) |
| 1779 | }; |
| 1780 | _visitor.visit_expr(&_i.expr); |
| 1781 | } |
| 1782 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1783 | pub fn visit_fields<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Fields) { |
| 1784 | match *_i { |
| 1785 | Fields::Named(ref _binding_0) => { |
| 1786 | _visitor.visit_fields_named(_binding_0); |
| 1787 | } |
| 1788 | Fields::Unnamed(ref _binding_0) => { |
| 1789 | _visitor.visit_fields_unnamed(_binding_0); |
| 1790 | } |
| 1791 | Fields::Unit => {} |
| 1792 | } |
| 1793 | } |
| 1794 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 1795 | pub fn visit_fields_named<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldsNamed) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1796 | tokens_helper(_visitor, &(_i.brace_token).0); |
| 1797 | for el in Punctuated::pairs(&_i.named) { |
| 1798 | let it = el.value(); |
| 1799 | _visitor.visit_field(it) |
| 1800 | } |
David Tolnay | e3d41b7 | 2017-12-31 15:24:00 -0500 | [diff] [blame] | 1801 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1802 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1803 | pub fn visit_fields_unnamed<'ast, V: Visit<'ast> + ?Sized>( |
| 1804 | _visitor: &mut V, |
| 1805 | _i: &'ast FieldsUnnamed, |
| 1806 | ) { |
| 1807 | tokens_helper(_visitor, &(_i.paren_token).0); |
| 1808 | for el in Punctuated::pairs(&_i.unnamed) { |
| 1809 | let it = el.value(); |
| 1810 | _visitor.visit_field(it) |
| 1811 | } |
David Tolnay | e3d41b7 | 2017-12-31 15:24:00 -0500 | [diff] [blame] | 1812 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1813 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 1814 | pub fn visit_file<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast File) { |
David Tolnay | 6af4899 | 2018-08-01 11:16:28 -0700 | [diff] [blame] | 1815 | skip!(_i.shebang); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1816 | for it in &_i.attrs { |
| 1817 | _visitor.visit_attribute(it) |
| 1818 | } |
| 1819 | for it in &_i.items { |
| 1820 | _visitor.visit_item(it) |
| 1821 | } |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1822 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1823 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 1824 | pub fn visit_fn_arg<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FnArg) { |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1825 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1826 | FnArg::SelfRef(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1827 | _visitor.visit_arg_self_ref(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1828 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1829 | FnArg::SelfValue(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1830 | _visitor.visit_arg_self(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1831 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1832 | FnArg::Captured(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1833 | _visitor.visit_arg_captured(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1834 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1835 | FnArg::Inferred(ref _binding_0) => { |
David Tolnay | 80ed55f | 2017-12-27 22:54:40 -0500 | [diff] [blame] | 1836 | _visitor.visit_pat(_binding_0); |
| 1837 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1838 | FnArg::Ignored(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1839 | _visitor.visit_type(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1840 | } |
| 1841 | } |
| 1842 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1843 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 1844 | pub fn visit_fn_decl<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FnDecl) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1845 | tokens_helper(_visitor, &(_i.fn_token).0); |
| 1846 | _visitor.visit_generics(&_i.generics); |
| 1847 | tokens_helper(_visitor, &(_i.paren_token).0); |
| 1848 | for el in Punctuated::pairs(&_i.inputs) { |
| 1849 | let it = el.value(); |
| 1850 | _visitor.visit_fn_arg(it) |
| 1851 | } |
| 1852 | if let Some(ref it) = _i.variadic { |
| 1853 | tokens_helper(_visitor, &(it).0) |
| 1854 | }; |
| 1855 | _visitor.visit_return_type(&_i.output); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1856 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1857 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 1858 | pub fn visit_foreign_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ForeignItem) { |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1859 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1860 | ForeignItem::Fn(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1861 | _visitor.visit_foreign_item_fn(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1862 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1863 | ForeignItem::Static(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1864 | _visitor.visit_foreign_item_static(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1865 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1866 | ForeignItem::Type(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1867 | _visitor.visit_foreign_item_type(_binding_0); |
David Tolnay | 199bcbb | 2017-11-12 10:33:52 -0800 | [diff] [blame] | 1868 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1869 | ForeignItem::Verbatim(ref _binding_0) => { |
David Tolnay | 2ae520a | 2017-12-29 11:19:50 -0500 | [diff] [blame] | 1870 | _visitor.visit_foreign_item_verbatim(_binding_0); |
| 1871 | } |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1872 | } |
| 1873 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1874 | #[cfg(feature = "full")] |
| 1875 | pub fn visit_foreign_item_fn<'ast, V: Visit<'ast> + ?Sized>( |
| 1876 | _visitor: &mut V, |
| 1877 | _i: &'ast ForeignItemFn, |
| 1878 | ) { |
| 1879 | for it in &_i.attrs { |
| 1880 | _visitor.visit_attribute(it) |
| 1881 | } |
| 1882 | _visitor.visit_visibility(&_i.vis); |
| 1883 | _visitor.visit_ident(&_i.ident); |
| 1884 | _visitor.visit_fn_decl(&*_i.decl); |
| 1885 | tokens_helper(_visitor, &(_i.semi_token).0); |
David Tolnay | 8894f60 | 2017-11-11 12:11:04 -0800 | [diff] [blame] | 1886 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1887 | #[cfg(feature = "full")] |
| 1888 | pub fn visit_foreign_item_static<'ast, V: Visit<'ast> + ?Sized>( |
| 1889 | _visitor: &mut V, |
| 1890 | _i: &'ast ForeignItemStatic, |
| 1891 | ) { |
| 1892 | for it in &_i.attrs { |
| 1893 | _visitor.visit_attribute(it) |
| 1894 | } |
| 1895 | _visitor.visit_visibility(&_i.vis); |
| 1896 | tokens_helper(_visitor, &(_i.static_token).0); |
| 1897 | if let Some(ref it) = _i.mutability { |
| 1898 | tokens_helper(_visitor, &(it).0) |
| 1899 | }; |
| 1900 | _visitor.visit_ident(&_i.ident); |
| 1901 | tokens_helper(_visitor, &(_i.colon_token).0); |
| 1902 | _visitor.visit_type(&*_i.ty); |
| 1903 | tokens_helper(_visitor, &(_i.semi_token).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1904 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1905 | #[cfg(feature = "full")] |
| 1906 | pub fn visit_foreign_item_type<'ast, V: Visit<'ast> + ?Sized>( |
| 1907 | _visitor: &mut V, |
| 1908 | _i: &'ast ForeignItemType, |
| 1909 | ) { |
| 1910 | for it in &_i.attrs { |
| 1911 | _visitor.visit_attribute(it) |
| 1912 | } |
| 1913 | _visitor.visit_visibility(&_i.vis); |
| 1914 | tokens_helper(_visitor, &(_i.type_token).0); |
| 1915 | _visitor.visit_ident(&_i.ident); |
| 1916 | tokens_helper(_visitor, &(_i.semi_token).0); |
David Tolnay | 199bcbb | 2017-11-12 10:33:52 -0800 | [diff] [blame] | 1917 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1918 | #[cfg(feature = "full")] |
| 1919 | pub fn visit_foreign_item_verbatim<'ast, V: Visit<'ast> + ?Sized>( |
| 1920 | _visitor: &mut V, |
| 1921 | _i: &'ast ForeignItemVerbatim, |
| 1922 | ) { |
David Tolnay | 6af4899 | 2018-08-01 11:16:28 -0700 | [diff] [blame] | 1923 | skip!(_i.tts); |
David Tolnay | 2ae520a | 2017-12-29 11:19:50 -0500 | [diff] [blame] | 1924 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1925 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1926 | pub fn visit_generic_argument<'ast, V: Visit<'ast> + ?Sized>( |
| 1927 | _visitor: &mut V, |
| 1928 | _i: &'ast GenericArgument, |
| 1929 | ) { |
Nika Layzell | 357885a | 2017-12-04 15:47:07 -0500 | [diff] [blame] | 1930 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1931 | GenericArgument::Lifetime(ref _binding_0) => { |
David Tolnay | 4ba63a0 | 2017-12-28 15:53:05 -0500 | [diff] [blame] | 1932 | _visitor.visit_lifetime(_binding_0); |
Nika Layzell | 357885a | 2017-12-04 15:47:07 -0500 | [diff] [blame] | 1933 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1934 | GenericArgument::Type(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1935 | _visitor.visit_type(_binding_0); |
Nika Layzell | 357885a | 2017-12-04 15:47:07 -0500 | [diff] [blame] | 1936 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1937 | GenericArgument::Binding(ref _binding_0) => { |
David Tolnay | 506e43a | 2017-12-29 11:34:36 -0500 | [diff] [blame] | 1938 | _visitor.visit_binding(_binding_0); |
Nika Layzell | 357885a | 2017-12-04 15:47:07 -0500 | [diff] [blame] | 1939 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1940 | GenericArgument::Const(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1941 | _visitor.visit_expr(_binding_0); |
Nika Layzell | c680e61 | 2017-12-04 19:07:20 -0500 | [diff] [blame] | 1942 | } |
Nika Layzell | 357885a | 2017-12-04 15:47:07 -0500 | [diff] [blame] | 1943 | } |
| 1944 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1945 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1946 | #[cfg(feature = "full")] |
| 1947 | pub fn visit_generic_method_argument<'ast, V: Visit<'ast> + ?Sized>( |
| 1948 | _visitor: &mut V, |
| 1949 | _i: &'ast GenericMethodArgument, |
| 1950 | ) { |
David Tolnay | d60cfec | 2017-12-29 00:21:38 -0500 | [diff] [blame] | 1951 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1952 | GenericMethodArgument::Type(ref _binding_0) => { |
David Tolnay | d60cfec | 2017-12-29 00:21:38 -0500 | [diff] [blame] | 1953 | _visitor.visit_type(_binding_0); |
| 1954 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1955 | GenericMethodArgument::Const(ref _binding_0) => { |
David Tolnay | d60cfec | 2017-12-29 00:21:38 -0500 | [diff] [blame] | 1956 | _visitor.visit_expr(_binding_0); |
| 1957 | } |
| 1958 | } |
| 1959 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1960 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1961 | pub fn visit_generic_param<'ast, V: Visit<'ast> + ?Sized>( |
| 1962 | _visitor: &mut V, |
| 1963 | _i: &'ast GenericParam, |
| 1964 | ) { |
David Tolnay | c2f1aba | 2017-11-12 20:29:22 -0800 | [diff] [blame] | 1965 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1966 | GenericParam::Type(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1967 | _visitor.visit_type_param(_binding_0); |
David Tolnay | c2f1aba | 2017-11-12 20:29:22 -0800 | [diff] [blame] | 1968 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1969 | GenericParam::Lifetime(ref _binding_0) => { |
David Tolnay | 517f369 | 2018-01-01 20:17:23 -0800 | [diff] [blame] | 1970 | _visitor.visit_lifetime_def(_binding_0); |
| 1971 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1972 | GenericParam::Const(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1973 | _visitor.visit_const_param(_binding_0); |
Nika Layzell | f1fdc0b | 2017-12-04 19:58:32 -0500 | [diff] [blame] | 1974 | } |
David Tolnay | c2f1aba | 2017-11-12 20:29:22 -0800 | [diff] [blame] | 1975 | } |
| 1976 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1977 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 1978 | pub fn visit_generics<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Generics) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1979 | if let Some(ref it) = _i.lt_token { |
| 1980 | tokens_helper(_visitor, &(it).0) |
| 1981 | }; |
| 1982 | for el in Punctuated::pairs(&_i.params) { |
| 1983 | let it = el.value(); |
| 1984 | _visitor.visit_generic_param(it) |
| 1985 | } |
| 1986 | if let Some(ref it) = _i.gt_token { |
| 1987 | tokens_helper(_visitor, &(it).0) |
| 1988 | }; |
| 1989 | if let Some(ref it) = _i.where_clause { |
| 1990 | _visitor.visit_where_clause(it) |
| 1991 | }; |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1992 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1993 | pub fn visit_ident<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Ident) {} |
| 1994 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 1995 | pub fn visit_impl_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ImplItem) { |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1996 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1997 | ImplItem::Const(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1998 | _visitor.visit_impl_item_const(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1999 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2000 | ImplItem::Method(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2001 | _visitor.visit_impl_item_method(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2002 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2003 | ImplItem::Type(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2004 | _visitor.visit_impl_item_type(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2005 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2006 | ImplItem::Macro(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2007 | _visitor.visit_impl_item_macro(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2008 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2009 | ImplItem::Verbatim(ref _binding_0) => { |
David Tolnay | 2ae520a | 2017-12-29 11:19:50 -0500 | [diff] [blame] | 2010 | _visitor.visit_impl_item_verbatim(_binding_0); |
| 2011 | } |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2012 | } |
| 2013 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2014 | #[cfg(feature = "full")] |
| 2015 | pub fn visit_impl_item_const<'ast, V: Visit<'ast> + ?Sized>( |
| 2016 | _visitor: &mut V, |
| 2017 | _i: &'ast ImplItemConst, |
| 2018 | ) { |
| 2019 | for it in &_i.attrs { |
| 2020 | _visitor.visit_attribute(it) |
| 2021 | } |
| 2022 | _visitor.visit_visibility(&_i.vis); |
| 2023 | if let Some(ref it) = _i.defaultness { |
| 2024 | tokens_helper(_visitor, &(it).0) |
| 2025 | }; |
| 2026 | tokens_helper(_visitor, &(_i.const_token).0); |
| 2027 | _visitor.visit_ident(&_i.ident); |
| 2028 | tokens_helper(_visitor, &(_i.colon_token).0); |
| 2029 | _visitor.visit_type(&_i.ty); |
| 2030 | tokens_helper(_visitor, &(_i.eq_token).0); |
| 2031 | _visitor.visit_expr(&_i.expr); |
| 2032 | tokens_helper(_visitor, &(_i.semi_token).0); |
David Tolnay | 857628c | 2017-11-11 12:25:31 -0800 | [diff] [blame] | 2033 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2034 | #[cfg(feature = "full")] |
| 2035 | pub fn visit_impl_item_macro<'ast, V: Visit<'ast> + ?Sized>( |
| 2036 | _visitor: &mut V, |
| 2037 | _i: &'ast ImplItemMacro, |
| 2038 | ) { |
| 2039 | for it in &_i.attrs { |
| 2040 | _visitor.visit_attribute(it) |
| 2041 | } |
| 2042 | _visitor.visit_macro(&_i.mac); |
| 2043 | if let Some(ref it) = _i.semi_token { |
| 2044 | tokens_helper(_visitor, &(it).0) |
| 2045 | }; |
David Tolnay | 857628c | 2017-11-11 12:25:31 -0800 | [diff] [blame] | 2046 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2047 | #[cfg(feature = "full")] |
| 2048 | pub fn visit_impl_item_method<'ast, V: Visit<'ast> + ?Sized>( |
| 2049 | _visitor: &mut V, |
| 2050 | _i: &'ast ImplItemMethod, |
| 2051 | ) { |
| 2052 | for it in &_i.attrs { |
| 2053 | _visitor.visit_attribute(it) |
| 2054 | } |
| 2055 | _visitor.visit_visibility(&_i.vis); |
| 2056 | if let Some(ref it) = _i.defaultness { |
| 2057 | tokens_helper(_visitor, &(it).0) |
| 2058 | }; |
| 2059 | _visitor.visit_method_sig(&_i.sig); |
| 2060 | _visitor.visit_block(&_i.block); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2061 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2062 | #[cfg(feature = "full")] |
| 2063 | pub fn visit_impl_item_type<'ast, V: Visit<'ast> + ?Sized>( |
| 2064 | _visitor: &mut V, |
| 2065 | _i: &'ast ImplItemType, |
| 2066 | ) { |
| 2067 | for it in &_i.attrs { |
| 2068 | _visitor.visit_attribute(it) |
| 2069 | } |
| 2070 | _visitor.visit_visibility(&_i.vis); |
| 2071 | if let Some(ref it) = _i.defaultness { |
| 2072 | tokens_helper(_visitor, &(it).0) |
| 2073 | }; |
| 2074 | tokens_helper(_visitor, &(_i.type_token).0); |
| 2075 | _visitor.visit_ident(&_i.ident); |
| 2076 | _visitor.visit_generics(&_i.generics); |
| 2077 | tokens_helper(_visitor, &(_i.eq_token).0); |
| 2078 | _visitor.visit_type(&_i.ty); |
| 2079 | tokens_helper(_visitor, &(_i.semi_token).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2080 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2081 | #[cfg(feature = "full")] |
| 2082 | pub fn visit_impl_item_verbatim<'ast, V: Visit<'ast> + ?Sized>( |
| 2083 | _visitor: &mut V, |
| 2084 | _i: &'ast ImplItemVerbatim, |
| 2085 | ) { |
David Tolnay | 6af4899 | 2018-08-01 11:16:28 -0700 | [diff] [blame] | 2086 | skip!(_i.tts); |
David Tolnay | 2ae520a | 2017-12-29 11:19:50 -0500 | [diff] [blame] | 2087 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2088 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2089 | pub fn visit_index<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Index) { |
David Tolnay | 6af4899 | 2018-08-01 11:16:28 -0700 | [diff] [blame] | 2090 | skip!(_i.index); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2091 | _visitor.visit_span(&_i.span); |
David Tolnay | 85b69a4 | 2017-12-27 20:43:10 -0500 | [diff] [blame] | 2092 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2093 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2094 | pub fn visit_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Item) { |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2095 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2096 | Item::ExternCrate(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2097 | _visitor.visit_item_extern_crate(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2098 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2099 | Item::Use(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2100 | _visitor.visit_item_use(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2101 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2102 | Item::Static(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2103 | _visitor.visit_item_static(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2104 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2105 | Item::Const(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2106 | _visitor.visit_item_const(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2107 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2108 | Item::Fn(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2109 | _visitor.visit_item_fn(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2110 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2111 | Item::Mod(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2112 | _visitor.visit_item_mod(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2113 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2114 | Item::ForeignMod(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2115 | _visitor.visit_item_foreign_mod(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2116 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2117 | Item::Type(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2118 | _visitor.visit_item_type(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2119 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2120 | Item::Struct(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2121 | _visitor.visit_item_struct(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2122 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2123 | Item::Enum(ref _binding_0) => { |
David Tolnay | e3d41b7 | 2017-12-31 15:24:00 -0500 | [diff] [blame] | 2124 | _visitor.visit_item_enum(_binding_0); |
| 2125 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2126 | Item::Union(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2127 | _visitor.visit_item_union(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2128 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2129 | Item::Trait(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2130 | _visitor.visit_item_trait(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2131 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2132 | Item::Impl(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2133 | _visitor.visit_item_impl(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2134 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2135 | Item::Macro(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2136 | _visitor.visit_item_macro(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2137 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2138 | Item::Macro2(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2139 | _visitor.visit_item_macro2(_binding_0); |
David Tolnay | 500d832 | 2017-12-18 00:32:51 -0800 | [diff] [blame] | 2140 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2141 | Item::Verbatim(ref _binding_0) => { |
David Tolnay | 2ae520a | 2017-12-29 11:19:50 -0500 | [diff] [blame] | 2142 | _visitor.visit_item_verbatim(_binding_0); |
| 2143 | } |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2144 | } |
| 2145 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2146 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2147 | pub fn visit_item_const<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemConst) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2148 | for it in &_i.attrs { |
| 2149 | _visitor.visit_attribute(it) |
| 2150 | } |
| 2151 | _visitor.visit_visibility(&_i.vis); |
| 2152 | tokens_helper(_visitor, &(_i.const_token).0); |
| 2153 | _visitor.visit_ident(&_i.ident); |
| 2154 | tokens_helper(_visitor, &(_i.colon_token).0); |
| 2155 | _visitor.visit_type(&*_i.ty); |
| 2156 | tokens_helper(_visitor, &(_i.eq_token).0); |
| 2157 | _visitor.visit_expr(&*_i.expr); |
| 2158 | tokens_helper(_visitor, &(_i.semi_token).0); |
David Tolnay | c6b55bc | 2017-11-09 22:48:38 -0800 | [diff] [blame] | 2159 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2160 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2161 | pub fn visit_item_enum<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemEnum) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2162 | for it in &_i.attrs { |
| 2163 | _visitor.visit_attribute(it) |
| 2164 | } |
| 2165 | _visitor.visit_visibility(&_i.vis); |
| 2166 | tokens_helper(_visitor, &(_i.enum_token).0); |
| 2167 | _visitor.visit_ident(&_i.ident); |
| 2168 | _visitor.visit_generics(&_i.generics); |
| 2169 | tokens_helper(_visitor, &(_i.brace_token).0); |
| 2170 | for el in Punctuated::pairs(&_i.variants) { |
| 2171 | let it = el.value(); |
| 2172 | _visitor.visit_variant(it) |
| 2173 | } |
David Tolnay | c6b55bc | 2017-11-09 22:48:38 -0800 | [diff] [blame] | 2174 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2175 | #[cfg(feature = "full")] |
| 2176 | pub 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); |
| 2184 | tokens_helper(_visitor, &(_i.extern_token).0); |
| 2185 | tokens_helper(_visitor, &(_i.crate_token).0); |
| 2186 | _visitor.visit_ident(&_i.ident); |
| 2187 | if let Some(ref it) = _i.rename { |
| 2188 | tokens_helper(_visitor, &((it).0).0); |
| 2189 | _visitor.visit_ident(&(it).1); |
| 2190 | }; |
| 2191 | tokens_helper(_visitor, &(_i.semi_token).0); |
David Tolnay | c6b55bc | 2017-11-09 22:48:38 -0800 | [diff] [blame] | 2192 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2193 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2194 | pub fn visit_item_fn<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemFn) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2195 | 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 { |
| 2200 | tokens_helper(_visitor, &(it).0) |
| 2201 | }; |
| 2202 | if let Some(ref it) = _i.unsafety { |
| 2203 | tokens_helper(_visitor, &(it).0) |
| 2204 | }; |
| 2205 | if let Some(ref it) = _i.abi { |
| 2206 | _visitor.visit_abi(it) |
| 2207 | }; |
| 2208 | _visitor.visit_ident(&_i.ident); |
| 2209 | _visitor.visit_fn_decl(&*_i.decl); |
| 2210 | _visitor.visit_block(&*_i.block); |
David Tolnay | c6b55bc | 2017-11-09 22:48:38 -0800 | [diff] [blame] | 2211 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2212 | #[cfg(feature = "full")] |
| 2213 | pub fn visit_item_foreign_mod<'ast, V: Visit<'ast> + ?Sized>( |
| 2214 | _visitor: &mut V, |
| 2215 | _i: &'ast ItemForeignMod, |
| 2216 | ) { |
| 2217 | for it in &_i.attrs { |
| 2218 | _visitor.visit_attribute(it) |
| 2219 | } |
| 2220 | _visitor.visit_abi(&_i.abi); |
| 2221 | tokens_helper(_visitor, &(_i.brace_token).0); |
| 2222 | for it in &_i.items { |
| 2223 | _visitor.visit_foreign_item(it) |
| 2224 | } |
David Tolnay | c6b55bc | 2017-11-09 22:48:38 -0800 | [diff] [blame] | 2225 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2226 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2227 | pub fn visit_item_impl<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemImpl) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2228 | for it in &_i.attrs { |
| 2229 | _visitor.visit_attribute(it) |
| 2230 | } |
| 2231 | if let Some(ref it) = _i.defaultness { |
| 2232 | tokens_helper(_visitor, &(it).0) |
| 2233 | }; |
| 2234 | if let Some(ref it) = _i.unsafety { |
| 2235 | tokens_helper(_visitor, &(it).0) |
| 2236 | }; |
| 2237 | tokens_helper(_visitor, &(_i.impl_token).0); |
| 2238 | _visitor.visit_generics(&_i.generics); |
| 2239 | if let Some(ref it) = _i.trait_ { |
| 2240 | if let Some(ref it) = (it).0 { |
| 2241 | tokens_helper(_visitor, &(it).0) |
| 2242 | }; |
| 2243 | _visitor.visit_path(&(it).1); |
| 2244 | tokens_helper(_visitor, &((it).2).0); |
| 2245 | }; |
| 2246 | _visitor.visit_type(&*_i.self_ty); |
| 2247 | tokens_helper(_visitor, &(_i.brace_token).0); |
| 2248 | for it in &_i.items { |
| 2249 | _visitor.visit_impl_item(it) |
| 2250 | } |
David Tolnay | c6b55bc | 2017-11-09 22:48:38 -0800 | [diff] [blame] | 2251 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2252 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2253 | pub fn visit_item_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemMacro) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2254 | for it in &_i.attrs { |
| 2255 | _visitor.visit_attribute(it) |
| 2256 | } |
| 2257 | if let Some(ref it) = _i.ident { |
| 2258 | _visitor.visit_ident(it) |
| 2259 | }; |
| 2260 | _visitor.visit_macro(&_i.mac); |
| 2261 | if let Some(ref it) = _i.semi_token { |
| 2262 | tokens_helper(_visitor, &(it).0) |
| 2263 | }; |
David Tolnay | c6b55bc | 2017-11-09 22:48:38 -0800 | [diff] [blame] | 2264 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2265 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2266 | pub fn visit_item_macro2<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemMacro2) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2267 | for it in &_i.attrs { |
| 2268 | _visitor.visit_attribute(it) |
| 2269 | } |
| 2270 | _visitor.visit_visibility(&_i.vis); |
| 2271 | tokens_helper(_visitor, &(_i.macro_token).0); |
| 2272 | _visitor.visit_ident(&_i.ident); |
| 2273 | tokens_helper(_visitor, &(_i.paren_token).0); |
David Tolnay | 6af4899 | 2018-08-01 11:16:28 -0700 | [diff] [blame] | 2274 | skip!(_i.args); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2275 | tokens_helper(_visitor, &(_i.brace_token).0); |
David Tolnay | 6af4899 | 2018-08-01 11:16:28 -0700 | [diff] [blame] | 2276 | skip!(_i.body); |
David Tolnay | 500d832 | 2017-12-18 00:32:51 -0800 | [diff] [blame] | 2277 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2278 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2279 | pub fn visit_item_mod<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemMod) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2280 | for it in &_i.attrs { |
| 2281 | _visitor.visit_attribute(it) |
| 2282 | } |
| 2283 | _visitor.visit_visibility(&_i.vis); |
| 2284 | tokens_helper(_visitor, &(_i.mod_token).0); |
| 2285 | _visitor.visit_ident(&_i.ident); |
| 2286 | if let Some(ref it) = _i.content { |
| 2287 | tokens_helper(_visitor, &((it).0).0); |
| 2288 | for it in &(it).1 { |
| 2289 | _visitor.visit_item(it) |
| 2290 | } |
| 2291 | }; |
| 2292 | if let Some(ref it) = _i.semi { |
| 2293 | tokens_helper(_visitor, &(it).0) |
| 2294 | }; |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2295 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2296 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2297 | pub fn visit_item_static<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemStatic) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2298 | for it in &_i.attrs { |
| 2299 | _visitor.visit_attribute(it) |
| 2300 | } |
| 2301 | _visitor.visit_visibility(&_i.vis); |
| 2302 | tokens_helper(_visitor, &(_i.static_token).0); |
| 2303 | if let Some(ref it) = _i.mutability { |
| 2304 | tokens_helper(_visitor, &(it).0) |
| 2305 | }; |
| 2306 | _visitor.visit_ident(&_i.ident); |
| 2307 | tokens_helper(_visitor, &(_i.colon_token).0); |
| 2308 | _visitor.visit_type(&*_i.ty); |
| 2309 | tokens_helper(_visitor, &(_i.eq_token).0); |
| 2310 | _visitor.visit_expr(&*_i.expr); |
| 2311 | tokens_helper(_visitor, &(_i.semi_token).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2312 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2313 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2314 | pub fn visit_item_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemStruct) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2315 | for it in &_i.attrs { |
| 2316 | _visitor.visit_attribute(it) |
| 2317 | } |
| 2318 | _visitor.visit_visibility(&_i.vis); |
| 2319 | tokens_helper(_visitor, &(_i.struct_token).0); |
| 2320 | _visitor.visit_ident(&_i.ident); |
| 2321 | _visitor.visit_generics(&_i.generics); |
| 2322 | _visitor.visit_fields(&_i.fields); |
| 2323 | if let Some(ref it) = _i.semi_token { |
| 2324 | tokens_helper(_visitor, &(it).0) |
| 2325 | }; |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2326 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2327 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2328 | pub fn visit_item_trait<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemTrait) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2329 | for it in &_i.attrs { |
| 2330 | _visitor.visit_attribute(it) |
| 2331 | } |
| 2332 | _visitor.visit_visibility(&_i.vis); |
| 2333 | if let Some(ref it) = _i.unsafety { |
| 2334 | tokens_helper(_visitor, &(it).0) |
| 2335 | }; |
| 2336 | if let Some(ref it) = _i.auto_token { |
| 2337 | tokens_helper(_visitor, &(it).0) |
| 2338 | }; |
| 2339 | tokens_helper(_visitor, &(_i.trait_token).0); |
| 2340 | _visitor.visit_ident(&_i.ident); |
| 2341 | _visitor.visit_generics(&_i.generics); |
| 2342 | if let Some(ref it) = _i.colon_token { |
| 2343 | tokens_helper(_visitor, &(it).0) |
| 2344 | }; |
| 2345 | for el in Punctuated::pairs(&_i.supertraits) { |
| 2346 | let it = el.value(); |
| 2347 | _visitor.visit_type_param_bound(it) |
| 2348 | } |
| 2349 | tokens_helper(_visitor, &(_i.brace_token).0); |
| 2350 | for it in &_i.items { |
| 2351 | _visitor.visit_trait_item(it) |
| 2352 | } |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2353 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2354 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2355 | pub fn visit_item_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemType) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2356 | for it in &_i.attrs { |
| 2357 | _visitor.visit_attribute(it) |
| 2358 | } |
| 2359 | _visitor.visit_visibility(&_i.vis); |
| 2360 | tokens_helper(_visitor, &(_i.type_token).0); |
| 2361 | _visitor.visit_ident(&_i.ident); |
| 2362 | _visitor.visit_generics(&_i.generics); |
| 2363 | tokens_helper(_visitor, &(_i.eq_token).0); |
| 2364 | _visitor.visit_type(&*_i.ty); |
| 2365 | tokens_helper(_visitor, &(_i.semi_token).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2366 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2367 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2368 | pub fn visit_item_union<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemUnion) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2369 | for it in &_i.attrs { |
| 2370 | _visitor.visit_attribute(it) |
| 2371 | } |
| 2372 | _visitor.visit_visibility(&_i.vis); |
| 2373 | tokens_helper(_visitor, &(_i.union_token).0); |
| 2374 | _visitor.visit_ident(&_i.ident); |
| 2375 | _visitor.visit_generics(&_i.generics); |
| 2376 | _visitor.visit_fields_named(&_i.fields); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2377 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2378 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2379 | pub fn visit_item_use<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemUse) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2380 | for it in &_i.attrs { |
| 2381 | _visitor.visit_attribute(it) |
| 2382 | } |
| 2383 | _visitor.visit_visibility(&_i.vis); |
| 2384 | tokens_helper(_visitor, &(_i.use_token).0); |
| 2385 | if let Some(ref it) = _i.leading_colon { |
| 2386 | tokens_helper(_visitor, &(it).0) |
| 2387 | }; |
| 2388 | _visitor.visit_use_tree(&_i.tree); |
| 2389 | tokens_helper(_visitor, &(_i.semi_token).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2390 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2391 | #[cfg(feature = "full")] |
| 2392 | pub fn visit_item_verbatim<'ast, V: Visit<'ast> + ?Sized>( |
| 2393 | _visitor: &mut V, |
| 2394 | _i: &'ast ItemVerbatim, |
| 2395 | ) { |
David Tolnay | 6af4899 | 2018-08-01 11:16:28 -0700 | [diff] [blame] | 2396 | skip!(_i.tts); |
David Tolnay | 2ae520a | 2017-12-29 11:19:50 -0500 | [diff] [blame] | 2397 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2398 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2399 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2400 | pub fn visit_label<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Label) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2401 | _visitor.visit_lifetime(&_i.name); |
| 2402 | tokens_helper(_visitor, &(_i.colon_token).0); |
David Tolnay | bcd498f | 2017-12-29 12:02:33 -0500 | [diff] [blame] | 2403 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2404 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2405 | pub fn visit_lifetime<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Lifetime) { |
David Tolnay | 6af4899 | 2018-08-01 11:16:28 -0700 | [diff] [blame] | 2406 | skip!(_i.apostrophe); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2407 | _visitor.visit_ident(&_i.ident); |
David Tolnay | 4ba63a0 | 2017-12-28 15:53:05 -0500 | [diff] [blame] | 2408 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2409 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2410 | pub fn visit_lifetime_def<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LifetimeDef) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2411 | for it in &_i.attrs { |
| 2412 | _visitor.visit_attribute(it) |
| 2413 | } |
| 2414 | _visitor.visit_lifetime(&_i.lifetime); |
| 2415 | if let Some(ref it) = _i.colon_token { |
| 2416 | tokens_helper(_visitor, &(it).0) |
| 2417 | }; |
| 2418 | for el in Punctuated::pairs(&_i.bounds) { |
| 2419 | let it = el.value(); |
| 2420 | _visitor.visit_lifetime(it) |
| 2421 | } |
David Tolnay | 4ba63a0 | 2017-12-28 15:53:05 -0500 | [diff] [blame] | 2422 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2423 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2424 | pub fn visit_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Lit) { |
David Tolnay | 360efd2 | 2018-01-04 23:35:26 -0800 | [diff] [blame] | 2425 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2426 | Lit::Str(ref _binding_0) => { |
David Tolnay | 360efd2 | 2018-01-04 23:35:26 -0800 | [diff] [blame] | 2427 | _visitor.visit_lit_str(_binding_0); |
| 2428 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2429 | Lit::ByteStr(ref _binding_0) => { |
David Tolnay | 360efd2 | 2018-01-04 23:35:26 -0800 | [diff] [blame] | 2430 | _visitor.visit_lit_byte_str(_binding_0); |
| 2431 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2432 | Lit::Byte(ref _binding_0) => { |
David Tolnay | 360efd2 | 2018-01-04 23:35:26 -0800 | [diff] [blame] | 2433 | _visitor.visit_lit_byte(_binding_0); |
| 2434 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2435 | Lit::Char(ref _binding_0) => { |
David Tolnay | 360efd2 | 2018-01-04 23:35:26 -0800 | [diff] [blame] | 2436 | _visitor.visit_lit_char(_binding_0); |
| 2437 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2438 | Lit::Int(ref _binding_0) => { |
David Tolnay | 360efd2 | 2018-01-04 23:35:26 -0800 | [diff] [blame] | 2439 | _visitor.visit_lit_int(_binding_0); |
| 2440 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2441 | Lit::Float(ref _binding_0) => { |
David Tolnay | 360efd2 | 2018-01-04 23:35:26 -0800 | [diff] [blame] | 2442 | _visitor.visit_lit_float(_binding_0); |
| 2443 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2444 | Lit::Bool(ref _binding_0) => { |
David Tolnay | 360efd2 | 2018-01-04 23:35:26 -0800 | [diff] [blame] | 2445 | _visitor.visit_lit_bool(_binding_0); |
| 2446 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2447 | Lit::Verbatim(ref _binding_0) => { |
David Tolnay | 360efd2 | 2018-01-04 23:35:26 -0800 | [diff] [blame] | 2448 | _visitor.visit_lit_verbatim(_binding_0); |
| 2449 | } |
| 2450 | } |
| 2451 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2452 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2453 | pub fn visit_lit_bool<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitBool) { |
David Tolnay | 6af4899 | 2018-08-01 11:16:28 -0700 | [diff] [blame] | 2454 | skip!(_i.value); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2455 | _visitor.visit_span(&_i.span); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2456 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2457 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2458 | pub fn visit_lit_byte<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitByte) { |
David Tolnay | 6af4899 | 2018-08-01 11:16:28 -0700 | [diff] [blame] | 2459 | skip!(_i.token); |
David Tolnay | 360efd2 | 2018-01-04 23:35:26 -0800 | [diff] [blame] | 2460 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2461 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2462 | pub fn visit_lit_byte_str<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitByteStr) { |
David Tolnay | 6af4899 | 2018-08-01 11:16:28 -0700 | [diff] [blame] | 2463 | skip!(_i.token); |
David Tolnay | 360efd2 | 2018-01-04 23:35:26 -0800 | [diff] [blame] | 2464 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2465 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2466 | pub fn visit_lit_char<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitChar) { |
David Tolnay | 6af4899 | 2018-08-01 11:16:28 -0700 | [diff] [blame] | 2467 | skip!(_i.token); |
David Tolnay | 360efd2 | 2018-01-04 23:35:26 -0800 | [diff] [blame] | 2468 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2469 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2470 | pub fn visit_lit_float<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitFloat) { |
David Tolnay | 6af4899 | 2018-08-01 11:16:28 -0700 | [diff] [blame] | 2471 | skip!(_i.token); |
David Tolnay | 360efd2 | 2018-01-04 23:35:26 -0800 | [diff] [blame] | 2472 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2473 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2474 | pub fn visit_lit_int<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitInt) { |
David Tolnay | 6af4899 | 2018-08-01 11:16:28 -0700 | [diff] [blame] | 2475 | skip!(_i.token); |
David Tolnay | 360efd2 | 2018-01-04 23:35:26 -0800 | [diff] [blame] | 2476 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2477 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2478 | pub fn visit_lit_str<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitStr) { |
David Tolnay | 6af4899 | 2018-08-01 11:16:28 -0700 | [diff] [blame] | 2479 | skip!(_i.token); |
David Tolnay | 360efd2 | 2018-01-04 23:35:26 -0800 | [diff] [blame] | 2480 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2481 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2482 | pub fn visit_lit_verbatim<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast LitVerbatim) { |
David Tolnay | 6af4899 | 2018-08-01 11:16:28 -0700 | [diff] [blame] | 2483 | skip!(_i.token); |
David Tolnay | 360efd2 | 2018-01-04 23:35:26 -0800 | [diff] [blame] | 2484 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2485 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2486 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2487 | pub fn visit_local<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Local) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2488 | for it in &_i.attrs { |
| 2489 | _visitor.visit_attribute(it) |
| 2490 | } |
| 2491 | tokens_helper(_visitor, &(_i.let_token).0); |
| 2492 | for el in Punctuated::pairs(&_i.pats) { |
| 2493 | let it = el.value(); |
| 2494 | _visitor.visit_pat(it) |
| 2495 | } |
| 2496 | if let Some(ref it) = _i.ty { |
| 2497 | tokens_helper(_visitor, &((it).0).0); |
| 2498 | _visitor.visit_type(&*(it).1); |
| 2499 | }; |
| 2500 | if let Some(ref it) = _i.init { |
| 2501 | tokens_helper(_visitor, &((it).0).0); |
| 2502 | _visitor.visit_expr(&*(it).1); |
| 2503 | }; |
| 2504 | tokens_helper(_visitor, &(_i.semi_token).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2505 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2506 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2507 | pub fn visit_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Macro) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2508 | _visitor.visit_path(&_i.path); |
| 2509 | tokens_helper(_visitor, &(_i.bang_token).0); |
| 2510 | _visitor.visit_macro_delimiter(&_i.delimiter); |
David Tolnay | 6af4899 | 2018-08-01 11:16:28 -0700 | [diff] [blame] | 2511 | skip!(_i.tts); |
David Tolnay | ab91951 | 2017-12-30 23:31:51 -0500 | [diff] [blame] | 2512 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2513 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2514 | pub fn visit_macro_delimiter<'ast, V: Visit<'ast> + ?Sized>( |
| 2515 | _visitor: &mut V, |
| 2516 | _i: &'ast MacroDelimiter, |
| 2517 | ) { |
David Tolnay | ab91951 | 2017-12-30 23:31:51 -0500 | [diff] [blame] | 2518 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2519 | MacroDelimiter::Paren(ref _binding_0) => { |
David Tolnay | ab91951 | 2017-12-30 23:31:51 -0500 | [diff] [blame] | 2520 | tokens_helper(_visitor, &(_binding_0).0); |
| 2521 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2522 | MacroDelimiter::Brace(ref _binding_0) => { |
David Tolnay | ab91951 | 2017-12-30 23:31:51 -0500 | [diff] [blame] | 2523 | tokens_helper(_visitor, &(_binding_0).0); |
| 2524 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2525 | MacroDelimiter::Bracket(ref _binding_0) => { |
David Tolnay | ab91951 | 2017-12-30 23:31:51 -0500 | [diff] [blame] | 2526 | tokens_helper(_visitor, &(_binding_0).0); |
| 2527 | } |
| 2528 | } |
David Tolnay | decf28d | 2017-11-11 11:56:45 -0800 | [diff] [blame] | 2529 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2530 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2531 | pub fn visit_member<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Member) { |
David Tolnay | 85b69a4 | 2017-12-27 20:43:10 -0500 | [diff] [blame] | 2532 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2533 | Member::Named(ref _binding_0) => { |
Alex Crichton | d261d09 | 2018-05-18 13:47:35 -0700 | [diff] [blame] | 2534 | _visitor.visit_ident(_binding_0); |
David Tolnay | 85b69a4 | 2017-12-27 20:43:10 -0500 | [diff] [blame] | 2535 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2536 | Member::Unnamed(ref _binding_0) => { |
David Tolnay | 85b69a4 | 2017-12-27 20:43:10 -0500 | [diff] [blame] | 2537 | _visitor.visit_index(_binding_0); |
| 2538 | } |
| 2539 | } |
| 2540 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2541 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | aaadd78 | 2018-01-06 22:58:13 -0800 | [diff] [blame] | 2542 | pub fn visit_meta<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Meta) { |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2543 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2544 | Meta::Word(ref _binding_0) => { |
Alex Crichton | d261d09 | 2018-05-18 13:47:35 -0700 | [diff] [blame] | 2545 | _visitor.visit_ident(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2546 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2547 | Meta::List(ref _binding_0) => { |
David Tolnay | aaadd78 | 2018-01-06 22:58:13 -0800 | [diff] [blame] | 2548 | _visitor.visit_meta_list(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2549 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2550 | Meta::NameValue(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2551 | _visitor.visit_meta_name_value(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2552 | } |
| 2553 | } |
| 2554 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2555 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | aaadd78 | 2018-01-06 22:58:13 -0800 | [diff] [blame] | 2556 | pub fn visit_meta_list<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast MetaList) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2557 | _visitor.visit_ident(&_i.ident); |
| 2558 | tokens_helper(_visitor, &(_i.paren_token).0); |
| 2559 | for el in Punctuated::pairs(&_i.nested) { |
| 2560 | let it = el.value(); |
| 2561 | _visitor.visit_nested_meta(it) |
| 2562 | } |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2563 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2564 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2565 | pub fn visit_meta_name_value<'ast, V: Visit<'ast> + ?Sized>( |
| 2566 | _visitor: &mut V, |
| 2567 | _i: &'ast MetaNameValue, |
| 2568 | ) { |
| 2569 | _visitor.visit_ident(&_i.ident); |
| 2570 | tokens_helper(_visitor, &(_i.eq_token).0); |
| 2571 | _visitor.visit_lit(&_i.lit); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2572 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2573 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2574 | pub fn visit_method_sig<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast MethodSig) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2575 | if let Some(ref it) = _i.constness { |
| 2576 | tokens_helper(_visitor, &(it).0) |
| 2577 | }; |
| 2578 | if let Some(ref it) = _i.unsafety { |
| 2579 | tokens_helper(_visitor, &(it).0) |
| 2580 | }; |
| 2581 | if let Some(ref it) = _i.abi { |
| 2582 | _visitor.visit_abi(it) |
| 2583 | }; |
| 2584 | _visitor.visit_ident(&_i.ident); |
| 2585 | _visitor.visit_fn_decl(&_i.decl); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2586 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2587 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2588 | #[cfg(feature = "full")] |
| 2589 | pub fn visit_method_turbofish<'ast, V: Visit<'ast> + ?Sized>( |
| 2590 | _visitor: &mut V, |
| 2591 | _i: &'ast MethodTurbofish, |
| 2592 | ) { |
| 2593 | tokens_helper(_visitor, &(_i.colon2_token).0); |
| 2594 | tokens_helper(_visitor, &(_i.lt_token).0); |
| 2595 | for el in Punctuated::pairs(&_i.args) { |
| 2596 | let it = el.value(); |
| 2597 | _visitor.visit_generic_method_argument(it) |
| 2598 | } |
| 2599 | tokens_helper(_visitor, &(_i.gt_token).0); |
David Tolnay | d60cfec | 2017-12-29 00:21:38 -0500 | [diff] [blame] | 2600 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2601 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | aaadd78 | 2018-01-06 22:58:13 -0800 | [diff] [blame] | 2602 | pub fn visit_nested_meta<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast NestedMeta) { |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2603 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2604 | NestedMeta::Meta(ref _binding_0) => { |
David Tolnay | aaadd78 | 2018-01-06 22:58:13 -0800 | [diff] [blame] | 2605 | _visitor.visit_meta(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2606 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2607 | NestedMeta::Literal(ref _binding_0) => { |
David Tolnay | 4ba63a0 | 2017-12-28 15:53:05 -0500 | [diff] [blame] | 2608 | _visitor.visit_lit(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2609 | } |
| 2610 | } |
| 2611 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2612 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2613 | pub fn visit_parenthesized_generic_arguments<'ast, V: Visit<'ast> + ?Sized>( |
| 2614 | _visitor: &mut V, |
| 2615 | _i: &'ast ParenthesizedGenericArguments, |
| 2616 | ) { |
| 2617 | tokens_helper(_visitor, &(_i.paren_token).0); |
| 2618 | for el in Punctuated::pairs(&_i.inputs) { |
| 2619 | let it = el.value(); |
| 2620 | _visitor.visit_type(it) |
| 2621 | } |
| 2622 | _visitor.visit_return_type(&_i.output); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2623 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2624 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2625 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2626 | pub fn visit_pat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Pat) { |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2627 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2628 | Pat::Wild(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2629 | _visitor.visit_pat_wild(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2630 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2631 | Pat::Ident(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2632 | _visitor.visit_pat_ident(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2633 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2634 | Pat::Struct(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2635 | _visitor.visit_pat_struct(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2636 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2637 | Pat::TupleStruct(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2638 | _visitor.visit_pat_tuple_struct(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2639 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2640 | Pat::Path(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2641 | _visitor.visit_pat_path(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2642 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2643 | Pat::Tuple(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2644 | _visitor.visit_pat_tuple(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2645 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2646 | Pat::Box(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2647 | _visitor.visit_pat_box(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2648 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2649 | Pat::Ref(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2650 | _visitor.visit_pat_ref(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2651 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2652 | Pat::Lit(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2653 | _visitor.visit_pat_lit(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2654 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2655 | Pat::Range(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2656 | _visitor.visit_pat_range(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2657 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2658 | Pat::Slice(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2659 | _visitor.visit_pat_slice(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2660 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2661 | Pat::Macro(ref _binding_0) => { |
David Tolnay | 323279a | 2017-12-29 11:26:32 -0500 | [diff] [blame] | 2662 | _visitor.visit_pat_macro(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2663 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2664 | Pat::Verbatim(ref _binding_0) => { |
David Tolnay | 2ae520a | 2017-12-29 11:19:50 -0500 | [diff] [blame] | 2665 | _visitor.visit_pat_verbatim(_binding_0); |
| 2666 | } |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2667 | } |
| 2668 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2669 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2670 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2671 | pub fn visit_pat_box<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatBox) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2672 | tokens_helper(_visitor, &(_i.box_token).0); |
| 2673 | _visitor.visit_pat(&*_i.pat); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2674 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2675 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2676 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2677 | pub fn visit_pat_ident<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatIdent) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2678 | if let Some(ref it) = _i.by_ref { |
| 2679 | tokens_helper(_visitor, &(it).0) |
| 2680 | }; |
| 2681 | if let Some(ref it) = _i.mutability { |
| 2682 | tokens_helper(_visitor, &(it).0) |
| 2683 | }; |
| 2684 | _visitor.visit_ident(&_i.ident); |
| 2685 | if let Some(ref it) = _i.subpat { |
| 2686 | tokens_helper(_visitor, &((it).0).0); |
| 2687 | _visitor.visit_pat(&*(it).1); |
| 2688 | }; |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2689 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2690 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2691 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2692 | pub fn visit_pat_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatLit) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2693 | _visitor.visit_expr(&*_i.expr); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2694 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2695 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2696 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2697 | pub fn visit_pat_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatMacro) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2698 | _visitor.visit_macro(&_i.mac); |
David Tolnay | 323279a | 2017-12-29 11:26:32 -0500 | [diff] [blame] | 2699 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2700 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2701 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2702 | pub fn visit_pat_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatPath) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2703 | if let Some(ref it) = _i.qself { |
| 2704 | _visitor.visit_qself(it) |
| 2705 | }; |
| 2706 | _visitor.visit_path(&_i.path); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2707 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2708 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2709 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2710 | pub fn visit_pat_range<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatRange) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2711 | _visitor.visit_expr(&*_i.lo); |
| 2712 | _visitor.visit_range_limits(&_i.limits); |
| 2713 | _visitor.visit_expr(&*_i.hi); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2714 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2715 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2716 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2717 | pub fn visit_pat_ref<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatRef) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2718 | tokens_helper(_visitor, &(_i.and_token).0); |
| 2719 | if let Some(ref it) = _i.mutability { |
| 2720 | tokens_helper(_visitor, &(it).0) |
| 2721 | }; |
| 2722 | _visitor.visit_pat(&*_i.pat); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2723 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2724 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2725 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2726 | pub fn visit_pat_slice<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatSlice) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2727 | tokens_helper(_visitor, &(_i.bracket_token).0); |
| 2728 | 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 { |
| 2736 | tokens_helper(_visitor, &(it).0) |
| 2737 | }; |
| 2738 | if let Some(ref it) = _i.comma_token { |
| 2739 | tokens_helper(_visitor, &(it).0) |
| 2740 | }; |
| 2741 | for el in Punctuated::pairs(&_i.back) { |
| 2742 | let it = el.value(); |
| 2743 | _visitor.visit_pat(it) |
| 2744 | } |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2745 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2746 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2747 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2748 | pub fn visit_pat_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatStruct) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2749 | _visitor.visit_path(&_i.path); |
| 2750 | tokens_helper(_visitor, &(_i.brace_token).0); |
| 2751 | for el in Punctuated::pairs(&_i.fields) { |
| 2752 | let it = el.value(); |
| 2753 | _visitor.visit_field_pat(it) |
| 2754 | } |
| 2755 | if let Some(ref it) = _i.dot2_token { |
| 2756 | tokens_helper(_visitor, &(it).0) |
| 2757 | }; |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2758 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2759 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2760 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2761 | pub fn visit_pat_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatTuple) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2762 | tokens_helper(_visitor, &(_i.paren_token).0); |
| 2763 | for el in Punctuated::pairs(&_i.front) { |
| 2764 | let it = el.value(); |
| 2765 | _visitor.visit_pat(it) |
| 2766 | } |
| 2767 | if let Some(ref it) = _i.dot2_token { |
| 2768 | tokens_helper(_visitor, &(it).0) |
| 2769 | }; |
| 2770 | if let Some(ref it) = _i.comma_token { |
| 2771 | tokens_helper(_visitor, &(it).0) |
| 2772 | }; |
| 2773 | for el in Punctuated::pairs(&_i.back) { |
| 2774 | let it = el.value(); |
| 2775 | _visitor.visit_pat(it) |
| 2776 | } |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2777 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2778 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2779 | #[cfg(feature = "full")] |
| 2780 | pub fn visit_pat_tuple_struct<'ast, V: Visit<'ast> + ?Sized>( |
| 2781 | _visitor: &mut V, |
| 2782 | _i: &'ast PatTupleStruct, |
| 2783 | ) { |
| 2784 | _visitor.visit_path(&_i.path); |
| 2785 | _visitor.visit_pat_tuple(&_i.pat); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2786 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2787 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2788 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2789 | pub fn visit_pat_verbatim<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatVerbatim) { |
David Tolnay | 6af4899 | 2018-08-01 11:16:28 -0700 | [diff] [blame] | 2790 | skip!(_i.tts); |
David Tolnay | 2ae520a | 2017-12-29 11:19:50 -0500 | [diff] [blame] | 2791 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2792 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2793 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2794 | pub fn visit_pat_wild<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatWild) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2795 | tokens_helper(_visitor, &(_i.underscore_token).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2796 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2797 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2798 | pub fn visit_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Path) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2799 | if let Some(ref it) = _i.leading_colon { |
| 2800 | tokens_helper(_visitor, &(it).0) |
| 2801 | }; |
| 2802 | for el in Punctuated::pairs(&_i.segments) { |
| 2803 | let it = el.value(); |
| 2804 | _visitor.visit_path_segment(it) |
| 2805 | } |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2806 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2807 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2808 | pub fn visit_path_arguments<'ast, V: Visit<'ast> + ?Sized>( |
| 2809 | _visitor: &mut V, |
| 2810 | _i: &'ast PathArguments, |
| 2811 | ) { |
Nika Layzell | c08227a | 2017-12-04 16:30:17 -0500 | [diff] [blame] | 2812 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2813 | PathArguments::None => {} |
| 2814 | PathArguments::AngleBracketed(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2815 | _visitor.visit_angle_bracketed_generic_arguments(_binding_0); |
Nika Layzell | c08227a | 2017-12-04 16:30:17 -0500 | [diff] [blame] | 2816 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2817 | PathArguments::Parenthesized(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2818 | _visitor.visit_parenthesized_generic_arguments(_binding_0); |
Nika Layzell | c08227a | 2017-12-04 16:30:17 -0500 | [diff] [blame] | 2819 | } |
| 2820 | } |
| 2821 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2822 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2823 | pub fn visit_path_segment<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PathSegment) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2824 | _visitor.visit_ident(&_i.ident); |
| 2825 | _visitor.visit_path_arguments(&_i.arguments); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2826 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2827 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2828 | pub fn visit_predicate_eq<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PredicateEq) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2829 | _visitor.visit_type(&_i.lhs_ty); |
| 2830 | tokens_helper(_visitor, &(_i.eq_token).0); |
| 2831 | _visitor.visit_type(&_i.rhs_ty); |
David Tolnay | d4add85 | 2018-01-01 20:13:24 -0800 | [diff] [blame] | 2832 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2833 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2834 | pub fn visit_predicate_lifetime<'ast, V: Visit<'ast> + ?Sized>( |
| 2835 | _visitor: &mut V, |
| 2836 | _i: &'ast PredicateLifetime, |
| 2837 | ) { |
| 2838 | _visitor.visit_lifetime(&_i.lifetime); |
| 2839 | if let Some(ref it) = _i.colon_token { |
| 2840 | tokens_helper(_visitor, &(it).0) |
| 2841 | }; |
| 2842 | for el in Punctuated::pairs(&_i.bounds) { |
| 2843 | let it = el.value(); |
| 2844 | _visitor.visit_lifetime(it) |
| 2845 | } |
David Tolnay | d4add85 | 2018-01-01 20:13:24 -0800 | [diff] [blame] | 2846 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2847 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2848 | pub fn visit_predicate_type<'ast, V: Visit<'ast> + ?Sized>( |
| 2849 | _visitor: &mut V, |
| 2850 | _i: &'ast PredicateType, |
| 2851 | ) { |
| 2852 | if let Some(ref it) = _i.lifetimes { |
| 2853 | _visitor.visit_bound_lifetimes(it) |
| 2854 | }; |
| 2855 | _visitor.visit_type(&_i.bounded_ty); |
| 2856 | tokens_helper(_visitor, &(_i.colon_token).0); |
| 2857 | for el in Punctuated::pairs(&_i.bounds) { |
| 2858 | let it = el.value(); |
| 2859 | _visitor.visit_type_param_bound(it) |
| 2860 | } |
David Tolnay | d4add85 | 2018-01-01 20:13:24 -0800 | [diff] [blame] | 2861 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2862 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2863 | pub fn visit_qself<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast QSelf) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2864 | tokens_helper(_visitor, &(_i.lt_token).0); |
| 2865 | _visitor.visit_type(&*_i.ty); |
David Tolnay | 6af4899 | 2018-08-01 11:16:28 -0700 | [diff] [blame] | 2866 | skip!(_i.position); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2867 | if let Some(ref it) = _i.as_token { |
| 2868 | tokens_helper(_visitor, &(it).0) |
| 2869 | }; |
| 2870 | tokens_helper(_visitor, &(_i.gt_token).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2871 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2872 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2873 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2874 | pub fn visit_range_limits<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast RangeLimits) { |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2875 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2876 | RangeLimits::HalfOpen(ref _binding_0) => { |
David Tolnay | cc0f037 | 2017-12-28 19:11:04 -0500 | [diff] [blame] | 2877 | tokens_helper(_visitor, &(_binding_0).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2878 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2879 | RangeLimits::Closed(ref _binding_0) => { |
David Tolnay | cc0f037 | 2017-12-28 19:11:04 -0500 | [diff] [blame] | 2880 | tokens_helper(_visitor, &(_binding_0).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2881 | } |
| 2882 | } |
| 2883 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2884 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2885 | pub fn visit_return_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ReturnType) { |
David Tolnay | f93b90d | 2017-11-11 19:21:26 -0800 | [diff] [blame] | 2886 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2887 | ReturnType::Default => {} |
| 2888 | ReturnType::Type(ref _binding_0, ref _binding_1) => { |
David Tolnay | 4a3f59a | 2017-12-28 21:21:12 -0500 | [diff] [blame] | 2889 | tokens_helper(_visitor, &(_binding_0).0); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2890 | _visitor.visit_type(&**_binding_1); |
David Tolnay | f93b90d | 2017-11-11 19:21:26 -0800 | [diff] [blame] | 2891 | } |
| 2892 | } |
| 2893 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2894 | pub fn visit_span<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Span) {} |
| 2895 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2896 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2897 | pub fn visit_stmt<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Stmt) { |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2898 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2899 | Stmt::Local(ref _binding_0) => { |
David Tolnay | 1f0b7b8 | 2018-01-06 16:07:14 -0800 | [diff] [blame] | 2900 | _visitor.visit_local(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2901 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2902 | Stmt::Item(ref _binding_0) => { |
David Tolnay | 1f0b7b8 | 2018-01-06 16:07:14 -0800 | [diff] [blame] | 2903 | _visitor.visit_item(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2904 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2905 | Stmt::Expr(ref _binding_0) => { |
David Tolnay | 1f0b7b8 | 2018-01-06 16:07:14 -0800 | [diff] [blame] | 2906 | _visitor.visit_expr(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2907 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2908 | Stmt::Semi(ref _binding_0, ref _binding_1) => { |
David Tolnay | 1f0b7b8 | 2018-01-06 16:07:14 -0800 | [diff] [blame] | 2909 | _visitor.visit_expr(_binding_0); |
David Tolnay | cc0f037 | 2017-12-28 19:11:04 -0500 | [diff] [blame] | 2910 | tokens_helper(_visitor, &(_binding_1).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2911 | } |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2912 | } |
| 2913 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2914 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2915 | pub fn visit_trait_bound<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TraitBound) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2916 | if let Some(ref it) = _i.paren_token { |
| 2917 | tokens_helper(_visitor, &(it).0) |
| 2918 | }; |
| 2919 | _visitor.visit_trait_bound_modifier(&_i.modifier); |
| 2920 | if let Some(ref it) = _i.lifetimes { |
| 2921 | _visitor.visit_bound_lifetimes(it) |
| 2922 | }; |
| 2923 | _visitor.visit_path(&_i.path); |
David Tolnay | 40fb8ce | 2018-01-02 10:53:46 -0800 | [diff] [blame] | 2924 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2925 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2926 | pub fn visit_trait_bound_modifier<'ast, V: Visit<'ast> + ?Sized>( |
| 2927 | _visitor: &mut V, |
| 2928 | _i: &'ast TraitBoundModifier, |
| 2929 | ) { |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2930 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2931 | TraitBoundModifier::None => {} |
| 2932 | TraitBoundModifier::Maybe(ref _binding_0) => { |
David Tolnay | cc0f037 | 2017-12-28 19:11:04 -0500 | [diff] [blame] | 2933 | tokens_helper(_visitor, &(_binding_0).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2934 | } |
| 2935 | } |
| 2936 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2937 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2938 | pub fn visit_trait_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TraitItem) { |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2939 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2940 | TraitItem::Const(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2941 | _visitor.visit_trait_item_const(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2942 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2943 | TraitItem::Method(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2944 | _visitor.visit_trait_item_method(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2945 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2946 | TraitItem::Type(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2947 | _visitor.visit_trait_item_type(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2948 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2949 | TraitItem::Macro(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2950 | _visitor.visit_trait_item_macro(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2951 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2952 | TraitItem::Verbatim(ref _binding_0) => { |
David Tolnay | 2ae520a | 2017-12-29 11:19:50 -0500 | [diff] [blame] | 2953 | _visitor.visit_trait_item_verbatim(_binding_0); |
| 2954 | } |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2955 | } |
| 2956 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2957 | #[cfg(feature = "full")] |
| 2958 | pub fn visit_trait_item_const<'ast, V: Visit<'ast> + ?Sized>( |
| 2959 | _visitor: &mut V, |
| 2960 | _i: &'ast TraitItemConst, |
| 2961 | ) { |
| 2962 | for it in &_i.attrs { |
| 2963 | _visitor.visit_attribute(it) |
| 2964 | } |
| 2965 | tokens_helper(_visitor, &(_i.const_token).0); |
| 2966 | _visitor.visit_ident(&_i.ident); |
| 2967 | tokens_helper(_visitor, &(_i.colon_token).0); |
| 2968 | _visitor.visit_type(&_i.ty); |
| 2969 | if let Some(ref it) = _i.default { |
| 2970 | tokens_helper(_visitor, &((it).0).0); |
| 2971 | _visitor.visit_expr(&(it).1); |
| 2972 | }; |
| 2973 | tokens_helper(_visitor, &(_i.semi_token).0); |
David Tolnay | da705bd | 2017-11-10 21:58:05 -0800 | [diff] [blame] | 2974 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2975 | #[cfg(feature = "full")] |
| 2976 | pub fn visit_trait_item_macro<'ast, V: Visit<'ast> + ?Sized>( |
| 2977 | _visitor: &mut V, |
| 2978 | _i: &'ast TraitItemMacro, |
| 2979 | ) { |
| 2980 | for it in &_i.attrs { |
| 2981 | _visitor.visit_attribute(it) |
| 2982 | } |
| 2983 | _visitor.visit_macro(&_i.mac); |
| 2984 | if let Some(ref it) = _i.semi_token { |
| 2985 | tokens_helper(_visitor, &(it).0) |
| 2986 | }; |
David Tolnay | da705bd | 2017-11-10 21:58:05 -0800 | [diff] [blame] | 2987 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2988 | #[cfg(feature = "full")] |
| 2989 | pub fn visit_trait_item_method<'ast, V: Visit<'ast> + ?Sized>( |
| 2990 | _visitor: &mut V, |
| 2991 | _i: &'ast TraitItemMethod, |
| 2992 | ) { |
| 2993 | for it in &_i.attrs { |
| 2994 | _visitor.visit_attribute(it) |
| 2995 | } |
| 2996 | _visitor.visit_method_sig(&_i.sig); |
| 2997 | if let Some(ref it) = _i.default { |
| 2998 | _visitor.visit_block(it) |
| 2999 | }; |
| 3000 | if let Some(ref it) = _i.semi_token { |
| 3001 | tokens_helper(_visitor, &(it).0) |
| 3002 | }; |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3003 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3004 | #[cfg(feature = "full")] |
| 3005 | pub fn visit_trait_item_type<'ast, V: Visit<'ast> + ?Sized>( |
| 3006 | _visitor: &mut V, |
| 3007 | _i: &'ast TraitItemType, |
| 3008 | ) { |
| 3009 | for it in &_i.attrs { |
| 3010 | _visitor.visit_attribute(it) |
| 3011 | } |
| 3012 | tokens_helper(_visitor, &(_i.type_token).0); |
| 3013 | _visitor.visit_ident(&_i.ident); |
| 3014 | _visitor.visit_generics(&_i.generics); |
| 3015 | if let Some(ref it) = _i.colon_token { |
| 3016 | tokens_helper(_visitor, &(it).0) |
| 3017 | }; |
| 3018 | for el in Punctuated::pairs(&_i.bounds) { |
| 3019 | let it = el.value(); |
| 3020 | _visitor.visit_type_param_bound(it) |
| 3021 | } |
| 3022 | if let Some(ref it) = _i.default { |
| 3023 | tokens_helper(_visitor, &((it).0).0); |
| 3024 | _visitor.visit_type(&(it).1); |
| 3025 | }; |
| 3026 | tokens_helper(_visitor, &(_i.semi_token).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3027 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3028 | #[cfg(feature = "full")] |
| 3029 | pub fn visit_trait_item_verbatim<'ast, V: Visit<'ast> + ?Sized>( |
| 3030 | _visitor: &mut V, |
| 3031 | _i: &'ast TraitItemVerbatim, |
| 3032 | ) { |
David Tolnay | 6af4899 | 2018-08-01 11:16:28 -0700 | [diff] [blame] | 3033 | skip!(_i.tts); |
David Tolnay | 2ae520a | 2017-12-29 11:19:50 -0500 | [diff] [blame] | 3034 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3035 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 3036 | pub fn visit_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Type) { |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3037 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3038 | Type::Slice(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 3039 | _visitor.visit_type_slice(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3040 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3041 | Type::Array(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 3042 | _visitor.visit_type_array(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3043 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3044 | Type::Ptr(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 3045 | _visitor.visit_type_ptr(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3046 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3047 | Type::Reference(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 3048 | _visitor.visit_type_reference(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3049 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3050 | Type::BareFn(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 3051 | _visitor.visit_type_bare_fn(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3052 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3053 | Type::Never(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 3054 | _visitor.visit_type_never(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3055 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3056 | Type::Tuple(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 3057 | _visitor.visit_type_tuple(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3058 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3059 | Type::Path(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 3060 | _visitor.visit_type_path(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3061 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3062 | Type::TraitObject(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 3063 | _visitor.visit_type_trait_object(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3064 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3065 | Type::ImplTrait(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 3066 | _visitor.visit_type_impl_trait(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3067 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3068 | Type::Paren(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 3069 | _visitor.visit_type_paren(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3070 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3071 | Type::Group(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 3072 | _visitor.visit_type_group(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3073 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3074 | Type::Infer(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 3075 | _visitor.visit_type_infer(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3076 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3077 | Type::Macro(ref _binding_0) => { |
David Tolnay | 323279a | 2017-12-29 11:26:32 -0500 | [diff] [blame] | 3078 | _visitor.visit_type_macro(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3079 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3080 | Type::Verbatim(ref _binding_0) => { |
David Tolnay | 2ae520a | 2017-12-29 11:19:50 -0500 | [diff] [blame] | 3081 | _visitor.visit_type_verbatim(_binding_0); |
| 3082 | } |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3083 | } |
| 3084 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3085 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 3086 | pub fn visit_type_array<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeArray) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3087 | tokens_helper(_visitor, &(_i.bracket_token).0); |
| 3088 | _visitor.visit_type(&*_i.elem); |
| 3089 | tokens_helper(_visitor, &(_i.semi_token).0); |
| 3090 | _visitor.visit_expr(&_i.len); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3091 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3092 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 3093 | pub fn visit_type_bare_fn<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeBareFn) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3094 | if let Some(ref it) = _i.unsafety { |
| 3095 | tokens_helper(_visitor, &(it).0) |
| 3096 | }; |
| 3097 | if let Some(ref it) = _i.abi { |
| 3098 | _visitor.visit_abi(it) |
| 3099 | }; |
| 3100 | tokens_helper(_visitor, &(_i.fn_token).0); |
| 3101 | if let Some(ref it) = _i.lifetimes { |
| 3102 | _visitor.visit_bound_lifetimes(it) |
| 3103 | }; |
| 3104 | tokens_helper(_visitor, &(_i.paren_token).0); |
| 3105 | for el in Punctuated::pairs(&_i.inputs) { |
| 3106 | let it = el.value(); |
| 3107 | _visitor.visit_bare_fn_arg(it) |
| 3108 | } |
| 3109 | if let Some(ref it) = _i.variadic { |
| 3110 | tokens_helper(_visitor, &(it).0) |
| 3111 | }; |
| 3112 | _visitor.visit_return_type(&_i.output); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3113 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3114 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 3115 | pub fn visit_type_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeGroup) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3116 | tokens_helper(_visitor, &(_i.group_token).0); |
| 3117 | _visitor.visit_type(&*_i.elem); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3118 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3119 | #[cfg(any(feature = "full", feature = "derive"))] |
| 3120 | pub fn visit_type_impl_trait<'ast, V: Visit<'ast> + ?Sized>( |
| 3121 | _visitor: &mut V, |
| 3122 | _i: &'ast TypeImplTrait, |
| 3123 | ) { |
| 3124 | tokens_helper(_visitor, &(_i.impl_token).0); |
| 3125 | for el in Punctuated::pairs(&_i.bounds) { |
| 3126 | let it = el.value(); |
| 3127 | _visitor.visit_type_param_bound(it) |
| 3128 | } |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3129 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3130 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 3131 | pub fn visit_type_infer<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeInfer) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3132 | tokens_helper(_visitor, &(_i.underscore_token).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3133 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3134 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 3135 | pub fn visit_type_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeMacro) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3136 | _visitor.visit_macro(&_i.mac); |
David Tolnay | 323279a | 2017-12-29 11:26:32 -0500 | [diff] [blame] | 3137 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3138 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 3139 | pub fn visit_type_never<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeNever) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3140 | tokens_helper(_visitor, &(_i.bang_token).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3141 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3142 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 3143 | pub fn visit_type_param<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeParam) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3144 | for it in &_i.attrs { |
| 3145 | _visitor.visit_attribute(it) |
| 3146 | } |
| 3147 | _visitor.visit_ident(&_i.ident); |
| 3148 | if let Some(ref it) = _i.colon_token { |
| 3149 | tokens_helper(_visitor, &(it).0) |
| 3150 | }; |
| 3151 | for el in Punctuated::pairs(&_i.bounds) { |
| 3152 | let it = el.value(); |
| 3153 | _visitor.visit_type_param_bound(it) |
| 3154 | } |
| 3155 | if let Some(ref it) = _i.eq_token { |
| 3156 | tokens_helper(_visitor, &(it).0) |
| 3157 | }; |
| 3158 | if let Some(ref it) = _i.default { |
| 3159 | _visitor.visit_type(it) |
| 3160 | }; |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3161 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3162 | #[cfg(any(feature = "full", feature = "derive"))] |
| 3163 | pub fn visit_type_param_bound<'ast, V: Visit<'ast> + ?Sized>( |
| 3164 | _visitor: &mut V, |
| 3165 | _i: &'ast TypeParamBound, |
| 3166 | ) { |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3167 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3168 | TypeParamBound::Trait(ref _binding_0) => { |
David Tolnay | 40fb8ce | 2018-01-02 10:53:46 -0800 | [diff] [blame] | 3169 | _visitor.visit_trait_bound(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3170 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3171 | TypeParamBound::Lifetime(ref _binding_0) => { |
David Tolnay | 4ba63a0 | 2017-12-28 15:53:05 -0500 | [diff] [blame] | 3172 | _visitor.visit_lifetime(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3173 | } |
| 3174 | } |
| 3175 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3176 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 3177 | pub fn visit_type_paren<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeParen) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3178 | tokens_helper(_visitor, &(_i.paren_token).0); |
| 3179 | _visitor.visit_type(&*_i.elem); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3180 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3181 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 3182 | pub fn visit_type_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypePath) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3183 | if let Some(ref it) = _i.qself { |
| 3184 | _visitor.visit_qself(it) |
| 3185 | }; |
| 3186 | _visitor.visit_path(&_i.path); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3187 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3188 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 3189 | pub fn visit_type_ptr<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypePtr) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3190 | tokens_helper(_visitor, &(_i.star_token).0); |
| 3191 | if let Some(ref it) = _i.const_token { |
| 3192 | tokens_helper(_visitor, &(it).0) |
| 3193 | }; |
| 3194 | if let Some(ref it) = _i.mutability { |
| 3195 | tokens_helper(_visitor, &(it).0) |
| 3196 | }; |
| 3197 | _visitor.visit_type(&*_i.elem); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3198 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3199 | #[cfg(any(feature = "full", feature = "derive"))] |
| 3200 | pub fn visit_type_reference<'ast, V: Visit<'ast> + ?Sized>( |
| 3201 | _visitor: &mut V, |
| 3202 | _i: &'ast TypeReference, |
| 3203 | ) { |
| 3204 | tokens_helper(_visitor, &(_i.and_token).0); |
| 3205 | if let Some(ref it) = _i.lifetime { |
| 3206 | _visitor.visit_lifetime(it) |
| 3207 | }; |
| 3208 | if let Some(ref it) = _i.mutability { |
| 3209 | tokens_helper(_visitor, &(it).0) |
| 3210 | }; |
| 3211 | _visitor.visit_type(&*_i.elem); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3212 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3213 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 3214 | pub fn visit_type_slice<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeSlice) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3215 | tokens_helper(_visitor, &(_i.bracket_token).0); |
| 3216 | _visitor.visit_type(&*_i.elem); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3217 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3218 | #[cfg(any(feature = "full", feature = "derive"))] |
| 3219 | pub fn visit_type_trait_object<'ast, V: Visit<'ast> + ?Sized>( |
| 3220 | _visitor: &mut V, |
| 3221 | _i: &'ast TypeTraitObject, |
| 3222 | ) { |
| 3223 | if let Some(ref it) = _i.dyn_token { |
| 3224 | tokens_helper(_visitor, &(it).0) |
| 3225 | }; |
| 3226 | for el in Punctuated::pairs(&_i.bounds) { |
| 3227 | let it = el.value(); |
| 3228 | _visitor.visit_type_param_bound(it) |
| 3229 | } |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3230 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3231 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 3232 | pub fn visit_type_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeTuple) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3233 | tokens_helper(_visitor, &(_i.paren_token).0); |
| 3234 | for el in Punctuated::pairs(&_i.elems) { |
| 3235 | let it = el.value(); |
| 3236 | _visitor.visit_type(it) |
| 3237 | } |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3238 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3239 | #[cfg(any(feature = "full", feature = "derive"))] |
| 3240 | pub fn visit_type_verbatim<'ast, V: Visit<'ast> + ?Sized>( |
| 3241 | _visitor: &mut V, |
| 3242 | _i: &'ast TypeVerbatim, |
| 3243 | ) { |
David Tolnay | 6af4899 | 2018-08-01 11:16:28 -0700 | [diff] [blame] | 3244 | skip!(_i.tts); |
David Tolnay | 2ae520a | 2017-12-29 11:19:50 -0500 | [diff] [blame] | 3245 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3246 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 3247 | pub fn visit_un_op<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UnOp) { |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3248 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3249 | UnOp::Deref(ref _binding_0) => { |
David Tolnay | cc0f037 | 2017-12-28 19:11:04 -0500 | [diff] [blame] | 3250 | tokens_helper(_visitor, &(_binding_0).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3251 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3252 | UnOp::Not(ref _binding_0) => { |
David Tolnay | cc0f037 | 2017-12-28 19:11:04 -0500 | [diff] [blame] | 3253 | tokens_helper(_visitor, &(_binding_0).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3254 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3255 | UnOp::Neg(ref _binding_0) => { |
David Tolnay | cc0f037 | 2017-12-28 19:11:04 -0500 | [diff] [blame] | 3256 | tokens_helper(_visitor, &(_binding_0).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3257 | } |
| 3258 | } |
| 3259 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3260 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 3261 | pub fn visit_use_glob<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseGlob) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3262 | tokens_helper(_visitor, &(_i.star_token).0); |
David Tolnay | 5f332a9 | 2017-12-26 00:42:45 -0500 | [diff] [blame] | 3263 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3264 | #[cfg(feature = "full")] |
David Tolnay | d97a7d2 | 2018-03-31 19:17:01 +0200 | [diff] [blame] | 3265 | pub fn visit_use_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseGroup) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3266 | tokens_helper(_visitor, &(_i.brace_token).0); |
| 3267 | for el in Punctuated::pairs(&_i.items) { |
| 3268 | let it = el.value(); |
| 3269 | _visitor.visit_use_tree(it) |
| 3270 | } |
David Tolnay | 5f332a9 | 2017-12-26 00:42:45 -0500 | [diff] [blame] | 3271 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3272 | #[cfg(feature = "full")] |
David Tolnay | d97a7d2 | 2018-03-31 19:17:01 +0200 | [diff] [blame] | 3273 | pub fn visit_use_name<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseName) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3274 | _visitor.visit_ident(&_i.ident); |
David Tolnay | d97a7d2 | 2018-03-31 19:17:01 +0200 | [diff] [blame] | 3275 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3276 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 3277 | pub fn visit_use_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UsePath) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3278 | _visitor.visit_ident(&_i.ident); |
| 3279 | tokens_helper(_visitor, &(_i.colon2_token).0); |
| 3280 | _visitor.visit_use_tree(&*_i.tree); |
David Tolnay | d97a7d2 | 2018-03-31 19:17:01 +0200 | [diff] [blame] | 3281 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3282 | #[cfg(feature = "full")] |
David Tolnay | d97a7d2 | 2018-03-31 19:17:01 +0200 | [diff] [blame] | 3283 | pub fn visit_use_rename<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseRename) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3284 | _visitor.visit_ident(&_i.ident); |
| 3285 | tokens_helper(_visitor, &(_i.as_token).0); |
| 3286 | _visitor.visit_ident(&_i.rename); |
David Tolnay | 5f332a9 | 2017-12-26 00:42:45 -0500 | [diff] [blame] | 3287 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3288 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 3289 | pub fn visit_use_tree<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseTree) { |
David Tolnay | 5f332a9 | 2017-12-26 00:42:45 -0500 | [diff] [blame] | 3290 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3291 | UseTree::Path(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 3292 | _visitor.visit_use_path(_binding_0); |
David Tolnay | 5f332a9 | 2017-12-26 00:42:45 -0500 | [diff] [blame] | 3293 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3294 | UseTree::Name(ref _binding_0) => { |
David Tolnay | d97a7d2 | 2018-03-31 19:17:01 +0200 | [diff] [blame] | 3295 | _visitor.visit_use_name(_binding_0); |
| 3296 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3297 | UseTree::Rename(ref _binding_0) => { |
David Tolnay | d97a7d2 | 2018-03-31 19:17:01 +0200 | [diff] [blame] | 3298 | _visitor.visit_use_rename(_binding_0); |
| 3299 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3300 | UseTree::Glob(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 3301 | _visitor.visit_use_glob(_binding_0); |
David Tolnay | 5f332a9 | 2017-12-26 00:42:45 -0500 | [diff] [blame] | 3302 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3303 | UseTree::Group(ref _binding_0) => { |
David Tolnay | d97a7d2 | 2018-03-31 19:17:01 +0200 | [diff] [blame] | 3304 | _visitor.visit_use_group(_binding_0); |
David Tolnay | 5f332a9 | 2017-12-26 00:42:45 -0500 | [diff] [blame] | 3305 | } |
| 3306 | } |
| 3307 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3308 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 3309 | pub fn visit_variant<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Variant) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3310 | for it in &_i.attrs { |
| 3311 | _visitor.visit_attribute(it) |
| 3312 | } |
| 3313 | _visitor.visit_ident(&_i.ident); |
| 3314 | _visitor.visit_fields(&_i.fields); |
| 3315 | if let Some(ref it) = _i.discriminant { |
| 3316 | tokens_helper(_visitor, &((it).0).0); |
| 3317 | _visitor.visit_expr(&(it).1); |
| 3318 | }; |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3319 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3320 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 3321 | pub fn visit_vis_crate<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast VisCrate) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3322 | tokens_helper(_visitor, &(_i.crate_token).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3323 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3324 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 3325 | pub fn visit_vis_public<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast VisPublic) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3326 | tokens_helper(_visitor, &(_i.pub_token).0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3327 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3328 | #[cfg(any(feature = "full", feature = "derive"))] |
| 3329 | pub fn visit_vis_restricted<'ast, V: Visit<'ast> + ?Sized>( |
| 3330 | _visitor: &mut V, |
| 3331 | _i: &'ast VisRestricted, |
| 3332 | ) { |
| 3333 | tokens_helper(_visitor, &(_i.pub_token).0); |
| 3334 | tokens_helper(_visitor, &(_i.paren_token).0); |
| 3335 | if let Some(ref it) = _i.in_token { |
| 3336 | tokens_helper(_visitor, &(it).0) |
| 3337 | }; |
| 3338 | _visitor.visit_path(&*_i.path); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3339 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3340 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 3341 | pub fn visit_visibility<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Visibility) { |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3342 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3343 | Visibility::Public(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 3344 | _visitor.visit_vis_public(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3345 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3346 | Visibility::Crate(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 3347 | _visitor.visit_vis_crate(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3348 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3349 | Visibility::Restricted(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 3350 | _visitor.visit_vis_restricted(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3351 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3352 | Visibility::Inherited => {} |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3353 | } |
| 3354 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3355 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 3356 | pub fn visit_where_clause<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast WhereClause) { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3357 | tokens_helper(_visitor, &(_i.where_token).0); |
| 3358 | for el in Punctuated::pairs(&_i.predicates) { |
| 3359 | let it = el.value(); |
| 3360 | _visitor.visit_where_predicate(it) |
| 3361 | } |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3362 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3363 | #[cfg(any(feature = "full", feature = "derive"))] |
| 3364 | pub fn visit_where_predicate<'ast, V: Visit<'ast> + ?Sized>( |
| 3365 | _visitor: &mut V, |
| 3366 | _i: &'ast WherePredicate, |
| 3367 | ) { |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3368 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3369 | WherePredicate::Type(ref _binding_0) => { |
David Tolnay | d4add85 | 2018-01-01 20:13:24 -0800 | [diff] [blame] | 3370 | _visitor.visit_predicate_type(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3371 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3372 | WherePredicate::Lifetime(ref _binding_0) => { |
David Tolnay | d4add85 | 2018-01-01 20:13:24 -0800 | [diff] [blame] | 3373 | _visitor.visit_predicate_lifetime(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3374 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3375 | WherePredicate::Eq(ref _binding_0) => { |
David Tolnay | d4add85 | 2018-01-01 20:13:24 -0800 | [diff] [blame] | 3376 | _visitor.visit_predicate_eq(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3377 | } |
| 3378 | } |
| 3379 | } |