diff options
| author | bors <bors@rust-lang.org> | 2016-12-23 18:43:12 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2016-12-23 18:43:12 +0000 |
| commit | 467a7f049bac0386097c6cd2c80966c8d7453ce8 (patch) | |
| tree | 1ed4cf6d82ab53213ec8f967e808e715af038655 /src/libsyntax | |
| parent | 00b4019f28f3e7f9ae3990ed871cb4917fd9e659 (diff) | |
| parent | c12fc66a9d643a6942d0bf4175d1a046e8d808de (diff) | |
| download | rust-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.rs | 2 |
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>) {} |
