@@ -61,10 +61,10 @@ impl MultiItemModifier for BuiltinDerive {
61
61
}
62
62
63
63
macro_rules! derive_traits {
64
- ( $( [ $deprecation: expr] $name: expr => $func: path, ) +) => {
64
+ ( $( [ $deprecation: expr] $name: ident => $func: path, ) +) => {
65
65
pub fn is_builtin_trait( name: ast:: Name ) -> bool {
66
- match & * name. as_str ( ) {
67
- $( $name ) |+ => true ,
66
+ match name {
67
+ $( sym :: $name ) |+ => true ,
68
68
_ => false ,
69
69
}
70
70
}
@@ -80,7 +80,7 @@ macro_rules! derive_traits {
80
80
81
81
$(
82
82
resolver. add_builtin(
83
- ast:: Ident :: with_empty_ctxt( Symbol :: intern ( $name) ) ,
83
+ ast:: Ident :: with_empty_ctxt( sym :: $name) ,
84
84
Lrc :: new( SyntaxExtension {
85
85
deprecation: $deprecation. map( |msg| Deprecation {
86
86
since: Some ( Symbol :: intern( "1.0.0" ) ) ,
@@ -100,40 +100,40 @@ macro_rules! derive_traits {
100
100
101
101
derive_traits ! {
102
102
[ None ]
103
- " Clone" => clone:: expand_deriving_clone,
103
+ Clone => clone:: expand_deriving_clone,
104
104
105
105
[ None ]
106
- " Hash" => hash:: expand_deriving_hash,
106
+ Hash => hash:: expand_deriving_hash,
107
107
108
108
[ None ]
109
- " RustcEncodable" => encodable:: expand_deriving_rustc_encodable,
109
+ RustcEncodable => encodable:: expand_deriving_rustc_encodable,
110
110
111
111
[ None ]
112
- " RustcDecodable" => decodable:: expand_deriving_rustc_decodable,
112
+ RustcDecodable => decodable:: expand_deriving_rustc_decodable,
113
113
114
114
[ None ]
115
- " PartialEq" => partial_eq:: expand_deriving_partial_eq,
115
+ PartialEq => partial_eq:: expand_deriving_partial_eq,
116
116
[ None ]
117
- "Eq" => eq:: expand_deriving_eq,
117
+ Eq => eq:: expand_deriving_eq,
118
118
[ None ]
119
- " PartialOrd" => partial_ord:: expand_deriving_partial_ord,
119
+ PartialOrd => partial_ord:: expand_deriving_partial_ord,
120
120
[ None ]
121
- " Ord" => ord:: expand_deriving_ord,
121
+ Ord => ord:: expand_deriving_ord,
122
122
123
123
[ None ]
124
- " Debug" => debug:: expand_deriving_debug,
124
+ Debug => debug:: expand_deriving_debug,
125
125
126
126
[ None ]
127
- " Default" => default :: expand_deriving_default,
127
+ Default => default :: expand_deriving_default,
128
128
129
129
[ None ]
130
- " Copy" => bounds:: expand_deriving_copy,
130
+ Copy => bounds:: expand_deriving_copy,
131
131
132
132
// deprecated
133
133
[ Some ( "derive(Encodable) is deprecated in favor of derive(RustcEncodable)" ) ]
134
- " Encodable" => encodable:: expand_deriving_encodable,
134
+ Encodable => encodable:: expand_deriving_encodable,
135
135
[ Some ( "derive(Decodable) is deprecated in favor of derive(RustcDecodable)" ) ]
136
- " Decodable" => decodable:: expand_deriving_decodable,
136
+ Decodable => decodable:: expand_deriving_decodable,
137
137
}
138
138
139
139
/// Construct a name for the inner type parameter that can't collide with any type parameters of
0 commit comments