aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/attr.rs6
-rw-r--r--src/lib.rs2
2 files changed, 5 insertions, 3 deletions
diff --git a/src/attr.rs b/src/attr.rs
index 8626d11..d66b843 100644
--- a/src/attr.rs
+++ b/src/attr.rs
@@ -1,6 +1,6 @@
use crate::error::Result;
use crate::segment::{self, Segment};
-use proc_macro::{Delimiter, Group, Span, TokenStream, TokenTree};
+use proc_macro::{Delimiter, Group, Spacing, Span, TokenStream, TokenTree};
use std::iter;
use std::mem;
use std::str::FromStr;
@@ -157,6 +157,8 @@ fn is_stringlike(token: &TokenTree) -> bool {
None => false,
}
}
- TokenTree::Punct(punct) => punct.as_char() == '\'' || punct.as_char() == ':',
+ TokenTree::Punct(punct) => {
+ punct.as_char() == '\'' || punct.as_char() == ':' && punct.spacing() == Spacing::Alone
+ }
}
}
diff --git a/src/lib.rs b/src/lib.rs
index d066ca0..8979099 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -230,7 +230,7 @@ fn expand(
flatten_single_interpolation && !is_attribute,
)?;
if is_attribute {
- nested = expand_attr(nested, span, &mut group_contains_paste)?
+ nested = expand_attr(nested, span, &mut group_contains_paste)?;
}
let group = if group_contains_paste {
let mut group = Group::new(delimiter, nested);