Skip to content

Commit 8659889

Browse files
committed
syntax: Add ToTokens for Attribute_
1 parent eddc3cc commit 8659889

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/libsyntax/ext/quote.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,12 @@ pub mod rt {
147147
impl_to_source_slice!(ast::Ty, ", ")
148148
impl_to_source_slice!(Gc<ast::Item>, "\n\n")
149149

150+
impl ToSource for ast::Attribute_ {
151+
fn to_source(&self) -> String {
152+
pprust::attribute_to_string(&dummy_spanned(*self))
153+
}
154+
}
155+
150156
impl<'a> ToSource for &'a str {
151157
fn to_source(&self) -> String {
152158
let lit = dummy_spanned(ast::LitStr(
@@ -238,6 +244,7 @@ pub mod rt {
238244
impl_to_tokens!(Gc<ast::Expr>)
239245
impl_to_tokens!(ast::Block)
240246
impl_to_tokens!(ast::Arg)
247+
impl_to_tokens!(ast::Attribute_)
241248
impl_to_tokens_lifetime!(&'a str)
242249
impl_to_tokens!(())
243250
impl_to_tokens!(char)

0 commit comments

Comments
 (0)