summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-12-23 18:43:12 +0000
committerbors <bors@rust-lang.org>2016-12-23 18:43:12 +0000
commit467a7f049bac0386097c6cd2c80966c8d7453ce8 (patch)
tree1ed4cf6d82ab53213ec8f967e808e715af038655 /src/libsyntax
parent00b4019f28f3e7f9ae3990ed871cb4917fd9e659 (diff)
parentc12fc66a9d643a6942d0bf4175d1a046e8d808de (diff)
downloadrust-467a7f049bac0386097c6cd2c80966c8d7453ce8.tar.gz
rust-467a7f049bac0386097c6cd2c80966c8d7453ce8.zip
Auto merge of #38533 - jseyfried:legacy_custom_derive_deprecation, r=nrc
Allow legacy custom derive authors to disable warnings in downstream crates

This PR allows legacy custom derive authors to use a pre-deprecated method `registry.register_custom_derive()` instead of `registry.register_syntax_extension()` to avoid downstream deprecation warnings.

r? @nrc
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ext/base.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs
index 8e63f73fdaa..68d261c64f8 100644
--- a/src/libsyntax/ext/base.rs
+++ b/src/libsyntax/ext/base.rs
@@ -516,6 +516,7 @@ pub trait Resolver {
     fn next_node_id(&mut self) -> ast::NodeId;
     fn get_module_scope(&mut self, id: ast::NodeId) -> Mark;
     fn eliminate_crate_var(&mut self, item: P<ast::Item>) -> P<ast::Item>;
+    fn is_whitelisted_legacy_custom_derive(&self, name: Name) -> bool;
 
     fn visit_expansion(&mut self, mark: Mark, expansion: &Expansion);
     fn add_ext(&mut self, ident: ast::Ident, ext: Rc<SyntaxExtension>);
@@ -539,6 +540,7 @@ impl Resolver for DummyResolver {
     fn next_node_id(&mut self) -> ast::NodeId { ast::DUMMY_NODE_ID }
     fn get_module_scope(&mut self, _id: ast::NodeId) -> Mark { Mark::root() }
     fn eliminate_crate_var(&mut self, item: P<ast::Item>) -> P<ast::Item> { item }
+    fn is_whitelisted_legacy_custom_derive(&self, _name: Name) -> bool { false }
 
     fn visit_expansion(&mut self, _invoc: Mark, _expansion: &Expansion) {}
     fn add_ext(&mut self, _ident: ast::Ident, _ext: Rc<SyntaxExtension>) {}