22
33use rustc_data_structures:: sync:: Lrc ;
44use syntax:: ast:: { self , MetaItem } ;
5- use syntax:: attr:: Deprecation ;
5+ use syntax:: attr:: Stability ;
66use syntax:: edition:: Edition ;
77use syntax:: ext:: base:: { Annotatable , ExtCtxt , Resolver , MultiItemModifier } ;
88use syntax:: ext:: base:: { SyntaxExtension , SyntaxExtensionKind } ;
@@ -61,7 +61,7 @@ impl MultiItemModifier for BuiltinDerive {
6161}
6262
6363macro_rules! derive_traits {
64- ( $( [ $deprecation : expr] $name: ident => $func: path, ) +) => {
64+ ( $( [ $stability : expr] $name: ident => $func: path, ) +) => {
6565 pub fn is_builtin_trait( name: ast:: Name ) -> bool {
6666 match name {
6767 $( sym:: $name ) |+ => true ,
@@ -82,10 +82,7 @@ macro_rules! derive_traits {
8282 resolver. add_builtin(
8383 ast:: Ident :: with_empty_ctxt( sym:: $name) ,
8484 Lrc :: new( SyntaxExtension {
85- deprecation: $deprecation. map( |msg| Deprecation {
86- since: Some ( Symbol :: intern( "1.0.0" ) ) ,
87- note: Some ( Symbol :: intern( msg) ) ,
88- } ) ,
85+ stability: $stability,
8986 allow_internal_unstable: allow_internal_unstable. clone( ) ,
9087 ..SyntaxExtension :: default (
9188 SyntaxExtensionKind :: LegacyDerive ( Box :: new( BuiltinDerive ( $func) ) ) ,
@@ -105,10 +102,14 @@ derive_traits! {
105102 [ None ]
106103 Hash => hash:: expand_deriving_hash,
107104
108- [ None ]
105+ [ Some ( Stability :: unstable(
106+ sym:: rustc_private, Some ( Symbol :: intern( "RustcEncodable crater run" ) ) , 0
107+ ) ) ]
109108 RustcEncodable => encodable:: expand_deriving_rustc_encodable,
110109
111- [ None ]
110+ [ Some ( Stability :: unstable(
111+ sym:: rustc_private, Some ( Symbol :: intern( "RustcDecodable crater run" ) ) , 0
112+ ) ) ]
112113 RustcDecodable => decodable:: expand_deriving_rustc_decodable,
113114
114115 [ None ]
@@ -130,9 +131,9 @@ derive_traits! {
130131 Copy => bounds:: expand_deriving_copy,
131132
132133 // deprecated
133- [ Some ( "derive( Encodable) is deprecated in favor of derive(RustcEncodable)" ) ]
134+ [ Some ( Stability :: unstable ( sym :: rustc_private , Some ( Symbol :: intern ( " Encodable crater run" ) ) , 0 ) ) ]
134135 Encodable => encodable:: expand_deriving_encodable,
135- [ Some ( "derive( Decodable) is deprecated in favor of derive(RustcDecodable)" ) ]
136+ [ Some ( Stability :: unstable ( sym :: rustc_private , Some ( Symbol :: intern ( " Decodable crater run" ) ) , 0 ) ) ]
136137 Decodable => decodable:: expand_deriving_decodable,
137138}
138139
0 commit comments