@@ -711,7 +711,7 @@ pub enum AttributeGate {
711
711
impl AttributeGate {
712
712
fn is_deprecated ( & self ) -> bool {
713
713
match * self {
714
- Gated ( Stability :: Deprecated ( _) , ..) => true ,
714
+ Gated ( Stability :: Deprecated ( _, _ ) , ..) => true ,
715
715
_ => false ,
716
716
}
717
717
}
@@ -720,8 +720,9 @@ impl AttributeGate {
720
720
#[ derive( Copy , Clone , Debug ) ]
721
721
pub enum Stability {
722
722
Unstable ,
723
- // Argument is tracking issue link.
724
- Deprecated ( & ' static str ) ,
723
+ // First argument is tracking issue link; second argument is an optional
724
+ // help message, which defaults to "remove this attribute"
725
+ Deprecated ( & ' static str , Option < & ' static str > ) ,
725
726
}
726
727
727
728
// fn() is not Debug
@@ -1044,7 +1045,7 @@ pub const BUILTIN_ATTRIBUTES: &'static [(&'static str, AttributeType, AttributeG
1044
1045
( "no_builtins" , Whitelisted , Ungated ) ,
1045
1046
( "no_mangle" , Whitelisted , Ungated ) ,
1046
1047
( "no_debug" , Whitelisted , Gated (
1047
- Stability :: Deprecated ( "https://github.com/rust-lang/rust/issues/29721" ) ,
1048
+ Stability :: Deprecated ( "https://github.com/rust-lang/rust/issues/29721" , None ) ,
1048
1049
"no_debug" ,
1049
1050
"the `#[no_debug]` attribute was an experimental feature that has been \
1050
1051
deprecated due to lack of demand",
@@ -1057,7 +1058,8 @@ pub const BUILTIN_ATTRIBUTES: &'static [(&'static str, AttributeType, AttributeG
1057
1058
cfg_fn ! ( omit_gdb_pretty_printer_section) ) ) ,
1058
1059
( "unsafe_destructor_blind_to_params" ,
1059
1060
Normal ,
1060
- Gated ( Stability :: Deprecated ( "https://github.com/rust-lang/rust/issues/34761" ) ,
1061
+ Gated ( Stability :: Deprecated ( "https://github.com/rust-lang/rust/issues/34761" ,
1062
+ Some ( "replace this attribute with `#[may_dangle]`" ) ) ,
1061
1063
"dropck_parametricity" ,
1062
1064
"unsafe_destructor_blind_to_params has been replaced by \
1063
1065
may_dangle and will be removed in the future",
@@ -1136,7 +1138,8 @@ pub const BUILTIN_ATTRIBUTES: &'static [(&'static str, AttributeType, AttributeG
1136
1138
( "panic_implementation" ,
1137
1139
Normal ,
1138
1140
Gated ( Stability :: Deprecated ( "https://github.com/rust-lang/rust/issues/44489\
1139
- #issuecomment-415140224") ,
1141
+ #issuecomment-415140224",
1142
+ Some ( "replace this attribute with `#[panic_handler]`" ) ) ,
1140
1143
"panic_implementation" ,
1141
1144
"this attribute was renamed to `panic_handler`" ,
1142
1145
cfg_fn ! ( panic_implementation) ) ) ,
0 commit comments