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