diff options
Diffstat (limited to 'vendor/thiserror-impl/src/span.rs')
-rw-r--r-- | vendor/thiserror-impl/src/span.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/vendor/thiserror-impl/src/span.rs b/vendor/thiserror-impl/src/span.rs new file mode 100644 index 0000000..c1237dd --- /dev/null +++ b/vendor/thiserror-impl/src/span.rs @@ -0,0 +1,15 @@ +use proc_macro2::Span; +use syn::Member; + +pub trait MemberSpan { + fn member_span(&self) -> Span; +} + +impl MemberSpan for Member { + fn member_span(&self) -> Span { + match self { + Member::Named(ident) => ident.span(), + Member::Unnamed(index) => index.span, + } + } +} |