about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorJorge Aparicio <japaricious@gmail.com>2014-11-17 15:19:36 -0500
committerJorge Aparicio <japaricious@gmail.com>2014-11-17 15:40:35 -0500
commitdaa949e51665c4ef850249ebf4c13dd6c8da26db (patch)
tree6304fa16eb0565177ba34beb8782e66a64081191 /src/libsyntax
parent38c17dc324b82f8f7be2e9f87930e0bd11a38e1c (diff)
downloadrust-daa949e51665c4ef850249ebf4c13dd6c8da26db.tar.gz
rust-daa949e51665c4ef850249ebf4c13dd6c8da26db.zip
libsyntax: DSTify `ToSource` and `ToSourceWithHygiene`
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ext/quote.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/libsyntax/ext/quote.rs b/src/libsyntax/ext/quote.rs
index b3086fba834..ec691757077 100644
--- a/src/libsyntax/ext/quote.rs
+++ b/src/libsyntax/ext/quote.rs
@@ -90,14 +90,14 @@ pub mod rt {
     */
 
     // FIXME: Move this trait to pprust and get rid of *_to_str?
-    pub trait ToSource {
+    pub trait ToSource for Sized? {
         // Takes a thing and generates a string containing rust code for it.
         fn to_source(&self) -> String;
     }
 
     // FIXME (Issue #16472): This should go away after ToToken impls
     // are revised to go directly to token-trees.
-    trait ToSourceWithHygiene : ToSource {
+    trait ToSourceWithHygiene for Sized? : ToSource {
         // Takes a thing and generates a string containing rust code
         // for it, encoding Idents as special byte sequences to
         // maintain hygiene across serialization and deserialization.
@@ -150,15 +150,15 @@ pub mod rt {
 
     macro_rules! impl_to_source_slice(
         ($t:ty, $sep:expr) => (
-            impl<'a> ToSource for &'a [$t] {
+            impl ToSource for [$t] {
                 fn to_source(&self) -> String {
-                    slice_to_source($sep, *self)
+                    slice_to_source($sep, self)
                 }
             }
 
-            impl<'a> ToSourceWithHygiene for &'a [$t] {
+            impl ToSourceWithHygiene for [$t] {
                 fn to_source_with_hygiene(&self) -> String {
-                    slice_to_source_with_hygiene($sep, *self)
+                    slice_to_source_with_hygiene($sep, self)
                 }
             }
         )
@@ -200,14 +200,14 @@ pub mod rt {
         }
     }
 
-    impl<'a> ToSource for &'a str {
+    impl ToSource for str {
         fn to_source(&self) -> String {
             let lit = dummy_spanned(ast::LitStr(
-                    token::intern_and_get_ident(*self), ast::CookedStr));
+                    token::intern_and_get_ident(self), ast::CookedStr));
             pprust::lit_to_string(&lit)
         }
     }
-    impl<'a> ToSourceWithHygiene for &'a str {
+    impl ToSourceWithHygiene for str {
         fn to_source_with_hygiene(&self) -> String {
             self.to_source()
         }