File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 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 =
897897 "allow_internal_unstable side-steps feature gating and stability checks" ;
898898
899899pub 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";
901906
902907pub const EXPLAIN_DERIVE_UNDERSCORE : & ' static str =
903908 "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,
175175 feature_gate:: GateIssue :: Language ,
176176 feature_gate:: EXPLAIN_CUSTOM_DERIVE ) ;
177177 } else {
178+ cx. span_warn ( titem. span , EXPLAIN_DEPR_CUSTOM_DERIVE ) ;
178179 let name = intern_and_get_ident ( & format ! ( "derive_{}" , tname) ) ;
179180 let mitem = cx. meta_word ( titem. span , name) ;
180181 new_attributes. push ( cx. attribute ( mitem. span , mitem) ) ;
You can’t perform that action at this time.
0 commit comments