diff --git a/Cargo.toml b/Cargo.toml index f99b48f..1454ec9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ repository = "https://github.com/dtolnay/quote" rust-version = "1.31" [dependencies] -proc-macro2 = { version = "1.0.40", default-features = false } +proc-macro2 = { version = "1.0.52", default-features = false } [dev-dependencies] rustversion = "1.0" diff --git a/src/spanned.rs b/src/spanned.rs index f64c8f5..316d0b7 100644 --- a/src/spanned.rs +++ b/src/spanned.rs @@ -1,4 +1,5 @@ use crate::ToTokens; +use proc_macro2::extra::DelimSpan; use proc_macro2::{Span, TokenStream}; pub trait Spanned { @@ -11,6 +12,12 @@ impl Spanned for Span { } } +impl Spanned for DelimSpan { + fn __span(&self) -> Span { + self.join() + } +} + impl Spanned for T { fn __span(&self) -> Span { join_spans(self.into_token_stream())