File tree 2 files changed +7
-1
lines changed
2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -897,7 +897,12 @@ pub const EXPLAIN_ALLOW_INTERNAL_UNSTABLE: &'static str =
897
897
"allow_internal_unstable side-steps feature gating and stability checks" ;
898
898
899
899
pub const EXPLAIN_CUSTOM_DERIVE : & ' static str =
900
- "`#[derive]` for custom traits is not stable enough for use and is subject to change" ;
900
+ "`#[derive]` for custom traits is not stable enough for use. It is deprecated and will \
901
+ be removed in v1.15";
902
+
903
+ pub const EXPLAIN_DEPR_CUSTOM_DERIVE : & ' static str =
904
+ "`#[derive]` for custom traits is deprecated and will be removed in v1.15. Prefer using \
905
+ procedural macro custom derive";
901
906
902
907
pub const EXPLAIN_DERIVE_UNDERSCORE : & ' static str =
903
908
"attributes of the form `#[derive_*]` are reserved for the compiler" ;
Original file line number Diff line number Diff line change @@ -175,6 +175,7 @@ pub fn expand_derive(cx: &mut ExtCtxt,
175
175
feature_gate:: GateIssue :: Language ,
176
176
feature_gate:: EXPLAIN_CUSTOM_DERIVE ) ;
177
177
} else {
178
+ cx. span_warn ( titem. span , EXPLAIN_DEPR_CUSTOM_DERIVE ) ;
178
179
let name = intern_and_get_ident ( & format ! ( "derive_{}" , tname) ) ;
179
180
let mitem = cx. meta_word ( titem. span , name) ;
180
181
new_attributes. push ( cx. attribute ( mitem. span , mitem) ) ;
You can’t perform that action at this time.
0 commit comments