diff options
| author | Jeffrey Seyfried <jeffrey.seyfried@gmail.com> | 2016-12-22 06:03:19 +0000 |
|---|---|---|
| committer | Jeffrey Seyfried <jeffrey.seyfried@gmail.com> | 2016-12-23 05:49:34 +0000 |
| commit | c12fc66a9d643a6942d0bf4175d1a046e8d808de (patch) | |
| tree | a0b9495755b4ffbcc95f2d8b603b7ee355873166 /src/libsyntax_ext | |
| parent | 164619a8cfe6d376d25bd3a6a9a5f2856c8de64d (diff) | |
| download | rust-c12fc66a9d643a6942d0bf4175d1a046e8d808de.tar.gz rust-c12fc66a9d643a6942d0bf4175d1a046e8d808de.zip | |
Allow legacy custom derive authors to disable warnings in downstream crates.
Diffstat (limited to 'src/libsyntax_ext')
| -rw-r--r-- | src/libsyntax_ext/deriving/mod.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libsyntax_ext/deriving/mod.rs b/src/libsyntax_ext/deriving/mod.rs index 535d7de19e3..0511b0d252b 100644 --- a/src/libsyntax_ext/deriving/mod.rs +++ b/src/libsyntax_ext/deriving/mod.rs @@ -175,8 +175,10 @@ pub fn expand_derive(cx: &mut ExtCtxt, feature_gate::GateIssue::Language, feature_gate::EXPLAIN_CUSTOM_DERIVE); } else { - cx.span_warn(titem.span, feature_gate::EXPLAIN_DEPR_CUSTOM_DERIVE); let name = Symbol::intern(&format!("derive_{}", tname)); + if !cx.resolver.is_whitelisted_legacy_custom_derive(name) { + cx.span_warn(titem.span, feature_gate::EXPLAIN_DEPR_CUSTOM_DERIVE); + } let mitem = cx.meta_word(titem.span, name); new_attributes.push(cx.attribute(mitem.span, mitem)); } |
