diff options
| author | bors <bors@rust-lang.org> | 2013-05-21 10:43:17 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-05-21 10:43:17 -0700 |
| commit | 64963d6cbaea86e0d2a58f507e57a76da7512e3e (patch) | |
| tree | 96dfdb86aaa32e4131710cb71507ddd3b9aa752f /src/librustpkg | |
| parent | 808aada1fb95133f9e9e78be70ad805c0fee4b9c (diff) | |
| parent | a59bec43e34715880f471db7d7c9d57939649d92 (diff) | |
| download | rust-64963d6cbaea86e0d2a58f507e57a76da7512e3e.tar.gz rust-64963d6cbaea86e0d2a58f507e57a76da7512e3e.zip | |
auto merge of #6611 : huonw/rust/syntax-ext-no-dup, r=jbclements
Fixes https://github.com/mozilla/rust/issues/6578 by merging the 3 different ways to build an AST into a single `AstBuilder` trait, creating a more uniform and briefer interface. Also, converts the `ext_ctxt` trait-object to be a plain struct, as well as renaming it to `ExtCtxt`. Seems to make expansion slightly faster for the normal case (e.g. `libcore` and `libstd`), but slower for `librustc` (slightly) and `libsyntax` (0.3s -> 0.8s! I'm investigating this, but I'd prefer this patch to land relatively quickly.). `git blame` suggests maybe @graydon or @erickt are familiar with this area of the code. r?
Diffstat (limited to 'src/librustpkg')
| -rw-r--r-- | src/librustpkg/util.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustpkg/util.rs b/src/librustpkg/util.rs index 0ae9539fece..f18396f95be 100644 --- a/src/librustpkg/util.rs +++ b/src/librustpkg/util.rs @@ -19,7 +19,7 @@ use std::semver; use std::term; use syntax::ast_util::*; use syntax::codemap::{dummy_sp, spanned, dummy_spanned}; -use syntax::ext::base::{mk_ctxt, ext_ctxt}; +use syntax::ext::base::ExtCtxt; use syntax::{ast, attr, codemap, diagnostic, fold}; use syntax::ast::{meta_name_value, meta_list}; use syntax::attr::{mk_attr}; @@ -178,7 +178,7 @@ struct ListenerFn { struct ReadyCtx { sess: session::Session, crate: @ast::crate, - ext_cx: @ext_ctxt, + ext_cx: @ExtCtxt, path: ~[ast::ident], fns: ~[ListenerFn] } @@ -247,7 +247,7 @@ pub fn ready_crate(sess: session::Session, let ctx = @mut ReadyCtx { sess: sess, crate: crate, - ext_cx: mk_ctxt(sess.parse_sess, copy sess.opts.cfg), + ext_cx: ExtCtxt::new(sess.parse_sess, copy sess.opts.cfg), path: ~[], fns: ~[] }; |
