diff options
| author | Corey Farwell <coreyf@rwell.org> | 2017-02-05 09:14:46 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-02-05 09:14:46 -0500 |
| commit | 805a99e6cb37ab9d6a873f8e1fdf57f08b508e73 (patch) | |
| tree | bc203d6f512f9375e3e8783378b77afee206e8db /src/libsyntax_ext/lib.rs | |
| parent | 65b24779a95d306ac9abd73bf430380e925e765e (diff) | |
| parent | a201348775081ae24bbd016b089b93906f44e3b7 (diff) | |
| download | rust-805a99e6cb37ab9d6a873f8e1fdf57f08b508e73.tar.gz rust-805a99e6cb37ab9d6a873f8e1fdf57f08b508e73.zip | |
Rollup merge of #39442 - keeperofdakeys:expand-derives, r=jseyfried
Expand derive macros in the MacroExpander This removes the expand_derives function, and sprinkles the functionality throughout the Invocation Collector, Expander and Resolver. Fixes https://github.com/rust-lang/rust/issues/39326 r? @jseyfried
Diffstat (limited to 'src/libsyntax_ext/lib.rs')
| -rw-r--r-- | src/libsyntax_ext/lib.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/libsyntax_ext/lib.rs b/src/libsyntax_ext/lib.rs index ebec23d0901..7533171b085 100644 --- a/src/libsyntax_ext/lib.rs +++ b/src/libsyntax_ext/lib.rs @@ -24,7 +24,6 @@ #![feature(staged_api)] extern crate fmt_macros; -#[macro_use] extern crate log; #[macro_use] extern crate syntax; @@ -51,12 +50,14 @@ pub mod proc_macro_impl; use std::rc::Rc; use syntax::ast; -use syntax::ext::base::{MacroExpanderFn, NormalTT, MultiModifier, NamedSyntaxExtension}; +use syntax::ext::base::{MacroExpanderFn, NormalTT, NamedSyntaxExtension}; use syntax::symbol::Symbol; pub fn register_builtins(resolver: &mut syntax::ext::base::Resolver, user_exts: Vec<NamedSyntaxExtension>, enable_quotes: bool) { + deriving::register_builtin_derives(resolver); + let mut register = |name, ext| { resolver.add_ext(ast::Ident::with_empty_ctxt(name), Rc::new(ext)); }; @@ -112,8 +113,6 @@ pub fn register_builtins(resolver: &mut syntax::ext::base::Resolver, register(Symbol::intern("format_args"), NormalTT(Box::new(format::expand_format_args), None, true)); - register(Symbol::intern("derive"), MultiModifier(Box::new(deriving::expand_derive))); - for (name, ext) in user_exts { register(name, ext); } |
