aienux
Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.
Brought by drakestapleton
aienux / vendor / syn / tests / debug / gen.rs
| 1 | // This file is @generated by syn-internal-codegen. |
| 2 | // It is not intended for manual editing. |
| 3 | |
| 4 | #![allow(clippy::match_wildcard_for_single_variants)] |
| 5 | use super::{Lite, Present}; |
| 6 | use core::fmt::{self, Debug, Display}; |
| 7 | use ref_cast::RefCast; |
| 8 | impl Debug for Lite<syn::Abi> { |
| 9 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 10 | let mut formatter = formatter.debug_struct("Abi"); |
| 11 | if let Some(val) = &self.value.name { |
| 12 | #[derive(RefCast)] |
| 13 | #[repr(transparent)] |
| 14 | struct Print(syn::LitStr); |
| 15 | impl Debug for Print { |
| 16 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 17 | formatter.write_str("Some(")?; |
| 18 | Debug::fmt(Lite(&self.0), formatter)?; |
| 19 | formatter.write_str(")")?; |
| 20 | Ok(()) |
| 21 | } |
| 22 | } |
| 23 | formatter.field("name", Print::ref_cast(val)); |
| 24 | } |
| 25 | formatter.finish() |
| 26 | } |
| 27 | } |
| 28 | impl Debug for Lite<syn::AngleBracketedGenericArguments> { |
| 29 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 30 | let mut formatter = formatter.debug_struct("AngleBracketedGenericArguments"); |
| 31 | if self.value.colon2_token.is_some() { |
| 32 | formatter.field("colon2_token", &Present); |
| 33 | } |
| 34 | if !self.value.args.is_empty() { |
| 35 | formatter.field("args", Lite(&self.value.args)); |
| 36 | } |
| 37 | formatter.finish() |
| 38 | } |
| 39 | } |
| 40 | impl Debug for Lite<syn::Arm> { |
| 41 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 42 | let mut formatter = formatter.debug_struct("Arm"); |
| 43 | if !self.value.attrs.is_empty() { |
| 44 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 45 | } |
| 46 | formatter.field("pat", Lite(&self.value.pat)); |
| 47 | formatter.field("body", Lite(&self.value.body)); |
| 48 | if self.value.comma.is_some() { |
| 49 | formatter.field("comma", &Present); |
| 50 | } |
| 51 | formatter.finish() |
| 52 | } |
| 53 | } |
| 54 | impl Debug for Lite<syn::AssocConst> { |
| 55 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 56 | let mut formatter = formatter.debug_struct("AssocConst"); |
| 57 | formatter.field("ident", Lite(&self.value.ident)); |
| 58 | if let Some(val) = &self.value.generics { |
| 59 | #[derive(RefCast)] |
| 60 | #[repr(transparent)] |
| 61 | struct Print(syn::AngleBracketedGenericArguments); |
| 62 | impl Debug for Print { |
| 63 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 64 | formatter.write_str("Some(")?; |
| 65 | Debug::fmt(Lite(&self.0), formatter)?; |
| 66 | formatter.write_str(")")?; |
| 67 | Ok(()) |
| 68 | } |
| 69 | } |
| 70 | formatter.field("generics", Print::ref_cast(val)); |
| 71 | } |
| 72 | formatter.field("value", Lite(&self.value.value)); |
| 73 | formatter.finish() |
| 74 | } |
| 75 | } |
| 76 | impl Debug for Lite<syn::AssocType> { |
| 77 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 78 | let mut formatter = formatter.debug_struct("AssocType"); |
| 79 | formatter.field("ident", Lite(&self.value.ident)); |
| 80 | if let Some(val) = &self.value.generics { |
| 81 | #[derive(RefCast)] |
| 82 | #[repr(transparent)] |
| 83 | struct Print(syn::AngleBracketedGenericArguments); |
| 84 | impl Debug for Print { |
| 85 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 86 | formatter.write_str("Some(")?; |
| 87 | Debug::fmt(Lite(&self.0), formatter)?; |
| 88 | formatter.write_str(")")?; |
| 89 | Ok(()) |
| 90 | } |
| 91 | } |
| 92 | formatter.field("generics", Print::ref_cast(val)); |
| 93 | } |
| 94 | formatter.field("ty", Lite(&self.value.ty)); |
| 95 | formatter.finish() |
| 96 | } |
| 97 | } |
| 98 | impl Debug for Lite<syn::AttrStyle> { |
| 99 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 100 | match &self.value { |
| 101 | syn::AttrStyle::Outer => formatter.write_str("AttrStyle::Outer"), |
| 102 | syn::AttrStyle::Inner(_val) => { |
| 103 | formatter.write_str("AttrStyle::Inner")?; |
| 104 | Ok(()) |
| 105 | } |
| 106 | } |
| 107 | } |
| 108 | } |
| 109 | impl Debug for Lite<syn::Attribute> { |
| 110 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 111 | let mut formatter = formatter.debug_struct("Attribute"); |
| 112 | formatter.field("style", Lite(&self.value.style)); |
| 113 | formatter.field("meta", Lite(&self.value.meta)); |
| 114 | formatter.finish() |
| 115 | } |
| 116 | } |
| 117 | impl Debug for Lite<syn::BinOp> { |
| 118 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 119 | match &self.value { |
| 120 | syn::BinOp::Add(_val) => { |
| 121 | formatter.write_str("BinOp::Add")?; |
| 122 | Ok(()) |
| 123 | } |
| 124 | syn::BinOp::Sub(_val) => { |
| 125 | formatter.write_str("BinOp::Sub")?; |
| 126 | Ok(()) |
| 127 | } |
| 128 | syn::BinOp::Mul(_val) => { |
| 129 | formatter.write_str("BinOp::Mul")?; |
| 130 | Ok(()) |
| 131 | } |
| 132 | syn::BinOp::Div(_val) => { |
| 133 | formatter.write_str("BinOp::Div")?; |
| 134 | Ok(()) |
| 135 | } |
| 136 | syn::BinOp::Rem(_val) => { |
| 137 | formatter.write_str("BinOp::Rem")?; |
| 138 | Ok(()) |
| 139 | } |
| 140 | syn::BinOp::And(_val) => { |
| 141 | formatter.write_str("BinOp::And")?; |
| 142 | Ok(()) |
| 143 | } |
| 144 | syn::BinOp::Or(_val) => { |
| 145 | formatter.write_str("BinOp::Or")?; |
| 146 | Ok(()) |
| 147 | } |
| 148 | syn::BinOp::BitXor(_val) => { |
| 149 | formatter.write_str("BinOp::BitXor")?; |
| 150 | Ok(()) |
| 151 | } |
| 152 | syn::BinOp::BitAnd(_val) => { |
| 153 | formatter.write_str("BinOp::BitAnd")?; |
| 154 | Ok(()) |
| 155 | } |
| 156 | syn::BinOp::BitOr(_val) => { |
| 157 | formatter.write_str("BinOp::BitOr")?; |
| 158 | Ok(()) |
| 159 | } |
| 160 | syn::BinOp::Shl(_val) => { |
| 161 | formatter.write_str("BinOp::Shl")?; |
| 162 | Ok(()) |
| 163 | } |
| 164 | syn::BinOp::Shr(_val) => { |
| 165 | formatter.write_str("BinOp::Shr")?; |
| 166 | Ok(()) |
| 167 | } |
| 168 | syn::BinOp::Eq(_val) => { |
| 169 | formatter.write_str("BinOp::Eq")?; |
| 170 | Ok(()) |
| 171 | } |
| 172 | syn::BinOp::Lt(_val) => { |
| 173 | formatter.write_str("BinOp::Lt")?; |
| 174 | Ok(()) |
| 175 | } |
| 176 | syn::BinOp::Le(_val) => { |
| 177 | formatter.write_str("BinOp::Le")?; |
| 178 | Ok(()) |
| 179 | } |
| 180 | syn::BinOp::Ne(_val) => { |
| 181 | formatter.write_str("BinOp::Ne")?; |
| 182 | Ok(()) |
| 183 | } |
| 184 | syn::BinOp::Ge(_val) => { |
| 185 | formatter.write_str("BinOp::Ge")?; |
| 186 | Ok(()) |
| 187 | } |
| 188 | syn::BinOp::Gt(_val) => { |
| 189 | formatter.write_str("BinOp::Gt")?; |
| 190 | Ok(()) |
| 191 | } |
| 192 | syn::BinOp::AddAssign(_val) => { |
| 193 | formatter.write_str("BinOp::AddAssign")?; |
| 194 | Ok(()) |
| 195 | } |
| 196 | syn::BinOp::SubAssign(_val) => { |
| 197 | formatter.write_str("BinOp::SubAssign")?; |
| 198 | Ok(()) |
| 199 | } |
| 200 | syn::BinOp::MulAssign(_val) => { |
| 201 | formatter.write_str("BinOp::MulAssign")?; |
| 202 | Ok(()) |
| 203 | } |
| 204 | syn::BinOp::DivAssign(_val) => { |
| 205 | formatter.write_str("BinOp::DivAssign")?; |
| 206 | Ok(()) |
| 207 | } |
| 208 | syn::BinOp::RemAssign(_val) => { |
| 209 | formatter.write_str("BinOp::RemAssign")?; |
| 210 | Ok(()) |
| 211 | } |
| 212 | syn::BinOp::BitXorAssign(_val) => { |
| 213 | formatter.write_str("BinOp::BitXorAssign")?; |
| 214 | Ok(()) |
| 215 | } |
| 216 | syn::BinOp::BitAndAssign(_val) => { |
| 217 | formatter.write_str("BinOp::BitAndAssign")?; |
| 218 | Ok(()) |
| 219 | } |
| 220 | syn::BinOp::BitOrAssign(_val) => { |
| 221 | formatter.write_str("BinOp::BitOrAssign")?; |
| 222 | Ok(()) |
| 223 | } |
| 224 | syn::BinOp::ShlAssign(_val) => { |
| 225 | formatter.write_str("BinOp::ShlAssign")?; |
| 226 | Ok(()) |
| 227 | } |
| 228 | syn::BinOp::ShrAssign(_val) => { |
| 229 | formatter.write_str("BinOp::ShrAssign")?; |
| 230 | Ok(()) |
| 231 | } |
| 232 | _ => unreachable!(), |
| 233 | } |
| 234 | } |
| 235 | } |
| 236 | impl Debug for Lite<syn::Block> { |
| 237 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 238 | let mut formatter = formatter.debug_struct("Block"); |
| 239 | formatter.field("stmts", Lite(&self.value.stmts)); |
| 240 | formatter.finish() |
| 241 | } |
| 242 | } |
| 243 | impl Debug for Lite<syn::BlockModifiers> { |
| 244 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 245 | let mut formatter = formatter.debug_struct("BlockModifiers"); |
| 246 | formatter.finish() |
| 247 | } |
| 248 | } |
| 249 | impl Debug for Lite<syn::BoundLifetimes> { |
| 250 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 251 | let mut formatter = formatter.debug_struct("BoundLifetimes"); |
| 252 | if !self.value.lifetimes.is_empty() { |
| 253 | formatter.field("lifetimes", Lite(&self.value.lifetimes)); |
| 254 | } |
| 255 | formatter.finish() |
| 256 | } |
| 257 | } |
| 258 | impl Debug for Lite<syn::CapturedParam> { |
| 259 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 260 | match &self.value { |
| 261 | syn::CapturedParam::Lifetime(_val) => { |
| 262 | formatter.write_str("CapturedParam::Lifetime")?; |
| 263 | formatter.write_str("(")?; |
| 264 | Debug::fmt(Lite(_val), formatter)?; |
| 265 | formatter.write_str(")")?; |
| 266 | Ok(()) |
| 267 | } |
| 268 | syn::CapturedParam::Ident(_val) => { |
| 269 | formatter.write_str("CapturedParam::Ident")?; |
| 270 | formatter.write_str("(")?; |
| 271 | Debug::fmt(Lite(_val), formatter)?; |
| 272 | formatter.write_str(")")?; |
| 273 | Ok(()) |
| 274 | } |
| 275 | _ => unreachable!(), |
| 276 | } |
| 277 | } |
| 278 | } |
| 279 | impl Debug for Lite<syn::ClosureModifiers> { |
| 280 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 281 | let mut formatter = formatter.debug_struct("ClosureModifiers"); |
| 282 | formatter.finish() |
| 283 | } |
| 284 | } |
| 285 | impl Debug for Lite<syn::ConstModifiers> { |
| 286 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 287 | let mut formatter = formatter.debug_struct("ConstModifiers"); |
| 288 | if self.value.defaultness.is_some() { |
| 289 | formatter.field("defaultness", &Present); |
| 290 | } |
| 291 | formatter.finish() |
| 292 | } |
| 293 | } |
| 294 | impl Debug for Lite<syn::ConstParam> { |
| 295 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 296 | let mut formatter = formatter.debug_struct("ConstParam"); |
| 297 | if !self.value.attrs.is_empty() { |
| 298 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 299 | } |
| 300 | formatter.field("ident", Lite(&self.value.ident)); |
| 301 | formatter.field("ty", Lite(&self.value.ty)); |
| 302 | if let Some(val) = &self.value.default { |
| 303 | #[derive(RefCast)] |
| 304 | #[repr(transparent)] |
| 305 | struct Print((syn::token::Eq, syn::Expr)); |
| 306 | impl Debug for Print { |
| 307 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 308 | formatter.write_str("Some(")?; |
| 309 | Debug::fmt(Lite(&self.0.1), formatter)?; |
| 310 | formatter.write_str(")")?; |
| 311 | Ok(()) |
| 312 | } |
| 313 | } |
| 314 | formatter.field("default", Print::ref_cast(val)); |
| 315 | } |
| 316 | formatter.finish() |
| 317 | } |
| 318 | } |
| 319 | impl Debug for Lite<syn::Constraint> { |
| 320 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 321 | let mut formatter = formatter.debug_struct("Constraint"); |
| 322 | formatter.field("ident", Lite(&self.value.ident)); |
| 323 | if let Some(val) = &self.value.generics { |
| 324 | #[derive(RefCast)] |
| 325 | #[repr(transparent)] |
| 326 | struct Print(syn::AngleBracketedGenericArguments); |
| 327 | impl Debug for Print { |
| 328 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 329 | formatter.write_str("Some(")?; |
| 330 | Debug::fmt(Lite(&self.0), formatter)?; |
| 331 | formatter.write_str(")")?; |
| 332 | Ok(()) |
| 333 | } |
| 334 | } |
| 335 | formatter.field("generics", Print::ref_cast(val)); |
| 336 | } |
| 337 | if !self.value.bounds.is_empty() { |
| 338 | formatter.field("bounds", Lite(&self.value.bounds)); |
| 339 | } |
| 340 | formatter.finish() |
| 341 | } |
| 342 | } |
| 343 | impl Debug for Lite<syn::Data> { |
| 344 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 345 | match &self.value { |
| 346 | syn::Data::Struct(_val) => { |
| 347 | let mut formatter = formatter.debug_struct("Data::Struct"); |
| 348 | formatter.field("fields", Lite(&_val.fields)); |
| 349 | if _val.semi_token.is_some() { |
| 350 | formatter.field("semi_token", &Present); |
| 351 | } |
| 352 | formatter.finish() |
| 353 | } |
| 354 | syn::Data::Enum(_val) => { |
| 355 | let mut formatter = formatter.debug_struct("Data::Enum"); |
| 356 | if !_val.variants.is_empty() { |
| 357 | formatter.field("variants", Lite(&_val.variants)); |
| 358 | } |
| 359 | formatter.finish() |
| 360 | } |
| 361 | syn::Data::Union(_val) => { |
| 362 | let mut formatter = formatter.debug_struct("Data::Union"); |
| 363 | formatter.field("fields", Lite(&_val.fields)); |
| 364 | formatter.finish() |
| 365 | } |
| 366 | } |
| 367 | } |
| 368 | } |
| 369 | impl Debug for Lite<syn::DataEnum> { |
| 370 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 371 | let mut formatter = formatter.debug_struct("DataEnum"); |
| 372 | if !self.value.variants.is_empty() { |
| 373 | formatter.field("variants", Lite(&self.value.variants)); |
| 374 | } |
| 375 | formatter.finish() |
| 376 | } |
| 377 | } |
| 378 | impl Debug for Lite<syn::DataStruct> { |
| 379 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 380 | let mut formatter = formatter.debug_struct("DataStruct"); |
| 381 | formatter.field("fields", Lite(&self.value.fields)); |
| 382 | if self.value.semi_token.is_some() { |
| 383 | formatter.field("semi_token", &Present); |
| 384 | } |
| 385 | formatter.finish() |
| 386 | } |
| 387 | } |
| 388 | impl Debug for Lite<syn::DataUnion> { |
| 389 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 390 | let mut formatter = formatter.debug_struct("DataUnion"); |
| 391 | formatter.field("fields", Lite(&self.value.fields)); |
| 392 | formatter.finish() |
| 393 | } |
| 394 | } |
| 395 | impl Debug for Lite<syn::DeriveInput> { |
| 396 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 397 | let mut formatter = formatter.debug_struct("DeriveInput"); |
| 398 | if !self.value.attrs.is_empty() { |
| 399 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 400 | } |
| 401 | formatter.field("vis", Lite(&self.value.vis)); |
| 402 | formatter.field("ident", Lite(&self.value.ident)); |
| 403 | formatter.field("generics", Lite(&self.value.generics)); |
| 404 | formatter.field("data", Lite(&self.value.data)); |
| 405 | formatter.finish() |
| 406 | } |
| 407 | } |
| 408 | impl Debug for Lite<syn::Expr> { |
| 409 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 410 | match &self.value { |
| 411 | syn::Expr::Array(_val) => { |
| 412 | let mut formatter = formatter.debug_struct("Expr::Array"); |
| 413 | if !_val.attrs.is_empty() { |
| 414 | formatter.field("attrs", Lite(&_val.attrs)); |
| 415 | } |
| 416 | if !_val.elems.is_empty() { |
| 417 | formatter.field("elems", Lite(&_val.elems)); |
| 418 | } |
| 419 | formatter.finish() |
| 420 | } |
| 421 | syn::Expr::Assign(_val) => { |
| 422 | let mut formatter = formatter.debug_struct("Expr::Assign"); |
| 423 | if !_val.attrs.is_empty() { |
| 424 | formatter.field("attrs", Lite(&_val.attrs)); |
| 425 | } |
| 426 | formatter.field("left", Lite(&_val.left)); |
| 427 | formatter.field("right", Lite(&_val.right)); |
| 428 | formatter.finish() |
| 429 | } |
| 430 | syn::Expr::Async(_val) => { |
| 431 | let mut formatter = formatter.debug_struct("Expr::Async"); |
| 432 | if !_val.attrs.is_empty() { |
| 433 | formatter.field("attrs", Lite(&_val.attrs)); |
| 434 | } |
| 435 | if _val.capture.is_some() { |
| 436 | formatter.field("capture", &Present); |
| 437 | } |
| 438 | formatter.field("modifiers", Lite(&_val.modifiers)); |
| 439 | formatter.field("block", Lite(&_val.block)); |
| 440 | formatter.finish() |
| 441 | } |
| 442 | syn::Expr::Await(_val) => { |
| 443 | let mut formatter = formatter.debug_struct("Expr::Await"); |
| 444 | if !_val.attrs.is_empty() { |
| 445 | formatter.field("attrs", Lite(&_val.attrs)); |
| 446 | } |
| 447 | formatter.field("base", Lite(&_val.base)); |
| 448 | formatter.finish() |
| 449 | } |
| 450 | syn::Expr::Binary(_val) => { |
| 451 | let mut formatter = formatter.debug_struct("Expr::Binary"); |
| 452 | if !_val.attrs.is_empty() { |
| 453 | formatter.field("attrs", Lite(&_val.attrs)); |
| 454 | } |
| 455 | formatter.field("left", Lite(&_val.left)); |
| 456 | formatter.field("op", Lite(&_val.op)); |
| 457 | formatter.field("right", Lite(&_val.right)); |
| 458 | formatter.finish() |
| 459 | } |
| 460 | syn::Expr::Block(_val) => { |
| 461 | let mut formatter = formatter.debug_struct("Expr::Block"); |
| 462 | if !_val.attrs.is_empty() { |
| 463 | formatter.field("attrs", Lite(&_val.attrs)); |
| 464 | } |
| 465 | if let Some(val) = &_val.label { |
| 466 | #[derive(RefCast)] |
| 467 | #[repr(transparent)] |
| 468 | struct Print(syn::Label); |
| 469 | impl Debug for Print { |
| 470 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 471 | formatter.write_str("Some(")?; |
| 472 | Debug::fmt(Lite(&self.0), formatter)?; |
| 473 | formatter.write_str(")")?; |
| 474 | Ok(()) |
| 475 | } |
| 476 | } |
| 477 | formatter.field("label", Print::ref_cast(val)); |
| 478 | } |
| 479 | formatter.field("block", Lite(&_val.block)); |
| 480 | formatter.finish() |
| 481 | } |
| 482 | syn::Expr::Break(_val) => { |
| 483 | let mut formatter = formatter.debug_struct("Expr::Break"); |
| 484 | if !_val.attrs.is_empty() { |
| 485 | formatter.field("attrs", Lite(&_val.attrs)); |
| 486 | } |
| 487 | if let Some(val) = &_val.label { |
| 488 | #[derive(RefCast)] |
| 489 | #[repr(transparent)] |
| 490 | struct Print(syn::Lifetime); |
| 491 | impl Debug for Print { |
| 492 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 493 | formatter.write_str("Some(")?; |
| 494 | Debug::fmt(Lite(&self.0), formatter)?; |
| 495 | formatter.write_str(")")?; |
| 496 | Ok(()) |
| 497 | } |
| 498 | } |
| 499 | formatter.field("label", Print::ref_cast(val)); |
| 500 | } |
| 501 | if let Some(val) = &_val.expr { |
| 502 | #[derive(RefCast)] |
| 503 | #[repr(transparent)] |
| 504 | struct Print(Box<syn::Expr>); |
| 505 | impl Debug for Print { |
| 506 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 507 | formatter.write_str("Some(")?; |
| 508 | Debug::fmt(Lite(&self.0), formatter)?; |
| 509 | formatter.write_str(")")?; |
| 510 | Ok(()) |
| 511 | } |
| 512 | } |
| 513 | formatter.field("expr", Print::ref_cast(val)); |
| 514 | } |
| 515 | formatter.finish() |
| 516 | } |
| 517 | syn::Expr::Call(_val) => { |
| 518 | let mut formatter = formatter.debug_struct("Expr::Call"); |
| 519 | if !_val.attrs.is_empty() { |
| 520 | formatter.field("attrs", Lite(&_val.attrs)); |
| 521 | } |
| 522 | formatter.field("func", Lite(&_val.func)); |
| 523 | if !_val.args.is_empty() { |
| 524 | formatter.field("args", Lite(&_val.args)); |
| 525 | } |
| 526 | formatter.finish() |
| 527 | } |
| 528 | syn::Expr::Cast(_val) => { |
| 529 | let mut formatter = formatter.debug_struct("Expr::Cast"); |
| 530 | if !_val.attrs.is_empty() { |
| 531 | formatter.field("attrs", Lite(&_val.attrs)); |
| 532 | } |
| 533 | formatter.field("expr", Lite(&_val.expr)); |
| 534 | formatter.field("ty", Lite(&_val.ty)); |
| 535 | formatter.finish() |
| 536 | } |
| 537 | syn::Expr::Closure(_val) => { |
| 538 | let mut formatter = formatter.debug_struct("Expr::Closure"); |
| 539 | if !_val.attrs.is_empty() { |
| 540 | formatter.field("attrs", Lite(&_val.attrs)); |
| 541 | } |
| 542 | if let Some(val) = &_val.lifetimes { |
| 543 | #[derive(RefCast)] |
| 544 | #[repr(transparent)] |
| 545 | struct Print(syn::BoundLifetimes); |
| 546 | impl Debug for Print { |
| 547 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 548 | formatter.write_str("Some(")?; |
| 549 | Debug::fmt(Lite(&self.0), formatter)?; |
| 550 | formatter.write_str(")")?; |
| 551 | Ok(()) |
| 552 | } |
| 553 | } |
| 554 | formatter.field("lifetimes", Print::ref_cast(val)); |
| 555 | } |
| 556 | formatter.field("modifiers", Lite(&_val.modifiers)); |
| 557 | if _val.constness.is_some() { |
| 558 | formatter.field("constness", &Present); |
| 559 | } |
| 560 | if _val.asyncness.is_some() { |
| 561 | formatter.field("asyncness", &Present); |
| 562 | } |
| 563 | if _val.capture.is_some() { |
| 564 | formatter.field("capture", &Present); |
| 565 | } |
| 566 | if !_val.inputs.is_empty() { |
| 567 | formatter.field("inputs", Lite(&_val.inputs)); |
| 568 | } |
| 569 | formatter.field("output", Lite(&_val.output)); |
| 570 | formatter.field("body", Lite(&_val.body)); |
| 571 | formatter.finish() |
| 572 | } |
| 573 | syn::Expr::Const(_val) => { |
| 574 | let mut formatter = formatter.debug_struct("Expr::Const"); |
| 575 | if !_val.attrs.is_empty() { |
| 576 | formatter.field("attrs", Lite(&_val.attrs)); |
| 577 | } |
| 578 | formatter.field("modifiers", Lite(&_val.modifiers)); |
| 579 | formatter.field("block", Lite(&_val.block)); |
| 580 | formatter.finish() |
| 581 | } |
| 582 | syn::Expr::Continue(_val) => { |
| 583 | let mut formatter = formatter.debug_struct("Expr::Continue"); |
| 584 | if !_val.attrs.is_empty() { |
| 585 | formatter.field("attrs", Lite(&_val.attrs)); |
| 586 | } |
| 587 | if let Some(val) = &_val.label { |
| 588 | #[derive(RefCast)] |
| 589 | #[repr(transparent)] |
| 590 | struct Print(syn::Lifetime); |
| 591 | impl Debug for Print { |
| 592 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 593 | formatter.write_str("Some(")?; |
| 594 | Debug::fmt(Lite(&self.0), formatter)?; |
| 595 | formatter.write_str(")")?; |
| 596 | Ok(()) |
| 597 | } |
| 598 | } |
| 599 | formatter.field("label", Print::ref_cast(val)); |
| 600 | } |
| 601 | formatter.finish() |
| 602 | } |
| 603 | syn::Expr::Field(_val) => { |
| 604 | let mut formatter = formatter.debug_struct("Expr::Field"); |
| 605 | if !_val.attrs.is_empty() { |
| 606 | formatter.field("attrs", Lite(&_val.attrs)); |
| 607 | } |
| 608 | formatter.field("base", Lite(&_val.base)); |
| 609 | formatter.field("member", Lite(&_val.member)); |
| 610 | formatter.finish() |
| 611 | } |
| 612 | syn::Expr::ForLoop(_val) => { |
| 613 | let mut formatter = formatter.debug_struct("Expr::ForLoop"); |
| 614 | if !_val.attrs.is_empty() { |
| 615 | formatter.field("attrs", Lite(&_val.attrs)); |
| 616 | } |
| 617 | if let Some(val) = &_val.label { |
| 618 | #[derive(RefCast)] |
| 619 | #[repr(transparent)] |
| 620 | struct Print(syn::Label); |
| 621 | impl Debug for Print { |
| 622 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 623 | formatter.write_str("Some(")?; |
| 624 | Debug::fmt(Lite(&self.0), formatter)?; |
| 625 | formatter.write_str(")")?; |
| 626 | Ok(()) |
| 627 | } |
| 628 | } |
| 629 | formatter.field("label", Print::ref_cast(val)); |
| 630 | } |
| 631 | formatter.field("pat", Lite(&_val.pat)); |
| 632 | formatter.field("expr", Lite(&_val.expr)); |
| 633 | formatter.field("body", Lite(&_val.body)); |
| 634 | formatter.finish() |
| 635 | } |
| 636 | syn::Expr::Group(_val) => { |
| 637 | let mut formatter = formatter.debug_struct("Expr::Group"); |
| 638 | if !_val.attrs.is_empty() { |
| 639 | formatter.field("attrs", Lite(&_val.attrs)); |
| 640 | } |
| 641 | formatter.field("expr", Lite(&_val.expr)); |
| 642 | formatter.finish() |
| 643 | } |
| 644 | syn::Expr::If(_val) => { |
| 645 | let mut formatter = formatter.debug_struct("Expr::If"); |
| 646 | if !_val.attrs.is_empty() { |
| 647 | formatter.field("attrs", Lite(&_val.attrs)); |
| 648 | } |
| 649 | formatter.field("cond", Lite(&_val.cond)); |
| 650 | formatter.field("then_branch", Lite(&_val.then_branch)); |
| 651 | if let Some(val) = &_val.else_branch { |
| 652 | #[derive(RefCast)] |
| 653 | #[repr(transparent)] |
| 654 | struct Print((syn::token::Else, Box<syn::Expr>)); |
| 655 | impl Debug for Print { |
| 656 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 657 | formatter.write_str("Some(")?; |
| 658 | Debug::fmt(Lite(&self.0.1), formatter)?; |
| 659 | formatter.write_str(")")?; |
| 660 | Ok(()) |
| 661 | } |
| 662 | } |
| 663 | formatter.field("else_branch", Print::ref_cast(val)); |
| 664 | } |
| 665 | formatter.finish() |
| 666 | } |
| 667 | syn::Expr::Index(_val) => { |
| 668 | let mut formatter = formatter.debug_struct("Expr::Index"); |
| 669 | if !_val.attrs.is_empty() { |
| 670 | formatter.field("attrs", Lite(&_val.attrs)); |
| 671 | } |
| 672 | formatter.field("expr", Lite(&_val.expr)); |
| 673 | formatter.field("index", Lite(&_val.index)); |
| 674 | formatter.finish() |
| 675 | } |
| 676 | syn::Expr::Infer(_val) => { |
| 677 | let mut formatter = formatter.debug_struct("Expr::Infer"); |
| 678 | if !_val.attrs.is_empty() { |
| 679 | formatter.field("attrs", Lite(&_val.attrs)); |
| 680 | } |
| 681 | formatter.finish() |
| 682 | } |
| 683 | syn::Expr::Let(_val) => { |
| 684 | let mut formatter = formatter.debug_struct("Expr::Let"); |
| 685 | if !_val.attrs.is_empty() { |
| 686 | formatter.field("attrs", Lite(&_val.attrs)); |
| 687 | } |
| 688 | formatter.field("pat", Lite(&_val.pat)); |
| 689 | formatter.field("expr", Lite(&_val.expr)); |
| 690 | formatter.finish() |
| 691 | } |
| 692 | syn::Expr::Lit(_val) => { |
| 693 | let mut formatter = formatter.debug_struct("Expr::Lit"); |
| 694 | if !_val.attrs.is_empty() { |
| 695 | formatter.field("attrs", Lite(&_val.attrs)); |
| 696 | } |
| 697 | formatter.field("lit", Lite(&_val.lit)); |
| 698 | formatter.finish() |
| 699 | } |
| 700 | syn::Expr::Loop(_val) => { |
| 701 | let mut formatter = formatter.debug_struct("Expr::Loop"); |
| 702 | if !_val.attrs.is_empty() { |
| 703 | formatter.field("attrs", Lite(&_val.attrs)); |
| 704 | } |
| 705 | if let Some(val) = &_val.label { |
| 706 | #[derive(RefCast)] |
| 707 | #[repr(transparent)] |
| 708 | struct Print(syn::Label); |
| 709 | impl Debug for Print { |
| 710 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 711 | formatter.write_str("Some(")?; |
| 712 | Debug::fmt(Lite(&self.0), formatter)?; |
| 713 | formatter.write_str(")")?; |
| 714 | Ok(()) |
| 715 | } |
| 716 | } |
| 717 | formatter.field("label", Print::ref_cast(val)); |
| 718 | } |
| 719 | formatter.field("body", Lite(&_val.body)); |
| 720 | formatter.finish() |
| 721 | } |
| 722 | syn::Expr::Macro(_val) => { |
| 723 | let mut formatter = formatter.debug_struct("Expr::Macro"); |
| 724 | if !_val.attrs.is_empty() { |
| 725 | formatter.field("attrs", Lite(&_val.attrs)); |
| 726 | } |
| 727 | formatter.field("mac", Lite(&_val.mac)); |
| 728 | formatter.finish() |
| 729 | } |
| 730 | syn::Expr::Match(_val) => { |
| 731 | let mut formatter = formatter.debug_struct("Expr::Match"); |
| 732 | if !_val.attrs.is_empty() { |
| 733 | formatter.field("attrs", Lite(&_val.attrs)); |
| 734 | } |
| 735 | formatter.field("expr", Lite(&_val.expr)); |
| 736 | if !_val.arms.is_empty() { |
| 737 | formatter.field("arms", Lite(&_val.arms)); |
| 738 | } |
| 739 | formatter.finish() |
| 740 | } |
| 741 | syn::Expr::MethodCall(_val) => { |
| 742 | let mut formatter = formatter.debug_struct("Expr::MethodCall"); |
| 743 | if !_val.attrs.is_empty() { |
| 744 | formatter.field("attrs", Lite(&_val.attrs)); |
| 745 | } |
| 746 | formatter.field("receiver", Lite(&_val.receiver)); |
| 747 | formatter.field("method", Lite(&_val.method)); |
| 748 | if let Some(val) = &_val.turbofish { |
| 749 | #[derive(RefCast)] |
| 750 | #[repr(transparent)] |
| 751 | struct Print(syn::AngleBracketedGenericArguments); |
| 752 | impl Debug for Print { |
| 753 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 754 | formatter.write_str("Some(")?; |
| 755 | Debug::fmt(Lite(&self.0), formatter)?; |
| 756 | formatter.write_str(")")?; |
| 757 | Ok(()) |
| 758 | } |
| 759 | } |
| 760 | formatter.field("turbofish", Print::ref_cast(val)); |
| 761 | } |
| 762 | if !_val.args.is_empty() { |
| 763 | formatter.field("args", Lite(&_val.args)); |
| 764 | } |
| 765 | formatter.finish() |
| 766 | } |
| 767 | syn::Expr::Paren(_val) => { |
| 768 | let mut formatter = formatter.debug_struct("Expr::Paren"); |
| 769 | if !_val.attrs.is_empty() { |
| 770 | formatter.field("attrs", Lite(&_val.attrs)); |
| 771 | } |
| 772 | formatter.field("expr", Lite(&_val.expr)); |
| 773 | formatter.finish() |
| 774 | } |
| 775 | syn::Expr::Path(_val) => { |
| 776 | let mut formatter = formatter.debug_struct("Expr::Path"); |
| 777 | if !_val.attrs.is_empty() { |
| 778 | formatter.field("attrs", Lite(&_val.attrs)); |
| 779 | } |
| 780 | if let Some(val) = &_val.qself { |
| 781 | #[derive(RefCast)] |
| 782 | #[repr(transparent)] |
| 783 | struct Print(syn::QSelf); |
| 784 | impl Debug for Print { |
| 785 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 786 | formatter.write_str("Some(")?; |
| 787 | Debug::fmt(Lite(&self.0), formatter)?; |
| 788 | formatter.write_str(")")?; |
| 789 | Ok(()) |
| 790 | } |
| 791 | } |
| 792 | formatter.field("qself", Print::ref_cast(val)); |
| 793 | } |
| 794 | formatter.field("path", Lite(&_val.path)); |
| 795 | formatter.finish() |
| 796 | } |
| 797 | syn::Expr::Range(_val) => { |
| 798 | let mut formatter = formatter.debug_struct("Expr::Range"); |
| 799 | if !_val.attrs.is_empty() { |
| 800 | formatter.field("attrs", Lite(&_val.attrs)); |
| 801 | } |
| 802 | if let Some(val) = &_val.start { |
| 803 | #[derive(RefCast)] |
| 804 | #[repr(transparent)] |
| 805 | struct Print(Box<syn::Expr>); |
| 806 | impl Debug for Print { |
| 807 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 808 | formatter.write_str("Some(")?; |
| 809 | Debug::fmt(Lite(&self.0), formatter)?; |
| 810 | formatter.write_str(")")?; |
| 811 | Ok(()) |
| 812 | } |
| 813 | } |
| 814 | formatter.field("start", Print::ref_cast(val)); |
| 815 | } |
| 816 | formatter.field("limits", Lite(&_val.limits)); |
| 817 | if let Some(val) = &_val.end { |
| 818 | #[derive(RefCast)] |
| 819 | #[repr(transparent)] |
| 820 | struct Print(Box<syn::Expr>); |
| 821 | impl Debug for Print { |
| 822 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 823 | formatter.write_str("Some(")?; |
| 824 | Debug::fmt(Lite(&self.0), formatter)?; |
| 825 | formatter.write_str(")")?; |
| 826 | Ok(()) |
| 827 | } |
| 828 | } |
| 829 | formatter.field("end", Print::ref_cast(val)); |
| 830 | } |
| 831 | formatter.finish() |
| 832 | } |
| 833 | syn::Expr::RawAddr(_val) => { |
| 834 | let mut formatter = formatter.debug_struct("Expr::RawAddr"); |
| 835 | if !_val.attrs.is_empty() { |
| 836 | formatter.field("attrs", Lite(&_val.attrs)); |
| 837 | } |
| 838 | formatter.field("mutability", Lite(&_val.mutability)); |
| 839 | formatter.field("expr", Lite(&_val.expr)); |
| 840 | formatter.finish() |
| 841 | } |
| 842 | syn::Expr::Reference(_val) => { |
| 843 | let mut formatter = formatter.debug_struct("Expr::Reference"); |
| 844 | if !_val.attrs.is_empty() { |
| 845 | formatter.field("attrs", Lite(&_val.attrs)); |
| 846 | } |
| 847 | if _val.mutability.is_some() { |
| 848 | formatter.field("mutability", &Present); |
| 849 | } |
| 850 | formatter.field("expr", Lite(&_val.expr)); |
| 851 | formatter.finish() |
| 852 | } |
| 853 | syn::Expr::Repeat(_val) => { |
| 854 | let mut formatter = formatter.debug_struct("Expr::Repeat"); |
| 855 | if !_val.attrs.is_empty() { |
| 856 | formatter.field("attrs", Lite(&_val.attrs)); |
| 857 | } |
| 858 | formatter.field("expr", Lite(&_val.expr)); |
| 859 | formatter.field("len", Lite(&_val.len)); |
| 860 | formatter.finish() |
| 861 | } |
| 862 | syn::Expr::Return(_val) => { |
| 863 | let mut formatter = formatter.debug_struct("Expr::Return"); |
| 864 | if !_val.attrs.is_empty() { |
| 865 | formatter.field("attrs", Lite(&_val.attrs)); |
| 866 | } |
| 867 | if let Some(val) = &_val.expr { |
| 868 | #[derive(RefCast)] |
| 869 | #[repr(transparent)] |
| 870 | struct Print(Box<syn::Expr>); |
| 871 | impl Debug for Print { |
| 872 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 873 | formatter.write_str("Some(")?; |
| 874 | Debug::fmt(Lite(&self.0), formatter)?; |
| 875 | formatter.write_str(")")?; |
| 876 | Ok(()) |
| 877 | } |
| 878 | } |
| 879 | formatter.field("expr", Print::ref_cast(val)); |
| 880 | } |
| 881 | formatter.finish() |
| 882 | } |
| 883 | syn::Expr::Struct(_val) => { |
| 884 | let mut formatter = formatter.debug_struct("Expr::Struct"); |
| 885 | if !_val.attrs.is_empty() { |
| 886 | formatter.field("attrs", Lite(&_val.attrs)); |
| 887 | } |
| 888 | if let Some(val) = &_val.qself { |
| 889 | #[derive(RefCast)] |
| 890 | #[repr(transparent)] |
| 891 | struct Print(syn::QSelf); |
| 892 | impl Debug for Print { |
| 893 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 894 | formatter.write_str("Some(")?; |
| 895 | Debug::fmt(Lite(&self.0), formatter)?; |
| 896 | formatter.write_str(")")?; |
| 897 | Ok(()) |
| 898 | } |
| 899 | } |
| 900 | formatter.field("qself", Print::ref_cast(val)); |
| 901 | } |
| 902 | formatter.field("path", Lite(&_val.path)); |
| 903 | if !_val.fields.is_empty() { |
| 904 | formatter.field("fields", Lite(&_val.fields)); |
| 905 | } |
| 906 | if _val.dot2_token.is_some() { |
| 907 | formatter.field("dot2_token", &Present); |
| 908 | } |
| 909 | if let Some(val) = &_val.rest { |
| 910 | #[derive(RefCast)] |
| 911 | #[repr(transparent)] |
| 912 | struct Print(Box<syn::Expr>); |
| 913 | impl Debug for Print { |
| 914 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 915 | formatter.write_str("Some(")?; |
| 916 | Debug::fmt(Lite(&self.0), formatter)?; |
| 917 | formatter.write_str(")")?; |
| 918 | Ok(()) |
| 919 | } |
| 920 | } |
| 921 | formatter.field("rest", Print::ref_cast(val)); |
| 922 | } |
| 923 | formatter.finish() |
| 924 | } |
| 925 | syn::Expr::Try(_val) => { |
| 926 | let mut formatter = formatter.debug_struct("Expr::Try"); |
| 927 | if !_val.attrs.is_empty() { |
| 928 | formatter.field("attrs", Lite(&_val.attrs)); |
| 929 | } |
| 930 | formatter.field("expr", Lite(&_val.expr)); |
| 931 | formatter.finish() |
| 932 | } |
| 933 | syn::Expr::TryBlock(_val) => { |
| 934 | let mut formatter = formatter.debug_struct("Expr::TryBlock"); |
| 935 | if !_val.attrs.is_empty() { |
| 936 | formatter.field("attrs", Lite(&_val.attrs)); |
| 937 | } |
| 938 | formatter.field("modifiers", Lite(&_val.modifiers)); |
| 939 | formatter.field("block", Lite(&_val.block)); |
| 940 | formatter.finish() |
| 941 | } |
| 942 | syn::Expr::Tuple(_val) => { |
| 943 | let mut formatter = formatter.debug_struct("Expr::Tuple"); |
| 944 | if !_val.attrs.is_empty() { |
| 945 | formatter.field("attrs", Lite(&_val.attrs)); |
| 946 | } |
| 947 | if !_val.elems.is_empty() { |
| 948 | formatter.field("elems", Lite(&_val.elems)); |
| 949 | } |
| 950 | formatter.finish() |
| 951 | } |
| 952 | syn::Expr::Unary(_val) => { |
| 953 | let mut formatter = formatter.debug_struct("Expr::Unary"); |
| 954 | if !_val.attrs.is_empty() { |
| 955 | formatter.field("attrs", Lite(&_val.attrs)); |
| 956 | } |
| 957 | formatter.field("op", Lite(&_val.op)); |
| 958 | formatter.field("expr", Lite(&_val.expr)); |
| 959 | formatter.finish() |
| 960 | } |
| 961 | syn::Expr::Unsafe(_val) => { |
| 962 | let mut formatter = formatter.debug_struct("Expr::Unsafe"); |
| 963 | if !_val.attrs.is_empty() { |
| 964 | formatter.field("attrs", Lite(&_val.attrs)); |
| 965 | } |
| 966 | formatter.field("block", Lite(&_val.block)); |
| 967 | formatter.finish() |
| 968 | } |
| 969 | syn::Expr::Verbatim(_val) => { |
| 970 | formatter.write_str("Expr::Verbatim")?; |
| 971 | formatter.write_str("(`")?; |
| 972 | Display::fmt(_val, formatter)?; |
| 973 | formatter.write_str("`)")?; |
| 974 | Ok(()) |
| 975 | } |
| 976 | syn::Expr::While(_val) => { |
| 977 | let mut formatter = formatter.debug_struct("Expr::While"); |
| 978 | if !_val.attrs.is_empty() { |
| 979 | formatter.field("attrs", Lite(&_val.attrs)); |
| 980 | } |
| 981 | if let Some(val) = &_val.label { |
| 982 | #[derive(RefCast)] |
| 983 | #[repr(transparent)] |
| 984 | struct Print(syn::Label); |
| 985 | impl Debug for Print { |
| 986 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 987 | formatter.write_str("Some(")?; |
| 988 | Debug::fmt(Lite(&self.0), formatter)?; |
| 989 | formatter.write_str(")")?; |
| 990 | Ok(()) |
| 991 | } |
| 992 | } |
| 993 | formatter.field("label", Print::ref_cast(val)); |
| 994 | } |
| 995 | formatter.field("cond", Lite(&_val.cond)); |
| 996 | formatter.field("body", Lite(&_val.body)); |
| 997 | formatter.finish() |
| 998 | } |
| 999 | syn::Expr::Yield(_val) => { |
| 1000 | let mut formatter = formatter.debug_struct("Expr::Yield"); |
| 1001 | if !_val.attrs.is_empty() { |
| 1002 | formatter.field("attrs", Lite(&_val.attrs)); |
| 1003 | } |
| 1004 | if let Some(val) = &_val.expr { |
| 1005 | #[derive(RefCast)] |
| 1006 | #[repr(transparent)] |
| 1007 | struct Print(Box<syn::Expr>); |
| 1008 | impl Debug for Print { |
| 1009 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1010 | formatter.write_str("Some(")?; |
| 1011 | Debug::fmt(Lite(&self.0), formatter)?; |
| 1012 | formatter.write_str(")")?; |
| 1013 | Ok(()) |
| 1014 | } |
| 1015 | } |
| 1016 | formatter.field("expr", Print::ref_cast(val)); |
| 1017 | } |
| 1018 | formatter.finish() |
| 1019 | } |
| 1020 | _ => unreachable!(), |
| 1021 | } |
| 1022 | } |
| 1023 | } |
| 1024 | impl Debug for Lite<syn::ExprArray> { |
| 1025 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1026 | let mut formatter = formatter.debug_struct("ExprArray"); |
| 1027 | if !self.value.attrs.is_empty() { |
| 1028 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1029 | } |
| 1030 | if !self.value.elems.is_empty() { |
| 1031 | formatter.field("elems", Lite(&self.value.elems)); |
| 1032 | } |
| 1033 | formatter.finish() |
| 1034 | } |
| 1035 | } |
| 1036 | impl Debug for Lite<syn::ExprAssign> { |
| 1037 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1038 | let mut formatter = formatter.debug_struct("ExprAssign"); |
| 1039 | if !self.value.attrs.is_empty() { |
| 1040 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1041 | } |
| 1042 | formatter.field("left", Lite(&self.value.left)); |
| 1043 | formatter.field("right", Lite(&self.value.right)); |
| 1044 | formatter.finish() |
| 1045 | } |
| 1046 | } |
| 1047 | impl Debug for Lite<syn::ExprAsync> { |
| 1048 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1049 | let mut formatter = formatter.debug_struct("ExprAsync"); |
| 1050 | if !self.value.attrs.is_empty() { |
| 1051 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1052 | } |
| 1053 | if self.value.capture.is_some() { |
| 1054 | formatter.field("capture", &Present); |
| 1055 | } |
| 1056 | formatter.field("modifiers", Lite(&self.value.modifiers)); |
| 1057 | formatter.field("block", Lite(&self.value.block)); |
| 1058 | formatter.finish() |
| 1059 | } |
| 1060 | } |
| 1061 | impl Debug for Lite<syn::ExprAwait> { |
| 1062 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1063 | let mut formatter = formatter.debug_struct("ExprAwait"); |
| 1064 | if !self.value.attrs.is_empty() { |
| 1065 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1066 | } |
| 1067 | formatter.field("base", Lite(&self.value.base)); |
| 1068 | formatter.finish() |
| 1069 | } |
| 1070 | } |
| 1071 | impl Debug for Lite<syn::ExprBinary> { |
| 1072 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1073 | let mut formatter = formatter.debug_struct("ExprBinary"); |
| 1074 | if !self.value.attrs.is_empty() { |
| 1075 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1076 | } |
| 1077 | formatter.field("left", Lite(&self.value.left)); |
| 1078 | formatter.field("op", Lite(&self.value.op)); |
| 1079 | formatter.field("right", Lite(&self.value.right)); |
| 1080 | formatter.finish() |
| 1081 | } |
| 1082 | } |
| 1083 | impl Debug for Lite<syn::ExprBlock> { |
| 1084 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1085 | let mut formatter = formatter.debug_struct("ExprBlock"); |
| 1086 | if !self.value.attrs.is_empty() { |
| 1087 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1088 | } |
| 1089 | if let Some(val) = &self.value.label { |
| 1090 | #[derive(RefCast)] |
| 1091 | #[repr(transparent)] |
| 1092 | struct Print(syn::Label); |
| 1093 | impl Debug for Print { |
| 1094 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1095 | formatter.write_str("Some(")?; |
| 1096 | Debug::fmt(Lite(&self.0), formatter)?; |
| 1097 | formatter.write_str(")")?; |
| 1098 | Ok(()) |
| 1099 | } |
| 1100 | } |
| 1101 | formatter.field("label", Print::ref_cast(val)); |
| 1102 | } |
| 1103 | formatter.field("block", Lite(&self.value.block)); |
| 1104 | formatter.finish() |
| 1105 | } |
| 1106 | } |
| 1107 | impl Debug for Lite<syn::ExprBreak> { |
| 1108 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1109 | let mut formatter = formatter.debug_struct("ExprBreak"); |
| 1110 | if !self.value.attrs.is_empty() { |
| 1111 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1112 | } |
| 1113 | if let Some(val) = &self.value.label { |
| 1114 | #[derive(RefCast)] |
| 1115 | #[repr(transparent)] |
| 1116 | struct Print(syn::Lifetime); |
| 1117 | impl Debug for Print { |
| 1118 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1119 | formatter.write_str("Some(")?; |
| 1120 | Debug::fmt(Lite(&self.0), formatter)?; |
| 1121 | formatter.write_str(")")?; |
| 1122 | Ok(()) |
| 1123 | } |
| 1124 | } |
| 1125 | formatter.field("label", Print::ref_cast(val)); |
| 1126 | } |
| 1127 | if let Some(val) = &self.value.expr { |
| 1128 | #[derive(RefCast)] |
| 1129 | #[repr(transparent)] |
| 1130 | struct Print(Box<syn::Expr>); |
| 1131 | impl Debug for Print { |
| 1132 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1133 | formatter.write_str("Some(")?; |
| 1134 | Debug::fmt(Lite(&self.0), formatter)?; |
| 1135 | formatter.write_str(")")?; |
| 1136 | Ok(()) |
| 1137 | } |
| 1138 | } |
| 1139 | formatter.field("expr", Print::ref_cast(val)); |
| 1140 | } |
| 1141 | formatter.finish() |
| 1142 | } |
| 1143 | } |
| 1144 | impl Debug for Lite<syn::ExprCall> { |
| 1145 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1146 | let mut formatter = formatter.debug_struct("ExprCall"); |
| 1147 | if !self.value.attrs.is_empty() { |
| 1148 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1149 | } |
| 1150 | formatter.field("func", Lite(&self.value.func)); |
| 1151 | if !self.value.args.is_empty() { |
| 1152 | formatter.field("args", Lite(&self.value.args)); |
| 1153 | } |
| 1154 | formatter.finish() |
| 1155 | } |
| 1156 | } |
| 1157 | impl Debug for Lite<syn::ExprCast> { |
| 1158 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1159 | let mut formatter = formatter.debug_struct("ExprCast"); |
| 1160 | if !self.value.attrs.is_empty() { |
| 1161 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1162 | } |
| 1163 | formatter.field("expr", Lite(&self.value.expr)); |
| 1164 | formatter.field("ty", Lite(&self.value.ty)); |
| 1165 | formatter.finish() |
| 1166 | } |
| 1167 | } |
| 1168 | impl Debug for Lite<syn::ExprClosure> { |
| 1169 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1170 | let mut formatter = formatter.debug_struct("ExprClosure"); |
| 1171 | if !self.value.attrs.is_empty() { |
| 1172 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1173 | } |
| 1174 | if let Some(val) = &self.value.lifetimes { |
| 1175 | #[derive(RefCast)] |
| 1176 | #[repr(transparent)] |
| 1177 | struct Print(syn::BoundLifetimes); |
| 1178 | impl Debug for Print { |
| 1179 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1180 | formatter.write_str("Some(")?; |
| 1181 | Debug::fmt(Lite(&self.0), formatter)?; |
| 1182 | formatter.write_str(")")?; |
| 1183 | Ok(()) |
| 1184 | } |
| 1185 | } |
| 1186 | formatter.field("lifetimes", Print::ref_cast(val)); |
| 1187 | } |
| 1188 | formatter.field("modifiers", Lite(&self.value.modifiers)); |
| 1189 | if self.value.constness.is_some() { |
| 1190 | formatter.field("constness", &Present); |
| 1191 | } |
| 1192 | if self.value.asyncness.is_some() { |
| 1193 | formatter.field("asyncness", &Present); |
| 1194 | } |
| 1195 | if self.value.capture.is_some() { |
| 1196 | formatter.field("capture", &Present); |
| 1197 | } |
| 1198 | if !self.value.inputs.is_empty() { |
| 1199 | formatter.field("inputs", Lite(&self.value.inputs)); |
| 1200 | } |
| 1201 | formatter.field("output", Lite(&self.value.output)); |
| 1202 | formatter.field("body", Lite(&self.value.body)); |
| 1203 | formatter.finish() |
| 1204 | } |
| 1205 | } |
| 1206 | impl Debug for Lite<syn::ExprConst> { |
| 1207 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1208 | let mut formatter = formatter.debug_struct("ExprConst"); |
| 1209 | if !self.value.attrs.is_empty() { |
| 1210 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1211 | } |
| 1212 | formatter.field("modifiers", Lite(&self.value.modifiers)); |
| 1213 | formatter.field("block", Lite(&self.value.block)); |
| 1214 | formatter.finish() |
| 1215 | } |
| 1216 | } |
| 1217 | impl Debug for Lite<syn::ExprContinue> { |
| 1218 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1219 | let mut formatter = formatter.debug_struct("ExprContinue"); |
| 1220 | if !self.value.attrs.is_empty() { |
| 1221 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1222 | } |
| 1223 | if let Some(val) = &self.value.label { |
| 1224 | #[derive(RefCast)] |
| 1225 | #[repr(transparent)] |
| 1226 | struct Print(syn::Lifetime); |
| 1227 | impl Debug for Print { |
| 1228 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1229 | formatter.write_str("Some(")?; |
| 1230 | Debug::fmt(Lite(&self.0), formatter)?; |
| 1231 | formatter.write_str(")")?; |
| 1232 | Ok(()) |
| 1233 | } |
| 1234 | } |
| 1235 | formatter.field("label", Print::ref_cast(val)); |
| 1236 | } |
| 1237 | formatter.finish() |
| 1238 | } |
| 1239 | } |
| 1240 | impl Debug for Lite<syn::ExprField> { |
| 1241 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1242 | let mut formatter = formatter.debug_struct("ExprField"); |
| 1243 | if !self.value.attrs.is_empty() { |
| 1244 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1245 | } |
| 1246 | formatter.field("base", Lite(&self.value.base)); |
| 1247 | formatter.field("member", Lite(&self.value.member)); |
| 1248 | formatter.finish() |
| 1249 | } |
| 1250 | } |
| 1251 | impl Debug for Lite<syn::ExprForLoop> { |
| 1252 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1253 | let mut formatter = formatter.debug_struct("ExprForLoop"); |
| 1254 | if !self.value.attrs.is_empty() { |
| 1255 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1256 | } |
| 1257 | if let Some(val) = &self.value.label { |
| 1258 | #[derive(RefCast)] |
| 1259 | #[repr(transparent)] |
| 1260 | struct Print(syn::Label); |
| 1261 | impl Debug for Print { |
| 1262 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1263 | formatter.write_str("Some(")?; |
| 1264 | Debug::fmt(Lite(&self.0), formatter)?; |
| 1265 | formatter.write_str(")")?; |
| 1266 | Ok(()) |
| 1267 | } |
| 1268 | } |
| 1269 | formatter.field("label", Print::ref_cast(val)); |
| 1270 | } |
| 1271 | formatter.field("pat", Lite(&self.value.pat)); |
| 1272 | formatter.field("expr", Lite(&self.value.expr)); |
| 1273 | formatter.field("body", Lite(&self.value.body)); |
| 1274 | formatter.finish() |
| 1275 | } |
| 1276 | } |
| 1277 | impl Debug for Lite<syn::ExprGroup> { |
| 1278 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1279 | let mut formatter = formatter.debug_struct("ExprGroup"); |
| 1280 | if !self.value.attrs.is_empty() { |
| 1281 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1282 | } |
| 1283 | formatter.field("expr", Lite(&self.value.expr)); |
| 1284 | formatter.finish() |
| 1285 | } |
| 1286 | } |
| 1287 | impl Debug for Lite<syn::ExprIf> { |
| 1288 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1289 | let mut formatter = formatter.debug_struct("ExprIf"); |
| 1290 | if !self.value.attrs.is_empty() { |
| 1291 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1292 | } |
| 1293 | formatter.field("cond", Lite(&self.value.cond)); |
| 1294 | formatter.field("then_branch", Lite(&self.value.then_branch)); |
| 1295 | if let Some(val) = &self.value.else_branch { |
| 1296 | #[derive(RefCast)] |
| 1297 | #[repr(transparent)] |
| 1298 | struct Print((syn::token::Else, Box<syn::Expr>)); |
| 1299 | impl Debug for Print { |
| 1300 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1301 | formatter.write_str("Some(")?; |
| 1302 | Debug::fmt(Lite(&self.0.1), formatter)?; |
| 1303 | formatter.write_str(")")?; |
| 1304 | Ok(()) |
| 1305 | } |
| 1306 | } |
| 1307 | formatter.field("else_branch", Print::ref_cast(val)); |
| 1308 | } |
| 1309 | formatter.finish() |
| 1310 | } |
| 1311 | } |
| 1312 | impl Debug for Lite<syn::ExprIndex> { |
| 1313 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1314 | let mut formatter = formatter.debug_struct("ExprIndex"); |
| 1315 | if !self.value.attrs.is_empty() { |
| 1316 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1317 | } |
| 1318 | formatter.field("expr", Lite(&self.value.expr)); |
| 1319 | formatter.field("index", Lite(&self.value.index)); |
| 1320 | formatter.finish() |
| 1321 | } |
| 1322 | } |
| 1323 | impl Debug for Lite<syn::ExprInfer> { |
| 1324 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1325 | let mut formatter = formatter.debug_struct("ExprInfer"); |
| 1326 | if !self.value.attrs.is_empty() { |
| 1327 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1328 | } |
| 1329 | formatter.finish() |
| 1330 | } |
| 1331 | } |
| 1332 | impl Debug for Lite<syn::ExprLet> { |
| 1333 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1334 | let mut formatter = formatter.debug_struct("ExprLet"); |
| 1335 | if !self.value.attrs.is_empty() { |
| 1336 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1337 | } |
| 1338 | formatter.field("pat", Lite(&self.value.pat)); |
| 1339 | formatter.field("expr", Lite(&self.value.expr)); |
| 1340 | formatter.finish() |
| 1341 | } |
| 1342 | } |
| 1343 | impl Debug for Lite<syn::ExprLit> { |
| 1344 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1345 | let mut formatter = formatter.debug_struct("ExprLit"); |
| 1346 | if !self.value.attrs.is_empty() { |
| 1347 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1348 | } |
| 1349 | formatter.field("lit", Lite(&self.value.lit)); |
| 1350 | formatter.finish() |
| 1351 | } |
| 1352 | } |
| 1353 | impl Debug for Lite<syn::ExprLoop> { |
| 1354 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1355 | let mut formatter = formatter.debug_struct("ExprLoop"); |
| 1356 | if !self.value.attrs.is_empty() { |
| 1357 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1358 | } |
| 1359 | if let Some(val) = &self.value.label { |
| 1360 | #[derive(RefCast)] |
| 1361 | #[repr(transparent)] |
| 1362 | struct Print(syn::Label); |
| 1363 | impl Debug for Print { |
| 1364 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1365 | formatter.write_str("Some(")?; |
| 1366 | Debug::fmt(Lite(&self.0), formatter)?; |
| 1367 | formatter.write_str(")")?; |
| 1368 | Ok(()) |
| 1369 | } |
| 1370 | } |
| 1371 | formatter.field("label", Print::ref_cast(val)); |
| 1372 | } |
| 1373 | formatter.field("body", Lite(&self.value.body)); |
| 1374 | formatter.finish() |
| 1375 | } |
| 1376 | } |
| 1377 | impl Debug for Lite<syn::ExprMacro> { |
| 1378 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1379 | let mut formatter = formatter.debug_struct("ExprMacro"); |
| 1380 | if !self.value.attrs.is_empty() { |
| 1381 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1382 | } |
| 1383 | formatter.field("mac", Lite(&self.value.mac)); |
| 1384 | formatter.finish() |
| 1385 | } |
| 1386 | } |
| 1387 | impl Debug for Lite<syn::ExprMatch> { |
| 1388 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1389 | let mut formatter = formatter.debug_struct("ExprMatch"); |
| 1390 | if !self.value.attrs.is_empty() { |
| 1391 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1392 | } |
| 1393 | formatter.field("expr", Lite(&self.value.expr)); |
| 1394 | if !self.value.arms.is_empty() { |
| 1395 | formatter.field("arms", Lite(&self.value.arms)); |
| 1396 | } |
| 1397 | formatter.finish() |
| 1398 | } |
| 1399 | } |
| 1400 | impl Debug for Lite<syn::ExprMethodCall> { |
| 1401 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1402 | let mut formatter = formatter.debug_struct("ExprMethodCall"); |
| 1403 | if !self.value.attrs.is_empty() { |
| 1404 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1405 | } |
| 1406 | formatter.field("receiver", Lite(&self.value.receiver)); |
| 1407 | formatter.field("method", Lite(&self.value.method)); |
| 1408 | if let Some(val) = &self.value.turbofish { |
| 1409 | #[derive(RefCast)] |
| 1410 | #[repr(transparent)] |
| 1411 | struct Print(syn::AngleBracketedGenericArguments); |
| 1412 | impl Debug for Print { |
| 1413 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1414 | formatter.write_str("Some(")?; |
| 1415 | Debug::fmt(Lite(&self.0), formatter)?; |
| 1416 | formatter.write_str(")")?; |
| 1417 | Ok(()) |
| 1418 | } |
| 1419 | } |
| 1420 | formatter.field("turbofish", Print::ref_cast(val)); |
| 1421 | } |
| 1422 | if !self.value.args.is_empty() { |
| 1423 | formatter.field("args", Lite(&self.value.args)); |
| 1424 | } |
| 1425 | formatter.finish() |
| 1426 | } |
| 1427 | } |
| 1428 | impl Debug for Lite<syn::ExprParen> { |
| 1429 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1430 | let mut formatter = formatter.debug_struct("ExprParen"); |
| 1431 | if !self.value.attrs.is_empty() { |
| 1432 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1433 | } |
| 1434 | formatter.field("expr", Lite(&self.value.expr)); |
| 1435 | formatter.finish() |
| 1436 | } |
| 1437 | } |
| 1438 | impl Debug for Lite<syn::ExprPath> { |
| 1439 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1440 | let mut formatter = formatter.debug_struct("ExprPath"); |
| 1441 | if !self.value.attrs.is_empty() { |
| 1442 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1443 | } |
| 1444 | if let Some(val) = &self.value.qself { |
| 1445 | #[derive(RefCast)] |
| 1446 | #[repr(transparent)] |
| 1447 | struct Print(syn::QSelf); |
| 1448 | impl Debug for Print { |
| 1449 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1450 | formatter.write_str("Some(")?; |
| 1451 | Debug::fmt(Lite(&self.0), formatter)?; |
| 1452 | formatter.write_str(")")?; |
| 1453 | Ok(()) |
| 1454 | } |
| 1455 | } |
| 1456 | formatter.field("qself", Print::ref_cast(val)); |
| 1457 | } |
| 1458 | formatter.field("path", Lite(&self.value.path)); |
| 1459 | formatter.finish() |
| 1460 | } |
| 1461 | } |
| 1462 | impl Debug for Lite<syn::ExprRange> { |
| 1463 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1464 | let mut formatter = formatter.debug_struct("ExprRange"); |
| 1465 | if !self.value.attrs.is_empty() { |
| 1466 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1467 | } |
| 1468 | if let Some(val) = &self.value.start { |
| 1469 | #[derive(RefCast)] |
| 1470 | #[repr(transparent)] |
| 1471 | struct Print(Box<syn::Expr>); |
| 1472 | impl Debug for Print { |
| 1473 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1474 | formatter.write_str("Some(")?; |
| 1475 | Debug::fmt(Lite(&self.0), formatter)?; |
| 1476 | formatter.write_str(")")?; |
| 1477 | Ok(()) |
| 1478 | } |
| 1479 | } |
| 1480 | formatter.field("start", Print::ref_cast(val)); |
| 1481 | } |
| 1482 | formatter.field("limits", Lite(&self.value.limits)); |
| 1483 | if let Some(val) = &self.value.end { |
| 1484 | #[derive(RefCast)] |
| 1485 | #[repr(transparent)] |
| 1486 | struct Print(Box<syn::Expr>); |
| 1487 | impl Debug for Print { |
| 1488 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1489 | formatter.write_str("Some(")?; |
| 1490 | Debug::fmt(Lite(&self.0), formatter)?; |
| 1491 | formatter.write_str(")")?; |
| 1492 | Ok(()) |
| 1493 | } |
| 1494 | } |
| 1495 | formatter.field("end", Print::ref_cast(val)); |
| 1496 | } |
| 1497 | formatter.finish() |
| 1498 | } |
| 1499 | } |
| 1500 | impl Debug for Lite<syn::ExprRawAddr> { |
| 1501 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1502 | let mut formatter = formatter.debug_struct("ExprRawAddr"); |
| 1503 | if !self.value.attrs.is_empty() { |
| 1504 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1505 | } |
| 1506 | formatter.field("mutability", Lite(&self.value.mutability)); |
| 1507 | formatter.field("expr", Lite(&self.value.expr)); |
| 1508 | formatter.finish() |
| 1509 | } |
| 1510 | } |
| 1511 | impl Debug for Lite<syn::ExprReference> { |
| 1512 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1513 | let mut formatter = formatter.debug_struct("ExprReference"); |
| 1514 | if !self.value.attrs.is_empty() { |
| 1515 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1516 | } |
| 1517 | if self.value.mutability.is_some() { |
| 1518 | formatter.field("mutability", &Present); |
| 1519 | } |
| 1520 | formatter.field("expr", Lite(&self.value.expr)); |
| 1521 | formatter.finish() |
| 1522 | } |
| 1523 | } |
| 1524 | impl Debug for Lite<syn::ExprRepeat> { |
| 1525 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1526 | let mut formatter = formatter.debug_struct("ExprRepeat"); |
| 1527 | if !self.value.attrs.is_empty() { |
| 1528 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1529 | } |
| 1530 | formatter.field("expr", Lite(&self.value.expr)); |
| 1531 | formatter.field("len", Lite(&self.value.len)); |
| 1532 | formatter.finish() |
| 1533 | } |
| 1534 | } |
| 1535 | impl Debug for Lite<syn::ExprReturn> { |
| 1536 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1537 | let mut formatter = formatter.debug_struct("ExprReturn"); |
| 1538 | if !self.value.attrs.is_empty() { |
| 1539 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1540 | } |
| 1541 | if let Some(val) = &self.value.expr { |
| 1542 | #[derive(RefCast)] |
| 1543 | #[repr(transparent)] |
| 1544 | struct Print(Box<syn::Expr>); |
| 1545 | impl Debug for Print { |
| 1546 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1547 | formatter.write_str("Some(")?; |
| 1548 | Debug::fmt(Lite(&self.0), formatter)?; |
| 1549 | formatter.write_str(")")?; |
| 1550 | Ok(()) |
| 1551 | } |
| 1552 | } |
| 1553 | formatter.field("expr", Print::ref_cast(val)); |
| 1554 | } |
| 1555 | formatter.finish() |
| 1556 | } |
| 1557 | } |
| 1558 | impl Debug for Lite<syn::ExprStruct> { |
| 1559 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1560 | let mut formatter = formatter.debug_struct("ExprStruct"); |
| 1561 | if !self.value.attrs.is_empty() { |
| 1562 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1563 | } |
| 1564 | if let Some(val) = &self.value.qself { |
| 1565 | #[derive(RefCast)] |
| 1566 | #[repr(transparent)] |
| 1567 | struct Print(syn::QSelf); |
| 1568 | impl Debug for Print { |
| 1569 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1570 | formatter.write_str("Some(")?; |
| 1571 | Debug::fmt(Lite(&self.0), formatter)?; |
| 1572 | formatter.write_str(")")?; |
| 1573 | Ok(()) |
| 1574 | } |
| 1575 | } |
| 1576 | formatter.field("qself", Print::ref_cast(val)); |
| 1577 | } |
| 1578 | formatter.field("path", Lite(&self.value.path)); |
| 1579 | if !self.value.fields.is_empty() { |
| 1580 | formatter.field("fields", Lite(&self.value.fields)); |
| 1581 | } |
| 1582 | if self.value.dot2_token.is_some() { |
| 1583 | formatter.field("dot2_token", &Present); |
| 1584 | } |
| 1585 | if let Some(val) = &self.value.rest { |
| 1586 | #[derive(RefCast)] |
| 1587 | #[repr(transparent)] |
| 1588 | struct Print(Box<syn::Expr>); |
| 1589 | impl Debug for Print { |
| 1590 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1591 | formatter.write_str("Some(")?; |
| 1592 | Debug::fmt(Lite(&self.0), formatter)?; |
| 1593 | formatter.write_str(")")?; |
| 1594 | Ok(()) |
| 1595 | } |
| 1596 | } |
| 1597 | formatter.field("rest", Print::ref_cast(val)); |
| 1598 | } |
| 1599 | formatter.finish() |
| 1600 | } |
| 1601 | } |
| 1602 | impl Debug for Lite<syn::ExprTry> { |
| 1603 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1604 | let mut formatter = formatter.debug_struct("ExprTry"); |
| 1605 | if !self.value.attrs.is_empty() { |
| 1606 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1607 | } |
| 1608 | formatter.field("expr", Lite(&self.value.expr)); |
| 1609 | formatter.finish() |
| 1610 | } |
| 1611 | } |
| 1612 | impl Debug for Lite<syn::ExprTryBlock> { |
| 1613 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1614 | let mut formatter = formatter.debug_struct("ExprTryBlock"); |
| 1615 | if !self.value.attrs.is_empty() { |
| 1616 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1617 | } |
| 1618 | formatter.field("modifiers", Lite(&self.value.modifiers)); |
| 1619 | formatter.field("block", Lite(&self.value.block)); |
| 1620 | formatter.finish() |
| 1621 | } |
| 1622 | } |
| 1623 | impl Debug for Lite<syn::ExprTuple> { |
| 1624 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1625 | let mut formatter = formatter.debug_struct("ExprTuple"); |
| 1626 | if !self.value.attrs.is_empty() { |
| 1627 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1628 | } |
| 1629 | if !self.value.elems.is_empty() { |
| 1630 | formatter.field("elems", Lite(&self.value.elems)); |
| 1631 | } |
| 1632 | formatter.finish() |
| 1633 | } |
| 1634 | } |
| 1635 | impl Debug for Lite<syn::ExprUnary> { |
| 1636 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1637 | let mut formatter = formatter.debug_struct("ExprUnary"); |
| 1638 | if !self.value.attrs.is_empty() { |
| 1639 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1640 | } |
| 1641 | formatter.field("op", Lite(&self.value.op)); |
| 1642 | formatter.field("expr", Lite(&self.value.expr)); |
| 1643 | formatter.finish() |
| 1644 | } |
| 1645 | } |
| 1646 | impl Debug for Lite<syn::ExprUnsafe> { |
| 1647 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1648 | let mut formatter = formatter.debug_struct("ExprUnsafe"); |
| 1649 | if !self.value.attrs.is_empty() { |
| 1650 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1651 | } |
| 1652 | formatter.field("block", Lite(&self.value.block)); |
| 1653 | formatter.finish() |
| 1654 | } |
| 1655 | } |
| 1656 | impl Debug for Lite<syn::ExprWhile> { |
| 1657 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1658 | let mut formatter = formatter.debug_struct("ExprWhile"); |
| 1659 | if !self.value.attrs.is_empty() { |
| 1660 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1661 | } |
| 1662 | if let Some(val) = &self.value.label { |
| 1663 | #[derive(RefCast)] |
| 1664 | #[repr(transparent)] |
| 1665 | struct Print(syn::Label); |
| 1666 | impl Debug for Print { |
| 1667 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1668 | formatter.write_str("Some(")?; |
| 1669 | Debug::fmt(Lite(&self.0), formatter)?; |
| 1670 | formatter.write_str(")")?; |
| 1671 | Ok(()) |
| 1672 | } |
| 1673 | } |
| 1674 | formatter.field("label", Print::ref_cast(val)); |
| 1675 | } |
| 1676 | formatter.field("cond", Lite(&self.value.cond)); |
| 1677 | formatter.field("body", Lite(&self.value.body)); |
| 1678 | formatter.finish() |
| 1679 | } |
| 1680 | } |
| 1681 | impl Debug for Lite<syn::ExprYield> { |
| 1682 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1683 | let mut formatter = formatter.debug_struct("ExprYield"); |
| 1684 | if !self.value.attrs.is_empty() { |
| 1685 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1686 | } |
| 1687 | if let Some(val) = &self.value.expr { |
| 1688 | #[derive(RefCast)] |
| 1689 | #[repr(transparent)] |
| 1690 | struct Print(Box<syn::Expr>); |
| 1691 | impl Debug for Print { |
| 1692 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1693 | formatter.write_str("Some(")?; |
| 1694 | Debug::fmt(Lite(&self.0), formatter)?; |
| 1695 | formatter.write_str(")")?; |
| 1696 | Ok(()) |
| 1697 | } |
| 1698 | } |
| 1699 | formatter.field("expr", Print::ref_cast(val)); |
| 1700 | } |
| 1701 | formatter.finish() |
| 1702 | } |
| 1703 | } |
| 1704 | impl Debug for Lite<syn::Field> { |
| 1705 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1706 | let mut formatter = formatter.debug_struct("Field"); |
| 1707 | if !self.value.attrs.is_empty() { |
| 1708 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1709 | } |
| 1710 | formatter.field("vis", Lite(&self.value.vis)); |
| 1711 | formatter.field("modifiers", Lite(&self.value.modifiers)); |
| 1712 | if let Some(val) = &self.value.ident { |
| 1713 | #[derive(RefCast)] |
| 1714 | #[repr(transparent)] |
| 1715 | struct Print(proc_macro2::Ident); |
| 1716 | impl Debug for Print { |
| 1717 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1718 | formatter.write_str("Some(")?; |
| 1719 | Debug::fmt(Lite(&self.0), formatter)?; |
| 1720 | formatter.write_str(")")?; |
| 1721 | Ok(()) |
| 1722 | } |
| 1723 | } |
| 1724 | formatter.field("ident", Print::ref_cast(val)); |
| 1725 | } |
| 1726 | if self.value.colon_token.is_some() { |
| 1727 | formatter.field("colon_token", &Present); |
| 1728 | } |
| 1729 | formatter.field("ty", Lite(&self.value.ty)); |
| 1730 | if let Some(val) = &self.value.default { |
| 1731 | #[derive(RefCast)] |
| 1732 | #[repr(transparent)] |
| 1733 | struct Print((syn::token::Eq, syn::Expr)); |
| 1734 | impl Debug for Print { |
| 1735 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1736 | formatter.write_str("Some(")?; |
| 1737 | Debug::fmt(Lite(&self.0.1), formatter)?; |
| 1738 | formatter.write_str(")")?; |
| 1739 | Ok(()) |
| 1740 | } |
| 1741 | } |
| 1742 | formatter.field("default", Print::ref_cast(val)); |
| 1743 | } |
| 1744 | formatter.finish() |
| 1745 | } |
| 1746 | } |
| 1747 | impl Debug for Lite<syn::FieldModifiers> { |
| 1748 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1749 | let mut formatter = formatter.debug_struct("FieldModifiers"); |
| 1750 | formatter.finish() |
| 1751 | } |
| 1752 | } |
| 1753 | impl Debug for Lite<syn::FieldPat> { |
| 1754 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1755 | let mut formatter = formatter.debug_struct("FieldPat"); |
| 1756 | if !self.value.attrs.is_empty() { |
| 1757 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1758 | } |
| 1759 | formatter.field("member", Lite(&self.value.member)); |
| 1760 | if self.value.colon_token.is_some() { |
| 1761 | formatter.field("colon_token", &Present); |
| 1762 | } |
| 1763 | formatter.field("pat", Lite(&self.value.pat)); |
| 1764 | formatter.finish() |
| 1765 | } |
| 1766 | } |
| 1767 | impl Debug for Lite<syn::FieldValue> { |
| 1768 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1769 | let mut formatter = formatter.debug_struct("FieldValue"); |
| 1770 | if !self.value.attrs.is_empty() { |
| 1771 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1772 | } |
| 1773 | formatter.field("member", Lite(&self.value.member)); |
| 1774 | if self.value.colon_token.is_some() { |
| 1775 | formatter.field("colon_token", &Present); |
| 1776 | } |
| 1777 | formatter.field("expr", Lite(&self.value.expr)); |
| 1778 | formatter.finish() |
| 1779 | } |
| 1780 | } |
| 1781 | impl Debug for Lite<syn::Fields> { |
| 1782 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1783 | match &self.value { |
| 1784 | syn::Fields::Named(_val) => { |
| 1785 | let mut formatter = formatter.debug_struct("Fields::Named"); |
| 1786 | if !_val.named.is_empty() { |
| 1787 | formatter.field("named", Lite(&_val.named)); |
| 1788 | } |
| 1789 | formatter.finish() |
| 1790 | } |
| 1791 | syn::Fields::Unnamed(_val) => { |
| 1792 | let mut formatter = formatter.debug_struct("Fields::Unnamed"); |
| 1793 | if !_val.unnamed.is_empty() { |
| 1794 | formatter.field("unnamed", Lite(&_val.unnamed)); |
| 1795 | } |
| 1796 | formatter.finish() |
| 1797 | } |
| 1798 | syn::Fields::Unit => formatter.write_str("Fields::Unit"), |
| 1799 | } |
| 1800 | } |
| 1801 | } |
| 1802 | impl Debug for Lite<syn::FieldsNamed> { |
| 1803 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1804 | let mut formatter = formatter.debug_struct("FieldsNamed"); |
| 1805 | if !self.value.named.is_empty() { |
| 1806 | formatter.field("named", Lite(&self.value.named)); |
| 1807 | } |
| 1808 | formatter.finish() |
| 1809 | } |
| 1810 | } |
| 1811 | impl Debug for Lite<syn::FieldsUnnamed> { |
| 1812 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1813 | let mut formatter = formatter.debug_struct("FieldsUnnamed"); |
| 1814 | if !self.value.unnamed.is_empty() { |
| 1815 | formatter.field("unnamed", Lite(&self.value.unnamed)); |
| 1816 | } |
| 1817 | formatter.finish() |
| 1818 | } |
| 1819 | } |
| 1820 | impl Debug for Lite<syn::File> { |
| 1821 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1822 | let mut formatter = formatter.debug_struct("File"); |
| 1823 | if let Some(val) = &self.value.shebang { |
| 1824 | #[derive(RefCast)] |
| 1825 | #[repr(transparent)] |
| 1826 | struct Print(String); |
| 1827 | impl Debug for Print { |
| 1828 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1829 | formatter.write_str("Some(")?; |
| 1830 | Debug::fmt(Lite(&self.0), formatter)?; |
| 1831 | formatter.write_str(")")?; |
| 1832 | Ok(()) |
| 1833 | } |
| 1834 | } |
| 1835 | formatter.field("shebang", Print::ref_cast(val)); |
| 1836 | } |
| 1837 | if let Some(val) = &self.value.frontmatter { |
| 1838 | #[derive(RefCast)] |
| 1839 | #[repr(transparent)] |
| 1840 | struct Print(syn::Frontmatter); |
| 1841 | impl Debug for Print { |
| 1842 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1843 | formatter.write_str("Some(")?; |
| 1844 | Debug::fmt(Lite(&self.0), formatter)?; |
| 1845 | formatter.write_str(")")?; |
| 1846 | Ok(()) |
| 1847 | } |
| 1848 | } |
| 1849 | formatter.field("frontmatter", Print::ref_cast(val)); |
| 1850 | } |
| 1851 | if !self.value.attrs.is_empty() { |
| 1852 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1853 | } |
| 1854 | if !self.value.items.is_empty() { |
| 1855 | formatter.field("items", Lite(&self.value.items)); |
| 1856 | } |
| 1857 | formatter.finish() |
| 1858 | } |
| 1859 | } |
| 1860 | impl Debug for Lite<syn::FnArg> { |
| 1861 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1862 | match &self.value { |
| 1863 | syn::FnArg::Receiver(_val) => { |
| 1864 | formatter.write_str("FnArg::Receiver")?; |
| 1865 | formatter.write_str("(")?; |
| 1866 | Debug::fmt(Lite(_val), formatter)?; |
| 1867 | formatter.write_str(")")?; |
| 1868 | Ok(()) |
| 1869 | } |
| 1870 | syn::FnArg::Typed(_val) => { |
| 1871 | formatter.write_str("FnArg::Typed")?; |
| 1872 | formatter.write_str("(")?; |
| 1873 | Debug::fmt(Lite(_val), formatter)?; |
| 1874 | formatter.write_str(")")?; |
| 1875 | Ok(()) |
| 1876 | } |
| 1877 | } |
| 1878 | } |
| 1879 | } |
| 1880 | impl Debug for Lite<syn::FnModifiers> { |
| 1881 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1882 | let mut formatter = formatter.debug_struct("FnModifiers"); |
| 1883 | if self.value.defaultness.is_some() { |
| 1884 | formatter.field("defaultness", &Present); |
| 1885 | } |
| 1886 | formatter.finish() |
| 1887 | } |
| 1888 | } |
| 1889 | impl Debug for Lite<syn::FnPtrVariadic> { |
| 1890 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1891 | let mut formatter = formatter.debug_struct("FnPtrVariadic"); |
| 1892 | if !self.value.attrs.is_empty() { |
| 1893 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1894 | } |
| 1895 | if let Some(val) = &self.value.name { |
| 1896 | #[derive(RefCast)] |
| 1897 | #[repr(transparent)] |
| 1898 | struct Print((proc_macro2::Ident, syn::token::Colon)); |
| 1899 | impl Debug for Print { |
| 1900 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1901 | formatter.write_str("Some(")?; |
| 1902 | Debug::fmt(Lite(&self.0.0), formatter)?; |
| 1903 | formatter.write_str(")")?; |
| 1904 | Ok(()) |
| 1905 | } |
| 1906 | } |
| 1907 | formatter.field("name", Print::ref_cast(val)); |
| 1908 | } |
| 1909 | if self.value.comma.is_some() { |
| 1910 | formatter.field("comma", &Present); |
| 1911 | } |
| 1912 | formatter.finish() |
| 1913 | } |
| 1914 | } |
| 1915 | impl Debug for Lite<syn::ForeignItem> { |
| 1916 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1917 | match &self.value { |
| 1918 | syn::ForeignItem::Fn(_val) => { |
| 1919 | let mut formatter = formatter.debug_struct("ForeignItem::Fn"); |
| 1920 | if !_val.attrs.is_empty() { |
| 1921 | formatter.field("attrs", Lite(&_val.attrs)); |
| 1922 | } |
| 1923 | formatter.field("vis", Lite(&_val.vis)); |
| 1924 | formatter.field("modifiers", Lite(&_val.modifiers)); |
| 1925 | formatter.field("sig", Lite(&_val.sig)); |
| 1926 | formatter.finish() |
| 1927 | } |
| 1928 | syn::ForeignItem::Static(_val) => { |
| 1929 | let mut formatter = formatter.debug_struct("ForeignItem::Static"); |
| 1930 | if !_val.attrs.is_empty() { |
| 1931 | formatter.field("attrs", Lite(&_val.attrs)); |
| 1932 | } |
| 1933 | formatter.field("vis", Lite(&_val.vis)); |
| 1934 | formatter.field("safety", Lite(&_val.safety)); |
| 1935 | match _val.mutability { |
| 1936 | syn::StaticMutability::None => {} |
| 1937 | _ => { |
| 1938 | formatter.field("mutability", Lite(&_val.mutability)); |
| 1939 | } |
| 1940 | } |
| 1941 | formatter.field("ident", Lite(&_val.ident)); |
| 1942 | formatter.field("ty", Lite(&_val.ty)); |
| 1943 | formatter.finish() |
| 1944 | } |
| 1945 | syn::ForeignItem::Type(_val) => { |
| 1946 | let mut formatter = formatter.debug_struct("ForeignItem::Type"); |
| 1947 | if !_val.attrs.is_empty() { |
| 1948 | formatter.field("attrs", Lite(&_val.attrs)); |
| 1949 | } |
| 1950 | formatter.field("vis", Lite(&_val.vis)); |
| 1951 | formatter.field("modifiers", Lite(&_val.modifiers)); |
| 1952 | formatter.field("ident", Lite(&_val.ident)); |
| 1953 | formatter.field("generics", Lite(&_val.generics)); |
| 1954 | formatter.finish() |
| 1955 | } |
| 1956 | syn::ForeignItem::Macro(_val) => { |
| 1957 | let mut formatter = formatter.debug_struct("ForeignItem::Macro"); |
| 1958 | if !_val.attrs.is_empty() { |
| 1959 | formatter.field("attrs", Lite(&_val.attrs)); |
| 1960 | } |
| 1961 | formatter.field("mac", Lite(&_val.mac)); |
| 1962 | if _val.semi_token.is_some() { |
| 1963 | formatter.field("semi_token", &Present); |
| 1964 | } |
| 1965 | formatter.finish() |
| 1966 | } |
| 1967 | syn::ForeignItem::Verbatim(_val) => { |
| 1968 | formatter.write_str("ForeignItem::Verbatim")?; |
| 1969 | formatter.write_str("(`")?; |
| 1970 | Display::fmt(_val, formatter)?; |
| 1971 | formatter.write_str("`)")?; |
| 1972 | Ok(()) |
| 1973 | } |
| 1974 | _ => unreachable!(), |
| 1975 | } |
| 1976 | } |
| 1977 | } |
| 1978 | impl Debug for Lite<syn::ForeignItemFn> { |
| 1979 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1980 | let mut formatter = formatter.debug_struct("ForeignItemFn"); |
| 1981 | if !self.value.attrs.is_empty() { |
| 1982 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1983 | } |
| 1984 | formatter.field("vis", Lite(&self.value.vis)); |
| 1985 | formatter.field("modifiers", Lite(&self.value.modifiers)); |
| 1986 | formatter.field("sig", Lite(&self.value.sig)); |
| 1987 | formatter.finish() |
| 1988 | } |
| 1989 | } |
| 1990 | impl Debug for Lite<syn::ForeignItemMacro> { |
| 1991 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 1992 | let mut formatter = formatter.debug_struct("ForeignItemMacro"); |
| 1993 | if !self.value.attrs.is_empty() { |
| 1994 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 1995 | } |
| 1996 | formatter.field("mac", Lite(&self.value.mac)); |
| 1997 | if self.value.semi_token.is_some() { |
| 1998 | formatter.field("semi_token", &Present); |
| 1999 | } |
| 2000 | formatter.finish() |
| 2001 | } |
| 2002 | } |
| 2003 | impl Debug for Lite<syn::ForeignItemStatic> { |
| 2004 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2005 | let mut formatter = formatter.debug_struct("ForeignItemStatic"); |
| 2006 | if !self.value.attrs.is_empty() { |
| 2007 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 2008 | } |
| 2009 | formatter.field("vis", Lite(&self.value.vis)); |
| 2010 | formatter.field("safety", Lite(&self.value.safety)); |
| 2011 | match self.value.mutability { |
| 2012 | syn::StaticMutability::None => {} |
| 2013 | _ => { |
| 2014 | formatter.field("mutability", Lite(&self.value.mutability)); |
| 2015 | } |
| 2016 | } |
| 2017 | formatter.field("ident", Lite(&self.value.ident)); |
| 2018 | formatter.field("ty", Lite(&self.value.ty)); |
| 2019 | formatter.finish() |
| 2020 | } |
| 2021 | } |
| 2022 | impl Debug for Lite<syn::ForeignItemType> { |
| 2023 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2024 | let mut formatter = formatter.debug_struct("ForeignItemType"); |
| 2025 | if !self.value.attrs.is_empty() { |
| 2026 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 2027 | } |
| 2028 | formatter.field("vis", Lite(&self.value.vis)); |
| 2029 | formatter.field("modifiers", Lite(&self.value.modifiers)); |
| 2030 | formatter.field("ident", Lite(&self.value.ident)); |
| 2031 | formatter.field("generics", Lite(&self.value.generics)); |
| 2032 | formatter.finish() |
| 2033 | } |
| 2034 | } |
| 2035 | impl Debug for Lite<syn::Frontmatter> { |
| 2036 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2037 | let mut formatter = formatter.debug_struct("Frontmatter"); |
| 2038 | formatter.finish() |
| 2039 | } |
| 2040 | } |
| 2041 | impl Debug for Lite<syn::GenericArgument> { |
| 2042 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2043 | match &self.value { |
| 2044 | syn::GenericArgument::Lifetime(_val) => { |
| 2045 | formatter.write_str("GenericArgument::Lifetime")?; |
| 2046 | formatter.write_str("(")?; |
| 2047 | Debug::fmt(Lite(_val), formatter)?; |
| 2048 | formatter.write_str(")")?; |
| 2049 | Ok(()) |
| 2050 | } |
| 2051 | syn::GenericArgument::Type(_val) => { |
| 2052 | formatter.write_str("GenericArgument::Type")?; |
| 2053 | formatter.write_str("(")?; |
| 2054 | Debug::fmt(Lite(_val), formatter)?; |
| 2055 | formatter.write_str(")")?; |
| 2056 | Ok(()) |
| 2057 | } |
| 2058 | syn::GenericArgument::Const(_val) => { |
| 2059 | formatter.write_str("GenericArgument::Const")?; |
| 2060 | formatter.write_str("(")?; |
| 2061 | Debug::fmt(Lite(_val), formatter)?; |
| 2062 | formatter.write_str(")")?; |
| 2063 | Ok(()) |
| 2064 | } |
| 2065 | syn::GenericArgument::AssocType(_val) => { |
| 2066 | formatter.write_str("GenericArgument::AssocType")?; |
| 2067 | formatter.write_str("(")?; |
| 2068 | Debug::fmt(Lite(_val), formatter)?; |
| 2069 | formatter.write_str(")")?; |
| 2070 | Ok(()) |
| 2071 | } |
| 2072 | syn::GenericArgument::AssocConst(_val) => { |
| 2073 | formatter.write_str("GenericArgument::AssocConst")?; |
| 2074 | formatter.write_str("(")?; |
| 2075 | Debug::fmt(Lite(_val), formatter)?; |
| 2076 | formatter.write_str(")")?; |
| 2077 | Ok(()) |
| 2078 | } |
| 2079 | syn::GenericArgument::Constraint(_val) => { |
| 2080 | formatter.write_str("GenericArgument::Constraint")?; |
| 2081 | formatter.write_str("(")?; |
| 2082 | Debug::fmt(Lite(_val), formatter)?; |
| 2083 | formatter.write_str(")")?; |
| 2084 | Ok(()) |
| 2085 | } |
| 2086 | _ => unreachable!(), |
| 2087 | } |
| 2088 | } |
| 2089 | } |
| 2090 | impl Debug for Lite<syn::GenericParam> { |
| 2091 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2092 | match &self.value { |
| 2093 | syn::GenericParam::Lifetime(_val) => { |
| 2094 | formatter.write_str("GenericParam::Lifetime")?; |
| 2095 | formatter.write_str("(")?; |
| 2096 | Debug::fmt(Lite(_val), formatter)?; |
| 2097 | formatter.write_str(")")?; |
| 2098 | Ok(()) |
| 2099 | } |
| 2100 | syn::GenericParam::Type(_val) => { |
| 2101 | formatter.write_str("GenericParam::Type")?; |
| 2102 | formatter.write_str("(")?; |
| 2103 | Debug::fmt(Lite(_val), formatter)?; |
| 2104 | formatter.write_str(")")?; |
| 2105 | Ok(()) |
| 2106 | } |
| 2107 | syn::GenericParam::Const(_val) => { |
| 2108 | formatter.write_str("GenericParam::Const")?; |
| 2109 | formatter.write_str("(")?; |
| 2110 | Debug::fmt(Lite(_val), formatter)?; |
| 2111 | formatter.write_str(")")?; |
| 2112 | Ok(()) |
| 2113 | } |
| 2114 | } |
| 2115 | } |
| 2116 | } |
| 2117 | impl Debug for Lite<syn::Generics> { |
| 2118 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2119 | let mut formatter = formatter.debug_struct("Generics"); |
| 2120 | if self.value.lt_token.is_some() { |
| 2121 | formatter.field("lt_token", &Present); |
| 2122 | } |
| 2123 | if !self.value.params.is_empty() { |
| 2124 | formatter.field("params", Lite(&self.value.params)); |
| 2125 | } |
| 2126 | if self.value.gt_token.is_some() { |
| 2127 | formatter.field("gt_token", &Present); |
| 2128 | } |
| 2129 | if let Some(val) = &self.value.where_clause { |
| 2130 | #[derive(RefCast)] |
| 2131 | #[repr(transparent)] |
| 2132 | struct Print(syn::WhereClause); |
| 2133 | impl Debug for Print { |
| 2134 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2135 | formatter.write_str("Some(")?; |
| 2136 | Debug::fmt(Lite(&self.0), formatter)?; |
| 2137 | formatter.write_str(")")?; |
| 2138 | Ok(()) |
| 2139 | } |
| 2140 | } |
| 2141 | formatter.field("where_clause", Print::ref_cast(val)); |
| 2142 | } |
| 2143 | formatter.finish() |
| 2144 | } |
| 2145 | } |
| 2146 | impl Debug for Lite<syn::ImplItem> { |
| 2147 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2148 | match &self.value { |
| 2149 | syn::ImplItem::Const(_val) => { |
| 2150 | let mut formatter = formatter.debug_struct("ImplItem::Const"); |
| 2151 | if !_val.attrs.is_empty() { |
| 2152 | formatter.field("attrs", Lite(&_val.attrs)); |
| 2153 | } |
| 2154 | formatter.field("vis", Lite(&_val.vis)); |
| 2155 | formatter.field("modifiers", Lite(&_val.modifiers)); |
| 2156 | formatter.field("ident", Lite(&_val.ident)); |
| 2157 | formatter.field("generics", Lite(&_val.generics)); |
| 2158 | formatter.field("ty", Lite(&_val.ty)); |
| 2159 | formatter.field("expr", Lite(&_val.expr)); |
| 2160 | formatter.finish() |
| 2161 | } |
| 2162 | syn::ImplItem::Fn(_val) => { |
| 2163 | let mut formatter = formatter.debug_struct("ImplItem::Fn"); |
| 2164 | if !_val.attrs.is_empty() { |
| 2165 | formatter.field("attrs", Lite(&_val.attrs)); |
| 2166 | } |
| 2167 | formatter.field("vis", Lite(&_val.vis)); |
| 2168 | formatter.field("modifiers", Lite(&_val.modifiers)); |
| 2169 | formatter.field("sig", Lite(&_val.sig)); |
| 2170 | formatter.field("block", Lite(&_val.block)); |
| 2171 | formatter.finish() |
| 2172 | } |
| 2173 | syn::ImplItem::Type(_val) => { |
| 2174 | let mut formatter = formatter.debug_struct("ImplItem::Type"); |
| 2175 | if !_val.attrs.is_empty() { |
| 2176 | formatter.field("attrs", Lite(&_val.attrs)); |
| 2177 | } |
| 2178 | formatter.field("vis", Lite(&_val.vis)); |
| 2179 | formatter.field("modifiers", Lite(&_val.modifiers)); |
| 2180 | formatter.field("ident", Lite(&_val.ident)); |
| 2181 | formatter.field("generics", Lite(&_val.generics)); |
| 2182 | formatter.field("ty", Lite(&_val.ty)); |
| 2183 | formatter.finish() |
| 2184 | } |
| 2185 | syn::ImplItem::Macro(_val) => { |
| 2186 | let mut formatter = formatter.debug_struct("ImplItem::Macro"); |
| 2187 | if !_val.attrs.is_empty() { |
| 2188 | formatter.field("attrs", Lite(&_val.attrs)); |
| 2189 | } |
| 2190 | formatter.field("mac", Lite(&_val.mac)); |
| 2191 | if _val.semi_token.is_some() { |
| 2192 | formatter.field("semi_token", &Present); |
| 2193 | } |
| 2194 | formatter.finish() |
| 2195 | } |
| 2196 | syn::ImplItem::Verbatim(_val) => { |
| 2197 | formatter.write_str("ImplItem::Verbatim")?; |
| 2198 | formatter.write_str("(`")?; |
| 2199 | Display::fmt(_val, formatter)?; |
| 2200 | formatter.write_str("`)")?; |
| 2201 | Ok(()) |
| 2202 | } |
| 2203 | _ => unreachable!(), |
| 2204 | } |
| 2205 | } |
| 2206 | } |
| 2207 | impl Debug for Lite<syn::ImplItemConst> { |
| 2208 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2209 | let mut formatter = formatter.debug_struct("ImplItemConst"); |
| 2210 | if !self.value.attrs.is_empty() { |
| 2211 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 2212 | } |
| 2213 | formatter.field("vis", Lite(&self.value.vis)); |
| 2214 | formatter.field("modifiers", Lite(&self.value.modifiers)); |
| 2215 | formatter.field("ident", Lite(&self.value.ident)); |
| 2216 | formatter.field("generics", Lite(&self.value.generics)); |
| 2217 | formatter.field("ty", Lite(&self.value.ty)); |
| 2218 | formatter.field("expr", Lite(&self.value.expr)); |
| 2219 | formatter.finish() |
| 2220 | } |
| 2221 | } |
| 2222 | impl Debug for Lite<syn::ImplItemFn> { |
| 2223 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2224 | let mut formatter = formatter.debug_struct("ImplItemFn"); |
| 2225 | if !self.value.attrs.is_empty() { |
| 2226 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 2227 | } |
| 2228 | formatter.field("vis", Lite(&self.value.vis)); |
| 2229 | formatter.field("modifiers", Lite(&self.value.modifiers)); |
| 2230 | formatter.field("sig", Lite(&self.value.sig)); |
| 2231 | formatter.field("block", Lite(&self.value.block)); |
| 2232 | formatter.finish() |
| 2233 | } |
| 2234 | } |
| 2235 | impl Debug for Lite<syn::ImplItemMacro> { |
| 2236 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2237 | let mut formatter = formatter.debug_struct("ImplItemMacro"); |
| 2238 | if !self.value.attrs.is_empty() { |
| 2239 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 2240 | } |
| 2241 | formatter.field("mac", Lite(&self.value.mac)); |
| 2242 | if self.value.semi_token.is_some() { |
| 2243 | formatter.field("semi_token", &Present); |
| 2244 | } |
| 2245 | formatter.finish() |
| 2246 | } |
| 2247 | } |
| 2248 | impl Debug for Lite<syn::ImplItemType> { |
| 2249 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2250 | let mut formatter = formatter.debug_struct("ImplItemType"); |
| 2251 | if !self.value.attrs.is_empty() { |
| 2252 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 2253 | } |
| 2254 | formatter.field("vis", Lite(&self.value.vis)); |
| 2255 | formatter.field("modifiers", Lite(&self.value.modifiers)); |
| 2256 | formatter.field("ident", Lite(&self.value.ident)); |
| 2257 | formatter.field("generics", Lite(&self.value.generics)); |
| 2258 | formatter.field("ty", Lite(&self.value.ty)); |
| 2259 | formatter.finish() |
| 2260 | } |
| 2261 | } |
| 2262 | impl Debug for Lite<syn::ImplModifiers> { |
| 2263 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2264 | let mut formatter = formatter.debug_struct("ImplModifiers"); |
| 2265 | if self.value.defaultness.is_some() { |
| 2266 | formatter.field("defaultness", &Present); |
| 2267 | } |
| 2268 | if self.value.polarity.is_some() { |
| 2269 | formatter.field("polarity", &Present); |
| 2270 | } |
| 2271 | formatter.finish() |
| 2272 | } |
| 2273 | } |
| 2274 | impl Debug for Lite<syn::Index> { |
| 2275 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2276 | let mut formatter = formatter.debug_struct("Index"); |
| 2277 | formatter.field("index", Lite(&self.value.index)); |
| 2278 | formatter.finish() |
| 2279 | } |
| 2280 | } |
| 2281 | impl Debug for Lite<syn::Item> { |
| 2282 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2283 | match &self.value { |
| 2284 | syn::Item::Const(_val) => { |
| 2285 | let mut formatter = formatter.debug_struct("Item::Const"); |
| 2286 | if !_val.attrs.is_empty() { |
| 2287 | formatter.field("attrs", Lite(&_val.attrs)); |
| 2288 | } |
| 2289 | formatter.field("vis", Lite(&_val.vis)); |
| 2290 | formatter.field("modifiers", Lite(&_val.modifiers)); |
| 2291 | formatter.field("ident", Lite(&_val.ident)); |
| 2292 | formatter.field("generics", Lite(&_val.generics)); |
| 2293 | formatter.field("ty", Lite(&_val.ty)); |
| 2294 | formatter.field("expr", Lite(&_val.expr)); |
| 2295 | formatter.finish() |
| 2296 | } |
| 2297 | syn::Item::Enum(_val) => { |
| 2298 | let mut formatter = formatter.debug_struct("Item::Enum"); |
| 2299 | if !_val.attrs.is_empty() { |
| 2300 | formatter.field("attrs", Lite(&_val.attrs)); |
| 2301 | } |
| 2302 | formatter.field("vis", Lite(&_val.vis)); |
| 2303 | formatter.field("ident", Lite(&_val.ident)); |
| 2304 | formatter.field("generics", Lite(&_val.generics)); |
| 2305 | if !_val.variants.is_empty() { |
| 2306 | formatter.field("variants", Lite(&_val.variants)); |
| 2307 | } |
| 2308 | formatter.finish() |
| 2309 | } |
| 2310 | syn::Item::ExternCrate(_val) => { |
| 2311 | let mut formatter = formatter.debug_struct("Item::ExternCrate"); |
| 2312 | if !_val.attrs.is_empty() { |
| 2313 | formatter.field("attrs", Lite(&_val.attrs)); |
| 2314 | } |
| 2315 | formatter.field("vis", Lite(&_val.vis)); |
| 2316 | formatter.field("ident", Lite(&_val.ident)); |
| 2317 | if let Some(val) = &_val.rename { |
| 2318 | #[derive(RefCast)] |
| 2319 | #[repr(transparent)] |
| 2320 | struct Print((syn::token::As, proc_macro2::Ident)); |
| 2321 | impl Debug for Print { |
| 2322 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2323 | formatter.write_str("Some(")?; |
| 2324 | Debug::fmt(Lite(&self.0.1), formatter)?; |
| 2325 | formatter.write_str(")")?; |
| 2326 | Ok(()) |
| 2327 | } |
| 2328 | } |
| 2329 | formatter.field("rename", Print::ref_cast(val)); |
| 2330 | } |
| 2331 | formatter.finish() |
| 2332 | } |
| 2333 | syn::Item::Fn(_val) => { |
| 2334 | let mut formatter = formatter.debug_struct("Item::Fn"); |
| 2335 | if !_val.attrs.is_empty() { |
| 2336 | formatter.field("attrs", Lite(&_val.attrs)); |
| 2337 | } |
| 2338 | formatter.field("vis", Lite(&_val.vis)); |
| 2339 | formatter.field("modifiers", Lite(&_val.modifiers)); |
| 2340 | formatter.field("sig", Lite(&_val.sig)); |
| 2341 | formatter.field("block", Lite(&_val.block)); |
| 2342 | formatter.finish() |
| 2343 | } |
| 2344 | syn::Item::ForeignMod(_val) => { |
| 2345 | let mut formatter = formatter.debug_struct("Item::ForeignMod"); |
| 2346 | if !_val.attrs.is_empty() { |
| 2347 | formatter.field("attrs", Lite(&_val.attrs)); |
| 2348 | } |
| 2349 | if _val.unsafety.is_some() { |
| 2350 | formatter.field("unsafety", &Present); |
| 2351 | } |
| 2352 | formatter.field("abi", Lite(&_val.abi)); |
| 2353 | if !_val.items.is_empty() { |
| 2354 | formatter.field("items", Lite(&_val.items)); |
| 2355 | } |
| 2356 | formatter.finish() |
| 2357 | } |
| 2358 | syn::Item::Impl(_val) => { |
| 2359 | let mut formatter = formatter.debug_struct("Item::Impl"); |
| 2360 | if !_val.attrs.is_empty() { |
| 2361 | formatter.field("attrs", Lite(&_val.attrs)); |
| 2362 | } |
| 2363 | formatter.field("modifiers", Lite(&_val.modifiers)); |
| 2364 | if _val.unsafety.is_some() { |
| 2365 | formatter.field("unsafety", &Present); |
| 2366 | } |
| 2367 | formatter.field("generics", Lite(&_val.generics)); |
| 2368 | if let Some(val) = &_val.trait_ { |
| 2369 | #[derive(RefCast)] |
| 2370 | #[repr(transparent)] |
| 2371 | struct Print((syn::Path, syn::token::For)); |
| 2372 | impl Debug for Print { |
| 2373 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2374 | formatter.write_str("Some(")?; |
| 2375 | Debug::fmt(Lite(&self.0.0), formatter)?; |
| 2376 | formatter.write_str(")")?; |
| 2377 | Ok(()) |
| 2378 | } |
| 2379 | } |
| 2380 | formatter.field("trait_", Print::ref_cast(val)); |
| 2381 | } |
| 2382 | formatter.field("self_ty", Lite(&_val.self_ty)); |
| 2383 | if !_val.items.is_empty() { |
| 2384 | formatter.field("items", Lite(&_val.items)); |
| 2385 | } |
| 2386 | formatter.finish() |
| 2387 | } |
| 2388 | syn::Item::Macro(_val) => { |
| 2389 | let mut formatter = formatter.debug_struct("Item::Macro"); |
| 2390 | if !_val.attrs.is_empty() { |
| 2391 | formatter.field("attrs", Lite(&_val.attrs)); |
| 2392 | } |
| 2393 | if let Some(val) = &_val.ident { |
| 2394 | #[derive(RefCast)] |
| 2395 | #[repr(transparent)] |
| 2396 | struct Print(proc_macro2::Ident); |
| 2397 | impl Debug for Print { |
| 2398 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2399 | formatter.write_str("Some(")?; |
| 2400 | Debug::fmt(Lite(&self.0), formatter)?; |
| 2401 | formatter.write_str(")")?; |
| 2402 | Ok(()) |
| 2403 | } |
| 2404 | } |
| 2405 | formatter.field("ident", Print::ref_cast(val)); |
| 2406 | } |
| 2407 | formatter.field("mac", Lite(&_val.mac)); |
| 2408 | if _val.semi_token.is_some() { |
| 2409 | formatter.field("semi_token", &Present); |
| 2410 | } |
| 2411 | formatter.finish() |
| 2412 | } |
| 2413 | syn::Item::Mod(_val) => { |
| 2414 | let mut formatter = formatter.debug_struct("Item::Mod"); |
| 2415 | if !_val.attrs.is_empty() { |
| 2416 | formatter.field("attrs", Lite(&_val.attrs)); |
| 2417 | } |
| 2418 | formatter.field("vis", Lite(&_val.vis)); |
| 2419 | if _val.unsafety.is_some() { |
| 2420 | formatter.field("unsafety", &Present); |
| 2421 | } |
| 2422 | formatter.field("ident", Lite(&_val.ident)); |
| 2423 | if let Some(val) = &_val.content { |
| 2424 | #[derive(RefCast)] |
| 2425 | #[repr(transparent)] |
| 2426 | struct Print((syn::token::Brace, Vec<syn::Item>)); |
| 2427 | impl Debug for Print { |
| 2428 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2429 | formatter.write_str("Some(")?; |
| 2430 | Debug::fmt(Lite(&self.0.1), formatter)?; |
| 2431 | formatter.write_str(")")?; |
| 2432 | Ok(()) |
| 2433 | } |
| 2434 | } |
| 2435 | formatter.field("content", Print::ref_cast(val)); |
| 2436 | } |
| 2437 | if _val.semi.is_some() { |
| 2438 | formatter.field("semi", &Present); |
| 2439 | } |
| 2440 | formatter.finish() |
| 2441 | } |
| 2442 | syn::Item::Static(_val) => { |
| 2443 | let mut formatter = formatter.debug_struct("Item::Static"); |
| 2444 | if !_val.attrs.is_empty() { |
| 2445 | formatter.field("attrs", Lite(&_val.attrs)); |
| 2446 | } |
| 2447 | formatter.field("vis", Lite(&_val.vis)); |
| 2448 | match _val.mutability { |
| 2449 | syn::StaticMutability::None => {} |
| 2450 | _ => { |
| 2451 | formatter.field("mutability", Lite(&_val.mutability)); |
| 2452 | } |
| 2453 | } |
| 2454 | formatter.field("ident", Lite(&_val.ident)); |
| 2455 | formatter.field("ty", Lite(&_val.ty)); |
| 2456 | formatter.field("expr", Lite(&_val.expr)); |
| 2457 | formatter.finish() |
| 2458 | } |
| 2459 | syn::Item::Struct(_val) => { |
| 2460 | let mut formatter = formatter.debug_struct("Item::Struct"); |
| 2461 | if !_val.attrs.is_empty() { |
| 2462 | formatter.field("attrs", Lite(&_val.attrs)); |
| 2463 | } |
| 2464 | formatter.field("vis", Lite(&_val.vis)); |
| 2465 | formatter.field("ident", Lite(&_val.ident)); |
| 2466 | formatter.field("generics", Lite(&_val.generics)); |
| 2467 | formatter.field("fields", Lite(&_val.fields)); |
| 2468 | if _val.semi_token.is_some() { |
| 2469 | formatter.field("semi_token", &Present); |
| 2470 | } |
| 2471 | formatter.finish() |
| 2472 | } |
| 2473 | syn::Item::Trait(_val) => { |
| 2474 | let mut formatter = formatter.debug_struct("Item::Trait"); |
| 2475 | if !_val.attrs.is_empty() { |
| 2476 | formatter.field("attrs", Lite(&_val.attrs)); |
| 2477 | } |
| 2478 | formatter.field("vis", Lite(&_val.vis)); |
| 2479 | formatter.field("modifiers", Lite(&_val.modifiers)); |
| 2480 | if _val.unsafety.is_some() { |
| 2481 | formatter.field("unsafety", &Present); |
| 2482 | } |
| 2483 | formatter.field("ident", Lite(&_val.ident)); |
| 2484 | formatter.field("generics", Lite(&_val.generics)); |
| 2485 | if _val.colon_token.is_some() { |
| 2486 | formatter.field("colon_token", &Present); |
| 2487 | } |
| 2488 | if !_val.supertraits.is_empty() { |
| 2489 | formatter.field("supertraits", Lite(&_val.supertraits)); |
| 2490 | } |
| 2491 | if !_val.items.is_empty() { |
| 2492 | formatter.field("items", Lite(&_val.items)); |
| 2493 | } |
| 2494 | formatter.finish() |
| 2495 | } |
| 2496 | syn::Item::TraitAlias(_val) => { |
| 2497 | let mut formatter = formatter.debug_struct("Item::TraitAlias"); |
| 2498 | if !_val.attrs.is_empty() { |
| 2499 | formatter.field("attrs", Lite(&_val.attrs)); |
| 2500 | } |
| 2501 | formatter.field("vis", Lite(&_val.vis)); |
| 2502 | formatter.field("ident", Lite(&_val.ident)); |
| 2503 | formatter.field("generics", Lite(&_val.generics)); |
| 2504 | if !_val.bounds.is_empty() { |
| 2505 | formatter.field("bounds", Lite(&_val.bounds)); |
| 2506 | } |
| 2507 | formatter.finish() |
| 2508 | } |
| 2509 | syn::Item::Type(_val) => { |
| 2510 | let mut formatter = formatter.debug_struct("Item::Type"); |
| 2511 | if !_val.attrs.is_empty() { |
| 2512 | formatter.field("attrs", Lite(&_val.attrs)); |
| 2513 | } |
| 2514 | formatter.field("vis", Lite(&_val.vis)); |
| 2515 | formatter.field("modifiers", Lite(&_val.modifiers)); |
| 2516 | formatter.field("ident", Lite(&_val.ident)); |
| 2517 | formatter.field("generics", Lite(&_val.generics)); |
| 2518 | formatter.field("ty", Lite(&_val.ty)); |
| 2519 | formatter |
| 2520 | .field("where_clause_placement", Lite(&_val.where_clause_placement)); |
| 2521 | formatter.finish() |
| 2522 | } |
| 2523 | syn::Item::Union(_val) => { |
| 2524 | let mut formatter = formatter.debug_struct("Item::Union"); |
| 2525 | if !_val.attrs.is_empty() { |
| 2526 | formatter.field("attrs", Lite(&_val.attrs)); |
| 2527 | } |
| 2528 | formatter.field("vis", Lite(&_val.vis)); |
| 2529 | formatter.field("ident", Lite(&_val.ident)); |
| 2530 | formatter.field("generics", Lite(&_val.generics)); |
| 2531 | formatter.field("fields", Lite(&_val.fields)); |
| 2532 | formatter.finish() |
| 2533 | } |
| 2534 | syn::Item::Use(_val) => { |
| 2535 | let mut formatter = formatter.debug_struct("Item::Use"); |
| 2536 | if !_val.attrs.is_empty() { |
| 2537 | formatter.field("attrs", Lite(&_val.attrs)); |
| 2538 | } |
| 2539 | formatter.field("vis", Lite(&_val.vis)); |
| 2540 | if _val.leading_colon.is_some() { |
| 2541 | formatter.field("leading_colon", &Present); |
| 2542 | } |
| 2543 | formatter.field("tree", Lite(&_val.tree)); |
| 2544 | formatter.finish() |
| 2545 | } |
| 2546 | syn::Item::Verbatim(_val) => { |
| 2547 | formatter.write_str("Item::Verbatim")?; |
| 2548 | formatter.write_str("(`")?; |
| 2549 | Display::fmt(_val, formatter)?; |
| 2550 | formatter.write_str("`)")?; |
| 2551 | Ok(()) |
| 2552 | } |
| 2553 | _ => unreachable!(), |
| 2554 | } |
| 2555 | } |
| 2556 | } |
| 2557 | impl Debug for Lite<syn::ItemConst> { |
| 2558 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2559 | let mut formatter = formatter.debug_struct("ItemConst"); |
| 2560 | if !self.value.attrs.is_empty() { |
| 2561 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 2562 | } |
| 2563 | formatter.field("vis", Lite(&self.value.vis)); |
| 2564 | formatter.field("modifiers", Lite(&self.value.modifiers)); |
| 2565 | formatter.field("ident", Lite(&self.value.ident)); |
| 2566 | formatter.field("generics", Lite(&self.value.generics)); |
| 2567 | formatter.field("ty", Lite(&self.value.ty)); |
| 2568 | formatter.field("expr", Lite(&self.value.expr)); |
| 2569 | formatter.finish() |
| 2570 | } |
| 2571 | } |
| 2572 | impl Debug for Lite<syn::ItemEnum> { |
| 2573 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2574 | let mut formatter = formatter.debug_struct("ItemEnum"); |
| 2575 | if !self.value.attrs.is_empty() { |
| 2576 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 2577 | } |
| 2578 | formatter.field("vis", Lite(&self.value.vis)); |
| 2579 | formatter.field("ident", Lite(&self.value.ident)); |
| 2580 | formatter.field("generics", Lite(&self.value.generics)); |
| 2581 | if !self.value.variants.is_empty() { |
| 2582 | formatter.field("variants", Lite(&self.value.variants)); |
| 2583 | } |
| 2584 | formatter.finish() |
| 2585 | } |
| 2586 | } |
| 2587 | impl Debug for Lite<syn::ItemExternCrate> { |
| 2588 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2589 | let mut formatter = formatter.debug_struct("ItemExternCrate"); |
| 2590 | if !self.value.attrs.is_empty() { |
| 2591 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 2592 | } |
| 2593 | formatter.field("vis", Lite(&self.value.vis)); |
| 2594 | formatter.field("ident", Lite(&self.value.ident)); |
| 2595 | if let Some(val) = &self.value.rename { |
| 2596 | #[derive(RefCast)] |
| 2597 | #[repr(transparent)] |
| 2598 | struct Print((syn::token::As, proc_macro2::Ident)); |
| 2599 | impl Debug for Print { |
| 2600 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2601 | formatter.write_str("Some(")?; |
| 2602 | Debug::fmt(Lite(&self.0.1), formatter)?; |
| 2603 | formatter.write_str(")")?; |
| 2604 | Ok(()) |
| 2605 | } |
| 2606 | } |
| 2607 | formatter.field("rename", Print::ref_cast(val)); |
| 2608 | } |
| 2609 | formatter.finish() |
| 2610 | } |
| 2611 | } |
| 2612 | impl Debug for Lite<syn::ItemFn> { |
| 2613 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2614 | let mut formatter = formatter.debug_struct("ItemFn"); |
| 2615 | if !self.value.attrs.is_empty() { |
| 2616 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 2617 | } |
| 2618 | formatter.field("vis", Lite(&self.value.vis)); |
| 2619 | formatter.field("modifiers", Lite(&self.value.modifiers)); |
| 2620 | formatter.field("sig", Lite(&self.value.sig)); |
| 2621 | formatter.field("block", Lite(&self.value.block)); |
| 2622 | formatter.finish() |
| 2623 | } |
| 2624 | } |
| 2625 | impl Debug for Lite<syn::ItemForeignMod> { |
| 2626 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2627 | let mut formatter = formatter.debug_struct("ItemForeignMod"); |
| 2628 | if !self.value.attrs.is_empty() { |
| 2629 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 2630 | } |
| 2631 | if self.value.unsafety.is_some() { |
| 2632 | formatter.field("unsafety", &Present); |
| 2633 | } |
| 2634 | formatter.field("abi", Lite(&self.value.abi)); |
| 2635 | if !self.value.items.is_empty() { |
| 2636 | formatter.field("items", Lite(&self.value.items)); |
| 2637 | } |
| 2638 | formatter.finish() |
| 2639 | } |
| 2640 | } |
| 2641 | impl Debug for Lite<syn::ItemImpl> { |
| 2642 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2643 | let mut formatter = formatter.debug_struct("ItemImpl"); |
| 2644 | if !self.value.attrs.is_empty() { |
| 2645 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 2646 | } |
| 2647 | formatter.field("modifiers", Lite(&self.value.modifiers)); |
| 2648 | if self.value.unsafety.is_some() { |
| 2649 | formatter.field("unsafety", &Present); |
| 2650 | } |
| 2651 | formatter.field("generics", Lite(&self.value.generics)); |
| 2652 | if let Some(val) = &self.value.trait_ { |
| 2653 | #[derive(RefCast)] |
| 2654 | #[repr(transparent)] |
| 2655 | struct Print((syn::Path, syn::token::For)); |
| 2656 | impl Debug for Print { |
| 2657 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2658 | formatter.write_str("Some(")?; |
| 2659 | Debug::fmt(Lite(&self.0.0), formatter)?; |
| 2660 | formatter.write_str(")")?; |
| 2661 | Ok(()) |
| 2662 | } |
| 2663 | } |
| 2664 | formatter.field("trait_", Print::ref_cast(val)); |
| 2665 | } |
| 2666 | formatter.field("self_ty", Lite(&self.value.self_ty)); |
| 2667 | if !self.value.items.is_empty() { |
| 2668 | formatter.field("items", Lite(&self.value.items)); |
| 2669 | } |
| 2670 | formatter.finish() |
| 2671 | } |
| 2672 | } |
| 2673 | impl Debug for Lite<syn::ItemMacro> { |
| 2674 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2675 | let mut formatter = formatter.debug_struct("ItemMacro"); |
| 2676 | if !self.value.attrs.is_empty() { |
| 2677 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 2678 | } |
| 2679 | if let Some(val) = &self.value.ident { |
| 2680 | #[derive(RefCast)] |
| 2681 | #[repr(transparent)] |
| 2682 | struct Print(proc_macro2::Ident); |
| 2683 | impl Debug for Print { |
| 2684 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2685 | formatter.write_str("Some(")?; |
| 2686 | Debug::fmt(Lite(&self.0), formatter)?; |
| 2687 | formatter.write_str(")")?; |
| 2688 | Ok(()) |
| 2689 | } |
| 2690 | } |
| 2691 | formatter.field("ident", Print::ref_cast(val)); |
| 2692 | } |
| 2693 | formatter.field("mac", Lite(&self.value.mac)); |
| 2694 | if self.value.semi_token.is_some() { |
| 2695 | formatter.field("semi_token", &Present); |
| 2696 | } |
| 2697 | formatter.finish() |
| 2698 | } |
| 2699 | } |
| 2700 | impl Debug for Lite<syn::ItemMod> { |
| 2701 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2702 | let mut formatter = formatter.debug_struct("ItemMod"); |
| 2703 | if !self.value.attrs.is_empty() { |
| 2704 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 2705 | } |
| 2706 | formatter.field("vis", Lite(&self.value.vis)); |
| 2707 | if self.value.unsafety.is_some() { |
| 2708 | formatter.field("unsafety", &Present); |
| 2709 | } |
| 2710 | formatter.field("ident", Lite(&self.value.ident)); |
| 2711 | if let Some(val) = &self.value.content { |
| 2712 | #[derive(RefCast)] |
| 2713 | #[repr(transparent)] |
| 2714 | struct Print((syn::token::Brace, Vec<syn::Item>)); |
| 2715 | impl Debug for Print { |
| 2716 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2717 | formatter.write_str("Some(")?; |
| 2718 | Debug::fmt(Lite(&self.0.1), formatter)?; |
| 2719 | formatter.write_str(")")?; |
| 2720 | Ok(()) |
| 2721 | } |
| 2722 | } |
| 2723 | formatter.field("content", Print::ref_cast(val)); |
| 2724 | } |
| 2725 | if self.value.semi.is_some() { |
| 2726 | formatter.field("semi", &Present); |
| 2727 | } |
| 2728 | formatter.finish() |
| 2729 | } |
| 2730 | } |
| 2731 | impl Debug for Lite<syn::ItemStatic> { |
| 2732 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2733 | let mut formatter = formatter.debug_struct("ItemStatic"); |
| 2734 | if !self.value.attrs.is_empty() { |
| 2735 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 2736 | } |
| 2737 | formatter.field("vis", Lite(&self.value.vis)); |
| 2738 | match self.value.mutability { |
| 2739 | syn::StaticMutability::None => {} |
| 2740 | _ => { |
| 2741 | formatter.field("mutability", Lite(&self.value.mutability)); |
| 2742 | } |
| 2743 | } |
| 2744 | formatter.field("ident", Lite(&self.value.ident)); |
| 2745 | formatter.field("ty", Lite(&self.value.ty)); |
| 2746 | formatter.field("expr", Lite(&self.value.expr)); |
| 2747 | formatter.finish() |
| 2748 | } |
| 2749 | } |
| 2750 | impl Debug for Lite<syn::ItemStruct> { |
| 2751 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2752 | let mut formatter = formatter.debug_struct("ItemStruct"); |
| 2753 | if !self.value.attrs.is_empty() { |
| 2754 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 2755 | } |
| 2756 | formatter.field("vis", Lite(&self.value.vis)); |
| 2757 | formatter.field("ident", Lite(&self.value.ident)); |
| 2758 | formatter.field("generics", Lite(&self.value.generics)); |
| 2759 | formatter.field("fields", Lite(&self.value.fields)); |
| 2760 | if self.value.semi_token.is_some() { |
| 2761 | formatter.field("semi_token", &Present); |
| 2762 | } |
| 2763 | formatter.finish() |
| 2764 | } |
| 2765 | } |
| 2766 | impl Debug for Lite<syn::ItemTrait> { |
| 2767 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2768 | let mut formatter = formatter.debug_struct("ItemTrait"); |
| 2769 | if !self.value.attrs.is_empty() { |
| 2770 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 2771 | } |
| 2772 | formatter.field("vis", Lite(&self.value.vis)); |
| 2773 | formatter.field("modifiers", Lite(&self.value.modifiers)); |
| 2774 | if self.value.unsafety.is_some() { |
| 2775 | formatter.field("unsafety", &Present); |
| 2776 | } |
| 2777 | formatter.field("ident", Lite(&self.value.ident)); |
| 2778 | formatter.field("generics", Lite(&self.value.generics)); |
| 2779 | if self.value.colon_token.is_some() { |
| 2780 | formatter.field("colon_token", &Present); |
| 2781 | } |
| 2782 | if !self.value.supertraits.is_empty() { |
| 2783 | formatter.field("supertraits", Lite(&self.value.supertraits)); |
| 2784 | } |
| 2785 | if !self.value.items.is_empty() { |
| 2786 | formatter.field("items", Lite(&self.value.items)); |
| 2787 | } |
| 2788 | formatter.finish() |
| 2789 | } |
| 2790 | } |
| 2791 | impl Debug for Lite<syn::ItemTraitAlias> { |
| 2792 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2793 | let mut formatter = formatter.debug_struct("ItemTraitAlias"); |
| 2794 | if !self.value.attrs.is_empty() { |
| 2795 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 2796 | } |
| 2797 | formatter.field("vis", Lite(&self.value.vis)); |
| 2798 | formatter.field("ident", Lite(&self.value.ident)); |
| 2799 | formatter.field("generics", Lite(&self.value.generics)); |
| 2800 | if !self.value.bounds.is_empty() { |
| 2801 | formatter.field("bounds", Lite(&self.value.bounds)); |
| 2802 | } |
| 2803 | formatter.finish() |
| 2804 | } |
| 2805 | } |
| 2806 | impl Debug for Lite<syn::ItemType> { |
| 2807 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2808 | let mut formatter = formatter.debug_struct("ItemType"); |
| 2809 | if !self.value.attrs.is_empty() { |
| 2810 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 2811 | } |
| 2812 | formatter.field("vis", Lite(&self.value.vis)); |
| 2813 | formatter.field("modifiers", Lite(&self.value.modifiers)); |
| 2814 | formatter.field("ident", Lite(&self.value.ident)); |
| 2815 | formatter.field("generics", Lite(&self.value.generics)); |
| 2816 | formatter.field("ty", Lite(&self.value.ty)); |
| 2817 | formatter |
| 2818 | .field("where_clause_placement", Lite(&self.value.where_clause_placement)); |
| 2819 | formatter.finish() |
| 2820 | } |
| 2821 | } |
| 2822 | impl Debug for Lite<syn::ItemUnion> { |
| 2823 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2824 | let mut formatter = formatter.debug_struct("ItemUnion"); |
| 2825 | if !self.value.attrs.is_empty() { |
| 2826 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 2827 | } |
| 2828 | formatter.field("vis", Lite(&self.value.vis)); |
| 2829 | formatter.field("ident", Lite(&self.value.ident)); |
| 2830 | formatter.field("generics", Lite(&self.value.generics)); |
| 2831 | formatter.field("fields", Lite(&self.value.fields)); |
| 2832 | formatter.finish() |
| 2833 | } |
| 2834 | } |
| 2835 | impl Debug for Lite<syn::ItemUse> { |
| 2836 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2837 | let mut formatter = formatter.debug_struct("ItemUse"); |
| 2838 | if !self.value.attrs.is_empty() { |
| 2839 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 2840 | } |
| 2841 | formatter.field("vis", Lite(&self.value.vis)); |
| 2842 | if self.value.leading_colon.is_some() { |
| 2843 | formatter.field("leading_colon", &Present); |
| 2844 | } |
| 2845 | formatter.field("tree", Lite(&self.value.tree)); |
| 2846 | formatter.finish() |
| 2847 | } |
| 2848 | } |
| 2849 | impl Debug for Lite<syn::Label> { |
| 2850 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2851 | let mut formatter = formatter.debug_struct("Label"); |
| 2852 | formatter.field("name", Lite(&self.value.name)); |
| 2853 | formatter.finish() |
| 2854 | } |
| 2855 | } |
| 2856 | impl Debug for Lite<syn::Lifetime> { |
| 2857 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2858 | let mut formatter = formatter.debug_struct("Lifetime"); |
| 2859 | formatter.field("ident", Lite(&self.value.ident)); |
| 2860 | formatter.finish() |
| 2861 | } |
| 2862 | } |
| 2863 | impl Debug for Lite<syn::LifetimeParam> { |
| 2864 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2865 | let mut formatter = formatter.debug_struct("LifetimeParam"); |
| 2866 | if !self.value.attrs.is_empty() { |
| 2867 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 2868 | } |
| 2869 | formatter.field("lifetime", Lite(&self.value.lifetime)); |
| 2870 | if self.value.colon_token.is_some() { |
| 2871 | formatter.field("colon_token", &Present); |
| 2872 | } |
| 2873 | if !self.value.bounds.is_empty() { |
| 2874 | formatter.field("bounds", Lite(&self.value.bounds)); |
| 2875 | } |
| 2876 | formatter.finish() |
| 2877 | } |
| 2878 | } |
| 2879 | impl Debug for Lite<syn::Lit> { |
| 2880 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2881 | match &self.value { |
| 2882 | syn::Lit::Str(_val) => write!(formatter, "{:?}", _val.value()), |
| 2883 | syn::Lit::ByteStr(_val) => write!(formatter, "{:?}", _val.value()), |
| 2884 | syn::Lit::CStr(_val) => write!(formatter, "{:?}", _val.value()), |
| 2885 | syn::Lit::Byte(_val) => write!(formatter, "{:?}", _val.value()), |
| 2886 | syn::Lit::Char(_val) => write!(formatter, "{:?}", _val.value()), |
| 2887 | syn::Lit::Int(_val) => write!(formatter, "{}", _val), |
| 2888 | syn::Lit::Float(_val) => write!(formatter, "{}", _val), |
| 2889 | syn::Lit::Bool(_val) => { |
| 2890 | let mut formatter = formatter.debug_struct("Lit::Bool"); |
| 2891 | formatter.field("value", Lite(&_val.value)); |
| 2892 | formatter.finish() |
| 2893 | } |
| 2894 | syn::Lit::Verbatim(_val) => { |
| 2895 | formatter.write_str("Lit::Verbatim")?; |
| 2896 | formatter.write_str("(`")?; |
| 2897 | Display::fmt(_val, formatter)?; |
| 2898 | formatter.write_str("`)")?; |
| 2899 | Ok(()) |
| 2900 | } |
| 2901 | _ => unreachable!(), |
| 2902 | } |
| 2903 | } |
| 2904 | } |
| 2905 | impl Debug for Lite<syn::LitBool> { |
| 2906 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2907 | let mut formatter = formatter.debug_struct("LitBool"); |
| 2908 | formatter.field("value", Lite(&self.value.value)); |
| 2909 | formatter.finish() |
| 2910 | } |
| 2911 | } |
| 2912 | impl Debug for Lite<syn::LitByte> { |
| 2913 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2914 | write!(formatter, "{:?}", self.value.value()) |
| 2915 | } |
| 2916 | } |
| 2917 | impl Debug for Lite<syn::LitByteStr> { |
| 2918 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2919 | write!(formatter, "{:?}", self.value.value()) |
| 2920 | } |
| 2921 | } |
| 2922 | impl Debug for Lite<syn::LitCStr> { |
| 2923 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2924 | write!(formatter, "{:?}", self.value.value()) |
| 2925 | } |
| 2926 | } |
| 2927 | impl Debug for Lite<syn::LitChar> { |
| 2928 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2929 | write!(formatter, "{:?}", self.value.value()) |
| 2930 | } |
| 2931 | } |
| 2932 | impl Debug for Lite<syn::LitFloat> { |
| 2933 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2934 | write!(formatter, "{}", self.value) |
| 2935 | } |
| 2936 | } |
| 2937 | impl Debug for Lite<syn::LitInt> { |
| 2938 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2939 | write!(formatter, "{}", self.value) |
| 2940 | } |
| 2941 | } |
| 2942 | impl Debug for Lite<syn::LitStr> { |
| 2943 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2944 | write!(formatter, "{:?}", self.value.value()) |
| 2945 | } |
| 2946 | } |
| 2947 | impl Debug for Lite<syn::Local> { |
| 2948 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2949 | let mut formatter = formatter.debug_struct("Local"); |
| 2950 | if !self.value.attrs.is_empty() { |
| 2951 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 2952 | } |
| 2953 | formatter.field("modifiers", Lite(&self.value.modifiers)); |
| 2954 | formatter.field("pat", Lite(&self.value.pat)); |
| 2955 | if let Some(val) = &self.value.init { |
| 2956 | #[derive(RefCast)] |
| 2957 | #[repr(transparent)] |
| 2958 | struct Print(syn::LocalInit); |
| 2959 | impl Debug for Print { |
| 2960 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2961 | formatter.write_str("Some(")?; |
| 2962 | Debug::fmt(Lite(&self.0), formatter)?; |
| 2963 | formatter.write_str(")")?; |
| 2964 | Ok(()) |
| 2965 | } |
| 2966 | } |
| 2967 | formatter.field("init", Print::ref_cast(val)); |
| 2968 | } |
| 2969 | formatter.finish() |
| 2970 | } |
| 2971 | } |
| 2972 | impl Debug for Lite<syn::LocalInit> { |
| 2973 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2974 | let mut formatter = formatter.debug_struct("LocalInit"); |
| 2975 | formatter.field("expr", Lite(&self.value.expr)); |
| 2976 | if let Some(val) = &self.value.diverge { |
| 2977 | #[derive(RefCast)] |
| 2978 | #[repr(transparent)] |
| 2979 | struct Print((syn::token::Else, Box<syn::Expr>)); |
| 2980 | impl Debug for Print { |
| 2981 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2982 | formatter.write_str("Some(")?; |
| 2983 | Debug::fmt(Lite(&self.0.1), formatter)?; |
| 2984 | formatter.write_str(")")?; |
| 2985 | Ok(()) |
| 2986 | } |
| 2987 | } |
| 2988 | formatter.field("diverge", Print::ref_cast(val)); |
| 2989 | } |
| 2990 | formatter.finish() |
| 2991 | } |
| 2992 | } |
| 2993 | impl Debug for Lite<syn::LocalModifiers> { |
| 2994 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 2995 | let mut formatter = formatter.debug_struct("LocalModifiers"); |
| 2996 | formatter.finish() |
| 2997 | } |
| 2998 | } |
| 2999 | impl Debug for Lite<syn::Macro> { |
| 3000 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3001 | let mut formatter = formatter.debug_struct("Macro"); |
| 3002 | formatter.field("path", Lite(&self.value.path)); |
| 3003 | formatter.field("delimiter", Lite(&self.value.delimiter)); |
| 3004 | formatter.field("tokens", Lite(&self.value.tokens)); |
| 3005 | formatter.finish() |
| 3006 | } |
| 3007 | } |
| 3008 | impl Debug for Lite<syn::MacroDelimiter> { |
| 3009 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3010 | match &self.value { |
| 3011 | syn::MacroDelimiter::Paren(_val) => { |
| 3012 | formatter.write_str("MacroDelimiter::Paren")?; |
| 3013 | Ok(()) |
| 3014 | } |
| 3015 | syn::MacroDelimiter::Brace(_val) => { |
| 3016 | formatter.write_str("MacroDelimiter::Brace")?; |
| 3017 | Ok(()) |
| 3018 | } |
| 3019 | syn::MacroDelimiter::Bracket(_val) => { |
| 3020 | formatter.write_str("MacroDelimiter::Bracket")?; |
| 3021 | Ok(()) |
| 3022 | } |
| 3023 | } |
| 3024 | } |
| 3025 | } |
| 3026 | impl Debug for Lite<syn::Member> { |
| 3027 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3028 | match &self.value { |
| 3029 | syn::Member::Named(_val) => { |
| 3030 | formatter.write_str("Member::Named")?; |
| 3031 | formatter.write_str("(")?; |
| 3032 | Debug::fmt(Lite(_val), formatter)?; |
| 3033 | formatter.write_str(")")?; |
| 3034 | Ok(()) |
| 3035 | } |
| 3036 | syn::Member::Unnamed(_val) => { |
| 3037 | formatter.write_str("Member::Unnamed")?; |
| 3038 | formatter.write_str("(")?; |
| 3039 | Debug::fmt(Lite(_val), formatter)?; |
| 3040 | formatter.write_str(")")?; |
| 3041 | Ok(()) |
| 3042 | } |
| 3043 | } |
| 3044 | } |
| 3045 | } |
| 3046 | impl Debug for Lite<syn::Meta> { |
| 3047 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3048 | match &self.value { |
| 3049 | syn::Meta::Path(_val) => { |
| 3050 | let mut formatter = formatter.debug_struct("Meta::Path"); |
| 3051 | if _val.leading_colon.is_some() { |
| 3052 | formatter.field("leading_colon", &Present); |
| 3053 | } |
| 3054 | if !_val.segments.is_empty() { |
| 3055 | formatter.field("segments", Lite(&_val.segments)); |
| 3056 | } |
| 3057 | formatter.finish() |
| 3058 | } |
| 3059 | syn::Meta::List(_val) => { |
| 3060 | let mut formatter = formatter.debug_struct("Meta::List"); |
| 3061 | formatter.field("path", Lite(&_val.path)); |
| 3062 | formatter.field("delimiter", Lite(&_val.delimiter)); |
| 3063 | formatter.field("tokens", Lite(&_val.tokens)); |
| 3064 | formatter.finish() |
| 3065 | } |
| 3066 | syn::Meta::NameValue(_val) => { |
| 3067 | let mut formatter = formatter.debug_struct("Meta::NameValue"); |
| 3068 | formatter.field("path", Lite(&_val.path)); |
| 3069 | formatter.field("value", Lite(&_val.value)); |
| 3070 | formatter.finish() |
| 3071 | } |
| 3072 | } |
| 3073 | } |
| 3074 | } |
| 3075 | impl Debug for Lite<syn::MetaList> { |
| 3076 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3077 | let mut formatter = formatter.debug_struct("MetaList"); |
| 3078 | formatter.field("path", Lite(&self.value.path)); |
| 3079 | formatter.field("delimiter", Lite(&self.value.delimiter)); |
| 3080 | formatter.field("tokens", Lite(&self.value.tokens)); |
| 3081 | formatter.finish() |
| 3082 | } |
| 3083 | } |
| 3084 | impl Debug for Lite<syn::MetaNameValue> { |
| 3085 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3086 | let mut formatter = formatter.debug_struct("MetaNameValue"); |
| 3087 | formatter.field("path", Lite(&self.value.path)); |
| 3088 | formatter.field("value", Lite(&self.value.value)); |
| 3089 | formatter.finish() |
| 3090 | } |
| 3091 | } |
| 3092 | impl Debug for Lite<syn::NamedArg> { |
| 3093 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3094 | let mut formatter = formatter.debug_struct("NamedArg"); |
| 3095 | if !self.value.attrs.is_empty() { |
| 3096 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 3097 | } |
| 3098 | if let Some(val) = &self.value.name { |
| 3099 | #[derive(RefCast)] |
| 3100 | #[repr(transparent)] |
| 3101 | struct Print((proc_macro2::Ident, syn::token::Colon)); |
| 3102 | impl Debug for Print { |
| 3103 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3104 | formatter.write_str("Some(")?; |
| 3105 | Debug::fmt(Lite(&self.0.0), formatter)?; |
| 3106 | formatter.write_str(")")?; |
| 3107 | Ok(()) |
| 3108 | } |
| 3109 | } |
| 3110 | formatter.field("name", Print::ref_cast(val)); |
| 3111 | } |
| 3112 | formatter.field("ty", Lite(&self.value.ty)); |
| 3113 | formatter.finish() |
| 3114 | } |
| 3115 | } |
| 3116 | impl Debug for Lite<syn::ParenthesizedGenericArguments> { |
| 3117 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3118 | let mut formatter = formatter.debug_struct("ParenthesizedGenericArguments"); |
| 3119 | if !self.value.inputs.is_empty() { |
| 3120 | formatter.field("inputs", Lite(&self.value.inputs)); |
| 3121 | } |
| 3122 | formatter.field("output", Lite(&self.value.output)); |
| 3123 | formatter.finish() |
| 3124 | } |
| 3125 | } |
| 3126 | impl Debug for Lite<syn::Pat> { |
| 3127 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3128 | match &self.value { |
| 3129 | syn::Pat::Const(_val) => { |
| 3130 | formatter.write_str("Pat::Const")?; |
| 3131 | formatter.write_str("(")?; |
| 3132 | Debug::fmt(Lite(_val), formatter)?; |
| 3133 | formatter.write_str(")")?; |
| 3134 | Ok(()) |
| 3135 | } |
| 3136 | syn::Pat::Guard(_val) => { |
| 3137 | let mut formatter = formatter.debug_struct("Pat::Guard"); |
| 3138 | if !_val.attrs.is_empty() { |
| 3139 | formatter.field("attrs", Lite(&_val.attrs)); |
| 3140 | } |
| 3141 | formatter.field("pat", Lite(&_val.pat)); |
| 3142 | formatter.field("guard", Lite(&_val.guard)); |
| 3143 | formatter.finish() |
| 3144 | } |
| 3145 | syn::Pat::Ident(_val) => { |
| 3146 | let mut formatter = formatter.debug_struct("Pat::Ident"); |
| 3147 | if !_val.attrs.is_empty() { |
| 3148 | formatter.field("attrs", Lite(&_val.attrs)); |
| 3149 | } |
| 3150 | if _val.by_ref.is_some() { |
| 3151 | formatter.field("by_ref", &Present); |
| 3152 | } |
| 3153 | if _val.mutability.is_some() { |
| 3154 | formatter.field("mutability", &Present); |
| 3155 | } |
| 3156 | formatter.field("ident", Lite(&_val.ident)); |
| 3157 | if let Some(val) = &_val.subpat { |
| 3158 | #[derive(RefCast)] |
| 3159 | #[repr(transparent)] |
| 3160 | struct Print((syn::token::At, Box<syn::Pat>)); |
| 3161 | impl Debug for Print { |
| 3162 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3163 | formatter.write_str("Some(")?; |
| 3164 | Debug::fmt(Lite(&self.0.1), formatter)?; |
| 3165 | formatter.write_str(")")?; |
| 3166 | Ok(()) |
| 3167 | } |
| 3168 | } |
| 3169 | formatter.field("subpat", Print::ref_cast(val)); |
| 3170 | } |
| 3171 | formatter.finish() |
| 3172 | } |
| 3173 | syn::Pat::Lit(_val) => { |
| 3174 | formatter.write_str("Pat::Lit")?; |
| 3175 | formatter.write_str("(")?; |
| 3176 | Debug::fmt(Lite(_val), formatter)?; |
| 3177 | formatter.write_str(")")?; |
| 3178 | Ok(()) |
| 3179 | } |
| 3180 | syn::Pat::Macro(_val) => { |
| 3181 | formatter.write_str("Pat::Macro")?; |
| 3182 | formatter.write_str("(")?; |
| 3183 | Debug::fmt(Lite(_val), formatter)?; |
| 3184 | formatter.write_str(")")?; |
| 3185 | Ok(()) |
| 3186 | } |
| 3187 | syn::Pat::Or(_val) => { |
| 3188 | let mut formatter = formatter.debug_struct("Pat::Or"); |
| 3189 | if !_val.attrs.is_empty() { |
| 3190 | formatter.field("attrs", Lite(&_val.attrs)); |
| 3191 | } |
| 3192 | if _val.leading_vert.is_some() { |
| 3193 | formatter.field("leading_vert", &Present); |
| 3194 | } |
| 3195 | if !_val.cases.is_empty() { |
| 3196 | formatter.field("cases", Lite(&_val.cases)); |
| 3197 | } |
| 3198 | formatter.finish() |
| 3199 | } |
| 3200 | syn::Pat::Paren(_val) => { |
| 3201 | let mut formatter = formatter.debug_struct("Pat::Paren"); |
| 3202 | if !_val.attrs.is_empty() { |
| 3203 | formatter.field("attrs", Lite(&_val.attrs)); |
| 3204 | } |
| 3205 | formatter.field("pat", Lite(&_val.pat)); |
| 3206 | formatter.finish() |
| 3207 | } |
| 3208 | syn::Pat::Path(_val) => { |
| 3209 | formatter.write_str("Pat::Path")?; |
| 3210 | formatter.write_str("(")?; |
| 3211 | Debug::fmt(Lite(_val), formatter)?; |
| 3212 | formatter.write_str(")")?; |
| 3213 | Ok(()) |
| 3214 | } |
| 3215 | syn::Pat::Range(_val) => { |
| 3216 | formatter.write_str("Pat::Range")?; |
| 3217 | formatter.write_str("(")?; |
| 3218 | Debug::fmt(Lite(_val), formatter)?; |
| 3219 | formatter.write_str(")")?; |
| 3220 | Ok(()) |
| 3221 | } |
| 3222 | syn::Pat::Reference(_val) => { |
| 3223 | let mut formatter = formatter.debug_struct("Pat::Reference"); |
| 3224 | if !_val.attrs.is_empty() { |
| 3225 | formatter.field("attrs", Lite(&_val.attrs)); |
| 3226 | } |
| 3227 | if _val.mutability.is_some() { |
| 3228 | formatter.field("mutability", &Present); |
| 3229 | } |
| 3230 | formatter.field("pat", Lite(&_val.pat)); |
| 3231 | formatter.finish() |
| 3232 | } |
| 3233 | syn::Pat::Rest(_val) => { |
| 3234 | let mut formatter = formatter.debug_struct("Pat::Rest"); |
| 3235 | if !_val.attrs.is_empty() { |
| 3236 | formatter.field("attrs", Lite(&_val.attrs)); |
| 3237 | } |
| 3238 | formatter.finish() |
| 3239 | } |
| 3240 | syn::Pat::Slice(_val) => { |
| 3241 | let mut formatter = formatter.debug_struct("Pat::Slice"); |
| 3242 | if !_val.attrs.is_empty() { |
| 3243 | formatter.field("attrs", Lite(&_val.attrs)); |
| 3244 | } |
| 3245 | if !_val.elems.is_empty() { |
| 3246 | formatter.field("elems", Lite(&_val.elems)); |
| 3247 | } |
| 3248 | formatter.finish() |
| 3249 | } |
| 3250 | syn::Pat::Struct(_val) => { |
| 3251 | let mut formatter = formatter.debug_struct("Pat::Struct"); |
| 3252 | if !_val.attrs.is_empty() { |
| 3253 | formatter.field("attrs", Lite(&_val.attrs)); |
| 3254 | } |
| 3255 | if let Some(val) = &_val.qself { |
| 3256 | #[derive(RefCast)] |
| 3257 | #[repr(transparent)] |
| 3258 | struct Print(syn::QSelf); |
| 3259 | impl Debug for Print { |
| 3260 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3261 | formatter.write_str("Some(")?; |
| 3262 | Debug::fmt(Lite(&self.0), formatter)?; |
| 3263 | formatter.write_str(")")?; |
| 3264 | Ok(()) |
| 3265 | } |
| 3266 | } |
| 3267 | formatter.field("qself", Print::ref_cast(val)); |
| 3268 | } |
| 3269 | formatter.field("path", Lite(&_val.path)); |
| 3270 | if !_val.fields.is_empty() { |
| 3271 | formatter.field("fields", Lite(&_val.fields)); |
| 3272 | } |
| 3273 | if let Some(val) = &_val.rest { |
| 3274 | #[derive(RefCast)] |
| 3275 | #[repr(transparent)] |
| 3276 | struct Print(syn::PatRest); |
| 3277 | impl Debug for Print { |
| 3278 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3279 | formatter.write_str("Some(")?; |
| 3280 | Debug::fmt(Lite(&self.0), formatter)?; |
| 3281 | formatter.write_str(")")?; |
| 3282 | Ok(()) |
| 3283 | } |
| 3284 | } |
| 3285 | formatter.field("rest", Print::ref_cast(val)); |
| 3286 | } |
| 3287 | formatter.finish() |
| 3288 | } |
| 3289 | syn::Pat::Tuple(_val) => { |
| 3290 | let mut formatter = formatter.debug_struct("Pat::Tuple"); |
| 3291 | if !_val.attrs.is_empty() { |
| 3292 | formatter.field("attrs", Lite(&_val.attrs)); |
| 3293 | } |
| 3294 | if !_val.elems.is_empty() { |
| 3295 | formatter.field("elems", Lite(&_val.elems)); |
| 3296 | } |
| 3297 | formatter.finish() |
| 3298 | } |
| 3299 | syn::Pat::TupleStruct(_val) => { |
| 3300 | let mut formatter = formatter.debug_struct("Pat::TupleStruct"); |
| 3301 | if !_val.attrs.is_empty() { |
| 3302 | formatter.field("attrs", Lite(&_val.attrs)); |
| 3303 | } |
| 3304 | if let Some(val) = &_val.qself { |
| 3305 | #[derive(RefCast)] |
| 3306 | #[repr(transparent)] |
| 3307 | struct Print(syn::QSelf); |
| 3308 | impl Debug for Print { |
| 3309 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3310 | formatter.write_str("Some(")?; |
| 3311 | Debug::fmt(Lite(&self.0), formatter)?; |
| 3312 | formatter.write_str(")")?; |
| 3313 | Ok(()) |
| 3314 | } |
| 3315 | } |
| 3316 | formatter.field("qself", Print::ref_cast(val)); |
| 3317 | } |
| 3318 | formatter.field("path", Lite(&_val.path)); |
| 3319 | if !_val.elems.is_empty() { |
| 3320 | formatter.field("elems", Lite(&_val.elems)); |
| 3321 | } |
| 3322 | formatter.finish() |
| 3323 | } |
| 3324 | syn::Pat::Type(_val) => { |
| 3325 | let mut formatter = formatter.debug_struct("Pat::Type"); |
| 3326 | if !_val.attrs.is_empty() { |
| 3327 | formatter.field("attrs", Lite(&_val.attrs)); |
| 3328 | } |
| 3329 | formatter.field("pat", Lite(&_val.pat)); |
| 3330 | formatter.field("ty", Lite(&_val.ty)); |
| 3331 | formatter.finish() |
| 3332 | } |
| 3333 | syn::Pat::Verbatim(_val) => { |
| 3334 | formatter.write_str("Pat::Verbatim")?; |
| 3335 | formatter.write_str("(`")?; |
| 3336 | Display::fmt(_val, formatter)?; |
| 3337 | formatter.write_str("`)")?; |
| 3338 | Ok(()) |
| 3339 | } |
| 3340 | syn::Pat::Wild(_val) => { |
| 3341 | let mut formatter = formatter.debug_struct("Pat::Wild"); |
| 3342 | if !_val.attrs.is_empty() { |
| 3343 | formatter.field("attrs", Lite(&_val.attrs)); |
| 3344 | } |
| 3345 | formatter.finish() |
| 3346 | } |
| 3347 | _ => unreachable!(), |
| 3348 | } |
| 3349 | } |
| 3350 | } |
| 3351 | impl Debug for Lite<syn::PatGuard> { |
| 3352 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3353 | let mut formatter = formatter.debug_struct("PatGuard"); |
| 3354 | if !self.value.attrs.is_empty() { |
| 3355 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 3356 | } |
| 3357 | formatter.field("pat", Lite(&self.value.pat)); |
| 3358 | formatter.field("guard", Lite(&self.value.guard)); |
| 3359 | formatter.finish() |
| 3360 | } |
| 3361 | } |
| 3362 | impl Debug for Lite<syn::PatIdent> { |
| 3363 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3364 | let mut formatter = formatter.debug_struct("PatIdent"); |
| 3365 | if !self.value.attrs.is_empty() { |
| 3366 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 3367 | } |
| 3368 | if self.value.by_ref.is_some() { |
| 3369 | formatter.field("by_ref", &Present); |
| 3370 | } |
| 3371 | if self.value.mutability.is_some() { |
| 3372 | formatter.field("mutability", &Present); |
| 3373 | } |
| 3374 | formatter.field("ident", Lite(&self.value.ident)); |
| 3375 | if let Some(val) = &self.value.subpat { |
| 3376 | #[derive(RefCast)] |
| 3377 | #[repr(transparent)] |
| 3378 | struct Print((syn::token::At, Box<syn::Pat>)); |
| 3379 | impl Debug for Print { |
| 3380 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3381 | formatter.write_str("Some(")?; |
| 3382 | Debug::fmt(Lite(&self.0.1), formatter)?; |
| 3383 | formatter.write_str(")")?; |
| 3384 | Ok(()) |
| 3385 | } |
| 3386 | } |
| 3387 | formatter.field("subpat", Print::ref_cast(val)); |
| 3388 | } |
| 3389 | formatter.finish() |
| 3390 | } |
| 3391 | } |
| 3392 | impl Debug for Lite<syn::PatOr> { |
| 3393 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3394 | let mut formatter = formatter.debug_struct("PatOr"); |
| 3395 | if !self.value.attrs.is_empty() { |
| 3396 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 3397 | } |
| 3398 | if self.value.leading_vert.is_some() { |
| 3399 | formatter.field("leading_vert", &Present); |
| 3400 | } |
| 3401 | if !self.value.cases.is_empty() { |
| 3402 | formatter.field("cases", Lite(&self.value.cases)); |
| 3403 | } |
| 3404 | formatter.finish() |
| 3405 | } |
| 3406 | } |
| 3407 | impl Debug for Lite<syn::PatParen> { |
| 3408 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3409 | let mut formatter = formatter.debug_struct("PatParen"); |
| 3410 | if !self.value.attrs.is_empty() { |
| 3411 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 3412 | } |
| 3413 | formatter.field("pat", Lite(&self.value.pat)); |
| 3414 | formatter.finish() |
| 3415 | } |
| 3416 | } |
| 3417 | impl Debug for Lite<syn::PatReference> { |
| 3418 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3419 | let mut formatter = formatter.debug_struct("PatReference"); |
| 3420 | if !self.value.attrs.is_empty() { |
| 3421 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 3422 | } |
| 3423 | if self.value.mutability.is_some() { |
| 3424 | formatter.field("mutability", &Present); |
| 3425 | } |
| 3426 | formatter.field("pat", Lite(&self.value.pat)); |
| 3427 | formatter.finish() |
| 3428 | } |
| 3429 | } |
| 3430 | impl Debug for Lite<syn::PatRest> { |
| 3431 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3432 | let mut formatter = formatter.debug_struct("PatRest"); |
| 3433 | if !self.value.attrs.is_empty() { |
| 3434 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 3435 | } |
| 3436 | formatter.finish() |
| 3437 | } |
| 3438 | } |
| 3439 | impl Debug for Lite<syn::PatSlice> { |
| 3440 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3441 | let mut formatter = formatter.debug_struct("PatSlice"); |
| 3442 | if !self.value.attrs.is_empty() { |
| 3443 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 3444 | } |
| 3445 | if !self.value.elems.is_empty() { |
| 3446 | formatter.field("elems", Lite(&self.value.elems)); |
| 3447 | } |
| 3448 | formatter.finish() |
| 3449 | } |
| 3450 | } |
| 3451 | impl Debug for Lite<syn::PatStruct> { |
| 3452 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3453 | let mut formatter = formatter.debug_struct("PatStruct"); |
| 3454 | if !self.value.attrs.is_empty() { |
| 3455 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 3456 | } |
| 3457 | if let Some(val) = &self.value.qself { |
| 3458 | #[derive(RefCast)] |
| 3459 | #[repr(transparent)] |
| 3460 | struct Print(syn::QSelf); |
| 3461 | impl Debug for Print { |
| 3462 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3463 | formatter.write_str("Some(")?; |
| 3464 | Debug::fmt(Lite(&self.0), formatter)?; |
| 3465 | formatter.write_str(")")?; |
| 3466 | Ok(()) |
| 3467 | } |
| 3468 | } |
| 3469 | formatter.field("qself", Print::ref_cast(val)); |
| 3470 | } |
| 3471 | formatter.field("path", Lite(&self.value.path)); |
| 3472 | if !self.value.fields.is_empty() { |
| 3473 | formatter.field("fields", Lite(&self.value.fields)); |
| 3474 | } |
| 3475 | if let Some(val) = &self.value.rest { |
| 3476 | #[derive(RefCast)] |
| 3477 | #[repr(transparent)] |
| 3478 | struct Print(syn::PatRest); |
| 3479 | impl Debug for Print { |
| 3480 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3481 | formatter.write_str("Some(")?; |
| 3482 | Debug::fmt(Lite(&self.0), formatter)?; |
| 3483 | formatter.write_str(")")?; |
| 3484 | Ok(()) |
| 3485 | } |
| 3486 | } |
| 3487 | formatter.field("rest", Print::ref_cast(val)); |
| 3488 | } |
| 3489 | formatter.finish() |
| 3490 | } |
| 3491 | } |
| 3492 | impl Debug for Lite<syn::PatTuple> { |
| 3493 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3494 | let mut formatter = formatter.debug_struct("PatTuple"); |
| 3495 | if !self.value.attrs.is_empty() { |
| 3496 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 3497 | } |
| 3498 | if !self.value.elems.is_empty() { |
| 3499 | formatter.field("elems", Lite(&self.value.elems)); |
| 3500 | } |
| 3501 | formatter.finish() |
| 3502 | } |
| 3503 | } |
| 3504 | impl Debug for Lite<syn::PatTupleStruct> { |
| 3505 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3506 | let mut formatter = formatter.debug_struct("PatTupleStruct"); |
| 3507 | if !self.value.attrs.is_empty() { |
| 3508 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 3509 | } |
| 3510 | if let Some(val) = &self.value.qself { |
| 3511 | #[derive(RefCast)] |
| 3512 | #[repr(transparent)] |
| 3513 | struct Print(syn::QSelf); |
| 3514 | impl Debug for Print { |
| 3515 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3516 | formatter.write_str("Some(")?; |
| 3517 | Debug::fmt(Lite(&self.0), formatter)?; |
| 3518 | formatter.write_str(")")?; |
| 3519 | Ok(()) |
| 3520 | } |
| 3521 | } |
| 3522 | formatter.field("qself", Print::ref_cast(val)); |
| 3523 | } |
| 3524 | formatter.field("path", Lite(&self.value.path)); |
| 3525 | if !self.value.elems.is_empty() { |
| 3526 | formatter.field("elems", Lite(&self.value.elems)); |
| 3527 | } |
| 3528 | formatter.finish() |
| 3529 | } |
| 3530 | } |
| 3531 | impl Debug for Lite<syn::PatType> { |
| 3532 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3533 | let mut formatter = formatter.debug_struct("PatType"); |
| 3534 | if !self.value.attrs.is_empty() { |
| 3535 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 3536 | } |
| 3537 | formatter.field("pat", Lite(&self.value.pat)); |
| 3538 | formatter.field("ty", Lite(&self.value.ty)); |
| 3539 | formatter.finish() |
| 3540 | } |
| 3541 | } |
| 3542 | impl Debug for Lite<syn::PatWild> { |
| 3543 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3544 | let mut formatter = formatter.debug_struct("PatWild"); |
| 3545 | if !self.value.attrs.is_empty() { |
| 3546 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 3547 | } |
| 3548 | formatter.finish() |
| 3549 | } |
| 3550 | } |
| 3551 | impl Debug for Lite<syn::Path> { |
| 3552 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3553 | let mut formatter = formatter.debug_struct("Path"); |
| 3554 | if self.value.leading_colon.is_some() { |
| 3555 | formatter.field("leading_colon", &Present); |
| 3556 | } |
| 3557 | if !self.value.segments.is_empty() { |
| 3558 | formatter.field("segments", Lite(&self.value.segments)); |
| 3559 | } |
| 3560 | formatter.finish() |
| 3561 | } |
| 3562 | } |
| 3563 | impl Debug for Lite<syn::PathArguments> { |
| 3564 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3565 | match &self.value { |
| 3566 | syn::PathArguments::None => formatter.write_str("PathArguments::None"), |
| 3567 | syn::PathArguments::AngleBracketed(_val) => { |
| 3568 | let mut formatter = formatter |
| 3569 | .debug_struct("PathArguments::AngleBracketed"); |
| 3570 | if _val.colon2_token.is_some() { |
| 3571 | formatter.field("colon2_token", &Present); |
| 3572 | } |
| 3573 | if !_val.args.is_empty() { |
| 3574 | formatter.field("args", Lite(&_val.args)); |
| 3575 | } |
| 3576 | formatter.finish() |
| 3577 | } |
| 3578 | syn::PathArguments::Parenthesized(_val) => { |
| 3579 | let mut formatter = formatter |
| 3580 | .debug_struct("PathArguments::Parenthesized"); |
| 3581 | if !_val.inputs.is_empty() { |
| 3582 | formatter.field("inputs", Lite(&_val.inputs)); |
| 3583 | } |
| 3584 | formatter.field("output", Lite(&_val.output)); |
| 3585 | formatter.finish() |
| 3586 | } |
| 3587 | } |
| 3588 | } |
| 3589 | } |
| 3590 | impl Debug for Lite<syn::PathSegment> { |
| 3591 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3592 | let mut formatter = formatter.debug_struct("PathSegment"); |
| 3593 | formatter.field("ident", Lite(&self.value.ident)); |
| 3594 | match self.value.arguments { |
| 3595 | syn::PathArguments::None => {} |
| 3596 | _ => { |
| 3597 | formatter.field("arguments", Lite(&self.value.arguments)); |
| 3598 | } |
| 3599 | } |
| 3600 | formatter.finish() |
| 3601 | } |
| 3602 | } |
| 3603 | impl Debug for Lite<syn::PointerMutability> { |
| 3604 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3605 | match &self.value { |
| 3606 | syn::PointerMutability::Const(_val) => { |
| 3607 | formatter.write_str("PointerMutability::Const")?; |
| 3608 | Ok(()) |
| 3609 | } |
| 3610 | syn::PointerMutability::Mut(_val) => { |
| 3611 | formatter.write_str("PointerMutability::Mut")?; |
| 3612 | Ok(()) |
| 3613 | } |
| 3614 | } |
| 3615 | } |
| 3616 | } |
| 3617 | impl Debug for Lite<syn::PreciseCapture> { |
| 3618 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3619 | let mut formatter = formatter.debug_struct("PreciseCapture"); |
| 3620 | if !self.value.params.is_empty() { |
| 3621 | formatter.field("params", Lite(&self.value.params)); |
| 3622 | } |
| 3623 | formatter.finish() |
| 3624 | } |
| 3625 | } |
| 3626 | impl Debug for Lite<syn::PredicateLifetime> { |
| 3627 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3628 | let mut formatter = formatter.debug_struct("PredicateLifetime"); |
| 3629 | if !self.value.attrs.is_empty() { |
| 3630 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 3631 | } |
| 3632 | formatter.field("lifetime", Lite(&self.value.lifetime)); |
| 3633 | if !self.value.bounds.is_empty() { |
| 3634 | formatter.field("bounds", Lite(&self.value.bounds)); |
| 3635 | } |
| 3636 | formatter.finish() |
| 3637 | } |
| 3638 | } |
| 3639 | impl Debug for Lite<syn::PredicateType> { |
| 3640 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3641 | let mut formatter = formatter.debug_struct("PredicateType"); |
| 3642 | if !self.value.attrs.is_empty() { |
| 3643 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 3644 | } |
| 3645 | if let Some(val) = &self.value.lifetimes { |
| 3646 | #[derive(RefCast)] |
| 3647 | #[repr(transparent)] |
| 3648 | struct Print(syn::BoundLifetimes); |
| 3649 | impl Debug for Print { |
| 3650 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3651 | formatter.write_str("Some(")?; |
| 3652 | Debug::fmt(Lite(&self.0), formatter)?; |
| 3653 | formatter.write_str(")")?; |
| 3654 | Ok(()) |
| 3655 | } |
| 3656 | } |
| 3657 | formatter.field("lifetimes", Print::ref_cast(val)); |
| 3658 | } |
| 3659 | formatter.field("bounded_ty", Lite(&self.value.bounded_ty)); |
| 3660 | if !self.value.bounds.is_empty() { |
| 3661 | formatter.field("bounds", Lite(&self.value.bounds)); |
| 3662 | } |
| 3663 | formatter.finish() |
| 3664 | } |
| 3665 | } |
| 3666 | impl Debug for Lite<syn::QSelf> { |
| 3667 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3668 | let mut formatter = formatter.debug_struct("QSelf"); |
| 3669 | formatter.field("ty", Lite(&self.value.ty)); |
| 3670 | formatter.field("position", Lite(&self.value.position)); |
| 3671 | if self.value.as_token.is_some() { |
| 3672 | formatter.field("as_token", &Present); |
| 3673 | } |
| 3674 | formatter.finish() |
| 3675 | } |
| 3676 | } |
| 3677 | impl Debug for Lite<syn::RangeLimits> { |
| 3678 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3679 | match &self.value { |
| 3680 | syn::RangeLimits::HalfOpen(_val) => { |
| 3681 | formatter.write_str("RangeLimits::HalfOpen")?; |
| 3682 | Ok(()) |
| 3683 | } |
| 3684 | syn::RangeLimits::Closed(_val) => { |
| 3685 | formatter.write_str("RangeLimits::Closed")?; |
| 3686 | Ok(()) |
| 3687 | } |
| 3688 | } |
| 3689 | } |
| 3690 | } |
| 3691 | impl Debug for Lite<syn::Receiver> { |
| 3692 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3693 | let mut formatter = formatter.debug_struct("Receiver"); |
| 3694 | if !self.value.attrs.is_empty() { |
| 3695 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 3696 | } |
| 3697 | if self.value.mutability.is_some() { |
| 3698 | formatter.field("mutability", &Present); |
| 3699 | } |
| 3700 | formatter.field("kind", Lite(&self.value.kind)); |
| 3701 | formatter.finish() |
| 3702 | } |
| 3703 | } |
| 3704 | impl Debug for Lite<syn::ReceiverKind> { |
| 3705 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3706 | match &self.value { |
| 3707 | syn::ReceiverKind::Value => formatter.write_str("ReceiverKind::Value"), |
| 3708 | syn::ReceiverKind::Reference(_v0, _v1, _v2) => { |
| 3709 | let mut formatter = formatter.debug_tuple("ReceiverKind::Reference"); |
| 3710 | formatter |
| 3711 | .field({ |
| 3712 | #[derive(RefCast)] |
| 3713 | #[repr(transparent)] |
| 3714 | struct Print(Option<syn::Lifetime>); |
| 3715 | impl Debug for Print { |
| 3716 | fn fmt( |
| 3717 | &self, |
| 3718 | formatter: &mut fmt::Formatter, |
| 3719 | ) -> fmt::Result { |
| 3720 | match &self.0 { |
| 3721 | Some(_val) => { |
| 3722 | formatter.write_str("Some(")?; |
| 3723 | Debug::fmt(Lite(_val), formatter)?; |
| 3724 | formatter.write_str(")")?; |
| 3725 | Ok(()) |
| 3726 | } |
| 3727 | None => formatter.write_str("None"), |
| 3728 | } |
| 3729 | } |
| 3730 | } |
| 3731 | Print::ref_cast(_v1) |
| 3732 | }); |
| 3733 | formatter |
| 3734 | .field( |
| 3735 | &super::Option { |
| 3736 | present: _v2.is_some(), |
| 3737 | }, |
| 3738 | ); |
| 3739 | formatter.finish() |
| 3740 | } |
| 3741 | syn::ReceiverKind::Typed(_v0, _v1) => { |
| 3742 | let mut formatter = formatter.debug_tuple("ReceiverKind::Typed"); |
| 3743 | formatter.field(Lite(_v1)); |
| 3744 | formatter.finish() |
| 3745 | } |
| 3746 | _ => unreachable!(), |
| 3747 | } |
| 3748 | } |
| 3749 | } |
| 3750 | impl Debug for Lite<syn::ReturnType> { |
| 3751 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3752 | match &self.value { |
| 3753 | syn::ReturnType::Default => formatter.write_str("ReturnType::Default"), |
| 3754 | syn::ReturnType::Type(_v0, _v1) => { |
| 3755 | let mut formatter = formatter.debug_tuple("ReturnType::Type"); |
| 3756 | formatter.field(Lite(_v1)); |
| 3757 | formatter.finish() |
| 3758 | } |
| 3759 | } |
| 3760 | } |
| 3761 | } |
| 3762 | impl Debug for Lite<syn::Safety> { |
| 3763 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3764 | match &self.value { |
| 3765 | syn::Safety::Safe(_val) => { |
| 3766 | formatter.write_str("Safety::Safe")?; |
| 3767 | Ok(()) |
| 3768 | } |
| 3769 | syn::Safety::Unsafe(_val) => { |
| 3770 | formatter.write_str("Safety::Unsafe")?; |
| 3771 | Ok(()) |
| 3772 | } |
| 3773 | syn::Safety::Default => formatter.write_str("Safety::Default"), |
| 3774 | } |
| 3775 | } |
| 3776 | } |
| 3777 | impl Debug for Lite<syn::Signature> { |
| 3778 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3779 | let mut formatter = formatter.debug_struct("Signature"); |
| 3780 | if self.value.constness.is_some() { |
| 3781 | formatter.field("constness", &Present); |
| 3782 | } |
| 3783 | if self.value.asyncness.is_some() { |
| 3784 | formatter.field("asyncness", &Present); |
| 3785 | } |
| 3786 | formatter.field("safety", Lite(&self.value.safety)); |
| 3787 | if let Some(val) = &self.value.abi { |
| 3788 | #[derive(RefCast)] |
| 3789 | #[repr(transparent)] |
| 3790 | struct Print(syn::Abi); |
| 3791 | impl Debug for Print { |
| 3792 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3793 | formatter.write_str("Some(")?; |
| 3794 | Debug::fmt(Lite(&self.0), formatter)?; |
| 3795 | formatter.write_str(")")?; |
| 3796 | Ok(()) |
| 3797 | } |
| 3798 | } |
| 3799 | formatter.field("abi", Print::ref_cast(val)); |
| 3800 | } |
| 3801 | formatter.field("ident", Lite(&self.value.ident)); |
| 3802 | formatter.field("generics", Lite(&self.value.generics)); |
| 3803 | if !self.value.inputs.is_empty() { |
| 3804 | formatter.field("inputs", Lite(&self.value.inputs)); |
| 3805 | } |
| 3806 | if let Some(val) = &self.value.variadic { |
| 3807 | #[derive(RefCast)] |
| 3808 | #[repr(transparent)] |
| 3809 | struct Print(syn::Variadic); |
| 3810 | impl Debug for Print { |
| 3811 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3812 | formatter.write_str("Some(")?; |
| 3813 | Debug::fmt(Lite(&self.0), formatter)?; |
| 3814 | formatter.write_str(")")?; |
| 3815 | Ok(()) |
| 3816 | } |
| 3817 | } |
| 3818 | formatter.field("variadic", Print::ref_cast(val)); |
| 3819 | } |
| 3820 | formatter.field("output", Lite(&self.value.output)); |
| 3821 | formatter.finish() |
| 3822 | } |
| 3823 | } |
| 3824 | impl Debug for Lite<syn::StaticMutability> { |
| 3825 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3826 | match &self.value { |
| 3827 | syn::StaticMutability::Mut(_val) => { |
| 3828 | formatter.write_str("StaticMutability::Mut")?; |
| 3829 | Ok(()) |
| 3830 | } |
| 3831 | syn::StaticMutability::None => formatter.write_str("StaticMutability::None"), |
| 3832 | _ => unreachable!(), |
| 3833 | } |
| 3834 | } |
| 3835 | } |
| 3836 | impl Debug for Lite<syn::Stmt> { |
| 3837 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3838 | match &self.value { |
| 3839 | syn::Stmt::Local(_val) => { |
| 3840 | let mut formatter = formatter.debug_struct("Stmt::Local"); |
| 3841 | if !_val.attrs.is_empty() { |
| 3842 | formatter.field("attrs", Lite(&_val.attrs)); |
| 3843 | } |
| 3844 | formatter.field("modifiers", Lite(&_val.modifiers)); |
| 3845 | formatter.field("pat", Lite(&_val.pat)); |
| 3846 | if let Some(val) = &_val.init { |
| 3847 | #[derive(RefCast)] |
| 3848 | #[repr(transparent)] |
| 3849 | struct Print(syn::LocalInit); |
| 3850 | impl Debug for Print { |
| 3851 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3852 | formatter.write_str("Some(")?; |
| 3853 | Debug::fmt(Lite(&self.0), formatter)?; |
| 3854 | formatter.write_str(")")?; |
| 3855 | Ok(()) |
| 3856 | } |
| 3857 | } |
| 3858 | formatter.field("init", Print::ref_cast(val)); |
| 3859 | } |
| 3860 | formatter.finish() |
| 3861 | } |
| 3862 | syn::Stmt::Item(_val) => { |
| 3863 | formatter.write_str("Stmt::Item")?; |
| 3864 | formatter.write_str("(")?; |
| 3865 | Debug::fmt(Lite(_val), formatter)?; |
| 3866 | formatter.write_str(")")?; |
| 3867 | Ok(()) |
| 3868 | } |
| 3869 | syn::Stmt::Expr(_v0, _v1) => { |
| 3870 | let mut formatter = formatter.debug_tuple("Stmt::Expr"); |
| 3871 | formatter.field(Lite(_v0)); |
| 3872 | formatter |
| 3873 | .field( |
| 3874 | &super::Option { |
| 3875 | present: _v1.is_some(), |
| 3876 | }, |
| 3877 | ); |
| 3878 | formatter.finish() |
| 3879 | } |
| 3880 | syn::Stmt::Macro(_val) => { |
| 3881 | let mut formatter = formatter.debug_struct("Stmt::Macro"); |
| 3882 | if !_val.attrs.is_empty() { |
| 3883 | formatter.field("attrs", Lite(&_val.attrs)); |
| 3884 | } |
| 3885 | formatter.field("mac", Lite(&_val.mac)); |
| 3886 | if _val.semi_token.is_some() { |
| 3887 | formatter.field("semi_token", &Present); |
| 3888 | } |
| 3889 | formatter.finish() |
| 3890 | } |
| 3891 | } |
| 3892 | } |
| 3893 | } |
| 3894 | impl Debug for Lite<syn::StmtMacro> { |
| 3895 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3896 | let mut formatter = formatter.debug_struct("StmtMacro"); |
| 3897 | if !self.value.attrs.is_empty() { |
| 3898 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 3899 | } |
| 3900 | formatter.field("mac", Lite(&self.value.mac)); |
| 3901 | if self.value.semi_token.is_some() { |
| 3902 | formatter.field("semi_token", &Present); |
| 3903 | } |
| 3904 | formatter.finish() |
| 3905 | } |
| 3906 | } |
| 3907 | impl Debug for Lite<syn::TraitBound> { |
| 3908 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3909 | let mut formatter = formatter.debug_struct("TraitBound"); |
| 3910 | if self.value.paren_token.is_some() { |
| 3911 | formatter.field("paren_token", &Present); |
| 3912 | } |
| 3913 | if let Some(val) = &self.value.lifetimes { |
| 3914 | #[derive(RefCast)] |
| 3915 | #[repr(transparent)] |
| 3916 | struct Print(syn::BoundLifetimes); |
| 3917 | impl Debug for Print { |
| 3918 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3919 | formatter.write_str("Some(")?; |
| 3920 | Debug::fmt(Lite(&self.0), formatter)?; |
| 3921 | formatter.write_str(")")?; |
| 3922 | Ok(()) |
| 3923 | } |
| 3924 | } |
| 3925 | formatter.field("lifetimes", Print::ref_cast(val)); |
| 3926 | } |
| 3927 | formatter.field("modifiers", Lite(&self.value.modifiers)); |
| 3928 | if self.value.maybe.is_some() { |
| 3929 | formatter.field("maybe", &Present); |
| 3930 | } |
| 3931 | formatter.field("path", Lite(&self.value.path)); |
| 3932 | formatter.finish() |
| 3933 | } |
| 3934 | } |
| 3935 | impl Debug for Lite<syn::TraitBoundModifiers> { |
| 3936 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3937 | let mut formatter = formatter.debug_struct("TraitBoundModifiers"); |
| 3938 | formatter.finish() |
| 3939 | } |
| 3940 | } |
| 3941 | impl Debug for Lite<syn::TraitItem> { |
| 3942 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3943 | match &self.value { |
| 3944 | syn::TraitItem::Const(_val) => { |
| 3945 | let mut formatter = formatter.debug_struct("TraitItem::Const"); |
| 3946 | if !_val.attrs.is_empty() { |
| 3947 | formatter.field("attrs", Lite(&_val.attrs)); |
| 3948 | } |
| 3949 | formatter.field("modifiers", Lite(&_val.modifiers)); |
| 3950 | formatter.field("ident", Lite(&_val.ident)); |
| 3951 | formatter.field("generics", Lite(&_val.generics)); |
| 3952 | formatter.field("ty", Lite(&_val.ty)); |
| 3953 | if let Some(val) = &_val.default { |
| 3954 | #[derive(RefCast)] |
| 3955 | #[repr(transparent)] |
| 3956 | struct Print((syn::token::Eq, syn::Expr)); |
| 3957 | impl Debug for Print { |
| 3958 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3959 | formatter.write_str("Some(")?; |
| 3960 | Debug::fmt(Lite(&self.0.1), formatter)?; |
| 3961 | formatter.write_str(")")?; |
| 3962 | Ok(()) |
| 3963 | } |
| 3964 | } |
| 3965 | formatter.field("default", Print::ref_cast(val)); |
| 3966 | } |
| 3967 | formatter.finish() |
| 3968 | } |
| 3969 | syn::TraitItem::Fn(_val) => { |
| 3970 | let mut formatter = formatter.debug_struct("TraitItem::Fn"); |
| 3971 | if !_val.attrs.is_empty() { |
| 3972 | formatter.field("attrs", Lite(&_val.attrs)); |
| 3973 | } |
| 3974 | formatter.field("modifiers", Lite(&_val.modifiers)); |
| 3975 | formatter.field("sig", Lite(&_val.sig)); |
| 3976 | if let Some(val) = &_val.default { |
| 3977 | #[derive(RefCast)] |
| 3978 | #[repr(transparent)] |
| 3979 | struct Print(syn::Block); |
| 3980 | impl Debug for Print { |
| 3981 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 3982 | formatter.write_str("Some(")?; |
| 3983 | Debug::fmt(Lite(&self.0), formatter)?; |
| 3984 | formatter.write_str(")")?; |
| 3985 | Ok(()) |
| 3986 | } |
| 3987 | } |
| 3988 | formatter.field("default", Print::ref_cast(val)); |
| 3989 | } |
| 3990 | if _val.semi_token.is_some() { |
| 3991 | formatter.field("semi_token", &Present); |
| 3992 | } |
| 3993 | formatter.finish() |
| 3994 | } |
| 3995 | syn::TraitItem::Type(_val) => { |
| 3996 | let mut formatter = formatter.debug_struct("TraitItem::Type"); |
| 3997 | if !_val.attrs.is_empty() { |
| 3998 | formatter.field("attrs", Lite(&_val.attrs)); |
| 3999 | } |
| 4000 | formatter.field("modifiers", Lite(&_val.modifiers)); |
| 4001 | formatter.field("ident", Lite(&_val.ident)); |
| 4002 | formatter.field("generics", Lite(&_val.generics)); |
| 4003 | if _val.colon_token.is_some() { |
| 4004 | formatter.field("colon_token", &Present); |
| 4005 | } |
| 4006 | if !_val.bounds.is_empty() { |
| 4007 | formatter.field("bounds", Lite(&_val.bounds)); |
| 4008 | } |
| 4009 | if let Some(val) = &_val.default { |
| 4010 | #[derive(RefCast)] |
| 4011 | #[repr(transparent)] |
| 4012 | struct Print((syn::token::Eq, syn::Type)); |
| 4013 | impl Debug for Print { |
| 4014 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4015 | formatter.write_str("Some(")?; |
| 4016 | Debug::fmt(Lite(&self.0.1), formatter)?; |
| 4017 | formatter.write_str(")")?; |
| 4018 | Ok(()) |
| 4019 | } |
| 4020 | } |
| 4021 | formatter.field("default", Print::ref_cast(val)); |
| 4022 | } |
| 4023 | formatter.finish() |
| 4024 | } |
| 4025 | syn::TraitItem::Macro(_val) => { |
| 4026 | let mut formatter = formatter.debug_struct("TraitItem::Macro"); |
| 4027 | if !_val.attrs.is_empty() { |
| 4028 | formatter.field("attrs", Lite(&_val.attrs)); |
| 4029 | } |
| 4030 | formatter.field("mac", Lite(&_val.mac)); |
| 4031 | if _val.semi_token.is_some() { |
| 4032 | formatter.field("semi_token", &Present); |
| 4033 | } |
| 4034 | formatter.finish() |
| 4035 | } |
| 4036 | syn::TraitItem::Verbatim(_val) => { |
| 4037 | formatter.write_str("TraitItem::Verbatim")?; |
| 4038 | formatter.write_str("(`")?; |
| 4039 | Display::fmt(_val, formatter)?; |
| 4040 | formatter.write_str("`)")?; |
| 4041 | Ok(()) |
| 4042 | } |
| 4043 | _ => unreachable!(), |
| 4044 | } |
| 4045 | } |
| 4046 | } |
| 4047 | impl Debug for Lite<syn::TraitItemConst> { |
| 4048 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4049 | let mut formatter = formatter.debug_struct("TraitItemConst"); |
| 4050 | if !self.value.attrs.is_empty() { |
| 4051 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 4052 | } |
| 4053 | formatter.field("modifiers", Lite(&self.value.modifiers)); |
| 4054 | formatter.field("ident", Lite(&self.value.ident)); |
| 4055 | formatter.field("generics", Lite(&self.value.generics)); |
| 4056 | formatter.field("ty", Lite(&self.value.ty)); |
| 4057 | if let Some(val) = &self.value.default { |
| 4058 | #[derive(RefCast)] |
| 4059 | #[repr(transparent)] |
| 4060 | struct Print((syn::token::Eq, syn::Expr)); |
| 4061 | impl Debug for Print { |
| 4062 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4063 | formatter.write_str("Some(")?; |
| 4064 | Debug::fmt(Lite(&self.0.1), formatter)?; |
| 4065 | formatter.write_str(")")?; |
| 4066 | Ok(()) |
| 4067 | } |
| 4068 | } |
| 4069 | formatter.field("default", Print::ref_cast(val)); |
| 4070 | } |
| 4071 | formatter.finish() |
| 4072 | } |
| 4073 | } |
| 4074 | impl Debug for Lite<syn::TraitItemFn> { |
| 4075 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4076 | let mut formatter = formatter.debug_struct("TraitItemFn"); |
| 4077 | if !self.value.attrs.is_empty() { |
| 4078 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 4079 | } |
| 4080 | formatter.field("modifiers", Lite(&self.value.modifiers)); |
| 4081 | formatter.field("sig", Lite(&self.value.sig)); |
| 4082 | if let Some(val) = &self.value.default { |
| 4083 | #[derive(RefCast)] |
| 4084 | #[repr(transparent)] |
| 4085 | struct Print(syn::Block); |
| 4086 | impl Debug for Print { |
| 4087 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4088 | formatter.write_str("Some(")?; |
| 4089 | Debug::fmt(Lite(&self.0), formatter)?; |
| 4090 | formatter.write_str(")")?; |
| 4091 | Ok(()) |
| 4092 | } |
| 4093 | } |
| 4094 | formatter.field("default", Print::ref_cast(val)); |
| 4095 | } |
| 4096 | if self.value.semi_token.is_some() { |
| 4097 | formatter.field("semi_token", &Present); |
| 4098 | } |
| 4099 | formatter.finish() |
| 4100 | } |
| 4101 | } |
| 4102 | impl Debug for Lite<syn::TraitItemMacro> { |
| 4103 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4104 | let mut formatter = formatter.debug_struct("TraitItemMacro"); |
| 4105 | if !self.value.attrs.is_empty() { |
| 4106 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 4107 | } |
| 4108 | formatter.field("mac", Lite(&self.value.mac)); |
| 4109 | if self.value.semi_token.is_some() { |
| 4110 | formatter.field("semi_token", &Present); |
| 4111 | } |
| 4112 | formatter.finish() |
| 4113 | } |
| 4114 | } |
| 4115 | impl Debug for Lite<syn::TraitItemType> { |
| 4116 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4117 | let mut formatter = formatter.debug_struct("TraitItemType"); |
| 4118 | if !self.value.attrs.is_empty() { |
| 4119 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 4120 | } |
| 4121 | formatter.field("modifiers", Lite(&self.value.modifiers)); |
| 4122 | formatter.field("ident", Lite(&self.value.ident)); |
| 4123 | formatter.field("generics", Lite(&self.value.generics)); |
| 4124 | if self.value.colon_token.is_some() { |
| 4125 | formatter.field("colon_token", &Present); |
| 4126 | } |
| 4127 | if !self.value.bounds.is_empty() { |
| 4128 | formatter.field("bounds", Lite(&self.value.bounds)); |
| 4129 | } |
| 4130 | if let Some(val) = &self.value.default { |
| 4131 | #[derive(RefCast)] |
| 4132 | #[repr(transparent)] |
| 4133 | struct Print((syn::token::Eq, syn::Type)); |
| 4134 | impl Debug for Print { |
| 4135 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4136 | formatter.write_str("Some(")?; |
| 4137 | Debug::fmt(Lite(&self.0.1), formatter)?; |
| 4138 | formatter.write_str(")")?; |
| 4139 | Ok(()) |
| 4140 | } |
| 4141 | } |
| 4142 | formatter.field("default", Print::ref_cast(val)); |
| 4143 | } |
| 4144 | formatter.finish() |
| 4145 | } |
| 4146 | } |
| 4147 | impl Debug for Lite<syn::TraitModifiers> { |
| 4148 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4149 | let mut formatter = formatter.debug_struct("TraitModifiers"); |
| 4150 | if self.value.auto_token.is_some() { |
| 4151 | formatter.field("auto_token", &Present); |
| 4152 | } |
| 4153 | formatter.finish() |
| 4154 | } |
| 4155 | } |
| 4156 | impl Debug for Lite<syn::Type> { |
| 4157 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4158 | match &self.value { |
| 4159 | syn::Type::Array(_val) => { |
| 4160 | let mut formatter = formatter.debug_struct("Type::Array"); |
| 4161 | if !_val.attrs.is_empty() { |
| 4162 | formatter.field("attrs", Lite(&_val.attrs)); |
| 4163 | } |
| 4164 | formatter.field("elem", Lite(&_val.elem)); |
| 4165 | formatter.field("len", Lite(&_val.len)); |
| 4166 | formatter.finish() |
| 4167 | } |
| 4168 | syn::Type::FnPtr(_val) => { |
| 4169 | let mut formatter = formatter.debug_struct("Type::FnPtr"); |
| 4170 | if !_val.attrs.is_empty() { |
| 4171 | formatter.field("attrs", Lite(&_val.attrs)); |
| 4172 | } |
| 4173 | if let Some(val) = &_val.lifetimes { |
| 4174 | #[derive(RefCast)] |
| 4175 | #[repr(transparent)] |
| 4176 | struct Print(syn::BoundLifetimes); |
| 4177 | impl Debug for Print { |
| 4178 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4179 | formatter.write_str("Some(")?; |
| 4180 | Debug::fmt(Lite(&self.0), formatter)?; |
| 4181 | formatter.write_str(")")?; |
| 4182 | Ok(()) |
| 4183 | } |
| 4184 | } |
| 4185 | formatter.field("lifetimes", Print::ref_cast(val)); |
| 4186 | } |
| 4187 | if _val.unsafety.is_some() { |
| 4188 | formatter.field("unsafety", &Present); |
| 4189 | } |
| 4190 | if let Some(val) = &_val.abi { |
| 4191 | #[derive(RefCast)] |
| 4192 | #[repr(transparent)] |
| 4193 | struct Print(syn::Abi); |
| 4194 | impl Debug for Print { |
| 4195 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4196 | formatter.write_str("Some(")?; |
| 4197 | Debug::fmt(Lite(&self.0), formatter)?; |
| 4198 | formatter.write_str(")")?; |
| 4199 | Ok(()) |
| 4200 | } |
| 4201 | } |
| 4202 | formatter.field("abi", Print::ref_cast(val)); |
| 4203 | } |
| 4204 | if !_val.inputs.is_empty() { |
| 4205 | formatter.field("inputs", Lite(&_val.inputs)); |
| 4206 | } |
| 4207 | if let Some(val) = &_val.variadic { |
| 4208 | #[derive(RefCast)] |
| 4209 | #[repr(transparent)] |
| 4210 | struct Print(syn::FnPtrVariadic); |
| 4211 | impl Debug for Print { |
| 4212 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4213 | formatter.write_str("Some(")?; |
| 4214 | Debug::fmt(Lite(&self.0), formatter)?; |
| 4215 | formatter.write_str(")")?; |
| 4216 | Ok(()) |
| 4217 | } |
| 4218 | } |
| 4219 | formatter.field("variadic", Print::ref_cast(val)); |
| 4220 | } |
| 4221 | formatter.field("output", Lite(&_val.output)); |
| 4222 | formatter.finish() |
| 4223 | } |
| 4224 | syn::Type::Group(_val) => { |
| 4225 | let mut formatter = formatter.debug_struct("Type::Group"); |
| 4226 | if !_val.attrs.is_empty() { |
| 4227 | formatter.field("attrs", Lite(&_val.attrs)); |
| 4228 | } |
| 4229 | formatter.field("elem", Lite(&_val.elem)); |
| 4230 | formatter.finish() |
| 4231 | } |
| 4232 | syn::Type::ImplTrait(_val) => { |
| 4233 | let mut formatter = formatter.debug_struct("Type::ImplTrait"); |
| 4234 | if !_val.attrs.is_empty() { |
| 4235 | formatter.field("attrs", Lite(&_val.attrs)); |
| 4236 | } |
| 4237 | if !_val.bounds.is_empty() { |
| 4238 | formatter.field("bounds", Lite(&_val.bounds)); |
| 4239 | } |
| 4240 | formatter.finish() |
| 4241 | } |
| 4242 | syn::Type::Infer(_val) => { |
| 4243 | let mut formatter = formatter.debug_struct("Type::Infer"); |
| 4244 | if !_val.attrs.is_empty() { |
| 4245 | formatter.field("attrs", Lite(&_val.attrs)); |
| 4246 | } |
| 4247 | formatter.finish() |
| 4248 | } |
| 4249 | syn::Type::Macro(_val) => { |
| 4250 | let mut formatter = formatter.debug_struct("Type::Macro"); |
| 4251 | if !_val.attrs.is_empty() { |
| 4252 | formatter.field("attrs", Lite(&_val.attrs)); |
| 4253 | } |
| 4254 | formatter.field("mac", Lite(&_val.mac)); |
| 4255 | formatter.finish() |
| 4256 | } |
| 4257 | syn::Type::Never(_val) => { |
| 4258 | let mut formatter = formatter.debug_struct("Type::Never"); |
| 4259 | if !_val.attrs.is_empty() { |
| 4260 | formatter.field("attrs", Lite(&_val.attrs)); |
| 4261 | } |
| 4262 | formatter.finish() |
| 4263 | } |
| 4264 | syn::Type::Paren(_val) => { |
| 4265 | let mut formatter = formatter.debug_struct("Type::Paren"); |
| 4266 | if !_val.attrs.is_empty() { |
| 4267 | formatter.field("attrs", Lite(&_val.attrs)); |
| 4268 | } |
| 4269 | formatter.field("elem", Lite(&_val.elem)); |
| 4270 | formatter.finish() |
| 4271 | } |
| 4272 | syn::Type::Path(_val) => { |
| 4273 | let mut formatter = formatter.debug_struct("Type::Path"); |
| 4274 | if !_val.attrs.is_empty() { |
| 4275 | formatter.field("attrs", Lite(&_val.attrs)); |
| 4276 | } |
| 4277 | if let Some(val) = &_val.qself { |
| 4278 | #[derive(RefCast)] |
| 4279 | #[repr(transparent)] |
| 4280 | struct Print(syn::QSelf); |
| 4281 | impl Debug for Print { |
| 4282 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4283 | formatter.write_str("Some(")?; |
| 4284 | Debug::fmt(Lite(&self.0), formatter)?; |
| 4285 | formatter.write_str(")")?; |
| 4286 | Ok(()) |
| 4287 | } |
| 4288 | } |
| 4289 | formatter.field("qself", Print::ref_cast(val)); |
| 4290 | } |
| 4291 | formatter.field("path", Lite(&_val.path)); |
| 4292 | formatter.finish() |
| 4293 | } |
| 4294 | syn::Type::Ptr(_val) => { |
| 4295 | let mut formatter = formatter.debug_struct("Type::Ptr"); |
| 4296 | if !_val.attrs.is_empty() { |
| 4297 | formatter.field("attrs", Lite(&_val.attrs)); |
| 4298 | } |
| 4299 | formatter.field("mutability", Lite(&_val.mutability)); |
| 4300 | formatter.field("elem", Lite(&_val.elem)); |
| 4301 | formatter.finish() |
| 4302 | } |
| 4303 | syn::Type::Reference(_val) => { |
| 4304 | let mut formatter = formatter.debug_struct("Type::Reference"); |
| 4305 | if !_val.attrs.is_empty() { |
| 4306 | formatter.field("attrs", Lite(&_val.attrs)); |
| 4307 | } |
| 4308 | if let Some(val) = &_val.lifetime { |
| 4309 | #[derive(RefCast)] |
| 4310 | #[repr(transparent)] |
| 4311 | struct Print(syn::Lifetime); |
| 4312 | impl Debug for Print { |
| 4313 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4314 | formatter.write_str("Some(")?; |
| 4315 | Debug::fmt(Lite(&self.0), formatter)?; |
| 4316 | formatter.write_str(")")?; |
| 4317 | Ok(()) |
| 4318 | } |
| 4319 | } |
| 4320 | formatter.field("lifetime", Print::ref_cast(val)); |
| 4321 | } |
| 4322 | if _val.mutability.is_some() { |
| 4323 | formatter.field("mutability", &Present); |
| 4324 | } |
| 4325 | formatter.field("elem", Lite(&_val.elem)); |
| 4326 | formatter.finish() |
| 4327 | } |
| 4328 | syn::Type::Slice(_val) => { |
| 4329 | let mut formatter = formatter.debug_struct("Type::Slice"); |
| 4330 | if !_val.attrs.is_empty() { |
| 4331 | formatter.field("attrs", Lite(&_val.attrs)); |
| 4332 | } |
| 4333 | formatter.field("elem", Lite(&_val.elem)); |
| 4334 | formatter.finish() |
| 4335 | } |
| 4336 | syn::Type::TraitObject(_val) => { |
| 4337 | let mut formatter = formatter.debug_struct("Type::TraitObject"); |
| 4338 | if !_val.attrs.is_empty() { |
| 4339 | formatter.field("attrs", Lite(&_val.attrs)); |
| 4340 | } |
| 4341 | if _val.dyn_token.is_some() { |
| 4342 | formatter.field("dyn_token", &Present); |
| 4343 | } |
| 4344 | if !_val.bounds.is_empty() { |
| 4345 | formatter.field("bounds", Lite(&_val.bounds)); |
| 4346 | } |
| 4347 | formatter.finish() |
| 4348 | } |
| 4349 | syn::Type::Tuple(_val) => { |
| 4350 | let mut formatter = formatter.debug_struct("Type::Tuple"); |
| 4351 | if !_val.attrs.is_empty() { |
| 4352 | formatter.field("attrs", Lite(&_val.attrs)); |
| 4353 | } |
| 4354 | if !_val.elems.is_empty() { |
| 4355 | formatter.field("elems", Lite(&_val.elems)); |
| 4356 | } |
| 4357 | formatter.finish() |
| 4358 | } |
| 4359 | syn::Type::Verbatim(_val) => { |
| 4360 | formatter.write_str("Type::Verbatim")?; |
| 4361 | formatter.write_str("(`")?; |
| 4362 | Display::fmt(_val, formatter)?; |
| 4363 | formatter.write_str("`)")?; |
| 4364 | Ok(()) |
| 4365 | } |
| 4366 | _ => unreachable!(), |
| 4367 | } |
| 4368 | } |
| 4369 | } |
| 4370 | impl Debug for Lite<syn::TypeArray> { |
| 4371 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4372 | let mut formatter = formatter.debug_struct("TypeArray"); |
| 4373 | if !self.value.attrs.is_empty() { |
| 4374 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 4375 | } |
| 4376 | formatter.field("elem", Lite(&self.value.elem)); |
| 4377 | formatter.field("len", Lite(&self.value.len)); |
| 4378 | formatter.finish() |
| 4379 | } |
| 4380 | } |
| 4381 | impl Debug for Lite<syn::TypeFnPtr> { |
| 4382 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4383 | let mut formatter = formatter.debug_struct("TypeFnPtr"); |
| 4384 | if !self.value.attrs.is_empty() { |
| 4385 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 4386 | } |
| 4387 | if let Some(val) = &self.value.lifetimes { |
| 4388 | #[derive(RefCast)] |
| 4389 | #[repr(transparent)] |
| 4390 | struct Print(syn::BoundLifetimes); |
| 4391 | impl Debug for Print { |
| 4392 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4393 | formatter.write_str("Some(")?; |
| 4394 | Debug::fmt(Lite(&self.0), formatter)?; |
| 4395 | formatter.write_str(")")?; |
| 4396 | Ok(()) |
| 4397 | } |
| 4398 | } |
| 4399 | formatter.field("lifetimes", Print::ref_cast(val)); |
| 4400 | } |
| 4401 | if self.value.unsafety.is_some() { |
| 4402 | formatter.field("unsafety", &Present); |
| 4403 | } |
| 4404 | if let Some(val) = &self.value.abi { |
| 4405 | #[derive(RefCast)] |
| 4406 | #[repr(transparent)] |
| 4407 | struct Print(syn::Abi); |
| 4408 | impl Debug for Print { |
| 4409 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4410 | formatter.write_str("Some(")?; |
| 4411 | Debug::fmt(Lite(&self.0), formatter)?; |
| 4412 | formatter.write_str(")")?; |
| 4413 | Ok(()) |
| 4414 | } |
| 4415 | } |
| 4416 | formatter.field("abi", Print::ref_cast(val)); |
| 4417 | } |
| 4418 | if !self.value.inputs.is_empty() { |
| 4419 | formatter.field("inputs", Lite(&self.value.inputs)); |
| 4420 | } |
| 4421 | if let Some(val) = &self.value.variadic { |
| 4422 | #[derive(RefCast)] |
| 4423 | #[repr(transparent)] |
| 4424 | struct Print(syn::FnPtrVariadic); |
| 4425 | impl Debug for Print { |
| 4426 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4427 | formatter.write_str("Some(")?; |
| 4428 | Debug::fmt(Lite(&self.0), formatter)?; |
| 4429 | formatter.write_str(")")?; |
| 4430 | Ok(()) |
| 4431 | } |
| 4432 | } |
| 4433 | formatter.field("variadic", Print::ref_cast(val)); |
| 4434 | } |
| 4435 | formatter.field("output", Lite(&self.value.output)); |
| 4436 | formatter.finish() |
| 4437 | } |
| 4438 | } |
| 4439 | impl Debug for Lite<syn::TypeGroup> { |
| 4440 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4441 | let mut formatter = formatter.debug_struct("TypeGroup"); |
| 4442 | if !self.value.attrs.is_empty() { |
| 4443 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 4444 | } |
| 4445 | formatter.field("elem", Lite(&self.value.elem)); |
| 4446 | formatter.finish() |
| 4447 | } |
| 4448 | } |
| 4449 | impl Debug for Lite<syn::TypeImplTrait> { |
| 4450 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4451 | let mut formatter = formatter.debug_struct("TypeImplTrait"); |
| 4452 | if !self.value.attrs.is_empty() { |
| 4453 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 4454 | } |
| 4455 | if !self.value.bounds.is_empty() { |
| 4456 | formatter.field("bounds", Lite(&self.value.bounds)); |
| 4457 | } |
| 4458 | formatter.finish() |
| 4459 | } |
| 4460 | } |
| 4461 | impl Debug for Lite<syn::TypeInfer> { |
| 4462 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4463 | let mut formatter = formatter.debug_struct("TypeInfer"); |
| 4464 | if !self.value.attrs.is_empty() { |
| 4465 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 4466 | } |
| 4467 | formatter.finish() |
| 4468 | } |
| 4469 | } |
| 4470 | impl Debug for Lite<syn::TypeMacro> { |
| 4471 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4472 | let mut formatter = formatter.debug_struct("TypeMacro"); |
| 4473 | if !self.value.attrs.is_empty() { |
| 4474 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 4475 | } |
| 4476 | formatter.field("mac", Lite(&self.value.mac)); |
| 4477 | formatter.finish() |
| 4478 | } |
| 4479 | } |
| 4480 | impl Debug for Lite<syn::TypeModifiers> { |
| 4481 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4482 | let mut formatter = formatter.debug_struct("TypeModifiers"); |
| 4483 | if self.value.defaultness.is_some() { |
| 4484 | formatter.field("defaultness", &Present); |
| 4485 | } |
| 4486 | formatter.finish() |
| 4487 | } |
| 4488 | } |
| 4489 | impl Debug for Lite<syn::TypeNever> { |
| 4490 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4491 | let mut formatter = formatter.debug_struct("TypeNever"); |
| 4492 | if !self.value.attrs.is_empty() { |
| 4493 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 4494 | } |
| 4495 | formatter.finish() |
| 4496 | } |
| 4497 | } |
| 4498 | impl Debug for Lite<syn::TypeParam> { |
| 4499 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4500 | let mut formatter = formatter.debug_struct("TypeParam"); |
| 4501 | if !self.value.attrs.is_empty() { |
| 4502 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 4503 | } |
| 4504 | formatter.field("ident", Lite(&self.value.ident)); |
| 4505 | if self.value.colon_token.is_some() { |
| 4506 | formatter.field("colon_token", &Present); |
| 4507 | } |
| 4508 | if !self.value.bounds.is_empty() { |
| 4509 | formatter.field("bounds", Lite(&self.value.bounds)); |
| 4510 | } |
| 4511 | if let Some(val) = &self.value.default { |
| 4512 | #[derive(RefCast)] |
| 4513 | #[repr(transparent)] |
| 4514 | struct Print((syn::token::Eq, syn::Type)); |
| 4515 | impl Debug for Print { |
| 4516 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4517 | formatter.write_str("Some(")?; |
| 4518 | Debug::fmt(Lite(&self.0.1), formatter)?; |
| 4519 | formatter.write_str(")")?; |
| 4520 | Ok(()) |
| 4521 | } |
| 4522 | } |
| 4523 | formatter.field("default", Print::ref_cast(val)); |
| 4524 | } |
| 4525 | formatter.finish() |
| 4526 | } |
| 4527 | } |
| 4528 | impl Debug for Lite<syn::TypeParamBound> { |
| 4529 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4530 | match &self.value { |
| 4531 | syn::TypeParamBound::Trait(_val) => { |
| 4532 | formatter.write_str("TypeParamBound::Trait")?; |
| 4533 | formatter.write_str("(")?; |
| 4534 | Debug::fmt(Lite(_val), formatter)?; |
| 4535 | formatter.write_str(")")?; |
| 4536 | Ok(()) |
| 4537 | } |
| 4538 | syn::TypeParamBound::Lifetime(_val) => { |
| 4539 | let mut formatter = formatter.debug_struct("TypeParamBound::Lifetime"); |
| 4540 | formatter.field("ident", Lite(&_val.ident)); |
| 4541 | formatter.finish() |
| 4542 | } |
| 4543 | syn::TypeParamBound::PreciseCapture(_val) => { |
| 4544 | formatter.write_str("TypeParamBound::PreciseCapture")?; |
| 4545 | formatter.write_str("(")?; |
| 4546 | Debug::fmt(Lite(_val), formatter)?; |
| 4547 | formatter.write_str(")")?; |
| 4548 | Ok(()) |
| 4549 | } |
| 4550 | syn::TypeParamBound::Verbatim(_val) => { |
| 4551 | formatter.write_str("TypeParamBound::Verbatim")?; |
| 4552 | formatter.write_str("(`")?; |
| 4553 | Display::fmt(_val, formatter)?; |
| 4554 | formatter.write_str("`)")?; |
| 4555 | Ok(()) |
| 4556 | } |
| 4557 | _ => unreachable!(), |
| 4558 | } |
| 4559 | } |
| 4560 | } |
| 4561 | impl Debug for Lite<syn::TypeParen> { |
| 4562 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4563 | let mut formatter = formatter.debug_struct("TypeParen"); |
| 4564 | if !self.value.attrs.is_empty() { |
| 4565 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 4566 | } |
| 4567 | formatter.field("elem", Lite(&self.value.elem)); |
| 4568 | formatter.finish() |
| 4569 | } |
| 4570 | } |
| 4571 | impl Debug for Lite<syn::TypePath> { |
| 4572 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4573 | let mut formatter = formatter.debug_struct("TypePath"); |
| 4574 | if !self.value.attrs.is_empty() { |
| 4575 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 4576 | } |
| 4577 | if let Some(val) = &self.value.qself { |
| 4578 | #[derive(RefCast)] |
| 4579 | #[repr(transparent)] |
| 4580 | struct Print(syn::QSelf); |
| 4581 | impl Debug for Print { |
| 4582 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4583 | formatter.write_str("Some(")?; |
| 4584 | Debug::fmt(Lite(&self.0), formatter)?; |
| 4585 | formatter.write_str(")")?; |
| 4586 | Ok(()) |
| 4587 | } |
| 4588 | } |
| 4589 | formatter.field("qself", Print::ref_cast(val)); |
| 4590 | } |
| 4591 | formatter.field("path", Lite(&self.value.path)); |
| 4592 | formatter.finish() |
| 4593 | } |
| 4594 | } |
| 4595 | impl Debug for Lite<syn::TypePtr> { |
| 4596 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4597 | let mut formatter = formatter.debug_struct("TypePtr"); |
| 4598 | if !self.value.attrs.is_empty() { |
| 4599 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 4600 | } |
| 4601 | formatter.field("mutability", Lite(&self.value.mutability)); |
| 4602 | formatter.field("elem", Lite(&self.value.elem)); |
| 4603 | formatter.finish() |
| 4604 | } |
| 4605 | } |
| 4606 | impl Debug for Lite<syn::TypeReference> { |
| 4607 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4608 | let mut formatter = formatter.debug_struct("TypeReference"); |
| 4609 | if !self.value.attrs.is_empty() { |
| 4610 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 4611 | } |
| 4612 | if let Some(val) = &self.value.lifetime { |
| 4613 | #[derive(RefCast)] |
| 4614 | #[repr(transparent)] |
| 4615 | struct Print(syn::Lifetime); |
| 4616 | impl Debug for Print { |
| 4617 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4618 | formatter.write_str("Some(")?; |
| 4619 | Debug::fmt(Lite(&self.0), formatter)?; |
| 4620 | formatter.write_str(")")?; |
| 4621 | Ok(()) |
| 4622 | } |
| 4623 | } |
| 4624 | formatter.field("lifetime", Print::ref_cast(val)); |
| 4625 | } |
| 4626 | if self.value.mutability.is_some() { |
| 4627 | formatter.field("mutability", &Present); |
| 4628 | } |
| 4629 | formatter.field("elem", Lite(&self.value.elem)); |
| 4630 | formatter.finish() |
| 4631 | } |
| 4632 | } |
| 4633 | impl Debug for Lite<syn::TypeSlice> { |
| 4634 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4635 | let mut formatter = formatter.debug_struct("TypeSlice"); |
| 4636 | if !self.value.attrs.is_empty() { |
| 4637 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 4638 | } |
| 4639 | formatter.field("elem", Lite(&self.value.elem)); |
| 4640 | formatter.finish() |
| 4641 | } |
| 4642 | } |
| 4643 | impl Debug for Lite<syn::TypeTraitObject> { |
| 4644 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4645 | let mut formatter = formatter.debug_struct("TypeTraitObject"); |
| 4646 | if !self.value.attrs.is_empty() { |
| 4647 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 4648 | } |
| 4649 | if self.value.dyn_token.is_some() { |
| 4650 | formatter.field("dyn_token", &Present); |
| 4651 | } |
| 4652 | if !self.value.bounds.is_empty() { |
| 4653 | formatter.field("bounds", Lite(&self.value.bounds)); |
| 4654 | } |
| 4655 | formatter.finish() |
| 4656 | } |
| 4657 | } |
| 4658 | impl Debug for Lite<syn::TypeTuple> { |
| 4659 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4660 | let mut formatter = formatter.debug_struct("TypeTuple"); |
| 4661 | if !self.value.attrs.is_empty() { |
| 4662 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 4663 | } |
| 4664 | if !self.value.elems.is_empty() { |
| 4665 | formatter.field("elems", Lite(&self.value.elems)); |
| 4666 | } |
| 4667 | formatter.finish() |
| 4668 | } |
| 4669 | } |
| 4670 | impl Debug for Lite<syn::UnOp> { |
| 4671 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4672 | match &self.value { |
| 4673 | syn::UnOp::Deref(_val) => { |
| 4674 | formatter.write_str("UnOp::Deref")?; |
| 4675 | Ok(()) |
| 4676 | } |
| 4677 | syn::UnOp::Not(_val) => { |
| 4678 | formatter.write_str("UnOp::Not")?; |
| 4679 | Ok(()) |
| 4680 | } |
| 4681 | syn::UnOp::Neg(_val) => { |
| 4682 | formatter.write_str("UnOp::Neg")?; |
| 4683 | Ok(()) |
| 4684 | } |
| 4685 | _ => unreachable!(), |
| 4686 | } |
| 4687 | } |
| 4688 | } |
| 4689 | impl Debug for Lite<syn::UseGlob> { |
| 4690 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4691 | let mut formatter = formatter.debug_struct("UseGlob"); |
| 4692 | formatter.finish() |
| 4693 | } |
| 4694 | } |
| 4695 | impl Debug for Lite<syn::UseGroup> { |
| 4696 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4697 | let mut formatter = formatter.debug_struct("UseGroup"); |
| 4698 | if !self.value.items.is_empty() { |
| 4699 | formatter.field("items", Lite(&self.value.items)); |
| 4700 | } |
| 4701 | formatter.finish() |
| 4702 | } |
| 4703 | } |
| 4704 | impl Debug for Lite<syn::UseName> { |
| 4705 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4706 | let mut formatter = formatter.debug_struct("UseName"); |
| 4707 | formatter.field("ident", Lite(&self.value.ident)); |
| 4708 | formatter.finish() |
| 4709 | } |
| 4710 | } |
| 4711 | impl Debug for Lite<syn::UsePath> { |
| 4712 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4713 | let mut formatter = formatter.debug_struct("UsePath"); |
| 4714 | formatter.field("ident", Lite(&self.value.ident)); |
| 4715 | formatter.field("tree", Lite(&self.value.tree)); |
| 4716 | formatter.finish() |
| 4717 | } |
| 4718 | } |
| 4719 | impl Debug for Lite<syn::UseRename> { |
| 4720 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4721 | let mut formatter = formatter.debug_struct("UseRename"); |
| 4722 | formatter.field("ident", Lite(&self.value.ident)); |
| 4723 | formatter.field("rename", Lite(&self.value.rename)); |
| 4724 | formatter.finish() |
| 4725 | } |
| 4726 | } |
| 4727 | impl Debug for Lite<syn::UseTree> { |
| 4728 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4729 | match &self.value { |
| 4730 | syn::UseTree::Path(_val) => { |
| 4731 | formatter.write_str("UseTree::Path")?; |
| 4732 | formatter.write_str("(")?; |
| 4733 | Debug::fmt(Lite(_val), formatter)?; |
| 4734 | formatter.write_str(")")?; |
| 4735 | Ok(()) |
| 4736 | } |
| 4737 | syn::UseTree::Name(_val) => { |
| 4738 | formatter.write_str("UseTree::Name")?; |
| 4739 | formatter.write_str("(")?; |
| 4740 | Debug::fmt(Lite(_val), formatter)?; |
| 4741 | formatter.write_str(")")?; |
| 4742 | Ok(()) |
| 4743 | } |
| 4744 | syn::UseTree::Rename(_val) => { |
| 4745 | formatter.write_str("UseTree::Rename")?; |
| 4746 | formatter.write_str("(")?; |
| 4747 | Debug::fmt(Lite(_val), formatter)?; |
| 4748 | formatter.write_str(")")?; |
| 4749 | Ok(()) |
| 4750 | } |
| 4751 | syn::UseTree::Glob(_val) => { |
| 4752 | formatter.write_str("UseTree::Glob")?; |
| 4753 | formatter.write_str("(")?; |
| 4754 | Debug::fmt(Lite(_val), formatter)?; |
| 4755 | formatter.write_str(")")?; |
| 4756 | Ok(()) |
| 4757 | } |
| 4758 | syn::UseTree::Group(_val) => { |
| 4759 | formatter.write_str("UseTree::Group")?; |
| 4760 | formatter.write_str("(")?; |
| 4761 | Debug::fmt(Lite(_val), formatter)?; |
| 4762 | formatter.write_str(")")?; |
| 4763 | Ok(()) |
| 4764 | } |
| 4765 | } |
| 4766 | } |
| 4767 | } |
| 4768 | impl Debug for Lite<syn::Variadic> { |
| 4769 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4770 | let mut formatter = formatter.debug_struct("Variadic"); |
| 4771 | if !self.value.attrs.is_empty() { |
| 4772 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 4773 | } |
| 4774 | if let Some(val) = &self.value.pat { |
| 4775 | #[derive(RefCast)] |
| 4776 | #[repr(transparent)] |
| 4777 | struct Print((Box<syn::Pat>, syn::token::Colon)); |
| 4778 | impl Debug for Print { |
| 4779 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4780 | formatter.write_str("Some(")?; |
| 4781 | Debug::fmt(Lite(&self.0.0), formatter)?; |
| 4782 | formatter.write_str(")")?; |
| 4783 | Ok(()) |
| 4784 | } |
| 4785 | } |
| 4786 | formatter.field("pat", Print::ref_cast(val)); |
| 4787 | } |
| 4788 | if self.value.comma.is_some() { |
| 4789 | formatter.field("comma", &Present); |
| 4790 | } |
| 4791 | formatter.finish() |
| 4792 | } |
| 4793 | } |
| 4794 | impl Debug for Lite<syn::Variant> { |
| 4795 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4796 | let mut formatter = formatter.debug_struct("Variant"); |
| 4797 | if !self.value.attrs.is_empty() { |
| 4798 | formatter.field("attrs", Lite(&self.value.attrs)); |
| 4799 | } |
| 4800 | formatter.field("ident", Lite(&self.value.ident)); |
| 4801 | formatter.field("fields", Lite(&self.value.fields)); |
| 4802 | if let Some(val) = &self.value.discriminant { |
| 4803 | #[derive(RefCast)] |
| 4804 | #[repr(transparent)] |
| 4805 | struct Print((syn::token::Eq, syn::Expr)); |
| 4806 | impl Debug for Print { |
| 4807 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4808 | formatter.write_str("Some(")?; |
| 4809 | Debug::fmt(Lite(&self.0.1), formatter)?; |
| 4810 | formatter.write_str(")")?; |
| 4811 | Ok(()) |
| 4812 | } |
| 4813 | } |
| 4814 | formatter.field("discriminant", Print::ref_cast(val)); |
| 4815 | } |
| 4816 | formatter.finish() |
| 4817 | } |
| 4818 | } |
| 4819 | impl Debug for Lite<syn::VisRestricted> { |
| 4820 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4821 | let mut formatter = formatter.debug_struct("VisRestricted"); |
| 4822 | if self.value.in_token.is_some() { |
| 4823 | formatter.field("in_token", &Present); |
| 4824 | } |
| 4825 | formatter.field("path", Lite(&self.value.path)); |
| 4826 | formatter.finish() |
| 4827 | } |
| 4828 | } |
| 4829 | impl Debug for Lite<syn::Visibility> { |
| 4830 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4831 | match &self.value { |
| 4832 | syn::Visibility::Public(_val) => { |
| 4833 | formatter.write_str("Visibility::Public")?; |
| 4834 | Ok(()) |
| 4835 | } |
| 4836 | syn::Visibility::Restricted(_val) => { |
| 4837 | let mut formatter = formatter.debug_struct("Visibility::Restricted"); |
| 4838 | if _val.in_token.is_some() { |
| 4839 | formatter.field("in_token", &Present); |
| 4840 | } |
| 4841 | formatter.field("path", Lite(&_val.path)); |
| 4842 | formatter.finish() |
| 4843 | } |
| 4844 | syn::Visibility::Inherited => formatter.write_str("Visibility::Inherited"), |
| 4845 | } |
| 4846 | } |
| 4847 | } |
| 4848 | impl Debug for Lite<syn::WhereClause> { |
| 4849 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4850 | let mut formatter = formatter.debug_struct("WhereClause"); |
| 4851 | if !self.value.predicates.is_empty() { |
| 4852 | formatter.field("predicates", Lite(&self.value.predicates)); |
| 4853 | } |
| 4854 | formatter.finish() |
| 4855 | } |
| 4856 | } |
| 4857 | impl Debug for Lite<syn::WhereClausePlacement> { |
| 4858 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4859 | match &self.value { |
| 4860 | syn::WhereClausePlacement::Early => { |
| 4861 | formatter.write_str("WhereClausePlacement::Early") |
| 4862 | } |
| 4863 | syn::WhereClausePlacement::Late => { |
| 4864 | formatter.write_str("WhereClausePlacement::Late") |
| 4865 | } |
| 4866 | } |
| 4867 | } |
| 4868 | } |
| 4869 | impl Debug for Lite<syn::WherePredicate> { |
| 4870 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4871 | match &self.value { |
| 4872 | syn::WherePredicate::Lifetime(_val) => { |
| 4873 | formatter.write_str("WherePredicate::Lifetime")?; |
| 4874 | formatter.write_str("(")?; |
| 4875 | Debug::fmt(Lite(_val), formatter)?; |
| 4876 | formatter.write_str(")")?; |
| 4877 | Ok(()) |
| 4878 | } |
| 4879 | syn::WherePredicate::Type(_val) => { |
| 4880 | formatter.write_str("WherePredicate::Type")?; |
| 4881 | formatter.write_str("(")?; |
| 4882 | Debug::fmt(Lite(_val), formatter)?; |
| 4883 | formatter.write_str(")")?; |
| 4884 | Ok(()) |
| 4885 | } |
| 4886 | _ => unreachable!(), |
| 4887 | } |
| 4888 | } |
| 4889 | } |
| 4890 | impl Debug for Lite<syn::token::Abstract> { |
| 4891 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4892 | formatter.write_str("Token![abstract]") |
| 4893 | } |
| 4894 | } |
| 4895 | impl Debug for Lite<syn::token::And> { |
| 4896 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4897 | formatter.write_str("Token![&]") |
| 4898 | } |
| 4899 | } |
| 4900 | impl Debug for Lite<syn::token::AndAnd> { |
| 4901 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4902 | formatter.write_str("Token![&&]") |
| 4903 | } |
| 4904 | } |
| 4905 | impl Debug for Lite<syn::token::AndEq> { |
| 4906 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4907 | formatter.write_str("Token![&=]") |
| 4908 | } |
| 4909 | } |
| 4910 | impl Debug for Lite<syn::token::As> { |
| 4911 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4912 | formatter.write_str("Token![as]") |
| 4913 | } |
| 4914 | } |
| 4915 | impl Debug for Lite<syn::token::Async> { |
| 4916 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4917 | formatter.write_str("Token![async]") |
| 4918 | } |
| 4919 | } |
| 4920 | impl Debug for Lite<syn::token::At> { |
| 4921 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4922 | formatter.write_str("Token![@]") |
| 4923 | } |
| 4924 | } |
| 4925 | impl Debug for Lite<syn::token::Auto> { |
| 4926 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4927 | formatter.write_str("Token![auto]") |
| 4928 | } |
| 4929 | } |
| 4930 | impl Debug for Lite<syn::token::Await> { |
| 4931 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4932 | formatter.write_str("Token![await]") |
| 4933 | } |
| 4934 | } |
| 4935 | impl Debug for Lite<syn::token::Become> { |
| 4936 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4937 | formatter.write_str("Token![become]") |
| 4938 | } |
| 4939 | } |
| 4940 | impl Debug for Lite<syn::token::Box> { |
| 4941 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4942 | formatter.write_str("Token![box]") |
| 4943 | } |
| 4944 | } |
| 4945 | impl Debug for Lite<syn::token::Break> { |
| 4946 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4947 | formatter.write_str("Token![break]") |
| 4948 | } |
| 4949 | } |
| 4950 | impl Debug for Lite<syn::token::Caret> { |
| 4951 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4952 | formatter.write_str("Token![^]") |
| 4953 | } |
| 4954 | } |
| 4955 | impl Debug for Lite<syn::token::CaretEq> { |
| 4956 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4957 | formatter.write_str("Token![^=]") |
| 4958 | } |
| 4959 | } |
| 4960 | impl Debug for Lite<syn::token::Colon> { |
| 4961 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4962 | formatter.write_str("Token![:]") |
| 4963 | } |
| 4964 | } |
| 4965 | impl Debug for Lite<syn::token::Comma> { |
| 4966 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4967 | formatter.write_str("Token![,]") |
| 4968 | } |
| 4969 | } |
| 4970 | impl Debug for Lite<syn::token::Const> { |
| 4971 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4972 | formatter.write_str("Token![const]") |
| 4973 | } |
| 4974 | } |
| 4975 | impl Debug for Lite<syn::token::Continue> { |
| 4976 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4977 | formatter.write_str("Token![continue]") |
| 4978 | } |
| 4979 | } |
| 4980 | impl Debug for Lite<syn::token::Crate> { |
| 4981 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4982 | formatter.write_str("Token![crate]") |
| 4983 | } |
| 4984 | } |
| 4985 | impl Debug for Lite<syn::token::Default> { |
| 4986 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4987 | formatter.write_str("Token![default]") |
| 4988 | } |
| 4989 | } |
| 4990 | impl Debug for Lite<syn::token::Do> { |
| 4991 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4992 | formatter.write_str("Token![do]") |
| 4993 | } |
| 4994 | } |
| 4995 | impl Debug for Lite<syn::token::Dollar> { |
| 4996 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 4997 | formatter.write_str("Token![$]") |
| 4998 | } |
| 4999 | } |
| 5000 | impl Debug for Lite<syn::token::Dot> { |
| 5001 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5002 | formatter.write_str("Token![.]") |
| 5003 | } |
| 5004 | } |
| 5005 | impl Debug for Lite<syn::token::DotDot> { |
| 5006 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5007 | formatter.write_str("Token![..]") |
| 5008 | } |
| 5009 | } |
| 5010 | impl Debug for Lite<syn::token::DotDotDot> { |
| 5011 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5012 | formatter.write_str("Token![...]") |
| 5013 | } |
| 5014 | } |
| 5015 | impl Debug for Lite<syn::token::DotDotEq> { |
| 5016 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5017 | formatter.write_str("Token![..=]") |
| 5018 | } |
| 5019 | } |
| 5020 | impl Debug for Lite<syn::token::Dyn> { |
| 5021 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5022 | formatter.write_str("Token![dyn]") |
| 5023 | } |
| 5024 | } |
| 5025 | impl Debug for Lite<syn::token::Else> { |
| 5026 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5027 | formatter.write_str("Token![else]") |
| 5028 | } |
| 5029 | } |
| 5030 | impl Debug for Lite<syn::token::Enum> { |
| 5031 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5032 | formatter.write_str("Token![enum]") |
| 5033 | } |
| 5034 | } |
| 5035 | impl Debug for Lite<syn::token::Eq> { |
| 5036 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5037 | formatter.write_str("Token![=]") |
| 5038 | } |
| 5039 | } |
| 5040 | impl Debug for Lite<syn::token::EqEq> { |
| 5041 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5042 | formatter.write_str("Token![==]") |
| 5043 | } |
| 5044 | } |
| 5045 | impl Debug for Lite<syn::token::Extern> { |
| 5046 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5047 | formatter.write_str("Token![extern]") |
| 5048 | } |
| 5049 | } |
| 5050 | impl Debug for Lite<syn::token::FatArrow> { |
| 5051 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5052 | formatter.write_str("Token![=>]") |
| 5053 | } |
| 5054 | } |
| 5055 | impl Debug for Lite<syn::token::Final> { |
| 5056 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5057 | formatter.write_str("Token![final]") |
| 5058 | } |
| 5059 | } |
| 5060 | impl Debug for Lite<syn::token::Fn> { |
| 5061 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5062 | formatter.write_str("Token![fn]") |
| 5063 | } |
| 5064 | } |
| 5065 | impl Debug for Lite<syn::token::For> { |
| 5066 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5067 | formatter.write_str("Token![for]") |
| 5068 | } |
| 5069 | } |
| 5070 | impl Debug for Lite<syn::token::Ge> { |
| 5071 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5072 | formatter.write_str("Token![>=]") |
| 5073 | } |
| 5074 | } |
| 5075 | impl Debug for Lite<syn::token::Gt> { |
| 5076 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5077 | formatter.write_str("Token![>]") |
| 5078 | } |
| 5079 | } |
| 5080 | impl Debug for Lite<syn::token::If> { |
| 5081 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5082 | formatter.write_str("Token![if]") |
| 5083 | } |
| 5084 | } |
| 5085 | impl Debug for Lite<syn::token::Impl> { |
| 5086 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5087 | formatter.write_str("Token![impl]") |
| 5088 | } |
| 5089 | } |
| 5090 | impl Debug for Lite<syn::token::In> { |
| 5091 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5092 | formatter.write_str("Token![in]") |
| 5093 | } |
| 5094 | } |
| 5095 | impl Debug for Lite<syn::token::LArrow> { |
| 5096 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5097 | formatter.write_str("Token![<-]") |
| 5098 | } |
| 5099 | } |
| 5100 | impl Debug for Lite<syn::token::Le> { |
| 5101 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5102 | formatter.write_str("Token![<=]") |
| 5103 | } |
| 5104 | } |
| 5105 | impl Debug for Lite<syn::token::Let> { |
| 5106 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5107 | formatter.write_str("Token![let]") |
| 5108 | } |
| 5109 | } |
| 5110 | impl Debug for Lite<syn::token::Loop> { |
| 5111 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5112 | formatter.write_str("Token![loop]") |
| 5113 | } |
| 5114 | } |
| 5115 | impl Debug for Lite<syn::token::Lt> { |
| 5116 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5117 | formatter.write_str("Token![<]") |
| 5118 | } |
| 5119 | } |
| 5120 | impl Debug for Lite<syn::token::Macro> { |
| 5121 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5122 | formatter.write_str("Token![macro]") |
| 5123 | } |
| 5124 | } |
| 5125 | impl Debug for Lite<syn::token::Match> { |
| 5126 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5127 | formatter.write_str("Token![match]") |
| 5128 | } |
| 5129 | } |
| 5130 | impl Debug for Lite<syn::token::Minus> { |
| 5131 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5132 | formatter.write_str("Token![-]") |
| 5133 | } |
| 5134 | } |
| 5135 | impl Debug for Lite<syn::token::MinusEq> { |
| 5136 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5137 | formatter.write_str("Token![-=]") |
| 5138 | } |
| 5139 | } |
| 5140 | impl Debug for Lite<syn::token::Mod> { |
| 5141 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5142 | formatter.write_str("Token![mod]") |
| 5143 | } |
| 5144 | } |
| 5145 | impl Debug for Lite<syn::token::Move> { |
| 5146 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5147 | formatter.write_str("Token![move]") |
| 5148 | } |
| 5149 | } |
| 5150 | impl Debug for Lite<syn::token::Mut> { |
| 5151 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5152 | formatter.write_str("Token![mut]") |
| 5153 | } |
| 5154 | } |
| 5155 | impl Debug for Lite<syn::token::Ne> { |
| 5156 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5157 | formatter.write_str("Token![!=]") |
| 5158 | } |
| 5159 | } |
| 5160 | impl Debug for Lite<syn::token::Not> { |
| 5161 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5162 | formatter.write_str("Token![!]") |
| 5163 | } |
| 5164 | } |
| 5165 | impl Debug for Lite<syn::token::Or> { |
| 5166 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5167 | formatter.write_str("Token![|]") |
| 5168 | } |
| 5169 | } |
| 5170 | impl Debug for Lite<syn::token::OrEq> { |
| 5171 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5172 | formatter.write_str("Token![|=]") |
| 5173 | } |
| 5174 | } |
| 5175 | impl Debug for Lite<syn::token::OrOr> { |
| 5176 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5177 | formatter.write_str("Token![||]") |
| 5178 | } |
| 5179 | } |
| 5180 | impl Debug for Lite<syn::token::Override> { |
| 5181 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5182 | formatter.write_str("Token![override]") |
| 5183 | } |
| 5184 | } |
| 5185 | impl Debug for Lite<syn::token::PathSep> { |
| 5186 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5187 | formatter.write_str("Token![::]") |
| 5188 | } |
| 5189 | } |
| 5190 | impl Debug for Lite<syn::token::Percent> { |
| 5191 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5192 | formatter.write_str("Token![%]") |
| 5193 | } |
| 5194 | } |
| 5195 | impl Debug for Lite<syn::token::PercentEq> { |
| 5196 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5197 | formatter.write_str("Token![%=]") |
| 5198 | } |
| 5199 | } |
| 5200 | impl Debug for Lite<syn::token::Plus> { |
| 5201 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5202 | formatter.write_str("Token![+]") |
| 5203 | } |
| 5204 | } |
| 5205 | impl Debug for Lite<syn::token::PlusEq> { |
| 5206 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5207 | formatter.write_str("Token![+=]") |
| 5208 | } |
| 5209 | } |
| 5210 | impl Debug for Lite<syn::token::Pound> { |
| 5211 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5212 | formatter.write_str("Token![#]") |
| 5213 | } |
| 5214 | } |
| 5215 | impl Debug for Lite<syn::token::Priv> { |
| 5216 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5217 | formatter.write_str("Token![priv]") |
| 5218 | } |
| 5219 | } |
| 5220 | impl Debug for Lite<syn::token::Pub> { |
| 5221 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5222 | formatter.write_str("Token![pub]") |
| 5223 | } |
| 5224 | } |
| 5225 | impl Debug for Lite<syn::token::Question> { |
| 5226 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5227 | formatter.write_str("Token![?]") |
| 5228 | } |
| 5229 | } |
| 5230 | impl Debug for Lite<syn::token::RArrow> { |
| 5231 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5232 | formatter.write_str("Token![->]") |
| 5233 | } |
| 5234 | } |
| 5235 | impl Debug for Lite<syn::token::Raw> { |
| 5236 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5237 | formatter.write_str("Token![raw]") |
| 5238 | } |
| 5239 | } |
| 5240 | impl Debug for Lite<syn::token::Ref> { |
| 5241 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5242 | formatter.write_str("Token![ref]") |
| 5243 | } |
| 5244 | } |
| 5245 | impl Debug for Lite<syn::token::Return> { |
| 5246 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5247 | formatter.write_str("Token![return]") |
| 5248 | } |
| 5249 | } |
| 5250 | impl Debug for Lite<syn::token::Safe> { |
| 5251 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5252 | formatter.write_str("Token![safe]") |
| 5253 | } |
| 5254 | } |
| 5255 | impl Debug for Lite<syn::token::SelfType> { |
| 5256 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5257 | formatter.write_str("Token![Self]") |
| 5258 | } |
| 5259 | } |
| 5260 | impl Debug for Lite<syn::token::SelfValue> { |
| 5261 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5262 | formatter.write_str("Token![self]") |
| 5263 | } |
| 5264 | } |
| 5265 | impl Debug for Lite<syn::token::Semi> { |
| 5266 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5267 | formatter.write_str("Token![;]") |
| 5268 | } |
| 5269 | } |
| 5270 | impl Debug for Lite<syn::token::Shl> { |
| 5271 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5272 | formatter.write_str("Token![<<]") |
| 5273 | } |
| 5274 | } |
| 5275 | impl Debug for Lite<syn::token::ShlEq> { |
| 5276 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5277 | formatter.write_str("Token![<<=]") |
| 5278 | } |
| 5279 | } |
| 5280 | impl Debug for Lite<syn::token::Shr> { |
| 5281 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5282 | formatter.write_str("Token![>>]") |
| 5283 | } |
| 5284 | } |
| 5285 | impl Debug for Lite<syn::token::ShrEq> { |
| 5286 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5287 | formatter.write_str("Token![>>=]") |
| 5288 | } |
| 5289 | } |
| 5290 | impl Debug for Lite<syn::token::Slash> { |
| 5291 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5292 | formatter.write_str("Token![/]") |
| 5293 | } |
| 5294 | } |
| 5295 | impl Debug for Lite<syn::token::SlashEq> { |
| 5296 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5297 | formatter.write_str("Token![/=]") |
| 5298 | } |
| 5299 | } |
| 5300 | impl Debug for Lite<syn::token::Star> { |
| 5301 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5302 | formatter.write_str("Token![*]") |
| 5303 | } |
| 5304 | } |
| 5305 | impl Debug for Lite<syn::token::StarEq> { |
| 5306 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5307 | formatter.write_str("Token![*=]") |
| 5308 | } |
| 5309 | } |
| 5310 | impl Debug for Lite<syn::token::Static> { |
| 5311 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5312 | formatter.write_str("Token![static]") |
| 5313 | } |
| 5314 | } |
| 5315 | impl Debug for Lite<syn::token::Struct> { |
| 5316 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5317 | formatter.write_str("Token![struct]") |
| 5318 | } |
| 5319 | } |
| 5320 | impl Debug for Lite<syn::token::Super> { |
| 5321 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5322 | formatter.write_str("Token![super]") |
| 5323 | } |
| 5324 | } |
| 5325 | impl Debug for Lite<syn::token::Tilde> { |
| 5326 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5327 | formatter.write_str("Token![~]") |
| 5328 | } |
| 5329 | } |
| 5330 | impl Debug for Lite<syn::token::Trait> { |
| 5331 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5332 | formatter.write_str("Token![trait]") |
| 5333 | } |
| 5334 | } |
| 5335 | impl Debug for Lite<syn::token::Try> { |
| 5336 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5337 | formatter.write_str("Token![try]") |
| 5338 | } |
| 5339 | } |
| 5340 | impl Debug for Lite<syn::token::Type> { |
| 5341 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5342 | formatter.write_str("Token![type]") |
| 5343 | } |
| 5344 | } |
| 5345 | impl Debug for Lite<syn::token::Typeof> { |
| 5346 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5347 | formatter.write_str("Token![typeof]") |
| 5348 | } |
| 5349 | } |
| 5350 | impl Debug for Lite<syn::token::Underscore> { |
| 5351 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5352 | formatter.write_str("Token![_]") |
| 5353 | } |
| 5354 | } |
| 5355 | impl Debug for Lite<syn::token::Union> { |
| 5356 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5357 | formatter.write_str("Token![union]") |
| 5358 | } |
| 5359 | } |
| 5360 | impl Debug for Lite<syn::token::Unsafe> { |
| 5361 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5362 | formatter.write_str("Token![unsafe]") |
| 5363 | } |
| 5364 | } |
| 5365 | impl Debug for Lite<syn::token::Unsized> { |
| 5366 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5367 | formatter.write_str("Token![unsized]") |
| 5368 | } |
| 5369 | } |
| 5370 | impl Debug for Lite<syn::token::Use> { |
| 5371 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5372 | formatter.write_str("Token![use]") |
| 5373 | } |
| 5374 | } |
| 5375 | impl Debug for Lite<syn::token::Virtual> { |
| 5376 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5377 | formatter.write_str("Token![virtual]") |
| 5378 | } |
| 5379 | } |
| 5380 | impl Debug for Lite<syn::token::Where> { |
| 5381 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5382 | formatter.write_str("Token![where]") |
| 5383 | } |
| 5384 | } |
| 5385 | impl Debug for Lite<syn::token::While> { |
| 5386 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5387 | formatter.write_str("Token![while]") |
| 5388 | } |
| 5389 | } |
| 5390 | impl Debug for Lite<syn::token::Yield> { |
| 5391 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
| 5392 | formatter.write_str("Token![yield]") |
| 5393 | } |
| 5394 | } |