@@ -90,14 +90,14 @@ pub mod rt {
90
90
*/
91
91
92
92
// FIXME: Move this trait to pprust and get rid of *_to_str?
93
- pub trait ToSource {
93
+ pub trait ToSource for Sized ? {
94
94
// Takes a thing and generates a string containing rust code for it.
95
95
fn to_source ( & self ) -> String ;
96
96
}
97
97
98
98
// FIXME (Issue #16472): This should go away after ToToken impls
99
99
// are revised to go directly to token-trees.
100
- trait ToSourceWithHygiene : ToSource {
100
+ trait ToSourceWithHygiene for Sized ? : ToSource {
101
101
// Takes a thing and generates a string containing rust code
102
102
// for it, encoding Idents as special byte sequences to
103
103
// maintain hygiene across serialization and deserialization.
@@ -150,15 +150,15 @@ pub mod rt {
150
150
151
151
macro_rules! impl_to_source_slice(
152
152
( $t: ty, $sep: expr) => (
153
- impl < ' a> ToSource for & ' a [ $t] {
153
+ impl ToSource for [ $t] {
154
154
fn to_source( & self ) -> String {
155
- slice_to_source( $sep, * self )
155
+ slice_to_source( $sep, self )
156
156
}
157
157
}
158
158
159
- impl < ' a> ToSourceWithHygiene for & ' a [ $t] {
159
+ impl ToSourceWithHygiene for [ $t] {
160
160
fn to_source_with_hygiene( & self ) -> String {
161
- slice_to_source_with_hygiene( $sep, * self )
161
+ slice_to_source_with_hygiene( $sep, self )
162
162
}
163
163
}
164
164
)
@@ -200,14 +200,14 @@ pub mod rt {
200
200
}
201
201
}
202
202
203
- impl < ' a > ToSource for & ' a str {
203
+ impl ToSource for str {
204
204
fn to_source ( & self ) -> String {
205
205
let lit = dummy_spanned ( ast:: LitStr (
206
- token:: intern_and_get_ident ( * self ) , ast:: CookedStr ) ) ;
206
+ token:: intern_and_get_ident ( self ) , ast:: CookedStr ) ) ;
207
207
pprust:: lit_to_string ( & lit)
208
208
}
209
209
}
210
- impl < ' a > ToSourceWithHygiene for & ' a str {
210
+ impl ToSourceWithHygiene for str {
211
211
fn to_source_with_hygiene ( & self ) -> String {
212
212
self . to_source ( )
213
213
}
0 commit comments