about summary refs log tree commit diff
path: root/src/libsyntax/ext
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2014-07-16 22:17:16 -0400
committerBen Gamari <bgamari.foss@gmail.com>2014-07-16 22:17:16 -0400
commit8659889ed959d1a5921cb18e42d92e7a4cad5903 (patch)
treee5177a9a399847906f4a780a508e2b1ff33827b5 /src/libsyntax/ext
parenteddc3ccce8d50634f860cd1f79f2f242eed7be0f (diff)
downloadrust-8659889ed959d1a5921cb18e42d92e7a4cad5903.tar.gz
rust-8659889ed959d1a5921cb18e42d92e7a4cad5903.zip
syntax: Add ToTokens for Attribute_
Diffstat (limited to 'src/libsyntax/ext')
-rw-r--r--src/libsyntax/ext/quote.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libsyntax/ext/quote.rs b/src/libsyntax/ext/quote.rs
index 0eab9a90b95..eb1f25143cf 100644
--- a/src/libsyntax/ext/quote.rs
+++ b/src/libsyntax/ext/quote.rs
@@ -147,6 +147,12 @@ pub mod rt {
     impl_to_source_slice!(ast::Ty, ", ")
     impl_to_source_slice!(Gc<ast::Item>, "\n\n")
 
+    impl ToSource for ast::Attribute_ {
+        fn to_source(&self) -> String {
+            pprust::attribute_to_string(&dummy_spanned(*self))
+        }
+    }
+
     impl<'a> ToSource for &'a str {
         fn to_source(&self) -> String {
             let lit = dummy_spanned(ast::LitStr(
@@ -238,6 +244,7 @@ pub mod rt {
     impl_to_tokens!(Gc<ast::Expr>)
     impl_to_tokens!(ast::Block)
     impl_to_tokens!(ast::Arg)
+    impl_to_tokens!(ast::Attribute_)
     impl_to_tokens_lifetime!(&'a str)
     impl_to_tokens!(())
     impl_to_tokens!(char)