diff options
author | David Tolnay <dtolnay@gmail.com> | 2019-01-19 19:23:59 -0800 |
---|---|---|
committer | David Tolnay <dtolnay@gmail.com> | 2019-01-19 19:35:20 -0800 |
commit | fd8cdc8a88eb40e92408262fc83892fb974f124a (patch) | |
tree | 4028a97fa6f32cf8cac74b37d83767c0345a680a /src/lib.rs | |
parent | 02b42d4ce670c9530d9e291b836a4eeadc8e71e3 (diff) | |
download | proc-macro2-fd8cdc8a88eb40e92408262fc83892fb974f124a.tar.gz |
Omit missing spans from Debug output
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -495,8 +495,7 @@ impl fmt::Debug for TokenTree { TokenTree::Ident(ref t) => { let mut debug = f.debug_struct("Ident"); debug.field("sym", &format_args!("{}", t)); - #[cfg(any(feature = "nightly", procmacro2_semver_exempt))] - debug.field("span", &t.span()); + imp::debug_span_field_if_nontrivial(&mut debug, t.span().inner); debug.finish() } TokenTree::Punct(ref t) => t.fmt(f), @@ -705,8 +704,7 @@ impl fmt::Debug for Punct { let mut debug = fmt.debug_struct("Punct"); debug.field("op", &self.op); debug.field("spacing", &self.spacing); - #[cfg(procmacro2_semver_exempt)] - debug.field("span", &self.span); + imp::debug_span_field_if_nontrivial(&mut debug, self.span.inner); debug.finish() } } |