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