about summary refs log tree commit diff
path: root/src/libsyntax_ext
diff options
context:
space:
mode:
authorJeffrey Seyfried <jeffrey.seyfried@gmail.com>2016-12-22 06:03:19 +0000
committerJeffrey Seyfried <jeffrey.seyfried@gmail.com>2016-12-23 05:49:34 +0000
commitc12fc66a9d643a6942d0bf4175d1a046e8d808de (patch)
treea0b9495755b4ffbcc95f2d8b603b7ee355873166 /src/libsyntax_ext
parent164619a8cfe6d376d25bd3a6a9a5f2856c8de64d (diff)
downloadrust-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.rs4
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));
         }