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