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 | 280202f | 2018-08-02 00:29:54 -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 | 280202f | 2018-08-02 00:29:54 -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 { |
David Tolnay | 280202f | 2018-08-02 00:29:54 -0700 | [diff] [blame] | 24 | ($($tt:tt)*) => {}; |
David Tolnay | 6af4899 | 2018-08-01 11:16:28 -0700 | [diff] [blame] | 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 | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 857 | tokens_helper(_visitor, &_i.extern_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 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 { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 868 | tokens_helper(_visitor, &it.spans) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 869 | }; |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 870 | tokens_helper(_visitor, &_i.lt_token.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 871 | for el in Punctuated::pairs(&_i.args) { |
| 872 | let it = el.value(); |
| 873 | _visitor.visit_generic_argument(it) |
| 874 | } |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 875 | tokens_helper(_visitor, &_i.gt_token.spans); |
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); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 880 | tokens_helper(_visitor, &_i.colon_token.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 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 { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 886 | tokens_helper(_visitor, &it.span) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 887 | }; |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 888 | tokens_helper(_visitor, &_i.self_token.span); |
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 | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 892 | tokens_helper(_visitor, &_i.and_token.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 893 | if let Some(ref it) = _i.lifetime { |
| 894 | _visitor.visit_lifetime(it) |
| 895 | }; |
| 896 | if let Some(ref it) = _i.mutability { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 897 | tokens_helper(_visitor, &it.span) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 898 | }; |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 899 | tokens_helper(_visitor, &_i.self_token.span); |
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 { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 908 | tokens_helper(_visitor, &it.spans) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 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 { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 915 | tokens_helper(_visitor, &(it).0.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 916 | _visitor.visit_expr(&*(it).1); |
| 917 | }; |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 918 | tokens_helper(_visitor, &_i.fat_arrow_token.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 919 | _visitor.visit_expr(&*_i.body); |
| 920 | if let Some(ref it) = _i.comma { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 921 | tokens_helper(_visitor, &it.spans) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 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 | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 929 | tokens_helper(_visitor, &_binding_0.spans); |
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 | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 935 | tokens_helper(_visitor, &_i.pound_token.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 936 | _visitor.visit_attr_style(&_i.style); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 937 | tokens_helper(_visitor, &_i.bracket_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 938 | _visitor.visit_path(&_i.path); |
David Tolnay | 6af4899 | 2018-08-01 11:16:28 -0700 | [diff] [blame] | 939 | skip!(_i.tts); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 940 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 941 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 942 | 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] | 943 | if let Some(ref it) = _i.name { |
| 944 | _visitor.visit_bare_fn_arg_name(&(it).0); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 945 | tokens_helper(_visitor, &(it).1.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 946 | }; |
| 947 | _visitor.visit_type(&_i.ty); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 948 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 949 | #[cfg(any(feature = "full", feature = "derive"))] |
| 950 | pub fn visit_bare_fn_arg_name<'ast, V: Visit<'ast> + ?Sized>( |
| 951 | _visitor: &mut V, |
| 952 | _i: &'ast BareFnArgName, |
| 953 | ) { |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 954 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 955 | BareFnArgName::Named(ref _binding_0) => { |
Alex Crichton | d261d09 | 2018-05-18 13:47:35 -0700 | [diff] [blame] | 956 | _visitor.visit_ident(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 957 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 958 | BareFnArgName::Wild(ref _binding_0) => { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 959 | tokens_helper(_visitor, &_binding_0.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 960 | } |
| 961 | } |
| 962 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 963 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 964 | 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] | 965 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 966 | BinOp::Add(ref _binding_0) => { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 967 | tokens_helper(_visitor, &_binding_0.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 968 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 969 | BinOp::Sub(ref _binding_0) => { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 970 | tokens_helper(_visitor, &_binding_0.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 971 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 972 | BinOp::Mul(ref _binding_0) => { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 973 | tokens_helper(_visitor, &_binding_0.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 974 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 975 | BinOp::Div(ref _binding_0) => { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 976 | tokens_helper(_visitor, &_binding_0.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 977 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 978 | BinOp::Rem(ref _binding_0) => { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 979 | tokens_helper(_visitor, &_binding_0.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 980 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 981 | BinOp::And(ref _binding_0) => { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 982 | tokens_helper(_visitor, &_binding_0.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 983 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 984 | BinOp::Or(ref _binding_0) => { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 985 | tokens_helper(_visitor, &_binding_0.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 986 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 987 | BinOp::BitXor(ref _binding_0) => { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 988 | tokens_helper(_visitor, &_binding_0.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 989 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 990 | BinOp::BitAnd(ref _binding_0) => { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 991 | tokens_helper(_visitor, &_binding_0.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 992 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 993 | BinOp::BitOr(ref _binding_0) => { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 994 | tokens_helper(_visitor, &_binding_0.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 995 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 996 | BinOp::Shl(ref _binding_0) => { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 997 | tokens_helper(_visitor, &_binding_0.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 998 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 999 | BinOp::Shr(ref _binding_0) => { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1000 | tokens_helper(_visitor, &_binding_0.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1001 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1002 | BinOp::Eq(ref _binding_0) => { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1003 | tokens_helper(_visitor, &_binding_0.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1004 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1005 | BinOp::Lt(ref _binding_0) => { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1006 | tokens_helper(_visitor, &_binding_0.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1007 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1008 | BinOp::Le(ref _binding_0) => { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1009 | tokens_helper(_visitor, &_binding_0.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1010 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1011 | BinOp::Ne(ref _binding_0) => { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1012 | tokens_helper(_visitor, &_binding_0.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1013 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1014 | BinOp::Ge(ref _binding_0) => { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1015 | tokens_helper(_visitor, &_binding_0.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1016 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1017 | BinOp::Gt(ref _binding_0) => { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1018 | tokens_helper(_visitor, &_binding_0.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1019 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1020 | BinOp::AddEq(ref _binding_0) => { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1021 | tokens_helper(_visitor, &_binding_0.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1022 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1023 | BinOp::SubEq(ref _binding_0) => { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1024 | tokens_helper(_visitor, &_binding_0.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1025 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1026 | BinOp::MulEq(ref _binding_0) => { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1027 | tokens_helper(_visitor, &_binding_0.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1028 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1029 | BinOp::DivEq(ref _binding_0) => { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1030 | tokens_helper(_visitor, &_binding_0.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1031 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1032 | BinOp::RemEq(ref _binding_0) => { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1033 | tokens_helper(_visitor, &_binding_0.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1034 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1035 | BinOp::BitXorEq(ref _binding_0) => { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1036 | tokens_helper(_visitor, &_binding_0.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1037 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1038 | BinOp::BitAndEq(ref _binding_0) => { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1039 | tokens_helper(_visitor, &_binding_0.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1040 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1041 | BinOp::BitOrEq(ref _binding_0) => { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1042 | tokens_helper(_visitor, &_binding_0.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1043 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1044 | BinOp::ShlEq(ref _binding_0) => { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1045 | tokens_helper(_visitor, &_binding_0.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1046 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1047 | BinOp::ShrEq(ref _binding_0) => { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1048 | tokens_helper(_visitor, &_binding_0.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1049 | } |
| 1050 | } |
| 1051 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1052 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 1053 | 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] | 1054 | _visitor.visit_ident(&_i.ident); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1055 | tokens_helper(_visitor, &_i.eq_token.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1056 | _visitor.visit_type(&_i.ty); |
David Tolnay | 506e43a | 2017-12-29 11:34:36 -0500 | [diff] [blame] | 1057 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1058 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1059 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 1060 | pub fn visit_block<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Block) { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1061 | tokens_helper(_visitor, &_i.brace_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1062 | for it in &_i.stmts { |
| 1063 | _visitor.visit_stmt(it) |
| 1064 | } |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1065 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1066 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1067 | pub fn visit_bound_lifetimes<'ast, V: Visit<'ast> + ?Sized>( |
| 1068 | _visitor: &mut V, |
| 1069 | _i: &'ast BoundLifetimes, |
| 1070 | ) { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1071 | tokens_helper(_visitor, &_i.for_token.span); |
| 1072 | tokens_helper(_visitor, &_i.lt_token.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1073 | for el in Punctuated::pairs(&_i.lifetimes) { |
| 1074 | let it = el.value(); |
| 1075 | _visitor.visit_lifetime_def(it) |
| 1076 | } |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1077 | tokens_helper(_visitor, &_i.gt_token.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1078 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1079 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 1080 | 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] | 1081 | for it in &_i.attrs { |
| 1082 | _visitor.visit_attribute(it) |
| 1083 | } |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1084 | tokens_helper(_visitor, &_i.const_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1085 | _visitor.visit_ident(&_i.ident); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1086 | tokens_helper(_visitor, &_i.colon_token.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1087 | _visitor.visit_type(&_i.ty); |
| 1088 | if let Some(ref it) = _i.eq_token { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1089 | tokens_helper(_visitor, &it.spans) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1090 | }; |
| 1091 | if let Some(ref it) = _i.default { |
| 1092 | _visitor.visit_expr(it) |
| 1093 | }; |
Nika Layzell | f1fdc0b | 2017-12-04 19:58:32 -0500 | [diff] [blame] | 1094 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1095 | #[cfg(feature = "derive")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 1096 | 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] | 1097 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1098 | Data::Struct(ref _binding_0) => { |
David Tolnay | e3d41b7 | 2017-12-31 15:24:00 -0500 | [diff] [blame] | 1099 | _visitor.visit_data_struct(_binding_0); |
| 1100 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1101 | Data::Enum(ref _binding_0) => { |
David Tolnay | e3d41b7 | 2017-12-31 15:24:00 -0500 | [diff] [blame] | 1102 | _visitor.visit_data_enum(_binding_0); |
| 1103 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1104 | Data::Union(ref _binding_0) => { |
David Tolnay | e3d41b7 | 2017-12-31 15:24:00 -0500 | [diff] [blame] | 1105 | _visitor.visit_data_union(_binding_0); |
| 1106 | } |
| 1107 | } |
| 1108 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1109 | #[cfg(feature = "derive")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 1110 | pub fn visit_data_enum<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataEnum) { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1111 | tokens_helper(_visitor, &_i.enum_token.span); |
| 1112 | tokens_helper(_visitor, &_i.brace_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1113 | for el in Punctuated::pairs(&_i.variants) { |
| 1114 | let it = el.value(); |
| 1115 | _visitor.visit_variant(it) |
| 1116 | } |
David Tolnay | e3d41b7 | 2017-12-31 15:24:00 -0500 | [diff] [blame] | 1117 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1118 | #[cfg(feature = "derive")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 1119 | pub fn visit_data_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataStruct) { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1120 | tokens_helper(_visitor, &_i.struct_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1121 | _visitor.visit_fields(&_i.fields); |
| 1122 | if let Some(ref it) = _i.semi_token { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1123 | tokens_helper(_visitor, &it.spans) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1124 | }; |
David Tolnay | e3d41b7 | 2017-12-31 15:24:00 -0500 | [diff] [blame] | 1125 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1126 | #[cfg(feature = "derive")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 1127 | pub fn visit_data_union<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast DataUnion) { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1128 | tokens_helper(_visitor, &_i.union_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1129 | _visitor.visit_fields_named(&_i.fields); |
David Tolnay | e3d41b7 | 2017-12-31 15:24:00 -0500 | [diff] [blame] | 1130 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1131 | #[cfg(feature = "derive")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 1132 | 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] | 1133 | for it in &_i.attrs { |
| 1134 | _visitor.visit_attribute(it) |
| 1135 | } |
| 1136 | _visitor.visit_visibility(&_i.vis); |
| 1137 | _visitor.visit_ident(&_i.ident); |
| 1138 | _visitor.visit_generics(&_i.generics); |
| 1139 | _visitor.visit_data(&_i.data); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1140 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1141 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 1142 | 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] | 1143 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1144 | Expr::Box(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1145 | full!(_visitor.visit_expr_box(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1146 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1147 | Expr::InPlace(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1148 | full!(_visitor.visit_expr_in_place(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1149 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1150 | Expr::Array(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1151 | full!(_visitor.visit_expr_array(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1152 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1153 | Expr::Call(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1154 | _visitor.visit_expr_call(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1155 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1156 | Expr::MethodCall(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1157 | full!(_visitor.visit_expr_method_call(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1158 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1159 | Expr::Tuple(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1160 | full!(_visitor.visit_expr_tuple(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1161 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1162 | Expr::Binary(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1163 | _visitor.visit_expr_binary(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1164 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1165 | Expr::Unary(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1166 | _visitor.visit_expr_unary(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1167 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1168 | Expr::Lit(ref _binding_0) => { |
David Tolnay | 8c91b88 | 2017-12-28 23:04:32 -0500 | [diff] [blame] | 1169 | _visitor.visit_expr_lit(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1170 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1171 | Expr::Cast(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1172 | _visitor.visit_expr_cast(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1173 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1174 | Expr::Type(ref _binding_0) => { |
David Tolnay | 0cf94f2 | 2017-12-28 23:46:26 -0500 | [diff] [blame] | 1175 | full!(_visitor.visit_expr_type(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1176 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1177 | Expr::If(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1178 | full!(_visitor.visit_expr_if(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1179 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1180 | Expr::IfLet(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1181 | full!(_visitor.visit_expr_if_let(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1182 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1183 | Expr::While(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1184 | full!(_visitor.visit_expr_while(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1185 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1186 | Expr::WhileLet(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1187 | full!(_visitor.visit_expr_while_let(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1188 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1189 | Expr::ForLoop(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1190 | full!(_visitor.visit_expr_for_loop(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1191 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1192 | Expr::Loop(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1193 | full!(_visitor.visit_expr_loop(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1194 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1195 | Expr::Match(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1196 | full!(_visitor.visit_expr_match(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1197 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1198 | Expr::Closure(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1199 | full!(_visitor.visit_expr_closure(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1200 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1201 | Expr::Unsafe(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1202 | full!(_visitor.visit_expr_unsafe(_binding_0)); |
Nika Layzell | 640832a | 2017-12-04 13:37:09 -0500 | [diff] [blame] | 1203 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1204 | Expr::Block(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1205 | full!(_visitor.visit_expr_block(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1206 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1207 | Expr::Assign(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1208 | full!(_visitor.visit_expr_assign(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1209 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1210 | Expr::AssignOp(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1211 | full!(_visitor.visit_expr_assign_op(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1212 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1213 | Expr::Field(ref _binding_0) => { |
David Tolnay | d093fa9 | 2018-06-30 10:23:25 -0700 | [diff] [blame] | 1214 | _visitor.visit_expr_field(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1215 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1216 | Expr::Index(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1217 | _visitor.visit_expr_index(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1218 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1219 | Expr::Range(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1220 | full!(_visitor.visit_expr_range(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1221 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1222 | Expr::Path(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1223 | _visitor.visit_expr_path(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1224 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1225 | Expr::Reference(ref _binding_0) => { |
David Tolnay | 00674ba | 2018-03-31 18:14:11 +0200 | [diff] [blame] | 1226 | full!(_visitor.visit_expr_reference(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1227 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1228 | Expr::Break(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1229 | full!(_visitor.visit_expr_break(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1230 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1231 | Expr::Continue(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1232 | full!(_visitor.visit_expr_continue(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1233 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1234 | Expr::Return(ref _binding_0) => { |
David Tolnay | c246cd3 | 2017-12-28 23:14:32 -0500 | [diff] [blame] | 1235 | full!(_visitor.visit_expr_return(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1236 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1237 | Expr::Macro(ref _binding_0) => { |
David Tolnay | 8c91b88 | 2017-12-28 23:04:32 -0500 | [diff] [blame] | 1238 | full!(_visitor.visit_expr_macro(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1239 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1240 | Expr::Struct(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1241 | full!(_visitor.visit_expr_struct(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1242 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1243 | Expr::Repeat(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1244 | full!(_visitor.visit_expr_repeat(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1245 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1246 | Expr::Paren(ref _binding_0) => { |
David Tolnay | 81ab4f6 | 2018-01-27 19:02:51 -0800 | [diff] [blame] | 1247 | _visitor.visit_expr_paren(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1248 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1249 | Expr::Group(ref _binding_0) => { |
David Tolnay | e98775f | 2017-12-28 23:17:00 -0500 | [diff] [blame] | 1250 | full!(_visitor.visit_expr_group(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1251 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1252 | Expr::Try(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1253 | full!(_visitor.visit_expr_try(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1254 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1255 | Expr::Catch(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1256 | full!(_visitor.visit_expr_catch(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1257 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1258 | Expr::Yield(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1259 | full!(_visitor.visit_expr_yield(_binding_0)); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1260 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1261 | Expr::Verbatim(ref _binding_0) => { |
David Tolnay | 2ae520a | 2017-12-29 11:19:50 -0500 | [diff] [blame] | 1262 | _visitor.visit_expr_verbatim(_binding_0); |
| 1263 | } |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1264 | } |
| 1265 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1266 | #[cfg(feature = "full")] |
| 1267 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 1268 | 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] | 1269 | for it in &_i.attrs { |
| 1270 | _visitor.visit_attribute(it) |
| 1271 | } |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1272 | tokens_helper(_visitor, &_i.bracket_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1273 | for el in Punctuated::pairs(&_i.elems) { |
| 1274 | let it = el.value(); |
| 1275 | _visitor.visit_expr(it) |
David Tolnay | e3d41b7 | 2017-12-31 15:24:00 -0500 | [diff] [blame] | 1276 | } |
| 1277 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1278 | #[cfg(feature = "full")] |
| 1279 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1280 | pub fn visit_expr_assign<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprAssign) { |
| 1281 | for it in &_i.attrs { |
| 1282 | _visitor.visit_attribute(it) |
| 1283 | } |
| 1284 | _visitor.visit_expr(&*_i.left); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1285 | tokens_helper(_visitor, &_i.eq_token.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1286 | _visitor.visit_expr(&*_i.right); |
| 1287 | } |
| 1288 | #[cfg(feature = "full")] |
| 1289 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1290 | pub fn visit_expr_assign_op<'ast, V: Visit<'ast> + ?Sized>( |
| 1291 | _visitor: &mut V, |
| 1292 | _i: &'ast ExprAssignOp, |
| 1293 | ) { |
| 1294 | for it in &_i.attrs { |
| 1295 | _visitor.visit_attribute(it) |
| 1296 | } |
| 1297 | _visitor.visit_expr(&*_i.left); |
| 1298 | _visitor.visit_bin_op(&_i.op); |
| 1299 | _visitor.visit_expr(&*_i.right); |
| 1300 | } |
| 1301 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1302 | pub fn visit_expr_binary<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBinary) { |
| 1303 | for it in &_i.attrs { |
| 1304 | _visitor.visit_attribute(it) |
| 1305 | } |
| 1306 | _visitor.visit_expr(&*_i.left); |
| 1307 | _visitor.visit_bin_op(&_i.op); |
| 1308 | _visitor.visit_expr(&*_i.right); |
| 1309 | } |
| 1310 | #[cfg(feature = "full")] |
| 1311 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1312 | pub fn visit_expr_block<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBlock) { |
| 1313 | for it in &_i.attrs { |
| 1314 | _visitor.visit_attribute(it) |
| 1315 | } |
| 1316 | _visitor.visit_block(&_i.block); |
| 1317 | } |
| 1318 | #[cfg(feature = "full")] |
| 1319 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1320 | pub fn visit_expr_box<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBox) { |
| 1321 | for it in &_i.attrs { |
| 1322 | _visitor.visit_attribute(it) |
| 1323 | } |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1324 | tokens_helper(_visitor, &_i.box_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1325 | _visitor.visit_expr(&*_i.expr); |
| 1326 | } |
| 1327 | #[cfg(feature = "full")] |
| 1328 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1329 | pub fn visit_expr_break<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprBreak) { |
| 1330 | for it in &_i.attrs { |
| 1331 | _visitor.visit_attribute(it) |
| 1332 | } |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1333 | tokens_helper(_visitor, &_i.break_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1334 | if let Some(ref it) = _i.label { |
| 1335 | _visitor.visit_lifetime(it) |
| 1336 | }; |
| 1337 | if let Some(ref it) = _i.expr { |
| 1338 | _visitor.visit_expr(&**it) |
| 1339 | }; |
| 1340 | } |
| 1341 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1342 | pub fn visit_expr_call<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprCall) { |
| 1343 | for it in &_i.attrs { |
| 1344 | _visitor.visit_attribute(it) |
| 1345 | } |
| 1346 | _visitor.visit_expr(&*_i.func); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1347 | tokens_helper(_visitor, &_i.paren_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1348 | for el in Punctuated::pairs(&_i.args) { |
| 1349 | let it = el.value(); |
| 1350 | _visitor.visit_expr(it) |
| 1351 | } |
| 1352 | } |
| 1353 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1354 | pub fn visit_expr_cast<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprCast) { |
| 1355 | for it in &_i.attrs { |
| 1356 | _visitor.visit_attribute(it) |
| 1357 | } |
| 1358 | _visitor.visit_expr(&*_i.expr); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1359 | tokens_helper(_visitor, &_i.as_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1360 | _visitor.visit_type(&*_i.ty); |
| 1361 | } |
| 1362 | #[cfg(feature = "full")] |
| 1363 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1364 | pub fn visit_expr_catch<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprCatch) { |
| 1365 | for it in &_i.attrs { |
| 1366 | _visitor.visit_attribute(it) |
| 1367 | } |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1368 | tokens_helper(_visitor, &_i.do_token.span); |
| 1369 | tokens_helper(_visitor, &_i.catch_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1370 | _visitor.visit_block(&_i.block); |
| 1371 | } |
| 1372 | #[cfg(feature = "full")] |
| 1373 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1374 | pub fn visit_expr_closure<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprClosure) { |
| 1375 | for it in &_i.attrs { |
| 1376 | _visitor.visit_attribute(it) |
| 1377 | } |
| 1378 | if let Some(ref it) = _i.movability { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1379 | tokens_helper(_visitor, &it.span) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1380 | }; |
| 1381 | if let Some(ref it) = _i.capture { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1382 | tokens_helper(_visitor, &it.span) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1383 | }; |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1384 | tokens_helper(_visitor, &_i.or1_token.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1385 | for el in Punctuated::pairs(&_i.inputs) { |
| 1386 | let it = el.value(); |
| 1387 | _visitor.visit_fn_arg(it) |
| 1388 | } |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1389 | tokens_helper(_visitor, &_i.or2_token.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1390 | _visitor.visit_return_type(&_i.output); |
| 1391 | _visitor.visit_expr(&*_i.body); |
| 1392 | } |
| 1393 | #[cfg(feature = "full")] |
| 1394 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1395 | pub fn visit_expr_continue<'ast, V: Visit<'ast> + ?Sized>( |
| 1396 | _visitor: &mut V, |
| 1397 | _i: &'ast ExprContinue, |
| 1398 | ) { |
| 1399 | for it in &_i.attrs { |
| 1400 | _visitor.visit_attribute(it) |
| 1401 | } |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1402 | tokens_helper(_visitor, &_i.continue_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1403 | if let Some(ref it) = _i.label { |
| 1404 | _visitor.visit_lifetime(it) |
| 1405 | }; |
| 1406 | } |
| 1407 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1408 | pub fn visit_expr_field<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprField) { |
| 1409 | for it in &_i.attrs { |
| 1410 | _visitor.visit_attribute(it) |
| 1411 | } |
| 1412 | _visitor.visit_expr(&*_i.base); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1413 | tokens_helper(_visitor, &_i.dot_token.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1414 | _visitor.visit_member(&_i.member); |
| 1415 | } |
| 1416 | #[cfg(feature = "full")] |
| 1417 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1418 | pub fn visit_expr_for_loop<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprForLoop) { |
| 1419 | for it in &_i.attrs { |
| 1420 | _visitor.visit_attribute(it) |
| 1421 | } |
| 1422 | if let Some(ref it) = _i.label { |
| 1423 | _visitor.visit_label(it) |
| 1424 | }; |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1425 | tokens_helper(_visitor, &_i.for_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1426 | _visitor.visit_pat(&*_i.pat); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1427 | tokens_helper(_visitor, &_i.in_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1428 | _visitor.visit_expr(&*_i.expr); |
| 1429 | _visitor.visit_block(&_i.body); |
| 1430 | } |
| 1431 | #[cfg(feature = "full")] |
| 1432 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1433 | pub fn visit_expr_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprGroup) { |
| 1434 | for it in &_i.attrs { |
| 1435 | _visitor.visit_attribute(it) |
| 1436 | } |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1437 | tokens_helper(_visitor, &_i.group_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1438 | _visitor.visit_expr(&*_i.expr); |
| 1439 | } |
| 1440 | #[cfg(feature = "full")] |
| 1441 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1442 | pub fn visit_expr_if<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprIf) { |
| 1443 | for it in &_i.attrs { |
| 1444 | _visitor.visit_attribute(it) |
| 1445 | } |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1446 | tokens_helper(_visitor, &_i.if_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1447 | _visitor.visit_expr(&*_i.cond); |
| 1448 | _visitor.visit_block(&_i.then_branch); |
| 1449 | if let Some(ref it) = _i.else_branch { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1450 | tokens_helper(_visitor, &(it).0.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1451 | _visitor.visit_expr(&*(it).1); |
| 1452 | }; |
| 1453 | } |
| 1454 | #[cfg(feature = "full")] |
| 1455 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1456 | pub fn visit_expr_if_let<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprIfLet) { |
| 1457 | for it in &_i.attrs { |
| 1458 | _visitor.visit_attribute(it) |
| 1459 | } |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1460 | tokens_helper(_visitor, &_i.if_token.span); |
| 1461 | tokens_helper(_visitor, &_i.let_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1462 | for el in Punctuated::pairs(&_i.pats) { |
| 1463 | let it = el.value(); |
| 1464 | _visitor.visit_pat(it) |
| 1465 | } |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1466 | tokens_helper(_visitor, &_i.eq_token.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1467 | _visitor.visit_expr(&*_i.expr); |
| 1468 | _visitor.visit_block(&_i.then_branch); |
| 1469 | if let Some(ref it) = _i.else_branch { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1470 | tokens_helper(_visitor, &(it).0.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1471 | _visitor.visit_expr(&*(it).1); |
| 1472 | }; |
| 1473 | } |
| 1474 | #[cfg(feature = "full")] |
| 1475 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1476 | pub fn visit_expr_in_place<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprInPlace) { |
| 1477 | for it in &_i.attrs { |
| 1478 | _visitor.visit_attribute(it) |
| 1479 | } |
| 1480 | _visitor.visit_expr(&*_i.place); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1481 | tokens_helper(_visitor, &_i.arrow_token.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1482 | _visitor.visit_expr(&*_i.value); |
| 1483 | } |
| 1484 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1485 | pub fn visit_expr_index<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprIndex) { |
| 1486 | for it in &_i.attrs { |
| 1487 | _visitor.visit_attribute(it) |
| 1488 | } |
| 1489 | _visitor.visit_expr(&*_i.expr); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1490 | tokens_helper(_visitor, &_i.bracket_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1491 | _visitor.visit_expr(&*_i.index); |
| 1492 | } |
| 1493 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1494 | pub fn visit_expr_lit<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprLit) { |
| 1495 | for it in &_i.attrs { |
| 1496 | _visitor.visit_attribute(it) |
| 1497 | } |
| 1498 | _visitor.visit_lit(&_i.lit); |
| 1499 | } |
| 1500 | #[cfg(feature = "full")] |
| 1501 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1502 | pub fn visit_expr_loop<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprLoop) { |
| 1503 | for it in &_i.attrs { |
| 1504 | _visitor.visit_attribute(it) |
| 1505 | } |
| 1506 | if let Some(ref it) = _i.label { |
| 1507 | _visitor.visit_label(it) |
| 1508 | }; |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1509 | tokens_helper(_visitor, &_i.loop_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1510 | _visitor.visit_block(&_i.body); |
| 1511 | } |
| 1512 | #[cfg(feature = "full")] |
| 1513 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1514 | pub fn visit_expr_macro<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprMacro) { |
| 1515 | for it in &_i.attrs { |
| 1516 | _visitor.visit_attribute(it) |
| 1517 | } |
| 1518 | _visitor.visit_macro(&_i.mac); |
| 1519 | } |
| 1520 | #[cfg(feature = "full")] |
| 1521 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1522 | pub fn visit_expr_match<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprMatch) { |
| 1523 | for it in &_i.attrs { |
| 1524 | _visitor.visit_attribute(it) |
| 1525 | } |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1526 | tokens_helper(_visitor, &_i.match_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1527 | _visitor.visit_expr(&*_i.expr); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1528 | tokens_helper(_visitor, &_i.brace_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1529 | for it in &_i.arms { |
| 1530 | _visitor.visit_arm(it) |
| 1531 | } |
| 1532 | } |
| 1533 | #[cfg(feature = "full")] |
| 1534 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1535 | pub fn visit_expr_method_call<'ast, V: Visit<'ast> + ?Sized>( |
| 1536 | _visitor: &mut V, |
| 1537 | _i: &'ast ExprMethodCall, |
| 1538 | ) { |
| 1539 | for it in &_i.attrs { |
| 1540 | _visitor.visit_attribute(it) |
| 1541 | } |
| 1542 | _visitor.visit_expr(&*_i.receiver); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1543 | tokens_helper(_visitor, &_i.dot_token.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1544 | _visitor.visit_ident(&_i.method); |
| 1545 | if let Some(ref it) = _i.turbofish { |
| 1546 | _visitor.visit_method_turbofish(it) |
| 1547 | }; |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1548 | tokens_helper(_visitor, &_i.paren_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1549 | for el in Punctuated::pairs(&_i.args) { |
| 1550 | let it = el.value(); |
| 1551 | _visitor.visit_expr(it) |
| 1552 | } |
| 1553 | } |
| 1554 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1555 | pub fn visit_expr_paren<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprParen) { |
| 1556 | for it in &_i.attrs { |
| 1557 | _visitor.visit_attribute(it) |
| 1558 | } |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1559 | tokens_helper(_visitor, &_i.paren_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1560 | _visitor.visit_expr(&*_i.expr); |
| 1561 | } |
| 1562 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1563 | pub fn visit_expr_path<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprPath) { |
| 1564 | for it in &_i.attrs { |
| 1565 | _visitor.visit_attribute(it) |
| 1566 | } |
| 1567 | if let Some(ref it) = _i.qself { |
| 1568 | _visitor.visit_qself(it) |
| 1569 | }; |
| 1570 | _visitor.visit_path(&_i.path); |
| 1571 | } |
| 1572 | #[cfg(feature = "full")] |
| 1573 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1574 | pub fn visit_expr_range<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprRange) { |
| 1575 | for it in &_i.attrs { |
| 1576 | _visitor.visit_attribute(it) |
| 1577 | } |
| 1578 | if let Some(ref it) = _i.from { |
| 1579 | _visitor.visit_expr(&**it) |
| 1580 | }; |
| 1581 | _visitor.visit_range_limits(&_i.limits); |
| 1582 | if let Some(ref it) = _i.to { |
| 1583 | _visitor.visit_expr(&**it) |
| 1584 | }; |
| 1585 | } |
| 1586 | #[cfg(feature = "full")] |
| 1587 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1588 | pub fn visit_expr_reference<'ast, V: Visit<'ast> + ?Sized>( |
| 1589 | _visitor: &mut V, |
| 1590 | _i: &'ast ExprReference, |
| 1591 | ) { |
| 1592 | for it in &_i.attrs { |
| 1593 | _visitor.visit_attribute(it) |
| 1594 | } |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1595 | tokens_helper(_visitor, &_i.and_token.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1596 | if let Some(ref it) = _i.mutability { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1597 | tokens_helper(_visitor, &it.span) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1598 | }; |
| 1599 | _visitor.visit_expr(&*_i.expr); |
| 1600 | } |
| 1601 | #[cfg(feature = "full")] |
| 1602 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1603 | pub fn visit_expr_repeat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprRepeat) { |
| 1604 | for it in &_i.attrs { |
| 1605 | _visitor.visit_attribute(it) |
| 1606 | } |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1607 | tokens_helper(_visitor, &_i.bracket_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1608 | _visitor.visit_expr(&*_i.expr); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1609 | tokens_helper(_visitor, &_i.semi_token.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1610 | _visitor.visit_expr(&*_i.len); |
| 1611 | } |
| 1612 | #[cfg(feature = "full")] |
| 1613 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1614 | pub fn visit_expr_return<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprReturn) { |
| 1615 | for it in &_i.attrs { |
| 1616 | _visitor.visit_attribute(it) |
| 1617 | } |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1618 | tokens_helper(_visitor, &_i.return_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1619 | if let Some(ref it) = _i.expr { |
| 1620 | _visitor.visit_expr(&**it) |
| 1621 | }; |
| 1622 | } |
| 1623 | #[cfg(feature = "full")] |
| 1624 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1625 | pub fn visit_expr_struct<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprStruct) { |
| 1626 | for it in &_i.attrs { |
| 1627 | _visitor.visit_attribute(it) |
| 1628 | } |
| 1629 | _visitor.visit_path(&_i.path); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1630 | tokens_helper(_visitor, &_i.brace_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1631 | for el in Punctuated::pairs(&_i.fields) { |
| 1632 | let it = el.value(); |
| 1633 | _visitor.visit_field_value(it) |
| 1634 | } |
| 1635 | if let Some(ref it) = _i.dot2_token { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1636 | tokens_helper(_visitor, &it.spans) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1637 | }; |
| 1638 | if let Some(ref it) = _i.rest { |
| 1639 | _visitor.visit_expr(&**it) |
| 1640 | }; |
| 1641 | } |
| 1642 | #[cfg(feature = "full")] |
| 1643 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1644 | pub fn visit_expr_try<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprTry) { |
| 1645 | for it in &_i.attrs { |
| 1646 | _visitor.visit_attribute(it) |
| 1647 | } |
| 1648 | _visitor.visit_expr(&*_i.expr); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1649 | tokens_helper(_visitor, &_i.question_token.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1650 | } |
| 1651 | #[cfg(feature = "full")] |
| 1652 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1653 | pub fn visit_expr_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprTuple) { |
| 1654 | for it in &_i.attrs { |
| 1655 | _visitor.visit_attribute(it) |
| 1656 | } |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1657 | tokens_helper(_visitor, &_i.paren_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1658 | for el in Punctuated::pairs(&_i.elems) { |
| 1659 | let it = el.value(); |
| 1660 | _visitor.visit_expr(it) |
| 1661 | } |
| 1662 | } |
| 1663 | #[cfg(feature = "full")] |
| 1664 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1665 | pub fn visit_expr_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprType) { |
| 1666 | for it in &_i.attrs { |
| 1667 | _visitor.visit_attribute(it) |
| 1668 | } |
| 1669 | _visitor.visit_expr(&*_i.expr); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1670 | tokens_helper(_visitor, &_i.colon_token.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1671 | _visitor.visit_type(&*_i.ty); |
| 1672 | } |
| 1673 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1674 | pub fn visit_expr_unary<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprUnary) { |
| 1675 | for it in &_i.attrs { |
| 1676 | _visitor.visit_attribute(it) |
| 1677 | } |
| 1678 | _visitor.visit_un_op(&_i.op); |
| 1679 | _visitor.visit_expr(&*_i.expr); |
| 1680 | } |
| 1681 | #[cfg(feature = "full")] |
| 1682 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1683 | pub fn visit_expr_unsafe<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprUnsafe) { |
| 1684 | for it in &_i.attrs { |
| 1685 | _visitor.visit_attribute(it) |
| 1686 | } |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1687 | tokens_helper(_visitor, &_i.unsafe_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1688 | _visitor.visit_block(&_i.block); |
| 1689 | } |
| 1690 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1691 | pub fn visit_expr_verbatim<'ast, V: Visit<'ast> + ?Sized>( |
| 1692 | _visitor: &mut V, |
| 1693 | _i: &'ast ExprVerbatim, |
| 1694 | ) { |
David Tolnay | 6af4899 | 2018-08-01 11:16:28 -0700 | [diff] [blame] | 1695 | skip!(_i.tts); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1696 | } |
| 1697 | #[cfg(feature = "full")] |
| 1698 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1699 | pub fn visit_expr_while<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprWhile) { |
| 1700 | for it in &_i.attrs { |
| 1701 | _visitor.visit_attribute(it) |
| 1702 | } |
| 1703 | if let Some(ref it) = _i.label { |
| 1704 | _visitor.visit_label(it) |
| 1705 | }; |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1706 | tokens_helper(_visitor, &_i.while_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1707 | _visitor.visit_expr(&*_i.cond); |
| 1708 | _visitor.visit_block(&_i.body); |
| 1709 | } |
| 1710 | #[cfg(feature = "full")] |
| 1711 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1712 | pub fn visit_expr_while_let<'ast, V: Visit<'ast> + ?Sized>( |
| 1713 | _visitor: &mut V, |
| 1714 | _i: &'ast ExprWhileLet, |
| 1715 | ) { |
| 1716 | for it in &_i.attrs { |
| 1717 | _visitor.visit_attribute(it) |
| 1718 | } |
| 1719 | if let Some(ref it) = _i.label { |
| 1720 | _visitor.visit_label(it) |
| 1721 | }; |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1722 | tokens_helper(_visitor, &_i.while_token.span); |
| 1723 | tokens_helper(_visitor, &_i.let_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1724 | for el in Punctuated::pairs(&_i.pats) { |
| 1725 | let it = el.value(); |
| 1726 | _visitor.visit_pat(it) |
| 1727 | } |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1728 | tokens_helper(_visitor, &_i.eq_token.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1729 | _visitor.visit_expr(&*_i.expr); |
| 1730 | _visitor.visit_block(&_i.body); |
| 1731 | } |
| 1732 | #[cfg(feature = "full")] |
| 1733 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1734 | pub fn visit_expr_yield<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ExprYield) { |
| 1735 | for it in &_i.attrs { |
| 1736 | _visitor.visit_attribute(it) |
| 1737 | } |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1738 | tokens_helper(_visitor, &_i.yield_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1739 | if let Some(ref it) = _i.expr { |
| 1740 | _visitor.visit_expr(&**it) |
| 1741 | }; |
| 1742 | } |
| 1743 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1744 | pub fn visit_field<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Field) { |
| 1745 | for it in &_i.attrs { |
| 1746 | _visitor.visit_attribute(it) |
| 1747 | } |
| 1748 | _visitor.visit_visibility(&_i.vis); |
| 1749 | if let Some(ref it) = _i.ident { |
| 1750 | _visitor.visit_ident(it) |
| 1751 | }; |
| 1752 | if let Some(ref it) = _i.colon_token { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1753 | tokens_helper(_visitor, &it.spans) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1754 | }; |
| 1755 | _visitor.visit_type(&_i.ty); |
| 1756 | } |
| 1757 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1758 | #[cfg(feature = "full")] |
| 1759 | pub fn visit_field_pat<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldPat) { |
| 1760 | for it in &_i.attrs { |
| 1761 | _visitor.visit_attribute(it) |
| 1762 | } |
| 1763 | _visitor.visit_member(&_i.member); |
| 1764 | if let Some(ref it) = _i.colon_token { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1765 | tokens_helper(_visitor, &it.spans) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1766 | }; |
| 1767 | _visitor.visit_pat(&*_i.pat); |
| 1768 | } |
| 1769 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1770 | #[cfg(feature = "full")] |
| 1771 | pub fn visit_field_value<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldValue) { |
| 1772 | for it in &_i.attrs { |
| 1773 | _visitor.visit_attribute(it) |
| 1774 | } |
| 1775 | _visitor.visit_member(&_i.member); |
| 1776 | if let Some(ref it) = _i.colon_token { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1777 | tokens_helper(_visitor, &it.spans) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1778 | }; |
| 1779 | _visitor.visit_expr(&_i.expr); |
| 1780 | } |
| 1781 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1782 | pub fn visit_fields<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Fields) { |
| 1783 | match *_i { |
| 1784 | Fields::Named(ref _binding_0) => { |
| 1785 | _visitor.visit_fields_named(_binding_0); |
| 1786 | } |
| 1787 | Fields::Unnamed(ref _binding_0) => { |
| 1788 | _visitor.visit_fields_unnamed(_binding_0); |
| 1789 | } |
| 1790 | Fields::Unit => {} |
| 1791 | } |
| 1792 | } |
| 1793 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 1794 | pub fn visit_fields_named<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FieldsNamed) { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1795 | tokens_helper(_visitor, &_i.brace_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1796 | for el in Punctuated::pairs(&_i.named) { |
| 1797 | let it = el.value(); |
| 1798 | _visitor.visit_field(it) |
| 1799 | } |
David Tolnay | e3d41b7 | 2017-12-31 15:24:00 -0500 | [diff] [blame] | 1800 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1801 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1802 | pub fn visit_fields_unnamed<'ast, V: Visit<'ast> + ?Sized>( |
| 1803 | _visitor: &mut V, |
| 1804 | _i: &'ast FieldsUnnamed, |
| 1805 | ) { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1806 | tokens_helper(_visitor, &_i.paren_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1807 | for el in Punctuated::pairs(&_i.unnamed) { |
| 1808 | let it = el.value(); |
| 1809 | _visitor.visit_field(it) |
| 1810 | } |
David Tolnay | e3d41b7 | 2017-12-31 15:24:00 -0500 | [diff] [blame] | 1811 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1812 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 1813 | 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] | 1814 | skip!(_i.shebang); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1815 | for it in &_i.attrs { |
| 1816 | _visitor.visit_attribute(it) |
| 1817 | } |
| 1818 | for it in &_i.items { |
| 1819 | _visitor.visit_item(it) |
| 1820 | } |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1821 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1822 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 1823 | 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] | 1824 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1825 | FnArg::SelfRef(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1826 | _visitor.visit_arg_self_ref(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1827 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1828 | FnArg::SelfValue(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1829 | _visitor.visit_arg_self(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1830 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1831 | FnArg::Captured(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1832 | _visitor.visit_arg_captured(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1833 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1834 | FnArg::Inferred(ref _binding_0) => { |
David Tolnay | 80ed55f | 2017-12-27 22:54:40 -0500 | [diff] [blame] | 1835 | _visitor.visit_pat(_binding_0); |
| 1836 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1837 | FnArg::Ignored(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1838 | _visitor.visit_type(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1839 | } |
| 1840 | } |
| 1841 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1842 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 1843 | pub fn visit_fn_decl<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FnDecl) { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1844 | tokens_helper(_visitor, &_i.fn_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1845 | _visitor.visit_generics(&_i.generics); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1846 | tokens_helper(_visitor, &_i.paren_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1847 | for el in Punctuated::pairs(&_i.inputs) { |
| 1848 | let it = el.value(); |
| 1849 | _visitor.visit_fn_arg(it) |
| 1850 | } |
| 1851 | if let Some(ref it) = _i.variadic { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1852 | tokens_helper(_visitor, &it.spans) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1853 | }; |
| 1854 | _visitor.visit_return_type(&_i.output); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1855 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1856 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 1857 | 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] | 1858 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1859 | ForeignItem::Fn(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1860 | _visitor.visit_foreign_item_fn(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1861 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1862 | ForeignItem::Static(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1863 | _visitor.visit_foreign_item_static(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1864 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1865 | ForeignItem::Type(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1866 | _visitor.visit_foreign_item_type(_binding_0); |
David Tolnay | 199bcbb | 2017-11-12 10:33:52 -0800 | [diff] [blame] | 1867 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1868 | ForeignItem::Verbatim(ref _binding_0) => { |
David Tolnay | 2ae520a | 2017-12-29 11:19:50 -0500 | [diff] [blame] | 1869 | _visitor.visit_foreign_item_verbatim(_binding_0); |
| 1870 | } |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1871 | } |
| 1872 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1873 | #[cfg(feature = "full")] |
| 1874 | pub fn visit_foreign_item_fn<'ast, V: Visit<'ast> + ?Sized>( |
| 1875 | _visitor: &mut V, |
| 1876 | _i: &'ast ForeignItemFn, |
| 1877 | ) { |
| 1878 | for it in &_i.attrs { |
| 1879 | _visitor.visit_attribute(it) |
| 1880 | } |
| 1881 | _visitor.visit_visibility(&_i.vis); |
| 1882 | _visitor.visit_ident(&_i.ident); |
| 1883 | _visitor.visit_fn_decl(&*_i.decl); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1884 | tokens_helper(_visitor, &_i.semi_token.spans); |
David Tolnay | 8894f60 | 2017-11-11 12:11:04 -0800 | [diff] [blame] | 1885 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1886 | #[cfg(feature = "full")] |
| 1887 | pub fn visit_foreign_item_static<'ast, V: Visit<'ast> + ?Sized>( |
| 1888 | _visitor: &mut V, |
| 1889 | _i: &'ast ForeignItemStatic, |
| 1890 | ) { |
| 1891 | for it in &_i.attrs { |
| 1892 | _visitor.visit_attribute(it) |
| 1893 | } |
| 1894 | _visitor.visit_visibility(&_i.vis); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1895 | tokens_helper(_visitor, &_i.static_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1896 | if let Some(ref it) = _i.mutability { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1897 | tokens_helper(_visitor, &it.span) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1898 | }; |
| 1899 | _visitor.visit_ident(&_i.ident); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1900 | tokens_helper(_visitor, &_i.colon_token.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1901 | _visitor.visit_type(&*_i.ty); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1902 | tokens_helper(_visitor, &_i.semi_token.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1903 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1904 | #[cfg(feature = "full")] |
| 1905 | pub fn visit_foreign_item_type<'ast, V: Visit<'ast> + ?Sized>( |
| 1906 | _visitor: &mut V, |
| 1907 | _i: &'ast ForeignItemType, |
| 1908 | ) { |
| 1909 | for it in &_i.attrs { |
| 1910 | _visitor.visit_attribute(it) |
| 1911 | } |
| 1912 | _visitor.visit_visibility(&_i.vis); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1913 | tokens_helper(_visitor, &_i.type_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1914 | _visitor.visit_ident(&_i.ident); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1915 | tokens_helper(_visitor, &_i.semi_token.spans); |
David Tolnay | 199bcbb | 2017-11-12 10:33:52 -0800 | [diff] [blame] | 1916 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1917 | #[cfg(feature = "full")] |
| 1918 | pub fn visit_foreign_item_verbatim<'ast, V: Visit<'ast> + ?Sized>( |
| 1919 | _visitor: &mut V, |
| 1920 | _i: &'ast ForeignItemVerbatim, |
| 1921 | ) { |
David Tolnay | 6af4899 | 2018-08-01 11:16:28 -0700 | [diff] [blame] | 1922 | skip!(_i.tts); |
David Tolnay | 2ae520a | 2017-12-29 11:19:50 -0500 | [diff] [blame] | 1923 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1924 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1925 | pub fn visit_generic_argument<'ast, V: Visit<'ast> + ?Sized>( |
| 1926 | _visitor: &mut V, |
| 1927 | _i: &'ast GenericArgument, |
| 1928 | ) { |
Nika Layzell | 357885a | 2017-12-04 15:47:07 -0500 | [diff] [blame] | 1929 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1930 | GenericArgument::Lifetime(ref _binding_0) => { |
David Tolnay | 4ba63a0 | 2017-12-28 15:53:05 -0500 | [diff] [blame] | 1931 | _visitor.visit_lifetime(_binding_0); |
Nika Layzell | 357885a | 2017-12-04 15:47:07 -0500 | [diff] [blame] | 1932 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1933 | GenericArgument::Type(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1934 | _visitor.visit_type(_binding_0); |
Nika Layzell | 357885a | 2017-12-04 15:47:07 -0500 | [diff] [blame] | 1935 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1936 | GenericArgument::Binding(ref _binding_0) => { |
David Tolnay | 506e43a | 2017-12-29 11:34:36 -0500 | [diff] [blame] | 1937 | _visitor.visit_binding(_binding_0); |
Nika Layzell | 357885a | 2017-12-04 15:47:07 -0500 | [diff] [blame] | 1938 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1939 | GenericArgument::Const(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1940 | _visitor.visit_expr(_binding_0); |
Nika Layzell | c680e61 | 2017-12-04 19:07:20 -0500 | [diff] [blame] | 1941 | } |
Nika Layzell | 357885a | 2017-12-04 15:47:07 -0500 | [diff] [blame] | 1942 | } |
| 1943 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1944 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1945 | #[cfg(feature = "full")] |
| 1946 | pub fn visit_generic_method_argument<'ast, V: Visit<'ast> + ?Sized>( |
| 1947 | _visitor: &mut V, |
| 1948 | _i: &'ast GenericMethodArgument, |
| 1949 | ) { |
David Tolnay | d60cfec | 2017-12-29 00:21:38 -0500 | [diff] [blame] | 1950 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1951 | GenericMethodArgument::Type(ref _binding_0) => { |
David Tolnay | d60cfec | 2017-12-29 00:21:38 -0500 | [diff] [blame] | 1952 | _visitor.visit_type(_binding_0); |
| 1953 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1954 | GenericMethodArgument::Const(ref _binding_0) => { |
David Tolnay | d60cfec | 2017-12-29 00:21:38 -0500 | [diff] [blame] | 1955 | _visitor.visit_expr(_binding_0); |
| 1956 | } |
| 1957 | } |
| 1958 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1959 | #[cfg(any(feature = "full", feature = "derive"))] |
| 1960 | pub fn visit_generic_param<'ast, V: Visit<'ast> + ?Sized>( |
| 1961 | _visitor: &mut V, |
| 1962 | _i: &'ast GenericParam, |
| 1963 | ) { |
David Tolnay | c2f1aba | 2017-11-12 20:29:22 -0800 | [diff] [blame] | 1964 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1965 | GenericParam::Type(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1966 | _visitor.visit_type_param(_binding_0); |
David Tolnay | c2f1aba | 2017-11-12 20:29:22 -0800 | [diff] [blame] | 1967 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1968 | GenericParam::Lifetime(ref _binding_0) => { |
David Tolnay | 517f369 | 2018-01-01 20:17:23 -0800 | [diff] [blame] | 1969 | _visitor.visit_lifetime_def(_binding_0); |
| 1970 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1971 | GenericParam::Const(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1972 | _visitor.visit_const_param(_binding_0); |
Nika Layzell | f1fdc0b | 2017-12-04 19:58:32 -0500 | [diff] [blame] | 1973 | } |
David Tolnay | c2f1aba | 2017-11-12 20:29:22 -0800 | [diff] [blame] | 1974 | } |
| 1975 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1976 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 1977 | 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] | 1978 | if let Some(ref it) = _i.lt_token { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1979 | tokens_helper(_visitor, &it.spans) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1980 | }; |
| 1981 | for el in Punctuated::pairs(&_i.params) { |
| 1982 | let it = el.value(); |
| 1983 | _visitor.visit_generic_param(it) |
| 1984 | } |
| 1985 | if let Some(ref it) = _i.gt_token { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 1986 | tokens_helper(_visitor, &it.spans) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1987 | }; |
| 1988 | if let Some(ref it) = _i.where_clause { |
| 1989 | _visitor.visit_where_clause(it) |
| 1990 | }; |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1991 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1992 | pub fn visit_ident<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Ident) {} |
| 1993 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 1994 | 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] | 1995 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1996 | ImplItem::Const(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 1997 | _visitor.visit_impl_item_const(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 1998 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 1999 | ImplItem::Method(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2000 | _visitor.visit_impl_item_method(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2001 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2002 | ImplItem::Type(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2003 | _visitor.visit_impl_item_type(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2004 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2005 | ImplItem::Macro(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2006 | _visitor.visit_impl_item_macro(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2007 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2008 | ImplItem::Verbatim(ref _binding_0) => { |
David Tolnay | 2ae520a | 2017-12-29 11:19:50 -0500 | [diff] [blame] | 2009 | _visitor.visit_impl_item_verbatim(_binding_0); |
| 2010 | } |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2011 | } |
| 2012 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2013 | #[cfg(feature = "full")] |
| 2014 | pub fn visit_impl_item_const<'ast, V: Visit<'ast> + ?Sized>( |
| 2015 | _visitor: &mut V, |
| 2016 | _i: &'ast ImplItemConst, |
| 2017 | ) { |
| 2018 | for it in &_i.attrs { |
| 2019 | _visitor.visit_attribute(it) |
| 2020 | } |
| 2021 | _visitor.visit_visibility(&_i.vis); |
| 2022 | if let Some(ref it) = _i.defaultness { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2023 | tokens_helper(_visitor, &it.span) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2024 | }; |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2025 | tokens_helper(_visitor, &_i.const_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2026 | _visitor.visit_ident(&_i.ident); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2027 | tokens_helper(_visitor, &_i.colon_token.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2028 | _visitor.visit_type(&_i.ty); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2029 | tokens_helper(_visitor, &_i.eq_token.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2030 | _visitor.visit_expr(&_i.expr); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2031 | tokens_helper(_visitor, &_i.semi_token.spans); |
David Tolnay | 857628c | 2017-11-11 12:25:31 -0800 | [diff] [blame] | 2032 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2033 | #[cfg(feature = "full")] |
| 2034 | pub fn visit_impl_item_macro<'ast, V: Visit<'ast> + ?Sized>( |
| 2035 | _visitor: &mut V, |
| 2036 | _i: &'ast ImplItemMacro, |
| 2037 | ) { |
| 2038 | for it in &_i.attrs { |
| 2039 | _visitor.visit_attribute(it) |
| 2040 | } |
| 2041 | _visitor.visit_macro(&_i.mac); |
| 2042 | if let Some(ref it) = _i.semi_token { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2043 | tokens_helper(_visitor, &it.spans) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2044 | }; |
David Tolnay | 857628c | 2017-11-11 12:25:31 -0800 | [diff] [blame] | 2045 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2046 | #[cfg(feature = "full")] |
| 2047 | pub fn visit_impl_item_method<'ast, V: Visit<'ast> + ?Sized>( |
| 2048 | _visitor: &mut V, |
| 2049 | _i: &'ast ImplItemMethod, |
| 2050 | ) { |
| 2051 | for it in &_i.attrs { |
| 2052 | _visitor.visit_attribute(it) |
| 2053 | } |
| 2054 | _visitor.visit_visibility(&_i.vis); |
| 2055 | if let Some(ref it) = _i.defaultness { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2056 | tokens_helper(_visitor, &it.span) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2057 | }; |
| 2058 | _visitor.visit_method_sig(&_i.sig); |
| 2059 | _visitor.visit_block(&_i.block); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2060 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2061 | #[cfg(feature = "full")] |
| 2062 | pub fn visit_impl_item_type<'ast, V: Visit<'ast> + ?Sized>( |
| 2063 | _visitor: &mut V, |
| 2064 | _i: &'ast ImplItemType, |
| 2065 | ) { |
| 2066 | for it in &_i.attrs { |
| 2067 | _visitor.visit_attribute(it) |
| 2068 | } |
| 2069 | _visitor.visit_visibility(&_i.vis); |
| 2070 | if let Some(ref it) = _i.defaultness { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2071 | tokens_helper(_visitor, &it.span) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2072 | }; |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2073 | tokens_helper(_visitor, &_i.type_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2074 | _visitor.visit_ident(&_i.ident); |
| 2075 | _visitor.visit_generics(&_i.generics); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2076 | tokens_helper(_visitor, &_i.eq_token.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2077 | _visitor.visit_type(&_i.ty); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2078 | tokens_helper(_visitor, &_i.semi_token.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2079 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2080 | #[cfg(feature = "full")] |
| 2081 | pub fn visit_impl_item_verbatim<'ast, V: Visit<'ast> + ?Sized>( |
| 2082 | _visitor: &mut V, |
| 2083 | _i: &'ast ImplItemVerbatim, |
| 2084 | ) { |
David Tolnay | 6af4899 | 2018-08-01 11:16:28 -0700 | [diff] [blame] | 2085 | skip!(_i.tts); |
David Tolnay | 2ae520a | 2017-12-29 11:19:50 -0500 | [diff] [blame] | 2086 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2087 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2088 | 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] | 2089 | skip!(_i.index); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2090 | _visitor.visit_span(&_i.span); |
David Tolnay | 85b69a4 | 2017-12-27 20:43:10 -0500 | [diff] [blame] | 2091 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2092 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2093 | 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] | 2094 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2095 | Item::ExternCrate(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2096 | _visitor.visit_item_extern_crate(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2097 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2098 | Item::Use(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2099 | _visitor.visit_item_use(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2100 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2101 | Item::Static(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2102 | _visitor.visit_item_static(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2103 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2104 | Item::Const(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2105 | _visitor.visit_item_const(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2106 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2107 | Item::Fn(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2108 | _visitor.visit_item_fn(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2109 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2110 | Item::Mod(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2111 | _visitor.visit_item_mod(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2112 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2113 | Item::ForeignMod(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2114 | _visitor.visit_item_foreign_mod(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2115 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2116 | Item::Type(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2117 | _visitor.visit_item_type(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2118 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2119 | Item::Struct(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2120 | _visitor.visit_item_struct(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2121 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2122 | Item::Enum(ref _binding_0) => { |
David Tolnay | e3d41b7 | 2017-12-31 15:24:00 -0500 | [diff] [blame] | 2123 | _visitor.visit_item_enum(_binding_0); |
| 2124 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2125 | Item::Union(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2126 | _visitor.visit_item_union(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2127 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2128 | Item::Trait(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2129 | _visitor.visit_item_trait(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2130 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2131 | Item::Impl(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2132 | _visitor.visit_item_impl(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2133 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2134 | Item::Macro(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2135 | _visitor.visit_item_macro(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2136 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2137 | Item::Macro2(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2138 | _visitor.visit_item_macro2(_binding_0); |
David Tolnay | 500d832 | 2017-12-18 00:32:51 -0800 | [diff] [blame] | 2139 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2140 | Item::Verbatim(ref _binding_0) => { |
David Tolnay | 2ae520a | 2017-12-29 11:19:50 -0500 | [diff] [blame] | 2141 | _visitor.visit_item_verbatim(_binding_0); |
| 2142 | } |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2143 | } |
| 2144 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2145 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2146 | 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] | 2147 | for it in &_i.attrs { |
| 2148 | _visitor.visit_attribute(it) |
| 2149 | } |
| 2150 | _visitor.visit_visibility(&_i.vis); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2151 | tokens_helper(_visitor, &_i.const_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2152 | _visitor.visit_ident(&_i.ident); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2153 | tokens_helper(_visitor, &_i.colon_token.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2154 | _visitor.visit_type(&*_i.ty); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2155 | tokens_helper(_visitor, &_i.eq_token.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2156 | _visitor.visit_expr(&*_i.expr); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2157 | tokens_helper(_visitor, &_i.semi_token.spans); |
David Tolnay | c6b55bc | 2017-11-09 22:48:38 -0800 | [diff] [blame] | 2158 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2159 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2160 | 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] | 2161 | for it in &_i.attrs { |
| 2162 | _visitor.visit_attribute(it) |
| 2163 | } |
| 2164 | _visitor.visit_visibility(&_i.vis); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2165 | tokens_helper(_visitor, &_i.enum_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2166 | _visitor.visit_ident(&_i.ident); |
| 2167 | _visitor.visit_generics(&_i.generics); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2168 | tokens_helper(_visitor, &_i.brace_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2169 | for el in Punctuated::pairs(&_i.variants) { |
| 2170 | let it = el.value(); |
| 2171 | _visitor.visit_variant(it) |
| 2172 | } |
David Tolnay | c6b55bc | 2017-11-09 22:48:38 -0800 | [diff] [blame] | 2173 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2174 | #[cfg(feature = "full")] |
| 2175 | pub fn visit_item_extern_crate<'ast, V: Visit<'ast> + ?Sized>( |
| 2176 | _visitor: &mut V, |
| 2177 | _i: &'ast ItemExternCrate, |
| 2178 | ) { |
| 2179 | for it in &_i.attrs { |
| 2180 | _visitor.visit_attribute(it) |
| 2181 | } |
| 2182 | _visitor.visit_visibility(&_i.vis); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2183 | tokens_helper(_visitor, &_i.extern_token.span); |
| 2184 | tokens_helper(_visitor, &_i.crate_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2185 | _visitor.visit_ident(&_i.ident); |
| 2186 | if let Some(ref it) = _i.rename { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2187 | tokens_helper(_visitor, &(it).0.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2188 | _visitor.visit_ident(&(it).1); |
| 2189 | }; |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2190 | tokens_helper(_visitor, &_i.semi_token.spans); |
David Tolnay | c6b55bc | 2017-11-09 22:48:38 -0800 | [diff] [blame] | 2191 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2192 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2193 | 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] | 2194 | for it in &_i.attrs { |
| 2195 | _visitor.visit_attribute(it) |
| 2196 | } |
| 2197 | _visitor.visit_visibility(&_i.vis); |
| 2198 | if let Some(ref it) = _i.constness { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2199 | tokens_helper(_visitor, &it.span) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2200 | }; |
| 2201 | if let Some(ref it) = _i.unsafety { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2202 | tokens_helper(_visitor, &it.span) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2203 | }; |
| 2204 | if let Some(ref it) = _i.abi { |
| 2205 | _visitor.visit_abi(it) |
| 2206 | }; |
| 2207 | _visitor.visit_ident(&_i.ident); |
| 2208 | _visitor.visit_fn_decl(&*_i.decl); |
| 2209 | _visitor.visit_block(&*_i.block); |
David Tolnay | c6b55bc | 2017-11-09 22:48:38 -0800 | [diff] [blame] | 2210 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2211 | #[cfg(feature = "full")] |
| 2212 | pub fn visit_item_foreign_mod<'ast, V: Visit<'ast> + ?Sized>( |
| 2213 | _visitor: &mut V, |
| 2214 | _i: &'ast ItemForeignMod, |
| 2215 | ) { |
| 2216 | for it in &_i.attrs { |
| 2217 | _visitor.visit_attribute(it) |
| 2218 | } |
| 2219 | _visitor.visit_abi(&_i.abi); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2220 | tokens_helper(_visitor, &_i.brace_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2221 | for it in &_i.items { |
| 2222 | _visitor.visit_foreign_item(it) |
| 2223 | } |
David Tolnay | c6b55bc | 2017-11-09 22:48:38 -0800 | [diff] [blame] | 2224 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2225 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2226 | 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] | 2227 | for it in &_i.attrs { |
| 2228 | _visitor.visit_attribute(it) |
| 2229 | } |
| 2230 | if let Some(ref it) = _i.defaultness { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2231 | tokens_helper(_visitor, &it.span) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2232 | }; |
| 2233 | if let Some(ref it) = _i.unsafety { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2234 | tokens_helper(_visitor, &it.span) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2235 | }; |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2236 | tokens_helper(_visitor, &_i.impl_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2237 | _visitor.visit_generics(&_i.generics); |
| 2238 | if let Some(ref it) = _i.trait_ { |
| 2239 | if let Some(ref it) = (it).0 { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2240 | tokens_helper(_visitor, &it.spans) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2241 | }; |
| 2242 | _visitor.visit_path(&(it).1); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2243 | tokens_helper(_visitor, &(it).2.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2244 | }; |
| 2245 | _visitor.visit_type(&*_i.self_ty); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2246 | tokens_helper(_visitor, &_i.brace_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2247 | for it in &_i.items { |
| 2248 | _visitor.visit_impl_item(it) |
| 2249 | } |
David Tolnay | c6b55bc | 2017-11-09 22:48:38 -0800 | [diff] [blame] | 2250 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2251 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2252 | 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] | 2253 | for it in &_i.attrs { |
| 2254 | _visitor.visit_attribute(it) |
| 2255 | } |
| 2256 | if let Some(ref it) = _i.ident { |
| 2257 | _visitor.visit_ident(it) |
| 2258 | }; |
| 2259 | _visitor.visit_macro(&_i.mac); |
| 2260 | if let Some(ref it) = _i.semi_token { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2261 | tokens_helper(_visitor, &it.spans) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2262 | }; |
David Tolnay | c6b55bc | 2017-11-09 22:48:38 -0800 | [diff] [blame] | 2263 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2264 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2265 | 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] | 2266 | for it in &_i.attrs { |
| 2267 | _visitor.visit_attribute(it) |
| 2268 | } |
| 2269 | _visitor.visit_visibility(&_i.vis); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2270 | tokens_helper(_visitor, &_i.macro_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2271 | _visitor.visit_ident(&_i.ident); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2272 | tokens_helper(_visitor, &_i.paren_token.span); |
David Tolnay | 6af4899 | 2018-08-01 11:16:28 -0700 | [diff] [blame] | 2273 | skip!(_i.args); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2274 | tokens_helper(_visitor, &_i.brace_token.span); |
David Tolnay | 6af4899 | 2018-08-01 11:16:28 -0700 | [diff] [blame] | 2275 | skip!(_i.body); |
David Tolnay | 500d832 | 2017-12-18 00:32:51 -0800 | [diff] [blame] | 2276 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2277 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2278 | 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] | 2279 | for it in &_i.attrs { |
| 2280 | _visitor.visit_attribute(it) |
| 2281 | } |
| 2282 | _visitor.visit_visibility(&_i.vis); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2283 | tokens_helper(_visitor, &_i.mod_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2284 | _visitor.visit_ident(&_i.ident); |
| 2285 | if let Some(ref it) = _i.content { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2286 | tokens_helper(_visitor, &(it).0.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2287 | for it in &(it).1 { |
| 2288 | _visitor.visit_item(it) |
| 2289 | } |
| 2290 | }; |
| 2291 | if let Some(ref it) = _i.semi { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2292 | tokens_helper(_visitor, &it.spans) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2293 | }; |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2294 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2295 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2296 | 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] | 2297 | for it in &_i.attrs { |
| 2298 | _visitor.visit_attribute(it) |
| 2299 | } |
| 2300 | _visitor.visit_visibility(&_i.vis); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2301 | tokens_helper(_visitor, &_i.static_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2302 | if let Some(ref it) = _i.mutability { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2303 | tokens_helper(_visitor, &it.span) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2304 | }; |
| 2305 | _visitor.visit_ident(&_i.ident); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2306 | tokens_helper(_visitor, &_i.colon_token.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2307 | _visitor.visit_type(&*_i.ty); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2308 | tokens_helper(_visitor, &_i.eq_token.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2309 | _visitor.visit_expr(&*_i.expr); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2310 | tokens_helper(_visitor, &_i.semi_token.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2311 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2312 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2313 | 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] | 2314 | for it in &_i.attrs { |
| 2315 | _visitor.visit_attribute(it) |
| 2316 | } |
| 2317 | _visitor.visit_visibility(&_i.vis); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2318 | tokens_helper(_visitor, &_i.struct_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2319 | _visitor.visit_ident(&_i.ident); |
| 2320 | _visitor.visit_generics(&_i.generics); |
| 2321 | _visitor.visit_fields(&_i.fields); |
| 2322 | if let Some(ref it) = _i.semi_token { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2323 | tokens_helper(_visitor, &it.spans) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2324 | }; |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2325 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2326 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2327 | 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] | 2328 | for it in &_i.attrs { |
| 2329 | _visitor.visit_attribute(it) |
| 2330 | } |
| 2331 | _visitor.visit_visibility(&_i.vis); |
| 2332 | if let Some(ref it) = _i.unsafety { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2333 | tokens_helper(_visitor, &it.span) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2334 | }; |
| 2335 | if let Some(ref it) = _i.auto_token { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2336 | tokens_helper(_visitor, &it.span) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2337 | }; |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2338 | tokens_helper(_visitor, &_i.trait_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2339 | _visitor.visit_ident(&_i.ident); |
| 2340 | _visitor.visit_generics(&_i.generics); |
| 2341 | if let Some(ref it) = _i.colon_token { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2342 | tokens_helper(_visitor, &it.spans) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2343 | }; |
| 2344 | for el in Punctuated::pairs(&_i.supertraits) { |
| 2345 | let it = el.value(); |
| 2346 | _visitor.visit_type_param_bound(it) |
| 2347 | } |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2348 | tokens_helper(_visitor, &_i.brace_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2349 | for it in &_i.items { |
| 2350 | _visitor.visit_trait_item(it) |
| 2351 | } |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2352 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2353 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2354 | 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] | 2355 | for it in &_i.attrs { |
| 2356 | _visitor.visit_attribute(it) |
| 2357 | } |
| 2358 | _visitor.visit_visibility(&_i.vis); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2359 | tokens_helper(_visitor, &_i.type_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2360 | _visitor.visit_ident(&_i.ident); |
| 2361 | _visitor.visit_generics(&_i.generics); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2362 | tokens_helper(_visitor, &_i.eq_token.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2363 | _visitor.visit_type(&*_i.ty); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2364 | tokens_helper(_visitor, &_i.semi_token.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2365 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2366 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2367 | 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] | 2368 | for it in &_i.attrs { |
| 2369 | _visitor.visit_attribute(it) |
| 2370 | } |
| 2371 | _visitor.visit_visibility(&_i.vis); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2372 | tokens_helper(_visitor, &_i.union_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2373 | _visitor.visit_ident(&_i.ident); |
| 2374 | _visitor.visit_generics(&_i.generics); |
| 2375 | _visitor.visit_fields_named(&_i.fields); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2376 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2377 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2378 | 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] | 2379 | for it in &_i.attrs { |
| 2380 | _visitor.visit_attribute(it) |
| 2381 | } |
| 2382 | _visitor.visit_visibility(&_i.vis); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2383 | tokens_helper(_visitor, &_i.use_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2384 | if let Some(ref it) = _i.leading_colon { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2385 | tokens_helper(_visitor, &it.spans) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2386 | }; |
| 2387 | _visitor.visit_use_tree(&_i.tree); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2388 | tokens_helper(_visitor, &_i.semi_token.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2389 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2390 | #[cfg(feature = "full")] |
| 2391 | pub fn visit_item_verbatim<'ast, V: Visit<'ast> + ?Sized>( |
| 2392 | _visitor: &mut V, |
| 2393 | _i: &'ast ItemVerbatim, |
| 2394 | ) { |
David Tolnay | 6af4899 | 2018-08-01 11:16:28 -0700 | [diff] [blame] | 2395 | skip!(_i.tts); |
David Tolnay | 2ae520a | 2017-12-29 11:19:50 -0500 | [diff] [blame] | 2396 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2397 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2398 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2399 | 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] | 2400 | _visitor.visit_lifetime(&_i.name); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2401 | tokens_helper(_visitor, &_i.colon_token.spans); |
David Tolnay | bcd498f | 2017-12-29 12:02:33 -0500 | [diff] [blame] | 2402 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2403 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2404 | 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] | 2405 | skip!(_i.apostrophe); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2406 | _visitor.visit_ident(&_i.ident); |
David Tolnay | 4ba63a0 | 2017-12-28 15:53:05 -0500 | [diff] [blame] | 2407 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2408 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2409 | 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] | 2410 | for it in &_i.attrs { |
| 2411 | _visitor.visit_attribute(it) |
| 2412 | } |
| 2413 | _visitor.visit_lifetime(&_i.lifetime); |
| 2414 | if let Some(ref it) = _i.colon_token { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2415 | tokens_helper(_visitor, &it.spans) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2416 | }; |
| 2417 | for el in Punctuated::pairs(&_i.bounds) { |
| 2418 | let it = el.value(); |
| 2419 | _visitor.visit_lifetime(it) |
| 2420 | } |
David Tolnay | 4ba63a0 | 2017-12-28 15:53:05 -0500 | [diff] [blame] | 2421 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2422 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2423 | 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] | 2424 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2425 | Lit::Str(ref _binding_0) => { |
David Tolnay | 360efd2 | 2018-01-04 23:35:26 -0800 | [diff] [blame] | 2426 | _visitor.visit_lit_str(_binding_0); |
| 2427 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2428 | Lit::ByteStr(ref _binding_0) => { |
David Tolnay | 360efd2 | 2018-01-04 23:35:26 -0800 | [diff] [blame] | 2429 | _visitor.visit_lit_byte_str(_binding_0); |
| 2430 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2431 | Lit::Byte(ref _binding_0) => { |
David Tolnay | 360efd2 | 2018-01-04 23:35:26 -0800 | [diff] [blame] | 2432 | _visitor.visit_lit_byte(_binding_0); |
| 2433 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2434 | Lit::Char(ref _binding_0) => { |
David Tolnay | 360efd2 | 2018-01-04 23:35:26 -0800 | [diff] [blame] | 2435 | _visitor.visit_lit_char(_binding_0); |
| 2436 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2437 | Lit::Int(ref _binding_0) => { |
David Tolnay | 360efd2 | 2018-01-04 23:35:26 -0800 | [diff] [blame] | 2438 | _visitor.visit_lit_int(_binding_0); |
| 2439 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2440 | Lit::Float(ref _binding_0) => { |
David Tolnay | 360efd2 | 2018-01-04 23:35:26 -0800 | [diff] [blame] | 2441 | _visitor.visit_lit_float(_binding_0); |
| 2442 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2443 | Lit::Bool(ref _binding_0) => { |
David Tolnay | 360efd2 | 2018-01-04 23:35:26 -0800 | [diff] [blame] | 2444 | _visitor.visit_lit_bool(_binding_0); |
| 2445 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2446 | Lit::Verbatim(ref _binding_0) => { |
David Tolnay | 360efd2 | 2018-01-04 23:35:26 -0800 | [diff] [blame] | 2447 | _visitor.visit_lit_verbatim(_binding_0); |
| 2448 | } |
| 2449 | } |
| 2450 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2451 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2452 | 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] | 2453 | skip!(_i.value); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2454 | _visitor.visit_span(&_i.span); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2455 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2456 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2457 | 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] | 2458 | skip!(_i.token); |
David Tolnay | 360efd2 | 2018-01-04 23:35:26 -0800 | [diff] [blame] | 2459 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2460 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2461 | 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] | 2462 | skip!(_i.token); |
David Tolnay | 360efd2 | 2018-01-04 23:35:26 -0800 | [diff] [blame] | 2463 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2464 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2465 | 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] | 2466 | skip!(_i.token); |
David Tolnay | 360efd2 | 2018-01-04 23:35:26 -0800 | [diff] [blame] | 2467 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2468 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2469 | 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] | 2470 | skip!(_i.token); |
David Tolnay | 360efd2 | 2018-01-04 23:35:26 -0800 | [diff] [blame] | 2471 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2472 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2473 | 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] | 2474 | skip!(_i.token); |
David Tolnay | 360efd2 | 2018-01-04 23:35:26 -0800 | [diff] [blame] | 2475 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2476 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2477 | 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] | 2478 | skip!(_i.token); |
David Tolnay | 360efd2 | 2018-01-04 23:35:26 -0800 | [diff] [blame] | 2479 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2480 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2481 | 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] | 2482 | skip!(_i.token); |
David Tolnay | 360efd2 | 2018-01-04 23:35:26 -0800 | [diff] [blame] | 2483 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2484 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2485 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2486 | 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] | 2487 | for it in &_i.attrs { |
| 2488 | _visitor.visit_attribute(it) |
| 2489 | } |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2490 | tokens_helper(_visitor, &_i.let_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2491 | for el in Punctuated::pairs(&_i.pats) { |
| 2492 | let it = el.value(); |
| 2493 | _visitor.visit_pat(it) |
| 2494 | } |
| 2495 | if let Some(ref it) = _i.ty { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2496 | tokens_helper(_visitor, &(it).0.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2497 | _visitor.visit_type(&*(it).1); |
| 2498 | }; |
| 2499 | if let Some(ref it) = _i.init { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2500 | tokens_helper(_visitor, &(it).0.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2501 | _visitor.visit_expr(&*(it).1); |
| 2502 | }; |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2503 | tokens_helper(_visitor, &_i.semi_token.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2504 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2505 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2506 | 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] | 2507 | _visitor.visit_path(&_i.path); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2508 | tokens_helper(_visitor, &_i.bang_token.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2509 | _visitor.visit_macro_delimiter(&_i.delimiter); |
David Tolnay | 6af4899 | 2018-08-01 11:16:28 -0700 | [diff] [blame] | 2510 | skip!(_i.tts); |
David Tolnay | ab91951 | 2017-12-30 23:31:51 -0500 | [diff] [blame] | 2511 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2512 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2513 | pub fn visit_macro_delimiter<'ast, V: Visit<'ast> + ?Sized>( |
| 2514 | _visitor: &mut V, |
| 2515 | _i: &'ast MacroDelimiter, |
| 2516 | ) { |
David Tolnay | ab91951 | 2017-12-30 23:31:51 -0500 | [diff] [blame] | 2517 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2518 | MacroDelimiter::Paren(ref _binding_0) => { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2519 | tokens_helper(_visitor, &_binding_0.span); |
David Tolnay | ab91951 | 2017-12-30 23:31:51 -0500 | [diff] [blame] | 2520 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2521 | MacroDelimiter::Brace(ref _binding_0) => { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2522 | tokens_helper(_visitor, &_binding_0.span); |
David Tolnay | ab91951 | 2017-12-30 23:31:51 -0500 | [diff] [blame] | 2523 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2524 | MacroDelimiter::Bracket(ref _binding_0) => { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2525 | tokens_helper(_visitor, &_binding_0.span); |
David Tolnay | ab91951 | 2017-12-30 23:31:51 -0500 | [diff] [blame] | 2526 | } |
| 2527 | } |
David Tolnay | decf28d | 2017-11-11 11:56:45 -0800 | [diff] [blame] | 2528 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2529 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2530 | 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] | 2531 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2532 | Member::Named(ref _binding_0) => { |
Alex Crichton | d261d09 | 2018-05-18 13:47:35 -0700 | [diff] [blame] | 2533 | _visitor.visit_ident(_binding_0); |
David Tolnay | 85b69a4 | 2017-12-27 20:43:10 -0500 | [diff] [blame] | 2534 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2535 | Member::Unnamed(ref _binding_0) => { |
David Tolnay | 85b69a4 | 2017-12-27 20:43:10 -0500 | [diff] [blame] | 2536 | _visitor.visit_index(_binding_0); |
| 2537 | } |
| 2538 | } |
| 2539 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2540 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | aaadd78 | 2018-01-06 22:58:13 -0800 | [diff] [blame] | 2541 | 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] | 2542 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2543 | Meta::Word(ref _binding_0) => { |
Alex Crichton | d261d09 | 2018-05-18 13:47:35 -0700 | [diff] [blame] | 2544 | _visitor.visit_ident(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2545 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2546 | Meta::List(ref _binding_0) => { |
David Tolnay | aaadd78 | 2018-01-06 22:58:13 -0800 | [diff] [blame] | 2547 | _visitor.visit_meta_list(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2548 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2549 | Meta::NameValue(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2550 | _visitor.visit_meta_name_value(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2551 | } |
| 2552 | } |
| 2553 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2554 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | aaadd78 | 2018-01-06 22:58:13 -0800 | [diff] [blame] | 2555 | 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] | 2556 | _visitor.visit_ident(&_i.ident); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2557 | tokens_helper(_visitor, &_i.paren_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2558 | for el in Punctuated::pairs(&_i.nested) { |
| 2559 | let it = el.value(); |
| 2560 | _visitor.visit_nested_meta(it) |
| 2561 | } |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2562 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2563 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2564 | pub fn visit_meta_name_value<'ast, V: Visit<'ast> + ?Sized>( |
| 2565 | _visitor: &mut V, |
| 2566 | _i: &'ast MetaNameValue, |
| 2567 | ) { |
| 2568 | _visitor.visit_ident(&_i.ident); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2569 | tokens_helper(_visitor, &_i.eq_token.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2570 | _visitor.visit_lit(&_i.lit); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2571 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2572 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2573 | 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] | 2574 | if let Some(ref it) = _i.constness { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2575 | tokens_helper(_visitor, &it.span) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2576 | }; |
| 2577 | if let Some(ref it) = _i.unsafety { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2578 | tokens_helper(_visitor, &it.span) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2579 | }; |
| 2580 | if let Some(ref it) = _i.abi { |
| 2581 | _visitor.visit_abi(it) |
| 2582 | }; |
| 2583 | _visitor.visit_ident(&_i.ident); |
| 2584 | _visitor.visit_fn_decl(&_i.decl); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2585 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2586 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2587 | #[cfg(feature = "full")] |
| 2588 | pub fn visit_method_turbofish<'ast, V: Visit<'ast> + ?Sized>( |
| 2589 | _visitor: &mut V, |
| 2590 | _i: &'ast MethodTurbofish, |
| 2591 | ) { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2592 | tokens_helper(_visitor, &_i.colon2_token.spans); |
| 2593 | tokens_helper(_visitor, &_i.lt_token.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2594 | for el in Punctuated::pairs(&_i.args) { |
| 2595 | let it = el.value(); |
| 2596 | _visitor.visit_generic_method_argument(it) |
| 2597 | } |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2598 | tokens_helper(_visitor, &_i.gt_token.spans); |
David Tolnay | d60cfec | 2017-12-29 00:21:38 -0500 | [diff] [blame] | 2599 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2600 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | aaadd78 | 2018-01-06 22:58:13 -0800 | [diff] [blame] | 2601 | 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] | 2602 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2603 | NestedMeta::Meta(ref _binding_0) => { |
David Tolnay | aaadd78 | 2018-01-06 22:58:13 -0800 | [diff] [blame] | 2604 | _visitor.visit_meta(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2605 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2606 | NestedMeta::Literal(ref _binding_0) => { |
David Tolnay | 4ba63a0 | 2017-12-28 15:53:05 -0500 | [diff] [blame] | 2607 | _visitor.visit_lit(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2608 | } |
| 2609 | } |
| 2610 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2611 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2612 | pub fn visit_parenthesized_generic_arguments<'ast, V: Visit<'ast> + ?Sized>( |
| 2613 | _visitor: &mut V, |
| 2614 | _i: &'ast ParenthesizedGenericArguments, |
| 2615 | ) { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2616 | tokens_helper(_visitor, &_i.paren_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2617 | for el in Punctuated::pairs(&_i.inputs) { |
| 2618 | let it = el.value(); |
| 2619 | _visitor.visit_type(it) |
| 2620 | } |
| 2621 | _visitor.visit_return_type(&_i.output); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2622 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2623 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2624 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2625 | 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] | 2626 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2627 | Pat::Wild(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2628 | _visitor.visit_pat_wild(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2629 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2630 | Pat::Ident(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2631 | _visitor.visit_pat_ident(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2632 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2633 | Pat::Struct(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2634 | _visitor.visit_pat_struct(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2635 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2636 | Pat::TupleStruct(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2637 | _visitor.visit_pat_tuple_struct(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2638 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2639 | Pat::Path(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2640 | _visitor.visit_pat_path(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2641 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2642 | Pat::Tuple(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2643 | _visitor.visit_pat_tuple(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2644 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2645 | Pat::Box(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2646 | _visitor.visit_pat_box(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2647 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2648 | Pat::Ref(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2649 | _visitor.visit_pat_ref(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2650 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2651 | Pat::Lit(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2652 | _visitor.visit_pat_lit(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2653 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2654 | Pat::Range(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2655 | _visitor.visit_pat_range(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2656 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2657 | Pat::Slice(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2658 | _visitor.visit_pat_slice(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2659 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2660 | Pat::Macro(ref _binding_0) => { |
David Tolnay | 323279a | 2017-12-29 11:26:32 -0500 | [diff] [blame] | 2661 | _visitor.visit_pat_macro(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2662 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2663 | Pat::Verbatim(ref _binding_0) => { |
David Tolnay | 2ae520a | 2017-12-29 11:19:50 -0500 | [diff] [blame] | 2664 | _visitor.visit_pat_verbatim(_binding_0); |
| 2665 | } |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2666 | } |
| 2667 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2668 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2669 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2670 | pub fn visit_pat_box<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatBox) { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2671 | tokens_helper(_visitor, &_i.box_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2672 | _visitor.visit_pat(&*_i.pat); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2673 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2674 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2675 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2676 | 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] | 2677 | if let Some(ref it) = _i.by_ref { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2678 | tokens_helper(_visitor, &it.span) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2679 | }; |
| 2680 | if let Some(ref it) = _i.mutability { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2681 | tokens_helper(_visitor, &it.span) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2682 | }; |
| 2683 | _visitor.visit_ident(&_i.ident); |
| 2684 | if let Some(ref it) = _i.subpat { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2685 | tokens_helper(_visitor, &(it).0.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2686 | _visitor.visit_pat(&*(it).1); |
| 2687 | }; |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2688 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2689 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2690 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2691 | 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] | 2692 | _visitor.visit_expr(&*_i.expr); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2693 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2694 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2695 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2696 | 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] | 2697 | _visitor.visit_macro(&_i.mac); |
David Tolnay | 323279a | 2017-12-29 11:26:32 -0500 | [diff] [blame] | 2698 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2699 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2700 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2701 | 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] | 2702 | if let Some(ref it) = _i.qself { |
| 2703 | _visitor.visit_qself(it) |
| 2704 | }; |
| 2705 | _visitor.visit_path(&_i.path); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2706 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2707 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2708 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2709 | 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] | 2710 | _visitor.visit_expr(&*_i.lo); |
| 2711 | _visitor.visit_range_limits(&_i.limits); |
| 2712 | _visitor.visit_expr(&*_i.hi); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2713 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2714 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2715 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2716 | pub fn visit_pat_ref<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatRef) { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2717 | tokens_helper(_visitor, &_i.and_token.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2718 | if let Some(ref it) = _i.mutability { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2719 | tokens_helper(_visitor, &it.span) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2720 | }; |
| 2721 | _visitor.visit_pat(&*_i.pat); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2722 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2723 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2724 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2725 | pub fn visit_pat_slice<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatSlice) { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2726 | tokens_helper(_visitor, &_i.bracket_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2727 | for el in Punctuated::pairs(&_i.front) { |
| 2728 | let it = el.value(); |
| 2729 | _visitor.visit_pat(it) |
| 2730 | } |
| 2731 | if let Some(ref it) = _i.middle { |
| 2732 | _visitor.visit_pat(&**it) |
| 2733 | }; |
| 2734 | if let Some(ref it) = _i.dot2_token { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2735 | tokens_helper(_visitor, &it.spans) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2736 | }; |
| 2737 | if let Some(ref it) = _i.comma_token { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2738 | tokens_helper(_visitor, &it.spans) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2739 | }; |
| 2740 | for el in Punctuated::pairs(&_i.back) { |
| 2741 | let it = el.value(); |
| 2742 | _visitor.visit_pat(it) |
| 2743 | } |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2744 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2745 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2746 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2747 | 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] | 2748 | _visitor.visit_path(&_i.path); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2749 | tokens_helper(_visitor, &_i.brace_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2750 | for el in Punctuated::pairs(&_i.fields) { |
| 2751 | let it = el.value(); |
| 2752 | _visitor.visit_field_pat(it) |
| 2753 | } |
| 2754 | if let Some(ref it) = _i.dot2_token { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2755 | tokens_helper(_visitor, &it.spans) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2756 | }; |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2757 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2758 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2759 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2760 | pub fn visit_pat_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatTuple) { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2761 | tokens_helper(_visitor, &_i.paren_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2762 | for el in Punctuated::pairs(&_i.front) { |
| 2763 | let it = el.value(); |
| 2764 | _visitor.visit_pat(it) |
| 2765 | } |
| 2766 | if let Some(ref it) = _i.dot2_token { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2767 | tokens_helper(_visitor, &it.spans) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2768 | }; |
| 2769 | if let Some(ref it) = _i.comma_token { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2770 | tokens_helper(_visitor, &it.spans) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2771 | }; |
| 2772 | for el in Punctuated::pairs(&_i.back) { |
| 2773 | let it = el.value(); |
| 2774 | _visitor.visit_pat(it) |
| 2775 | } |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2776 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2777 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2778 | #[cfg(feature = "full")] |
| 2779 | pub fn visit_pat_tuple_struct<'ast, V: Visit<'ast> + ?Sized>( |
| 2780 | _visitor: &mut V, |
| 2781 | _i: &'ast PatTupleStruct, |
| 2782 | ) { |
| 2783 | _visitor.visit_path(&_i.path); |
| 2784 | _visitor.visit_pat_tuple(&_i.pat); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2785 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2786 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2787 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2788 | 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] | 2789 | skip!(_i.tts); |
David Tolnay | 2ae520a | 2017-12-29 11:19:50 -0500 | [diff] [blame] | 2790 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2791 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2792 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2793 | pub fn visit_pat_wild<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast PatWild) { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2794 | tokens_helper(_visitor, &_i.underscore_token.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2795 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2796 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2797 | 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] | 2798 | if let Some(ref it) = _i.leading_colon { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2799 | tokens_helper(_visitor, &it.spans) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2800 | }; |
| 2801 | for el in Punctuated::pairs(&_i.segments) { |
| 2802 | let it = el.value(); |
| 2803 | _visitor.visit_path_segment(it) |
| 2804 | } |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2805 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2806 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2807 | pub fn visit_path_arguments<'ast, V: Visit<'ast> + ?Sized>( |
| 2808 | _visitor: &mut V, |
| 2809 | _i: &'ast PathArguments, |
| 2810 | ) { |
Nika Layzell | c08227a | 2017-12-04 16:30:17 -0500 | [diff] [blame] | 2811 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2812 | PathArguments::None => {} |
| 2813 | PathArguments::AngleBracketed(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2814 | _visitor.visit_angle_bracketed_generic_arguments(_binding_0); |
Nika Layzell | c08227a | 2017-12-04 16:30:17 -0500 | [diff] [blame] | 2815 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2816 | PathArguments::Parenthesized(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2817 | _visitor.visit_parenthesized_generic_arguments(_binding_0); |
Nika Layzell | c08227a | 2017-12-04 16:30:17 -0500 | [diff] [blame] | 2818 | } |
| 2819 | } |
| 2820 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2821 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2822 | 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] | 2823 | _visitor.visit_ident(&_i.ident); |
| 2824 | _visitor.visit_path_arguments(&_i.arguments); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2825 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2826 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2827 | 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] | 2828 | _visitor.visit_type(&_i.lhs_ty); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2829 | tokens_helper(_visitor, &_i.eq_token.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2830 | _visitor.visit_type(&_i.rhs_ty); |
David Tolnay | d4add85 | 2018-01-01 20:13:24 -0800 | [diff] [blame] | 2831 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2832 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2833 | pub fn visit_predicate_lifetime<'ast, V: Visit<'ast> + ?Sized>( |
| 2834 | _visitor: &mut V, |
| 2835 | _i: &'ast PredicateLifetime, |
| 2836 | ) { |
| 2837 | _visitor.visit_lifetime(&_i.lifetime); |
| 2838 | if let Some(ref it) = _i.colon_token { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2839 | tokens_helper(_visitor, &it.spans) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2840 | }; |
| 2841 | for el in Punctuated::pairs(&_i.bounds) { |
| 2842 | let it = el.value(); |
| 2843 | _visitor.visit_lifetime(it) |
| 2844 | } |
David Tolnay | d4add85 | 2018-01-01 20:13:24 -0800 | [diff] [blame] | 2845 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2846 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2847 | pub fn visit_predicate_type<'ast, V: Visit<'ast> + ?Sized>( |
| 2848 | _visitor: &mut V, |
| 2849 | _i: &'ast PredicateType, |
| 2850 | ) { |
| 2851 | if let Some(ref it) = _i.lifetimes { |
| 2852 | _visitor.visit_bound_lifetimes(it) |
| 2853 | }; |
| 2854 | _visitor.visit_type(&_i.bounded_ty); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2855 | tokens_helper(_visitor, &_i.colon_token.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2856 | for el in Punctuated::pairs(&_i.bounds) { |
| 2857 | let it = el.value(); |
| 2858 | _visitor.visit_type_param_bound(it) |
| 2859 | } |
David Tolnay | d4add85 | 2018-01-01 20:13:24 -0800 | [diff] [blame] | 2860 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2861 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2862 | pub fn visit_qself<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast QSelf) { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2863 | tokens_helper(_visitor, &_i.lt_token.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2864 | _visitor.visit_type(&*_i.ty); |
David Tolnay | 6af4899 | 2018-08-01 11:16:28 -0700 | [diff] [blame] | 2865 | skip!(_i.position); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2866 | if let Some(ref it) = _i.as_token { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2867 | tokens_helper(_visitor, &it.span) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2868 | }; |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2869 | tokens_helper(_visitor, &_i.gt_token.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2870 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2871 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2872 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2873 | 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] | 2874 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2875 | RangeLimits::HalfOpen(ref _binding_0) => { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2876 | tokens_helper(_visitor, &_binding_0.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2877 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2878 | RangeLimits::Closed(ref _binding_0) => { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2879 | tokens_helper(_visitor, &_binding_0.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2880 | } |
| 2881 | } |
| 2882 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2883 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2884 | 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] | 2885 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2886 | ReturnType::Default => {} |
| 2887 | ReturnType::Type(ref _binding_0, ref _binding_1) => { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2888 | tokens_helper(_visitor, &_binding_0.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2889 | _visitor.visit_type(&**_binding_1); |
David Tolnay | f93b90d | 2017-11-11 19:21:26 -0800 | [diff] [blame] | 2890 | } |
| 2891 | } |
| 2892 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2893 | pub fn visit_span<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Span) {} |
| 2894 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2895 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2896 | 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] | 2897 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2898 | Stmt::Local(ref _binding_0) => { |
David Tolnay | 1f0b7b8 | 2018-01-06 16:07:14 -0800 | [diff] [blame] | 2899 | _visitor.visit_local(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2900 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2901 | Stmt::Item(ref _binding_0) => { |
David Tolnay | 1f0b7b8 | 2018-01-06 16:07:14 -0800 | [diff] [blame] | 2902 | _visitor.visit_item(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2903 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2904 | Stmt::Expr(ref _binding_0) => { |
David Tolnay | 1f0b7b8 | 2018-01-06 16:07:14 -0800 | [diff] [blame] | 2905 | _visitor.visit_expr(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2906 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2907 | Stmt::Semi(ref _binding_0, ref _binding_1) => { |
David Tolnay | 1f0b7b8 | 2018-01-06 16:07:14 -0800 | [diff] [blame] | 2908 | _visitor.visit_expr(_binding_0); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2909 | tokens_helper(_visitor, &_binding_1.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2910 | } |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2911 | } |
| 2912 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2913 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2914 | 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] | 2915 | if let Some(ref it) = _i.paren_token { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2916 | tokens_helper(_visitor, &it.span) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2917 | }; |
| 2918 | _visitor.visit_trait_bound_modifier(&_i.modifier); |
| 2919 | if let Some(ref it) = _i.lifetimes { |
| 2920 | _visitor.visit_bound_lifetimes(it) |
| 2921 | }; |
| 2922 | _visitor.visit_path(&_i.path); |
David Tolnay | 40fb8ce | 2018-01-02 10:53:46 -0800 | [diff] [blame] | 2923 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2924 | #[cfg(any(feature = "full", feature = "derive"))] |
| 2925 | pub fn visit_trait_bound_modifier<'ast, V: Visit<'ast> + ?Sized>( |
| 2926 | _visitor: &mut V, |
| 2927 | _i: &'ast TraitBoundModifier, |
| 2928 | ) { |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2929 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2930 | TraitBoundModifier::None => {} |
| 2931 | TraitBoundModifier::Maybe(ref _binding_0) => { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2932 | tokens_helper(_visitor, &_binding_0.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2933 | } |
| 2934 | } |
| 2935 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2936 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 2937 | 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] | 2938 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2939 | TraitItem::Const(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2940 | _visitor.visit_trait_item_const(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2941 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2942 | TraitItem::Method(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2943 | _visitor.visit_trait_item_method(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2944 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2945 | TraitItem::Type(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2946 | _visitor.visit_trait_item_type(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2947 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2948 | TraitItem::Macro(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 2949 | _visitor.visit_trait_item_macro(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2950 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2951 | TraitItem::Verbatim(ref _binding_0) => { |
David Tolnay | 2ae520a | 2017-12-29 11:19:50 -0500 | [diff] [blame] | 2952 | _visitor.visit_trait_item_verbatim(_binding_0); |
| 2953 | } |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 2954 | } |
| 2955 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2956 | #[cfg(feature = "full")] |
| 2957 | pub fn visit_trait_item_const<'ast, V: Visit<'ast> + ?Sized>( |
| 2958 | _visitor: &mut V, |
| 2959 | _i: &'ast TraitItemConst, |
| 2960 | ) { |
| 2961 | for it in &_i.attrs { |
| 2962 | _visitor.visit_attribute(it) |
| 2963 | } |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2964 | tokens_helper(_visitor, &_i.const_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2965 | _visitor.visit_ident(&_i.ident); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2966 | tokens_helper(_visitor, &_i.colon_token.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2967 | _visitor.visit_type(&_i.ty); |
| 2968 | if let Some(ref it) = _i.default { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2969 | tokens_helper(_visitor, &(it).0.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2970 | _visitor.visit_expr(&(it).1); |
| 2971 | }; |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2972 | tokens_helper(_visitor, &_i.semi_token.spans); |
David Tolnay | da705bd | 2017-11-10 21:58:05 -0800 | [diff] [blame] | 2973 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2974 | #[cfg(feature = "full")] |
| 2975 | pub fn visit_trait_item_macro<'ast, V: Visit<'ast> + ?Sized>( |
| 2976 | _visitor: &mut V, |
| 2977 | _i: &'ast TraitItemMacro, |
| 2978 | ) { |
| 2979 | for it in &_i.attrs { |
| 2980 | _visitor.visit_attribute(it) |
| 2981 | } |
| 2982 | _visitor.visit_macro(&_i.mac); |
| 2983 | if let Some(ref it) = _i.semi_token { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 2984 | tokens_helper(_visitor, &it.spans) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2985 | }; |
David Tolnay | da705bd | 2017-11-10 21:58:05 -0800 | [diff] [blame] | 2986 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 2987 | #[cfg(feature = "full")] |
| 2988 | pub fn visit_trait_item_method<'ast, V: Visit<'ast> + ?Sized>( |
| 2989 | _visitor: &mut V, |
| 2990 | _i: &'ast TraitItemMethod, |
| 2991 | ) { |
| 2992 | for it in &_i.attrs { |
| 2993 | _visitor.visit_attribute(it) |
| 2994 | } |
| 2995 | _visitor.visit_method_sig(&_i.sig); |
| 2996 | if let Some(ref it) = _i.default { |
| 2997 | _visitor.visit_block(it) |
| 2998 | }; |
| 2999 | if let Some(ref it) = _i.semi_token { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 3000 | tokens_helper(_visitor, &it.spans) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3001 | }; |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3002 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3003 | #[cfg(feature = "full")] |
| 3004 | pub fn visit_trait_item_type<'ast, V: Visit<'ast> + ?Sized>( |
| 3005 | _visitor: &mut V, |
| 3006 | _i: &'ast TraitItemType, |
| 3007 | ) { |
| 3008 | for it in &_i.attrs { |
| 3009 | _visitor.visit_attribute(it) |
| 3010 | } |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 3011 | tokens_helper(_visitor, &_i.type_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3012 | _visitor.visit_ident(&_i.ident); |
| 3013 | _visitor.visit_generics(&_i.generics); |
| 3014 | if let Some(ref it) = _i.colon_token { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 3015 | tokens_helper(_visitor, &it.spans) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3016 | }; |
| 3017 | for el in Punctuated::pairs(&_i.bounds) { |
| 3018 | let it = el.value(); |
| 3019 | _visitor.visit_type_param_bound(it) |
| 3020 | } |
| 3021 | if let Some(ref it) = _i.default { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 3022 | tokens_helper(_visitor, &(it).0.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3023 | _visitor.visit_type(&(it).1); |
| 3024 | }; |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 3025 | tokens_helper(_visitor, &_i.semi_token.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3026 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3027 | #[cfg(feature = "full")] |
| 3028 | pub fn visit_trait_item_verbatim<'ast, V: Visit<'ast> + ?Sized>( |
| 3029 | _visitor: &mut V, |
| 3030 | _i: &'ast TraitItemVerbatim, |
| 3031 | ) { |
David Tolnay | 6af4899 | 2018-08-01 11:16:28 -0700 | [diff] [blame] | 3032 | skip!(_i.tts); |
David Tolnay | 2ae520a | 2017-12-29 11:19:50 -0500 | [diff] [blame] | 3033 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3034 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 3035 | 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] | 3036 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3037 | Type::Slice(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 3038 | _visitor.visit_type_slice(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3039 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3040 | Type::Array(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 3041 | _visitor.visit_type_array(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3042 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3043 | Type::Ptr(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 3044 | _visitor.visit_type_ptr(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3045 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3046 | Type::Reference(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 3047 | _visitor.visit_type_reference(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3048 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3049 | Type::BareFn(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 3050 | _visitor.visit_type_bare_fn(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3051 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3052 | Type::Never(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 3053 | _visitor.visit_type_never(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3054 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3055 | Type::Tuple(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 3056 | _visitor.visit_type_tuple(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3057 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3058 | Type::Path(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 3059 | _visitor.visit_type_path(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3060 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3061 | Type::TraitObject(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 3062 | _visitor.visit_type_trait_object(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3063 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3064 | Type::ImplTrait(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 3065 | _visitor.visit_type_impl_trait(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3066 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3067 | Type::Paren(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 3068 | _visitor.visit_type_paren(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3069 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3070 | Type::Group(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 3071 | _visitor.visit_type_group(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3072 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3073 | Type::Infer(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 3074 | _visitor.visit_type_infer(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3075 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3076 | Type::Macro(ref _binding_0) => { |
David Tolnay | 323279a | 2017-12-29 11:26:32 -0500 | [diff] [blame] | 3077 | _visitor.visit_type_macro(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3078 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3079 | Type::Verbatim(ref _binding_0) => { |
David Tolnay | 2ae520a | 2017-12-29 11:19:50 -0500 | [diff] [blame] | 3080 | _visitor.visit_type_verbatim(_binding_0); |
| 3081 | } |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3082 | } |
| 3083 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3084 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 3085 | pub fn visit_type_array<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeArray) { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 3086 | tokens_helper(_visitor, &_i.bracket_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3087 | _visitor.visit_type(&*_i.elem); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 3088 | tokens_helper(_visitor, &_i.semi_token.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3089 | _visitor.visit_expr(&_i.len); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3090 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3091 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 3092 | 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] | 3093 | if let Some(ref it) = _i.unsafety { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 3094 | tokens_helper(_visitor, &it.span) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3095 | }; |
| 3096 | if let Some(ref it) = _i.abi { |
| 3097 | _visitor.visit_abi(it) |
| 3098 | }; |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 3099 | tokens_helper(_visitor, &_i.fn_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3100 | if let Some(ref it) = _i.lifetimes { |
| 3101 | _visitor.visit_bound_lifetimes(it) |
| 3102 | }; |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 3103 | tokens_helper(_visitor, &_i.paren_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3104 | for el in Punctuated::pairs(&_i.inputs) { |
| 3105 | let it = el.value(); |
| 3106 | _visitor.visit_bare_fn_arg(it) |
| 3107 | } |
| 3108 | if let Some(ref it) = _i.variadic { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 3109 | tokens_helper(_visitor, &it.spans) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3110 | }; |
| 3111 | _visitor.visit_return_type(&_i.output); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3112 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3113 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 3114 | pub fn visit_type_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeGroup) { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 3115 | tokens_helper(_visitor, &_i.group_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3116 | _visitor.visit_type(&*_i.elem); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3117 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3118 | #[cfg(any(feature = "full", feature = "derive"))] |
| 3119 | pub fn visit_type_impl_trait<'ast, V: Visit<'ast> + ?Sized>( |
| 3120 | _visitor: &mut V, |
| 3121 | _i: &'ast TypeImplTrait, |
| 3122 | ) { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 3123 | tokens_helper(_visitor, &_i.impl_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3124 | for el in Punctuated::pairs(&_i.bounds) { |
| 3125 | let it = el.value(); |
| 3126 | _visitor.visit_type_param_bound(it) |
| 3127 | } |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3128 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3129 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 3130 | pub fn visit_type_infer<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeInfer) { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 3131 | tokens_helper(_visitor, &_i.underscore_token.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3132 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3133 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 3134 | 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] | 3135 | _visitor.visit_macro(&_i.mac); |
David Tolnay | 323279a | 2017-12-29 11:26:32 -0500 | [diff] [blame] | 3136 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3137 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 3138 | pub fn visit_type_never<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeNever) { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 3139 | tokens_helper(_visitor, &_i.bang_token.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3140 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3141 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 3142 | 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] | 3143 | for it in &_i.attrs { |
| 3144 | _visitor.visit_attribute(it) |
| 3145 | } |
| 3146 | _visitor.visit_ident(&_i.ident); |
| 3147 | if let Some(ref it) = _i.colon_token { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 3148 | tokens_helper(_visitor, &it.spans) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3149 | }; |
| 3150 | for el in Punctuated::pairs(&_i.bounds) { |
| 3151 | let it = el.value(); |
| 3152 | _visitor.visit_type_param_bound(it) |
| 3153 | } |
| 3154 | if let Some(ref it) = _i.eq_token { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 3155 | tokens_helper(_visitor, &it.spans) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3156 | }; |
| 3157 | if let Some(ref it) = _i.default { |
| 3158 | _visitor.visit_type(it) |
| 3159 | }; |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3160 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3161 | #[cfg(any(feature = "full", feature = "derive"))] |
| 3162 | pub fn visit_type_param_bound<'ast, V: Visit<'ast> + ?Sized>( |
| 3163 | _visitor: &mut V, |
| 3164 | _i: &'ast TypeParamBound, |
| 3165 | ) { |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3166 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3167 | TypeParamBound::Trait(ref _binding_0) => { |
David Tolnay | 40fb8ce | 2018-01-02 10:53:46 -0800 | [diff] [blame] | 3168 | _visitor.visit_trait_bound(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3169 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3170 | TypeParamBound::Lifetime(ref _binding_0) => { |
David Tolnay | 4ba63a0 | 2017-12-28 15:53:05 -0500 | [diff] [blame] | 3171 | _visitor.visit_lifetime(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3172 | } |
| 3173 | } |
| 3174 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3175 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 3176 | pub fn visit_type_paren<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeParen) { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 3177 | tokens_helper(_visitor, &_i.paren_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3178 | _visitor.visit_type(&*_i.elem); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3179 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3180 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 3181 | 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] | 3182 | if let Some(ref it) = _i.qself { |
| 3183 | _visitor.visit_qself(it) |
| 3184 | }; |
| 3185 | _visitor.visit_path(&_i.path); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3186 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3187 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 3188 | pub fn visit_type_ptr<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypePtr) { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 3189 | tokens_helper(_visitor, &_i.star_token.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3190 | if let Some(ref it) = _i.const_token { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 3191 | tokens_helper(_visitor, &it.span) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3192 | }; |
| 3193 | if let Some(ref it) = _i.mutability { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 3194 | tokens_helper(_visitor, &it.span) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3195 | }; |
| 3196 | _visitor.visit_type(&*_i.elem); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3197 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3198 | #[cfg(any(feature = "full", feature = "derive"))] |
| 3199 | pub fn visit_type_reference<'ast, V: Visit<'ast> + ?Sized>( |
| 3200 | _visitor: &mut V, |
| 3201 | _i: &'ast TypeReference, |
| 3202 | ) { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 3203 | tokens_helper(_visitor, &_i.and_token.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3204 | if let Some(ref it) = _i.lifetime { |
| 3205 | _visitor.visit_lifetime(it) |
| 3206 | }; |
| 3207 | if let Some(ref it) = _i.mutability { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 3208 | tokens_helper(_visitor, &it.span) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3209 | }; |
| 3210 | _visitor.visit_type(&*_i.elem); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3211 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3212 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 3213 | pub fn visit_type_slice<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeSlice) { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 3214 | tokens_helper(_visitor, &_i.bracket_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3215 | _visitor.visit_type(&*_i.elem); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3216 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3217 | #[cfg(any(feature = "full", feature = "derive"))] |
| 3218 | pub fn visit_type_trait_object<'ast, V: Visit<'ast> + ?Sized>( |
| 3219 | _visitor: &mut V, |
| 3220 | _i: &'ast TypeTraitObject, |
| 3221 | ) { |
| 3222 | if let Some(ref it) = _i.dyn_token { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 3223 | tokens_helper(_visitor, &it.span) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3224 | }; |
| 3225 | for el in Punctuated::pairs(&_i.bounds) { |
| 3226 | let it = el.value(); |
| 3227 | _visitor.visit_type_param_bound(it) |
| 3228 | } |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3229 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3230 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 3231 | pub fn visit_type_tuple<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast TypeTuple) { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 3232 | tokens_helper(_visitor, &_i.paren_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3233 | for el in Punctuated::pairs(&_i.elems) { |
| 3234 | let it = el.value(); |
| 3235 | _visitor.visit_type(it) |
| 3236 | } |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3237 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3238 | #[cfg(any(feature = "full", feature = "derive"))] |
| 3239 | pub fn visit_type_verbatim<'ast, V: Visit<'ast> + ?Sized>( |
| 3240 | _visitor: &mut V, |
| 3241 | _i: &'ast TypeVerbatim, |
| 3242 | ) { |
David Tolnay | 6af4899 | 2018-08-01 11:16:28 -0700 | [diff] [blame] | 3243 | skip!(_i.tts); |
David Tolnay | 2ae520a | 2017-12-29 11:19:50 -0500 | [diff] [blame] | 3244 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3245 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 3246 | 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] | 3247 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3248 | UnOp::Deref(ref _binding_0) => { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 3249 | tokens_helper(_visitor, &_binding_0.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3250 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3251 | UnOp::Not(ref _binding_0) => { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 3252 | tokens_helper(_visitor, &_binding_0.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3253 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3254 | UnOp::Neg(ref _binding_0) => { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 3255 | tokens_helper(_visitor, &_binding_0.spans); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3256 | } |
| 3257 | } |
| 3258 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3259 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 3260 | pub fn visit_use_glob<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseGlob) { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 3261 | tokens_helper(_visitor, &_i.star_token.spans); |
David Tolnay | 5f332a9 | 2017-12-26 00:42:45 -0500 | [diff] [blame] | 3262 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3263 | #[cfg(feature = "full")] |
David Tolnay | d97a7d2 | 2018-03-31 19:17:01 +0200 | [diff] [blame] | 3264 | pub fn visit_use_group<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast UseGroup) { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 3265 | tokens_helper(_visitor, &_i.brace_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3266 | for el in Punctuated::pairs(&_i.items) { |
| 3267 | let it = el.value(); |
| 3268 | _visitor.visit_use_tree(it) |
| 3269 | } |
David Tolnay | 5f332a9 | 2017-12-26 00:42:45 -0500 | [diff] [blame] | 3270 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3271 | #[cfg(feature = "full")] |
David Tolnay | d97a7d2 | 2018-03-31 19:17:01 +0200 | [diff] [blame] | 3272 | 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] | 3273 | _visitor.visit_ident(&_i.ident); |
David Tolnay | d97a7d2 | 2018-03-31 19:17:01 +0200 | [diff] [blame] | 3274 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3275 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 3276 | 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] | 3277 | _visitor.visit_ident(&_i.ident); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 3278 | tokens_helper(_visitor, &_i.colon2_token.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3279 | _visitor.visit_use_tree(&*_i.tree); |
David Tolnay | d97a7d2 | 2018-03-31 19:17:01 +0200 | [diff] [blame] | 3280 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3281 | #[cfg(feature = "full")] |
David Tolnay | d97a7d2 | 2018-03-31 19:17:01 +0200 | [diff] [blame] | 3282 | 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] | 3283 | _visitor.visit_ident(&_i.ident); |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 3284 | tokens_helper(_visitor, &_i.as_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3285 | _visitor.visit_ident(&_i.rename); |
David Tolnay | 5f332a9 | 2017-12-26 00:42:45 -0500 | [diff] [blame] | 3286 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3287 | #[cfg(feature = "full")] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 3288 | 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] | 3289 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3290 | UseTree::Path(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 3291 | _visitor.visit_use_path(_binding_0); |
David Tolnay | 5f332a9 | 2017-12-26 00:42:45 -0500 | [diff] [blame] | 3292 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3293 | UseTree::Name(ref _binding_0) => { |
David Tolnay | d97a7d2 | 2018-03-31 19:17:01 +0200 | [diff] [blame] | 3294 | _visitor.visit_use_name(_binding_0); |
| 3295 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3296 | UseTree::Rename(ref _binding_0) => { |
David Tolnay | d97a7d2 | 2018-03-31 19:17:01 +0200 | [diff] [blame] | 3297 | _visitor.visit_use_rename(_binding_0); |
| 3298 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3299 | UseTree::Glob(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 3300 | _visitor.visit_use_glob(_binding_0); |
David Tolnay | 5f332a9 | 2017-12-26 00:42:45 -0500 | [diff] [blame] | 3301 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3302 | UseTree::Group(ref _binding_0) => { |
David Tolnay | d97a7d2 | 2018-03-31 19:17:01 +0200 | [diff] [blame] | 3303 | _visitor.visit_use_group(_binding_0); |
David Tolnay | 5f332a9 | 2017-12-26 00:42:45 -0500 | [diff] [blame] | 3304 | } |
| 3305 | } |
| 3306 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3307 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 3308 | 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] | 3309 | for it in &_i.attrs { |
| 3310 | _visitor.visit_attribute(it) |
| 3311 | } |
| 3312 | _visitor.visit_ident(&_i.ident); |
| 3313 | _visitor.visit_fields(&_i.fields); |
| 3314 | if let Some(ref it) = _i.discriminant { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 3315 | tokens_helper(_visitor, &(it).0.spans); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3316 | _visitor.visit_expr(&(it).1); |
| 3317 | }; |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3318 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3319 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 3320 | pub fn visit_vis_crate<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast VisCrate) { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 3321 | tokens_helper(_visitor, &_i.crate_token.span); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3322 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3323 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 3324 | pub fn visit_vis_public<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast VisPublic) { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 3325 | tokens_helper(_visitor, &_i.pub_token.span); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3326 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3327 | #[cfg(any(feature = "full", feature = "derive"))] |
| 3328 | pub fn visit_vis_restricted<'ast, V: Visit<'ast> + ?Sized>( |
| 3329 | _visitor: &mut V, |
| 3330 | _i: &'ast VisRestricted, |
| 3331 | ) { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 3332 | tokens_helper(_visitor, &_i.pub_token.span); |
| 3333 | tokens_helper(_visitor, &_i.paren_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3334 | if let Some(ref it) = _i.in_token { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 3335 | tokens_helper(_visitor, &it.span) |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3336 | }; |
| 3337 | _visitor.visit_path(&*_i.path); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3338 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3339 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 3340 | 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] | 3341 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3342 | Visibility::Public(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 3343 | _visitor.visit_vis_public(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3344 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3345 | Visibility::Crate(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 3346 | _visitor.visit_vis_crate(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3347 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3348 | Visibility::Restricted(ref _binding_0) => { |
David Tolnay | f0d63bf | 2017-12-26 12:29:47 -0500 | [diff] [blame] | 3349 | _visitor.visit_vis_restricted(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3350 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3351 | Visibility::Inherited => {} |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3352 | } |
| 3353 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3354 | #[cfg(any(feature = "full", feature = "derive"))] |
David Tolnay | 4b4c4b6 | 2018-01-06 13:48:05 -0800 | [diff] [blame] | 3355 | pub fn visit_where_clause<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast WhereClause) { |
David Tolnay | 7ac699c | 2018-08-24 14:00:58 -0400 | [diff] [blame] | 3356 | tokens_helper(_visitor, &_i.where_token.span); |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3357 | for el in Punctuated::pairs(&_i.predicates) { |
| 3358 | let it = el.value(); |
| 3359 | _visitor.visit_where_predicate(it) |
| 3360 | } |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3361 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3362 | #[cfg(any(feature = "full", feature = "derive"))] |
| 3363 | pub fn visit_where_predicate<'ast, V: Visit<'ast> + ?Sized>( |
| 3364 | _visitor: &mut V, |
| 3365 | _i: &'ast WherePredicate, |
| 3366 | ) { |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3367 | match *_i { |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3368 | WherePredicate::Type(ref _binding_0) => { |
David Tolnay | d4add85 | 2018-01-01 20:13:24 -0800 | [diff] [blame] | 3369 | _visitor.visit_predicate_type(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3370 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3371 | WherePredicate::Lifetime(ref _binding_0) => { |
David Tolnay | d4add85 | 2018-01-01 20:13:24 -0800 | [diff] [blame] | 3372 | _visitor.visit_predicate_lifetime(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3373 | } |
David Tolnay | 8c81f62 | 2018-07-31 23:34:35 -0700 | [diff] [blame] | 3374 | WherePredicate::Eq(ref _binding_0) => { |
David Tolnay | d4add85 | 2018-01-01 20:13:24 -0800 | [diff] [blame] | 3375 | _visitor.visit_predicate_eq(_binding_0); |
Nika Layzell | 2772666 | 2017-10-24 23:16:35 -0400 | [diff] [blame] | 3376 | } |
| 3377 | } |
| 3378 | } |