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