]> git.lizzy.rs Git - rust.git/commitdiff
Replace AstBuilder with inherent methods
authorMark Rousskov <mark.simulacrum@gmail.com>
Wed, 31 Jul 2019 11:40:32 +0000 (07:40 -0400)
committerMark Rousskov <mark.simulacrum@gmail.com>
Wed, 31 Jul 2019 12:55:37 +0000 (08:55 -0400)
30 files changed:
src/doc/unstable-book/src/language-features/plugin.md
src/libsyntax/attr/builtin.rs
src/libsyntax/diagnostics/plugin.rs
src/libsyntax/ext/build.rs
src/libsyntax/ext/proc_macro.rs
src/libsyntax_ext/assert.rs
src/libsyntax_ext/cfg.rs
src/libsyntax_ext/concat.rs
src/libsyntax_ext/deriving/clone.rs
src/libsyntax_ext/deriving/cmp/eq.rs
src/libsyntax_ext/deriving/cmp/ord.rs
src/libsyntax_ext/deriving/cmp/partial_eq.rs
src/libsyntax_ext/deriving/cmp/partial_ord.rs
src/libsyntax_ext/deriving/debug.rs
src/libsyntax_ext/deriving/decodable.rs
src/libsyntax_ext/deriving/default.rs
src/libsyntax_ext/deriving/encodable.rs
src/libsyntax_ext/deriving/generic/mod.rs
src/libsyntax_ext/deriving/generic/ty.rs
src/libsyntax_ext/deriving/hash.rs
src/libsyntax_ext/deriving/mod.rs
src/libsyntax_ext/env.rs
src/libsyntax_ext/format.rs
src/libsyntax_ext/global_allocator.rs
src/libsyntax_ext/proc_macro_harness.rs
src/libsyntax_ext/source_util.rs
src/libsyntax_ext/test.rs
src/libsyntax_ext/test_harness.rs
src/test/ui-fulldeps/auxiliary/plugin-args.rs
src/test/ui-fulldeps/auxiliary/roman-numerals.rs

index f19b39daca3ef791010490905ef30f4af038faed..8be4d16998276f91e4cc63e065304780fd3ef071 100644 (file)
@@ -59,7 +59,6 @@ extern crate rustc_plugin;
 use syntax::parse::token::{self, Token};
 use syntax::tokenstream::TokenTree;
 use syntax::ext::base::{ExtCtxt, MacResult, DummyResult, MacEager};
-use syntax::ext::build::AstBuilder;  // A trait for expr_usize.
 use syntax_pos::Span;
 use rustc_plugin::Registry;
 
@@ -164,13 +163,6 @@ can continue and find further errors.
 To print syntax fragments for debugging, you can use `span_note` together with
 `syntax::print::pprust::*_to_string`.
 
-The example above produced an integer literal using `AstBuilder::expr_usize`.
-As an alternative to the `AstBuilder` trait, `libsyntax` provides a set of
-quasiquote macros. They are undocumented and very rough around the edges.
-However, the implementation may be a good starting point for an improved
-quasiquote as an ordinary plugin library.
-
-
 # Lint plugins
 
 Plugins can extend [Rust's lint
index eabb6302d463bc5ff19cdf48c19f608a1425fae1..5fb513783fbaac3fe64d6a79b9b9addd94f18ffd 100644 (file)
@@ -3,7 +3,6 @@
 use crate::ast::{self, Attribute, MetaItem, NestedMetaItem};
 use crate::early_buffered_lints::BufferedEarlyLintId;
 use crate::ext::base::ExtCtxt;
-use crate::ext::build::AstBuilder;
 use crate::feature_gate::{Features, GatedCfg};
 use crate::parse::ParseSess;
 
index e5e55a6444a2eb8012d5231eec876a333bc2f1f1..80591ad304df0200f398029e13b5483467d8bba3 100644 (file)
@@ -4,7 +4,6 @@
 use crate::ast::{self, Ident, Name};
 use crate::source_map;
 use crate::ext::base::{ExtCtxt, MacEager, MacResult};
-use crate::ext::build::AstBuilder;
 use crate::parse::token::{self, Token};
 use crate::ptr::P;
 use crate::symbol::kw;
index 0791dc94e34b2a3af83083449b4a4f4f92b872d1..570ca012364f6395e7c87301e52dadbaf4c536c9 100644 (file)
 use rustc_target::spec::abi::Abi;
 use syntax_pos::{Pos, Span};
 
-pub trait AstBuilder {
-    // Paths
-    fn path(&self, span: Span, strs: Vec<ast::Ident> ) -> ast::Path;
-    fn path_ident(&self, span: Span, id: ast::Ident) -> ast::Path;
-    fn path_global(&self, span: Span, strs: Vec<ast::Ident> ) -> ast::Path;
-    fn path_all(&self, sp: Span,
-                global: bool,
-                idents: Vec<ast::Ident>,
-                args: Vec<ast::GenericArg>,
-                constraints: Vec<ast::AssocTyConstraint>)
-        -> ast::Path;
-
-    fn qpath(&self, self_type: P<ast::Ty>,
-             trait_path: ast::Path,
-             ident: ast::Ident)
-             -> (ast::QSelf, ast::Path);
-    fn qpath_all(&self, self_type: P<ast::Ty>,
-                trait_path: ast::Path,
-                ident: ast::Ident,
-                args: Vec<ast::GenericArg>,
-                constraints: Vec<ast::AssocTyConstraint>)
-                -> (ast::QSelf, ast::Path);
-
-    // types and consts
-    fn ty_mt(&self, ty: P<ast::Ty>, mutbl: ast::Mutability) -> ast::MutTy;
-
-    fn ty(&self, span: Span, ty: ast::TyKind) -> P<ast::Ty>;
-    fn ty_path(&self, path: ast::Path) -> P<ast::Ty>;
-    fn ty_ident(&self, span: Span, idents: ast::Ident) -> P<ast::Ty>;
-    fn anon_const(&self, span: Span, expr: ast::ExprKind) -> ast::AnonConst;
-    fn const_ident(&self, span: Span, idents: ast::Ident) -> ast::AnonConst;
-
-    fn ty_rptr(&self, span: Span,
-               ty: P<ast::Ty>,
-               lifetime: Option<ast::Lifetime>,
-               mutbl: ast::Mutability) -> P<ast::Ty>;
-    fn ty_ptr(&self, span: Span,
-              ty: P<ast::Ty>,
-              mutbl: ast::Mutability) -> P<ast::Ty>;
-
-    fn ty_infer(&self, sp: Span) -> P<ast::Ty>;
-
-    fn typaram(&self,
-               span: Span,
-               id: ast::Ident,
-               attrs: Vec<ast::Attribute>,
-               bounds: ast::GenericBounds,
-               default: Option<P<ast::Ty>>) -> ast::GenericParam;
-
-    fn trait_ref(&self, path: ast::Path) -> ast::TraitRef;
-    fn poly_trait_ref(&self, span: Span, path: ast::Path) -> ast::PolyTraitRef;
-    fn trait_bound(&self, path: ast::Path) -> ast::GenericBound;
-    fn lifetime(&self, span: Span, ident: ast::Ident) -> ast::Lifetime;
-    fn lifetime_def(&self,
-                    span: Span,
-                    ident: ast::Ident,
-                    attrs: Vec<ast::Attribute>,
-                    bounds: ast::GenericBounds)
-                    -> ast::GenericParam;
-
-    // Statements
-    fn stmt_expr(&self, expr: P<ast::Expr>) -> ast::Stmt;
-    fn stmt_semi(&self, expr: P<ast::Expr>) -> ast::Stmt;
-    fn stmt_let(&self, sp: Span, mutbl: bool, ident: ast::Ident, ex: P<ast::Expr>) -> ast::Stmt;
-    fn stmt_let_typed(&self,
-                      sp: Span,
-                      mutbl: bool,
-                      ident: ast::Ident,
-                      typ: P<ast::Ty>,
-                      ex: P<ast::Expr>)
-                      -> ast::Stmt;
-    fn stmt_let_type_only(&self, span: Span, ty: P<ast::Ty>) -> ast::Stmt;
-    fn stmt_item(&self, sp: Span, item: P<ast::Item>) -> ast::Stmt;
-
-    // Blocks
-    fn block(&self, span: Span, stmts: Vec<ast::Stmt>) -> P<ast::Block>;
-    fn block_expr(&self, expr: P<ast::Expr>) -> P<ast::Block>;
-
-    // Expressions
-    fn expr(&self, span: Span, node: ast::ExprKind) -> P<ast::Expr>;
-    fn expr_path(&self, path: ast::Path) -> P<ast::Expr>;
-    fn expr_qpath(&self, span: Span, qself: ast::QSelf, path: ast::Path) -> P<ast::Expr>;
-    fn expr_ident(&self, span: Span, id: ast::Ident) -> P<ast::Expr>;
-
-    fn expr_self(&self, span: Span) -> P<ast::Expr>;
-    fn expr_binary(&self, sp: Span, op: ast::BinOpKind,
-                   lhs: P<ast::Expr>, rhs: P<ast::Expr>) -> P<ast::Expr>;
-    fn expr_deref(&self, sp: Span, e: P<ast::Expr>) -> P<ast::Expr>;
-    fn expr_unary(&self, sp: Span, op: ast::UnOp, e: P<ast::Expr>) -> P<ast::Expr>;
-
-    fn expr_addr_of(&self, sp: Span, e: P<ast::Expr>) -> P<ast::Expr>;
-    fn expr_mut_addr_of(&self, sp: Span, e: P<ast::Expr>) -> P<ast::Expr>;
-    fn expr_field_access(&self, span: Span, expr: P<ast::Expr>, ident: ast::Ident) -> P<ast::Expr>;
-    fn expr_tup_field_access(&self, sp: Span, expr: P<ast::Expr>,
-                             idx: usize) -> P<ast::Expr>;
-    fn expr_call(&self, span: Span, expr: P<ast::Expr>, args: Vec<P<ast::Expr>>) -> P<ast::Expr>;
-    fn expr_call_ident(&self, span: Span, id: ast::Ident, args: Vec<P<ast::Expr>>) -> P<ast::Expr>;
-    fn expr_call_global(&self, sp: Span, fn_path: Vec<ast::Ident>,
-                        args: Vec<P<ast::Expr>> ) -> P<ast::Expr>;
-    fn expr_method_call(&self, span: Span,
-                        expr: P<ast::Expr>, ident: ast::Ident,
-                        args: Vec<P<ast::Expr>> ) -> P<ast::Expr>;
-    fn expr_block(&self, b: P<ast::Block>) -> P<ast::Expr>;
-    fn expr_cast(&self, sp: Span, expr: P<ast::Expr>, ty: P<ast::Ty>) -> P<ast::Expr>;
-
-    fn field_imm(&self, span: Span, name: Ident, e: P<ast::Expr>) -> ast::Field;
-    fn expr_struct(&self, span: Span, path: ast::Path, fields: Vec<ast::Field>) -> P<ast::Expr>;
-    fn expr_struct_ident(&self, span: Span, id: ast::Ident,
-                         fields: Vec<ast::Field>) -> P<ast::Expr>;
-
-    fn expr_lit(&self, sp: Span, lit: ast::LitKind) -> P<ast::Expr>;
-
-    fn expr_usize(&self, span: Span, i: usize) -> P<ast::Expr>;
-    fn expr_isize(&self, sp: Span, i: isize) -> P<ast::Expr>;
-    fn expr_u8(&self, sp: Span, u: u8) -> P<ast::Expr>;
-    fn expr_u16(&self, sp: Span, u: u16) -> P<ast::Expr>;
-    fn expr_u32(&self, sp: Span, u: u32) -> P<ast::Expr>;
-    fn expr_bool(&self, sp: Span, value: bool) -> P<ast::Expr>;
-
-    fn expr_vec(&self, sp: Span, exprs: Vec<P<ast::Expr>>) -> P<ast::Expr>;
-    fn expr_vec_ng(&self, sp: Span) -> P<ast::Expr>;
-    fn expr_vec_slice(&self, sp: Span, exprs: Vec<P<ast::Expr>>) -> P<ast::Expr>;
-    fn expr_str(&self, sp: Span, s: Symbol) -> P<ast::Expr>;
-
-    fn expr_some(&self, sp: Span, expr: P<ast::Expr>) -> P<ast::Expr>;
-    fn expr_none(&self, sp: Span) -> P<ast::Expr>;
-
-    fn expr_break(&self, sp: Span) -> P<ast::Expr>;
-
-    fn expr_tuple(&self, sp: Span, exprs: Vec<P<ast::Expr>>) -> P<ast::Expr>;
-
-    fn expr_fail(&self, span: Span, msg: Symbol) -> P<ast::Expr>;
-    fn expr_unreachable(&self, span: Span) -> P<ast::Expr>;
-
-    fn expr_ok(&self, span: Span, expr: P<ast::Expr>) -> P<ast::Expr>;
-    fn expr_err(&self, span: Span, expr: P<ast::Expr>) -> P<ast::Expr>;
-    fn expr_try(&self, span: Span, head: P<ast::Expr>) -> P<ast::Expr>;
-
-    fn pat(&self, span: Span, pat: PatKind) -> P<ast::Pat>;
-    fn pat_wild(&self, span: Span) -> P<ast::Pat>;
-    fn pat_lit(&self, span: Span, expr: P<ast::Expr>) -> P<ast::Pat>;
-    fn pat_ident(&self, span: Span, ident: ast::Ident) -> P<ast::Pat>;
-
-    fn pat_ident_binding_mode(&self,
-                              span: Span,
-                              ident: ast::Ident,
-                              bm: ast::BindingMode) -> P<ast::Pat>;
-    fn pat_path(&self, span: Span, path: ast::Path) -> P<ast::Pat>;
-    fn pat_tuple_struct(&self, span: Span, path: ast::Path,
-                        subpats: Vec<P<ast::Pat>>) -> P<ast::Pat>;
-    fn pat_struct(&self, span: Span, path: ast::Path,
-                  field_pats: Vec<Spanned<ast::FieldPat>>) -> P<ast::Pat>;
-    fn pat_tuple(&self, span: Span, pats: Vec<P<ast::Pat>>) -> P<ast::Pat>;
-
-    fn pat_some(&self, span: Span, pat: P<ast::Pat>) -> P<ast::Pat>;
-    fn pat_none(&self, span: Span) -> P<ast::Pat>;
-
-    fn pat_ok(&self, span: Span, pat: P<ast::Pat>) -> P<ast::Pat>;
-    fn pat_err(&self, span: Span, pat: P<ast::Pat>) -> P<ast::Pat>;
-
-    fn arm(&self, span: Span, pats: Vec<P<ast::Pat>>, expr: P<ast::Expr>) -> ast::Arm;
-    fn arm_unreachable(&self, span: Span) -> ast::Arm;
-
-    fn expr_match(&self, span: Span, arg: P<ast::Expr>, arms: Vec<ast::Arm> ) -> P<ast::Expr>;
-    fn expr_if(&self, span: Span,
-               cond: P<ast::Expr>, then: P<ast::Expr>, els: Option<P<ast::Expr>>) -> P<ast::Expr>;
-    fn expr_loop(&self, span: Span, block: P<ast::Block>) -> P<ast::Expr>;
-
-    fn lambda_fn_decl(&self,
-                      span: Span,
-                      fn_decl: P<ast::FnDecl>,
-                      body: P<ast::Expr>,
-                      fn_decl_span: Span)
-                      -> P<ast::Expr>;
-
-    fn lambda(&self, span: Span, ids: Vec<ast::Ident>, body: P<ast::Expr>) -> P<ast::Expr>;
-    fn lambda0(&self, span: Span, body: P<ast::Expr>) -> P<ast::Expr>;
-    fn lambda1(&self, span: Span, body: P<ast::Expr>, ident: ast::Ident) -> P<ast::Expr>;
-
-    fn lambda_stmts(&self, span: Span, ids: Vec<ast::Ident>,
-                    blk: Vec<ast::Stmt>) -> P<ast::Expr>;
-    fn lambda_stmts_0(&self, span: Span, stmts: Vec<ast::Stmt>) -> P<ast::Expr>;
-    fn lambda_stmts_1(&self, span: Span, stmts: Vec<ast::Stmt>,
-                      ident: ast::Ident) -> P<ast::Expr>;
-
-    // Items
-    fn item(&self, span: Span,
-            name: Ident, attrs: Vec<ast::Attribute> , node: ast::ItemKind) -> P<ast::Item>;
-
-    fn arg(&self, span: Span, name: Ident, ty: P<ast::Ty>) -> ast::Arg;
-    // FIXME: unused `self`
-    fn fn_decl(&self, inputs: Vec<ast::Arg> , output: ast::FunctionRetTy) -> P<ast::FnDecl>;
-
-    fn item_fn_poly(&self,
-                    span: Span,
-                    name: Ident,
-                    inputs: Vec<ast::Arg> ,
-                    output: P<ast::Ty>,
-                    generics: Generics,
-                    body: P<ast::Block>) -> P<ast::Item>;
-    fn item_fn(&self,
-               span: Span,
-               name: Ident,
-               inputs: Vec<ast::Arg> ,
-               output: P<ast::Ty>,
-               body: P<ast::Block>) -> P<ast::Item>;
-
-    fn variant(&self, span: Span, name: Ident, tys: Vec<P<ast::Ty>> ) -> ast::Variant;
-    fn item_enum_poly(&self,
-                      span: Span,
-                      name: Ident,
-                      enum_definition: ast::EnumDef,
-                      generics: Generics) -> P<ast::Item>;
-    fn item_enum(&self, span: Span, name: Ident, enum_def: ast::EnumDef) -> P<ast::Item>;
-
-    fn item_struct_poly(&self,
-                        span: Span,
-                        name: Ident,
-                        struct_def: ast::VariantData,
-                        generics: Generics) -> P<ast::Item>;
-    fn item_struct(&self, span: Span, name: Ident, struct_def: ast::VariantData) -> P<ast::Item>;
-
-    fn item_mod(&self, span: Span, inner_span: Span,
-                name: Ident, attrs: Vec<ast::Attribute>,
-                items: Vec<P<ast::Item>>) -> P<ast::Item>;
-
-    fn item_extern_crate(&self, span: Span, name: Ident) -> P<ast::Item>;
-
-    fn item_static(&self,
-                   span: Span,
-                   name: Ident,
-                   ty: P<ast::Ty>,
-                   mutbl: ast::Mutability,
-                   expr: P<ast::Expr>)
-                   -> P<ast::Item>;
-
-    fn item_const(&self,
-                   span: Span,
-                   name: Ident,
-                   ty: P<ast::Ty>,
-                   expr: P<ast::Expr>)
-                   -> P<ast::Item>;
-
-    fn item_ty_poly(&self,
-                    span: Span,
-                    name: Ident,
-                    ty: P<ast::Ty>,
-                    generics: Generics) -> P<ast::Item>;
-    fn item_ty(&self, span: Span, name: Ident, ty: P<ast::Ty>) -> P<ast::Item>;
-
-    fn attribute(&self, mi: ast::MetaItem) -> ast::Attribute;
-
-    fn meta_word(&self, sp: Span, w: ast::Name) -> ast::MetaItem;
-
-    fn meta_list_item_word(&self, sp: Span, w: ast::Name) -> ast::NestedMetaItem;
-
-    fn meta_list(&self,
-                 sp: Span,
-                 name: ast::Name,
-                 mis: Vec<ast::NestedMetaItem> )
-                 -> ast::MetaItem;
-    fn meta_name_value(&self,
-                       sp: Span,
-                       name: ast::Name,
-                       value: ast::LitKind)
-                       -> ast::MetaItem;
-
-    fn item_use(&self, sp: Span,
-                vis: ast::Visibility, vp: P<ast::UseTree>) -> P<ast::Item>;
-    fn item_use_simple(&self, sp: Span, vis: ast::Visibility, path: ast::Path) -> P<ast::Item>;
-    fn item_use_simple_(&self, sp: Span, vis: ast::Visibility,
-                        ident: Option<ast::Ident>, path: ast::Path) -> P<ast::Item>;
-    fn item_use_list(&self, sp: Span, vis: ast::Visibility,
-                     path: Vec<ast::Ident>, imports: &[ast::Ident]) -> P<ast::Item>;
-    fn item_use_glob(&self, sp: Span,
-                     vis: ast::Visibility, path: Vec<ast::Ident>) -> P<ast::Item>;
-}
+// Left so that Cargo tests don't break, this can be removed once those no longer use it
+pub trait AstBuilder {}
 
-impl<'a> AstBuilder for ExtCtxt<'a> {
-    fn path(&self, span: Span, strs: Vec<ast::Ident> ) -> ast::Path {
+impl<'a> ExtCtxt<'a> {
+    pub fn path(&self, span: Span, strs: Vec<ast::Ident> ) -> ast::Path {
         self.path_all(span, false, strs, vec![], vec![])
     }
-    fn path_ident(&self, span: Span, id: ast::Ident) -> ast::Path {
+    pub fn path_ident(&self, span: Span, id: ast::Ident) -> ast::Path {
         self.path(span, vec![id])
     }
-    fn path_global(&self, span: Span, strs: Vec<ast::Ident> ) -> ast::Path {
+    pub fn path_global(&self, span: Span, strs: Vec<ast::Ident> ) -> ast::Path {
         self.path_all(span, true, strs, vec![], vec![])
     }
-    fn path_all(&self,
+    pub fn path_all(&self,
                 span: Span,
                 global: bool,
                 mut idents: Vec<ast::Ident> ,
@@ -330,7 +55,7 @@ fn path_all(&self,
     /// Constructs a qualified path.
     ///
     /// Constructs a path like `<self_type as trait_path>::ident`.
-    fn qpath(&self,
+    pub fn qpath(&self,
              self_type: P<ast::Ty>,
              trait_path: ast::Path,
              ident: ast::Ident)
@@ -341,7 +66,7 @@ fn qpath(&self,
     /// Constructs a qualified path.
     ///
     /// Constructs a path like `<self_type as trait_path>::ident<'a, T, A = Bar>`.
-    fn qpath_all(&self,
+    pub fn qpath_all(&self,
                  self_type: P<ast::Ty>,
                  trait_path: ast::Path,
                  ident: ast::Ident,
@@ -363,14 +88,14 @@ fn qpath_all(&self,
         }, path)
     }
 
-    fn ty_mt(&self, ty: P<ast::Ty>, mutbl: ast::Mutability) -> ast::MutTy {
+    pub fn ty_mt(&self, ty: P<ast::Ty>, mutbl: ast::Mutability) -> ast::MutTy {
         ast::MutTy {
             ty,
             mutbl,
         }
     }
 
-    fn ty(&self, span: Span, ty: ast::TyKind) -> P<ast::Ty> {
+    pub fn ty(&self, span: Span, ty: ast::TyKind) -> P<ast::Ty> {
         P(ast::Ty {
             id: ast::DUMMY_NODE_ID,
             span,
@@ -378,18 +103,18 @@ fn ty(&self, span: Span, ty: ast::TyKind) -> P<ast::Ty> {
         })
     }
 
-    fn ty_path(&self, path: ast::Path) -> P<ast::Ty> {
+    pub fn ty_path(&self, path: ast::Path) -> P<ast::Ty> {
         self.ty(path.span, ast::TyKind::Path(None, path))
     }
 
     // Might need to take bounds as an argument in the future, if you ever want
     // to generate a bounded existential trait type.
-    fn ty_ident(&self, span: Span, ident: ast::Ident)
+    pub fn ty_ident(&self, span: Span, ident: ast::Ident)
         -> P<ast::Ty> {
         self.ty_path(self.path_ident(span, ident))
     }
 
-    fn anon_const(&self, span: Span, expr: ast::ExprKind) -> ast::AnonConst {
+    pub fn anon_const(&self, span: Span, expr: ast::ExprKind) -> ast::AnonConst {
         ast::AnonConst {
             id: ast::DUMMY_NODE_ID,
             value: P(ast::Expr {
@@ -401,11 +126,11 @@ fn anon_const(&self, span: Span, expr: ast::ExprKind) -> ast::AnonConst {
         }
     }
 
-    fn const_ident(&self, span: Span, ident: ast::Ident) -> ast::AnonConst {
+    pub fn const_ident(&self, span: Span, ident: ast::Ident) -> ast::AnonConst {
         self.anon_const(span, ast::ExprKind::Path(None, self.path_ident(span, ident)))
     }
 
-    fn ty_rptr(&self,
+    pub fn ty_rptr(&self,
                span: Span,
                ty: P<ast::Ty>,
                lifetime: Option<ast::Lifetime>,
@@ -415,7 +140,7 @@ fn ty_rptr(&self,
                 ast::TyKind::Rptr(lifetime, self.ty_mt(ty, mutbl)))
     }
 
-    fn ty_ptr(&self,
+    pub fn ty_ptr(&self,
               span: Span,
               ty: P<ast::Ty>,
               mutbl: ast::Mutability)
@@ -424,11 +149,11 @@ fn ty_ptr(&self,
                 ast::TyKind::Ptr(self.ty_mt(ty, mutbl)))
     }
 
-    fn ty_infer(&self, span: Span) -> P<ast::Ty> {
+    pub fn ty_infer(&self, span: Span) -> P<ast::Ty> {
         self.ty(span, ast::TyKind::Infer)
     }
 
-    fn typaram(&self,
+    pub fn typaram(&self,
                span: Span,
                ident: ast::Ident,
                attrs: Vec<ast::Attribute>,
@@ -445,14 +170,14 @@ fn typaram(&self,
         }
     }
 
-    fn trait_ref(&self, path: ast::Path) -> ast::TraitRef {
+    pub fn trait_ref(&self, path: ast::Path) -> ast::TraitRef {
         ast::TraitRef {
             path,
             ref_id: ast::DUMMY_NODE_ID,
         }
     }
 
-    fn poly_trait_ref(&self, span: Span, path: ast::Path) -> ast::PolyTraitRef {
+    pub fn poly_trait_ref(&self, span: Span, path: ast::Path) -> ast::PolyTraitRef {
         ast::PolyTraitRef {
             bound_generic_params: Vec::new(),
             trait_ref: self.trait_ref(path),
@@ -460,16 +185,16 @@ fn poly_trait_ref(&self, span: Span, path: ast::Path) -> ast::PolyTraitRef {
         }
     }
 
-    fn trait_bound(&self, path: ast::Path) -> ast::GenericBound {
+    pub fn trait_bound(&self, path: ast::Path) -> ast::GenericBound {
         ast::GenericBound::Trait(self.poly_trait_ref(path.span, path),
                                  ast::TraitBoundModifier::None)
     }
 
-    fn lifetime(&self, span: Span, ident: ast::Ident) -> ast::Lifetime {
+    pub fn lifetime(&self, span: Span, ident: ast::Ident) -> ast::Lifetime {
         ast::Lifetime { id: ast::DUMMY_NODE_ID, ident: ident.with_span_pos(span) }
     }
 
-    fn lifetime_def(&self,
+    pub fn lifetime_def(&self,
                     span: Span,
                     ident: ast::Ident,
                     attrs: Vec<ast::Attribute>,
@@ -485,7 +210,7 @@ fn lifetime_def(&self,
         }
     }
 
-    fn stmt_expr(&self, expr: P<ast::Expr>) -> ast::Stmt {
+    pub fn stmt_expr(&self, expr: P<ast::Expr>) -> ast::Stmt {
         ast::Stmt {
             id: ast::DUMMY_NODE_ID,
             span: expr.span,
@@ -493,7 +218,7 @@ fn stmt_expr(&self, expr: P<ast::Expr>) -> ast::Stmt {
         }
     }
 
-    fn stmt_semi(&self, expr: P<ast::Expr>) -> ast::Stmt {
+    pub fn stmt_semi(&self, expr: P<ast::Expr>) -> ast::Stmt {
         ast::Stmt {
             id: ast::DUMMY_NODE_ID,
             span: expr.span,
@@ -501,7 +226,7 @@ fn stmt_semi(&self, expr: P<ast::Expr>) -> ast::Stmt {
         }
     }
 
-    fn stmt_let(&self, sp: Span, mutbl: bool, ident: ast::Ident,
+    pub fn stmt_let(&self, sp: Span, mutbl: bool, ident: ast::Ident,
                 ex: P<ast::Expr>) -> ast::Stmt {
         let pat = if mutbl {
             let binding_mode = ast::BindingMode::ByValue(ast::Mutability::Mutable);
@@ -524,7 +249,7 @@ fn stmt_let(&self, sp: Span, mutbl: bool, ident: ast::Ident,
         }
     }
 
-    fn stmt_let_typed(&self,
+    pub fn stmt_let_typed(&self,
                       sp: Span,
                       mutbl: bool,
                       ident: ast::Ident,
@@ -553,7 +278,7 @@ fn stmt_let_typed(&self,
     }
 
     // Generates `let _: Type;`, which is usually used for type assertions.
-    fn stmt_let_type_only(&self, span: Span, ty: P<ast::Ty>) -> ast::Stmt {
+    pub fn stmt_let_type_only(&self, span: Span, ty: P<ast::Ty>) -> ast::Stmt {
         let local = P(ast::Local {
             pat: self.pat_wild(span),
             ty: Some(ty),
@@ -569,7 +294,7 @@ fn stmt_let_type_only(&self, span: Span, ty: P<ast::Ty>) -> ast::Stmt {
         }
     }
 
-    fn stmt_item(&self, sp: Span, item: P<ast::Item>) -> ast::Stmt {
+    pub fn stmt_item(&self, sp: Span, item: P<ast::Item>) -> ast::Stmt {
         ast::Stmt {
             id: ast::DUMMY_NODE_ID,
             node: ast::StmtKind::Item(item),
@@ -577,14 +302,14 @@ fn stmt_item(&self, sp: Span, item: P<ast::Item>) -> ast::Stmt {
         }
     }
 
-    fn block_expr(&self, expr: P<ast::Expr>) -> P<ast::Block> {
+    pub fn block_expr(&self, expr: P<ast::Expr>) -> P<ast::Block> {
         self.block(expr.span, vec![ast::Stmt {
             id: ast::DUMMY_NODE_ID,
             span: expr.span,
             node: ast::StmtKind::Expr(expr),
         }])
     }
-    fn block(&self, span: Span, stmts: Vec<ast::Stmt>) -> P<ast::Block> {
+    pub fn block(&self, span: Span, stmts: Vec<ast::Stmt>) -> P<ast::Block> {
         P(ast::Block {
            stmts,
            id: ast::DUMMY_NODE_ID,
@@ -593,7 +318,7 @@ fn block(&self, span: Span, stmts: Vec<ast::Stmt>) -> P<ast::Block> {
         })
     }
 
-    fn expr(&self, span: Span, node: ast::ExprKind) -> P<ast::Expr> {
+    pub fn expr(&self, span: Span, node: ast::ExprKind) -> P<ast::Expr> {
         P(ast::Expr {
             id: ast::DUMMY_NODE_ID,
             node,
@@ -602,61 +327,65 @@ fn expr(&self, span: Span, node: ast::ExprKind) -> P<ast::Expr> {
         })
     }
 
-    fn expr_path(&self, path: ast::Path) -> P<ast::Expr> {
+    pub fn expr_path(&self, path: ast::Path) -> P<ast::Expr> {
         self.expr(path.span, ast::ExprKind::Path(None, path))
     }
 
     /// Constructs a `QPath` expression.
-    fn expr_qpath(&self, span: Span, qself: ast::QSelf, path: ast::Path) -> P<ast::Expr> {
+    pub fn expr_qpath(&self, span: Span, qself: ast::QSelf, path: ast::Path) -> P<ast::Expr> {
         self.expr(span, ast::ExprKind::Path(Some(qself), path))
     }
 
-    fn expr_ident(&self, span: Span, id: ast::Ident) -> P<ast::Expr> {
+    pub fn expr_ident(&self, span: Span, id: ast::Ident) -> P<ast::Expr> {
         self.expr_path(self.path_ident(span, id))
     }
-    fn expr_self(&self, span: Span) -> P<ast::Expr> {
+    pub fn expr_self(&self, span: Span) -> P<ast::Expr> {
         self.expr_ident(span, Ident::with_empty_ctxt(kw::SelfLower))
     }
 
-    fn expr_binary(&self, sp: Span, op: ast::BinOpKind,
+    pub fn expr_binary(&self, sp: Span, op: ast::BinOpKind,
                    lhs: P<ast::Expr>, rhs: P<ast::Expr>) -> P<ast::Expr> {
         self.expr(sp, ast::ExprKind::Binary(Spanned { node: op, span: sp }, lhs, rhs))
     }
 
-    fn expr_deref(&self, sp: Span, e: P<ast::Expr>) -> P<ast::Expr> {
+    pub fn expr_deref(&self, sp: Span, e: P<ast::Expr>) -> P<ast::Expr> {
         self.expr_unary(sp, UnOp::Deref, e)
     }
-    fn expr_unary(&self, sp: Span, op: ast::UnOp, e: P<ast::Expr>) -> P<ast::Expr> {
+    pub fn expr_unary(&self, sp: Span, op: ast::UnOp, e: P<ast::Expr>) -> P<ast::Expr> {
         self.expr(sp, ast::ExprKind::Unary(op, e))
     }
 
-    fn expr_field_access(&self, sp: Span, expr: P<ast::Expr>, ident: ast::Ident) -> P<ast::Expr> {
+    pub fn expr_field_access(
+        &self, sp: Span, expr: P<ast::Expr>, ident: ast::Ident,
+    ) -> P<ast::Expr> {
         self.expr(sp, ast::ExprKind::Field(expr, ident.with_span_pos(sp)))
     }
-    fn expr_tup_field_access(&self, sp: Span, expr: P<ast::Expr>, idx: usize) -> P<ast::Expr> {
+    pub fn expr_tup_field_access(&self, sp: Span, expr: P<ast::Expr>, idx: usize) -> P<ast::Expr> {
         let ident = Ident::from_str(&idx.to_string()).with_span_pos(sp);
         self.expr(sp, ast::ExprKind::Field(expr, ident))
     }
-    fn expr_addr_of(&self, sp: Span, e: P<ast::Expr>) -> P<ast::Expr> {
+    pub fn expr_addr_of(&self, sp: Span, e: P<ast::Expr>) -> P<ast::Expr> {
         self.expr(sp, ast::ExprKind::AddrOf(ast::Mutability::Immutable, e))
     }
-    fn expr_mut_addr_of(&self, sp: Span, e: P<ast::Expr>) -> P<ast::Expr> {
+    pub fn expr_mut_addr_of(&self, sp: Span, e: P<ast::Expr>) -> P<ast::Expr> {
         self.expr(sp, ast::ExprKind::AddrOf(ast::Mutability::Mutable, e))
     }
 
-    fn expr_call(&self, span: Span, expr: P<ast::Expr>, args: Vec<P<ast::Expr>>) -> P<ast::Expr> {
+    pub fn expr_call(
+        &self, span: Span, expr: P<ast::Expr>, args: Vec<P<ast::Expr>>,
+    ) -> P<ast::Expr> {
         self.expr(span, ast::ExprKind::Call(expr, args))
     }
-    fn expr_call_ident(&self, span: Span, id: ast::Ident,
+    pub fn expr_call_ident(&self, span: Span, id: ast::Ident,
                        args: Vec<P<ast::Expr>>) -> P<ast::Expr> {
         self.expr(span, ast::ExprKind::Call(self.expr_ident(span, id), args))
     }
-    fn expr_call_global(&self, sp: Span, fn_path: Vec<ast::Ident> ,
+    pub fn expr_call_global(&self, sp: Span, fn_path: Vec<ast::Ident> ,
                       args: Vec<P<ast::Expr>> ) -> P<ast::Expr> {
         let pathexpr = self.expr_path(self.path_global(sp, fn_path));
         self.expr_call(sp, pathexpr, args)
     }
-    fn expr_method_call(&self, span: Span,
+    pub fn expr_method_call(&self, span: Span,
                         expr: P<ast::Expr>,
                         ident: ast::Ident,
                         mut args: Vec<P<ast::Expr>> ) -> P<ast::Expr> {
@@ -664,10 +393,10 @@ fn expr_method_call(&self, span: Span,
         let segment = ast::PathSegment::from_ident(ident.with_span_pos(span));
         self.expr(span, ast::ExprKind::MethodCall(segment, args))
     }
-    fn expr_block(&self, b: P<ast::Block>) -> P<ast::Expr> {
+    pub fn expr_block(&self, b: P<ast::Block>) -> P<ast::Expr> {
         self.expr(b.span, ast::ExprKind::Block(b, None))
     }
-    fn field_imm(&self, span: Span, ident: Ident, e: P<ast::Expr>) -> ast::Field {
+    pub fn field_imm(&self, span: Span, ident: Ident, e: P<ast::Expr>) -> ast::Field {
         ast::Field {
             ident: ident.with_span_pos(span),
             expr: e,
@@ -676,23 +405,25 @@ fn field_imm(&self, span: Span, ident: Ident, e: P<ast::Expr>) -> ast::Field {
             attrs: ThinVec::new(),
         }
     }
-    fn expr_struct(&self, span: Span, path: ast::Path, fields: Vec<ast::Field>) -> P<ast::Expr> {
+    pub fn expr_struct(
+        &self, span: Span, path: ast::Path, fields: Vec<ast::Field>
+    ) -> P<ast::Expr> {
         self.expr(span, ast::ExprKind::Struct(path, fields, None))
     }
-    fn expr_struct_ident(&self, span: Span,
+    pub fn expr_struct_ident(&self, span: Span,
                          id: ast::Ident, fields: Vec<ast::Field>) -> P<ast::Expr> {
         self.expr_struct(span, self.path_ident(span, id), fields)
     }
 
-    fn expr_lit(&self, span: Span, lit_kind: ast::LitKind) -> P<ast::Expr> {
+    pub fn expr_lit(&self, span: Span, lit_kind: ast::LitKind) -> P<ast::Expr> {
         let lit = ast::Lit::from_lit_kind(lit_kind, span);
         self.expr(span, ast::ExprKind::Lit(lit))
     }
-    fn expr_usize(&self, span: Span, i: usize) -> P<ast::Expr> {
+    pub fn expr_usize(&self, span: Span, i: usize) -> P<ast::Expr> {
         self.expr_lit(span, ast::LitKind::Int(i as u128,
                                               ast::LitIntType::Unsigned(ast::UintTy::Usize)))
     }
-    fn expr_isize(&self, sp: Span, i: isize) -> P<ast::Expr> {
+    pub fn expr_isize(&self, sp: Span, i: isize) -> P<ast::Expr> {
         if i < 0 {
             let i = (-i) as u128;
             let lit_ty = ast::LitIntType::Signed(ast::IntTy::Isize);
@@ -703,59 +434,59 @@ fn expr_isize(&self, sp: Span, i: isize) -> P<ast::Expr> {
                                                 ast::LitIntType::Signed(ast::IntTy::Isize)))
         }
     }
-    fn expr_u32(&self, sp: Span, u: u32) -> P<ast::Expr> {
+    pub fn expr_u32(&self, sp: Span, u: u32) -> P<ast::Expr> {
         self.expr_lit(sp, ast::LitKind::Int(u as u128,
                                             ast::LitIntType::Unsigned(ast::UintTy::U32)))
     }
-    fn expr_u16(&self, sp: Span, u: u16) -> P<ast::Expr> {
+    pub fn expr_u16(&self, sp: Span, u: u16) -> P<ast::Expr> {
         self.expr_lit(sp, ast::LitKind::Int(u as u128,
                                             ast::LitIntType::Unsigned(ast::UintTy::U16)))
     }
-    fn expr_u8(&self, sp: Span, u: u8) -> P<ast::Expr> {
+    pub fn expr_u8(&self, sp: Span, u: u8) -> P<ast::Expr> {
         self.expr_lit(sp, ast::LitKind::Int(u as u128, ast::LitIntType::Unsigned(ast::UintTy::U8)))
     }
-    fn expr_bool(&self, sp: Span, value: bool) -> P<ast::Expr> {
+    pub fn expr_bool(&self, sp: Span, value: bool) -> P<ast::Expr> {
         self.expr_lit(sp, ast::LitKind::Bool(value))
     }
 
-    fn expr_vec(&self, sp: Span, exprs: Vec<P<ast::Expr>>) -> P<ast::Expr> {
+    pub fn expr_vec(&self, sp: Span, exprs: Vec<P<ast::Expr>>) -> P<ast::Expr> {
         self.expr(sp, ast::ExprKind::Array(exprs))
     }
-    fn expr_vec_ng(&self, sp: Span) -> P<ast::Expr> {
+    pub fn expr_vec_ng(&self, sp: Span) -> P<ast::Expr> {
         self.expr_call_global(sp, self.std_path(&[sym::vec, sym::Vec, sym::new]),
                               Vec::new())
     }
-    fn expr_vec_slice(&self, sp: Span, exprs: Vec<P<ast::Expr>>) -> P<ast::Expr> {
+    pub fn expr_vec_slice(&self, sp: Span, exprs: Vec<P<ast::Expr>>) -> P<ast::Expr> {
         self.expr_addr_of(sp, self.expr_vec(sp, exprs))
     }
-    fn expr_str(&self, sp: Span, s: Symbol) -> P<ast::Expr> {
+    pub fn expr_str(&self, sp: Span, s: Symbol) -> P<ast::Expr> {
         self.expr_lit(sp, ast::LitKind::Str(s, ast::StrStyle::Cooked))
     }
 
-    fn expr_cast(&self, sp: Span, expr: P<ast::Expr>, ty: P<ast::Ty>) -> P<ast::Expr> {
+    pub fn expr_cast(&self, sp: Span, expr: P<ast::Expr>, ty: P<ast::Ty>) -> P<ast::Expr> {
         self.expr(sp, ast::ExprKind::Cast(expr, ty))
     }
 
-    fn expr_some(&self, sp: Span, expr: P<ast::Expr>) -> P<ast::Expr> {
+    pub fn expr_some(&self, sp: Span, expr: P<ast::Expr>) -> P<ast::Expr> {
         let some = self.std_path(&[sym::option, sym::Option, sym::Some]);
         self.expr_call_global(sp, some, vec![expr])
     }
 
-    fn expr_none(&self, sp: Span) -> P<ast::Expr> {
+    pub fn expr_none(&self, sp: Span) -> P<ast::Expr> {
         let none = self.std_path(&[sym::option, sym::Option, sym::None]);
         let none = self.path_global(sp, none);
         self.expr_path(none)
     }
 
-    fn expr_break(&self, sp: Span) -> P<ast::Expr> {
+    pub fn expr_break(&self, sp: Span) -> P<ast::Expr> {
         self.expr(sp, ast::ExprKind::Break(None, None))
     }
 
-    fn expr_tuple(&self, sp: Span, exprs: Vec<P<ast::Expr>>) -> P<ast::Expr> {
+    pub fn expr_tuple(&self, sp: Span, exprs: Vec<P<ast::Expr>>) -> P<ast::Expr> {
         self.expr(sp, ast::ExprKind::Tup(exprs))
     }
 
-    fn expr_fail(&self, span: Span, msg: Symbol) -> P<ast::Expr> {
+    pub fn expr_fail(&self, span: Span, msg: Symbol) -> P<ast::Expr> {
         let loc = self.source_map().lookup_char_pos(span.lo());
         let expr_file = self.expr_str(span, Symbol::intern(&loc.file.name.to_string()));
         let expr_line = self.expr_u32(span, loc.line as u32);
@@ -770,21 +501,21 @@ fn expr_fail(&self, span: Span, msg: Symbol) -> P<ast::Expr> {
                 expr_loc_ptr])
     }
 
-    fn expr_unreachable(&self, span: Span) -> P<ast::Expr> {
+    pub fn expr_unreachable(&self, span: Span) -> P<ast::Expr> {
         self.expr_fail(span, Symbol::intern("internal error: entered unreachable code"))
     }
 
-    fn expr_ok(&self, sp: Span, expr: P<ast::Expr>) -> P<ast::Expr> {
+    pub fn expr_ok(&self, sp: Span, expr: P<ast::Expr>) -> P<ast::Expr> {
         let ok = self.std_path(&[sym::result, sym::Result, sym::Ok]);
         self.expr_call_global(sp, ok, vec![expr])
     }
 
-    fn expr_err(&self, sp: Span, expr: P<ast::Expr>) -> P<ast::Expr> {
+    pub fn expr_err(&self, sp: Span, expr: P<ast::Expr>) -> P<ast::Expr> {
         let err = self.std_path(&[sym::result, sym::Result, sym::Err]);
         self.expr_call_global(sp, err, vec![expr])
     }
 
-    fn expr_try(&self, sp: Span, head: P<ast::Expr>) -> P<ast::Expr> {
+    pub fn expr_try(&self, sp: Span, head: P<ast::Expr>) -> P<ast::Expr> {
         let ok = self.std_path(&[sym::result, sym::Result, sym::Ok]);
         let ok_path = self.path_global(sp, ok);
         let err = self.std_path(&[sym::result, sym::Result, sym::Err]);
@@ -814,67 +545,67 @@ fn expr_try(&self, sp: Span, head: P<ast::Expr>) -> P<ast::Expr> {
     }
 
 
-    fn pat(&self, span: Span, pat: PatKind) -> P<ast::Pat> {
+    pub fn pat(&self, span: Span, pat: PatKind) -> P<ast::Pat> {
         P(ast::Pat { id: ast::DUMMY_NODE_ID, node: pat, span })
     }
-    fn pat_wild(&self, span: Span) -> P<ast::Pat> {
+    pub fn pat_wild(&self, span: Span) -> P<ast::Pat> {
         self.pat(span, PatKind::Wild)
     }
-    fn pat_lit(&self, span: Span, expr: P<ast::Expr>) -> P<ast::Pat> {
+    pub fn pat_lit(&self, span: Span, expr: P<ast::Expr>) -> P<ast::Pat> {
         self.pat(span, PatKind::Lit(expr))
     }
-    fn pat_ident(&self, span: Span, ident: ast::Ident) -> P<ast::Pat> {
+    pub fn pat_ident(&self, span: Span, ident: ast::Ident) -> P<ast::Pat> {
         let binding_mode = ast::BindingMode::ByValue(ast::Mutability::Immutable);
         self.pat_ident_binding_mode(span, ident, binding_mode)
     }
 
-    fn pat_ident_binding_mode(&self,
+    pub fn pat_ident_binding_mode(&self,
                               span: Span,
                               ident: ast::Ident,
                               bm: ast::BindingMode) -> P<ast::Pat> {
         let pat = PatKind::Ident(bm, ident.with_span_pos(span), None);
         self.pat(span, pat)
     }
-    fn pat_path(&self, span: Span, path: ast::Path) -> P<ast::Pat> {
+    pub fn pat_path(&self, span: Span, path: ast::Path) -> P<ast::Pat> {
         self.pat(span, PatKind::Path(None, path))
     }
-    fn pat_tuple_struct(&self, span: Span, path: ast::Path,
+    pub fn pat_tuple_struct(&self, span: Span, path: ast::Path,
                         subpats: Vec<P<ast::Pat>>) -> P<ast::Pat> {
         self.pat(span, PatKind::TupleStruct(path, subpats))
     }
-    fn pat_struct(&self, span: Span, path: ast::Path,
+    pub fn pat_struct(&self, span: Span, path: ast::Path,
                   field_pats: Vec<Spanned<ast::FieldPat>>) -> P<ast::Pat> {
         self.pat(span, PatKind::Struct(path, field_pats, false))
     }
-    fn pat_tuple(&self, span: Span, pats: Vec<P<ast::Pat>>) -> P<ast::Pat> {
+    pub fn pat_tuple(&self, span: Span, pats: Vec<P<ast::Pat>>) -> P<ast::Pat> {
         self.pat(span, PatKind::Tuple(pats))
     }
 
-    fn pat_some(&self, span: Span, pat: P<ast::Pat>) -> P<ast::Pat> {
+    pub fn pat_some(&self, span: Span, pat: P<ast::Pat>) -> P<ast::Pat> {
         let some = self.std_path(&[sym::option, sym::Option, sym::Some]);
         let path = self.path_global(span, some);
         self.pat_tuple_struct(span, path, vec![pat])
     }
 
-    fn pat_none(&self, span: Span) -> P<ast::Pat> {
+    pub fn pat_none(&self, span: Span) -> P<ast::Pat> {
         let some = self.std_path(&[sym::option, sym::Option, sym::None]);
         let path = self.path_global(span, some);
         self.pat_path(span, path)
     }
 
-    fn pat_ok(&self, span: Span, pat: P<ast::Pat>) -> P<ast::Pat> {
+    pub fn pat_ok(&self, span: Span, pat: P<ast::Pat>) -> P<ast::Pat> {
         let some = self.std_path(&[sym::result, sym::Result, sym::Ok]);
         let path = self.path_global(span, some);
         self.pat_tuple_struct(span, path, vec![pat])
     }
 
-    fn pat_err(&self, span: Span, pat: P<ast::Pat>) -> P<ast::Pat> {
+    pub fn pat_err(&self, span: Span, pat: P<ast::Pat>) -> P<ast::Pat> {
         let some = self.std_path(&[sym::result, sym::Result, sym::Err]);
         let path = self.path_global(span, some);
         self.pat_tuple_struct(span, path, vec![pat])
     }
 
-    fn arm(&self, span: Span, pats: Vec<P<ast::Pat>>, expr: P<ast::Expr>) -> ast::Arm {
+    pub fn arm(&self, span: Span, pats: Vec<P<ast::Pat>>, expr: P<ast::Expr>) -> ast::Arm {
         ast::Arm {
             attrs: vec![],
             pats,
@@ -884,25 +615,25 @@ fn arm(&self, span: Span, pats: Vec<P<ast::Pat>>, expr: P<ast::Expr>) -> ast::Ar
         }
     }
 
-    fn arm_unreachable(&self, span: Span) -> ast::Arm {
+    pub fn arm_unreachable(&self, span: Span) -> ast::Arm {
         self.arm(span, vec![self.pat_wild(span)], self.expr_unreachable(span))
     }
 
-    fn expr_match(&self, span: Span, arg: P<ast::Expr>, arms: Vec<ast::Arm>) -> P<Expr> {
+    pub fn expr_match(&self, span: Span, arg: P<ast::Expr>, arms: Vec<ast::Arm>) -> P<Expr> {
         self.expr(span, ast::ExprKind::Match(arg, arms))
     }
 
-    fn expr_if(&self, span: Span, cond: P<ast::Expr>,
+    pub fn expr_if(&self, span: Span, cond: P<ast::Expr>,
                then: P<ast::Expr>, els: Option<P<ast::Expr>>) -> P<ast::Expr> {
         let els = els.map(|x| self.expr_block(self.block_expr(x)));
         self.expr(span, ast::ExprKind::If(cond, self.block_expr(then), els))
     }
 
-    fn expr_loop(&self, span: Span, block: P<ast::Block>) -> P<ast::Expr> {
+    pub fn expr_loop(&self, span: Span, block: P<ast::Block>) -> P<ast::Expr> {
         self.expr(span, ast::ExprKind::Loop(block, None))
     }
 
-    fn lambda_fn_decl(&self,
+    pub fn lambda_fn_decl(&self,
                       span: Span,
                       fn_decl: P<ast::FnDecl>,
                       body: P<ast::Expr>,
@@ -916,7 +647,7 @@ fn lambda_fn_decl(&self,
                                                fn_decl_span))
     }
 
-    fn lambda(&self,
+    pub fn lambda(&self,
               span: Span,
               ids: Vec<ast::Ident>,
               body: P<ast::Expr>)
@@ -937,30 +668,30 @@ fn lambda(&self,
                                                span))
     }
 
-    fn lambda0(&self, span: Span, body: P<ast::Expr>) -> P<ast::Expr> {
+    pub fn lambda0(&self, span: Span, body: P<ast::Expr>) -> P<ast::Expr> {
         self.lambda(span, Vec::new(), body)
     }
 
-    fn lambda1(&self, span: Span, body: P<ast::Expr>, ident: ast::Ident) -> P<ast::Expr> {
+    pub fn lambda1(&self, span: Span, body: P<ast::Expr>, ident: ast::Ident) -> P<ast::Expr> {
         self.lambda(span, vec![ident], body)
     }
 
-    fn lambda_stmts(&self,
+    pub fn lambda_stmts(&self,
                     span: Span,
                     ids: Vec<ast::Ident>,
                     stmts: Vec<ast::Stmt>)
                     -> P<ast::Expr> {
         self.lambda(span, ids, self.expr_block(self.block(span, stmts)))
     }
-    fn lambda_stmts_0(&self, span: Span, stmts: Vec<ast::Stmt>) -> P<ast::Expr> {
+    pub fn lambda_stmts_0(&self, span: Span, stmts: Vec<ast::Stmt>) -> P<ast::Expr> {
         self.lambda0(span, self.expr_block(self.block(span, stmts)))
     }
-    fn lambda_stmts_1(&self, span: Span, stmts: Vec<ast::Stmt>,
+    pub fn lambda_stmts_1(&self, span: Span, stmts: Vec<ast::Stmt>,
                       ident: ast::Ident) -> P<ast::Expr> {
         self.lambda1(span, self.expr_block(self.block(span, stmts)), ident)
     }
 
-    fn arg(&self, span: Span, ident: ast::Ident, ty: P<ast::Ty>) -> ast::Arg {
+    pub fn arg(&self, span: Span, ident: ast::Ident, ty: P<ast::Ty>) -> ast::Arg {
         let arg_pat = self.pat_ident(span, ident);
         ast::Arg {
             attrs: ThinVec::default(),
@@ -972,7 +703,7 @@ fn arg(&self, span: Span, ident: ast::Ident, ty: P<ast::Ty>) -> ast::Arg {
     }
 
     // FIXME: unused `self`
-    fn fn_decl(&self, inputs: Vec<ast::Arg>, output: ast::FunctionRetTy) -> P<ast::FnDecl> {
+    pub fn fn_decl(&self, inputs: Vec<ast::Arg>, output: ast::FunctionRetTy) -> P<ast::FnDecl> {
         P(ast::FnDecl {
             inputs,
             output,
@@ -980,7 +711,7 @@ fn fn_decl(&self, inputs: Vec<ast::Arg>, output: ast::FunctionRetTy) -> P<ast::F
         })
     }
 
-    fn item(&self, span: Span, name: Ident,
+    pub fn item(&self, span: Span, name: Ident,
             attrs: Vec<ast::Attribute>, node: ast::ItemKind) -> P<ast::Item> {
         // FIXME: Would be nice if our generated code didn't violate
         // Rust coding conventions
@@ -995,7 +726,7 @@ fn item(&self, span: Span, name: Ident,
         })
     }
 
-    fn item_fn_poly(&self,
+    pub fn item_fn_poly(&self,
                     span: Span,
                     name: Ident,
                     inputs: Vec<ast::Arg> ,
@@ -1016,7 +747,7 @@ fn item_fn_poly(&self,
                               body))
     }
 
-    fn item_fn(&self,
+    pub fn item_fn(&self,
                span: Span,
                name: Ident,
                inputs: Vec<ast::Arg> ,
@@ -1032,7 +763,7 @@ fn item_fn(&self,
             body)
     }
 
-    fn variant(&self, span: Span, ident: Ident, tys: Vec<P<ast::Ty>> ) -> ast::Variant {
+    pub fn variant(&self, span: Span, ident: Ident, tys: Vec<P<ast::Ty>> ) -> ast::Variant {
         let fields: Vec<_> = tys.into_iter().map(|ty| {
             ast::StructField {
                 span: ty.span,
@@ -1060,19 +791,19 @@ fn variant(&self, span: Span, ident: Ident, tys: Vec<P<ast::Ty>> ) -> ast::Varia
                })
     }
 
-    fn item_enum_poly(&self, span: Span, name: Ident,
+    pub fn item_enum_poly(&self, span: Span, name: Ident,
                       enum_definition: ast::EnumDef,
                       generics: Generics) -> P<ast::Item> {
         self.item(span, name, Vec::new(), ast::ItemKind::Enum(enum_definition, generics))
     }
 
-    fn item_enum(&self, span: Span, name: Ident,
+    pub fn item_enum(&self, span: Span, name: Ident,
                  enum_definition: ast::EnumDef) -> P<ast::Item> {
         self.item_enum_poly(span, name, enum_definition,
                             Generics::default())
     }
 
-    fn item_struct(&self, span: Span, name: Ident,
+    pub fn item_struct(&self, span: Span, name: Ident,
                    struct_def: ast::VariantData) -> P<ast::Item> {
         self.item_struct_poly(
             span,
@@ -1082,12 +813,12 @@ fn item_struct(&self, span: Span, name: Ident,
         )
     }
 
-    fn item_struct_poly(&self, span: Span, name: Ident,
+    pub fn item_struct_poly(&self, span: Span, name: Ident,
         struct_def: ast::VariantData, generics: Generics) -> P<ast::Item> {
         self.item(span, name, Vec::new(), ast::ItemKind::Struct(struct_def, generics))
     }
 
-    fn item_mod(&self, span: Span, inner_span: Span, name: Ident,
+    pub fn item_mod(&self, span: Span, inner_span: Span, name: Ident,
                 attrs: Vec<ast::Attribute>,
                 items: Vec<P<ast::Item>>) -> P<ast::Item> {
         self.item(
@@ -1102,11 +833,11 @@ fn item_mod(&self, span: Span, inner_span: Span, name: Ident,
         )
     }
 
-    fn item_extern_crate(&self, span: Span, name: Ident) -> P<ast::Item> {
+    pub fn item_extern_crate(&self, span: Span, name: Ident) -> P<ast::Item> {
         self.item(span, name, Vec::new(), ast::ItemKind::ExternCrate(None))
     }
 
-    fn item_static(&self,
+    pub fn item_static(&self,
                    span: Span,
                    name: Ident,
                    ty: P<ast::Ty>,
@@ -1116,7 +847,7 @@ fn item_static(&self,
         self.item(span, name, Vec::new(), ast::ItemKind::Static(ty, mutbl, expr))
     }
 
-    fn item_const(&self,
+    pub fn item_const(&self,
                   span: Span,
                   name: Ident,
                   ty: P<ast::Ty>,
@@ -1125,39 +856,39 @@ fn item_const(&self,
         self.item(span, name, Vec::new(), ast::ItemKind::Const(ty, expr))
     }
 
-    fn item_ty_poly(&self, span: Span, name: Ident, ty: P<ast::Ty>,
+    pub fn item_ty_poly(&self, span: Span, name: Ident, ty: P<ast::Ty>,
                     generics: Generics) -> P<ast::Item> {
         self.item(span, name, Vec::new(), ast::ItemKind::Ty(ty, generics))
     }
 
-    fn item_ty(&self, span: Span, name: Ident, ty: P<ast::Ty>) -> P<ast::Item> {
+    pub fn item_ty(&self, span: Span, name: Ident, ty: P<ast::Ty>) -> P<ast::Item> {
         self.item_ty_poly(span, name, ty, Generics::default())
     }
 
-    fn attribute(&self, mi: ast::MetaItem) -> ast::Attribute {
+    pub fn attribute(&self, mi: ast::MetaItem) -> ast::Attribute {
         attr::mk_attr_outer(mi)
     }
 
-    fn meta_word(&self, sp: Span, w: ast::Name) -> ast::MetaItem {
+    pub fn meta_word(&self, sp: Span, w: ast::Name) -> ast::MetaItem {
         attr::mk_word_item(Ident::with_empty_ctxt(w).with_span_pos(sp))
     }
 
-    fn meta_list_item_word(&self, sp: Span, w: ast::Name) -> ast::NestedMetaItem {
+    pub fn meta_list_item_word(&self, sp: Span, w: ast::Name) -> ast::NestedMetaItem {
         attr::mk_nested_word_item(Ident::with_empty_ctxt(w).with_span_pos(sp))
     }
 
-    fn meta_list(&self, sp: Span, name: ast::Name, mis: Vec<ast::NestedMetaItem>)
+    pub fn meta_list(&self, sp: Span, name: ast::Name, mis: Vec<ast::NestedMetaItem>)
                  -> ast::MetaItem {
         attr::mk_list_item(sp, Ident::with_empty_ctxt(name).with_span_pos(sp), mis)
     }
 
-    fn meta_name_value(&self, span: Span, name: ast::Name, lit_kind: ast::LitKind)
+    pub fn meta_name_value(&self, span: Span, name: ast::Name, lit_kind: ast::LitKind)
                        -> ast::MetaItem {
         attr::mk_name_value_item(span, Ident::with_empty_ctxt(name).with_span_pos(span),
                                  lit_kind, span)
     }
 
-    fn item_use(&self, sp: Span,
+    pub fn item_use(&self, sp: Span,
                 vis: ast::Visibility, vp: P<ast::UseTree>) -> P<ast::Item> {
         P(ast::Item {
             id: ast::DUMMY_NODE_ID,
@@ -1170,11 +901,11 @@ fn item_use(&self, sp: Span,
         })
     }
 
-    fn item_use_simple(&self, sp: Span, vis: ast::Visibility, path: ast::Path) -> P<ast::Item> {
+    pub fn item_use_simple(&self, sp: Span, vis: ast::Visibility, path: ast::Path) -> P<ast::Item> {
         self.item_use_simple_(sp, vis, None, path)
     }
 
-    fn item_use_simple_(&self, sp: Span, vis: ast::Visibility,
+    pub fn item_use_simple_(&self, sp: Span, vis: ast::Visibility,
                         rename: Option<ast::Ident>, path: ast::Path) -> P<ast::Item> {
         self.item_use(sp, vis, P(ast::UseTree {
             span: sp,
@@ -1183,7 +914,7 @@ fn item_use_simple_(&self, sp: Span, vis: ast::Visibility,
         }))
     }
 
-    fn item_use_list(&self, sp: Span, vis: ast::Visibility,
+    pub fn item_use_list(&self, sp: Span, vis: ast::Visibility,
                      path: Vec<ast::Ident>, imports: &[ast::Ident]) -> P<ast::Item> {
         let imports = imports.iter().map(|id| {
             (ast::UseTree {
@@ -1200,7 +931,7 @@ fn item_use_list(&self, sp: Span, vis: ast::Visibility,
         }))
     }
 
-    fn item_use_glob(&self, sp: Span,
+    pub fn item_use_glob(&self, sp: Span,
                      vis: ast::Visibility, path: Vec<ast::Ident>) -> P<ast::Item> {
         self.item_use(sp, vis, P(ast::UseTree {
             span: sp,
index d1fabf963b5d99013007de042224f5cecc458d87..ec708994fad8616de0d5fa0a648ca10749038393 100644 (file)
@@ -2,7 +2,6 @@
 use crate::attr::{mark_used, mark_known, HasAttrs};
 use crate::errors::{Applicability, FatalError};
 use crate::ext::base::{self, *};
-use crate::ext::build::AstBuilder;
 use crate::ext::proc_macro_server;
 use crate::parse::{self, token};
 use crate::parse::parser::PathStyle;
index 235565314f5e29e891bec55c74b17a8c7058d8f1..b10d8fcd357c422fcb3a218b83c356864ec6c6b5 100644 (file)
@@ -3,7 +3,6 @@
 use syntax::ast::{self, *};
 use syntax::source_map::Spanned;
 use syntax::ext::base::*;
-use syntax::ext::build::AstBuilder;
 use syntax::parse::token::{self, TokenKind};
 use syntax::parse::parser::Parser;
 use syntax::print::pprust;
index 2b64f558be0a0223f2eff73723bfbf07ee42ed66..84830e6ddda1a0855e70ff06ff4544713402d249 100644 (file)
@@ -6,7 +6,6 @@
 
 use syntax::ast;
 use syntax::ext::base::{self, *};
-use syntax::ext::build::AstBuilder;
 use syntax::attr;
 use syntax::tokenstream;
 use syntax::parse::token;
index dbc985fd8599a679c4623805be55f80499a24b04..f1d079eb05379fb22d803c86cdf9ad9acabbb652 100644 (file)
@@ -1,6 +1,5 @@
 use syntax::ast;
 use syntax::ext::base;
-use syntax::ext::build::AstBuilder;
 use syntax::symbol::Symbol;
 use syntax::tokenstream;
 
index 350eacc3230ef6a6c4404887615b3b03b17d92e2..2340238aaea41bb94b9b86cdbe6455d38df882cf 100644 (file)
@@ -5,7 +5,6 @@
 use syntax::ast::{self, Expr, GenericArg, Generics, ItemKind, MetaItem, VariantData};
 use syntax::attr;
 use syntax::ext::base::{Annotatable, ExtCtxt};
-use syntax::ext::build::AstBuilder;
 use syntax::ptr::P;
 use syntax::symbol::{kw, sym, Symbol};
 use syntax_pos::Span;
index 5698a8e38239174dcf6373f97d50cf67f5ca07b2..0c34599814a79fa49a54a989bdd583095b5c51d3 100644 (file)
@@ -4,7 +4,6 @@
 
 use syntax::ast::{self, Expr, MetaItem, GenericArg};
 use syntax::ext::base::{Annotatable, ExtCtxt};
-use syntax::ext::build::AstBuilder;
 use syntax::ptr::P;
 use syntax::symbol::{sym, Symbol};
 use syntax_pos::Span;
index 8405d2898421736e68add3d0d5e92fe3d22ed0f5..885cfee35658a8bc0e4f9e9035403e7d8626b7fc 100644 (file)
@@ -4,7 +4,6 @@
 
 use syntax::ast::{self, Expr, MetaItem};
 use syntax::ext::base::{Annotatable, ExtCtxt};
-use syntax::ext::build::AstBuilder;
 use syntax::ptr::P;
 use syntax::symbol::sym;
 use syntax_pos::Span;
index 4ab136538877a9037e2570fe7965c72ca136e870..337f7c5cfe238e3b6fb34e6d26949219b4c4fa64 100644 (file)
@@ -4,7 +4,6 @@
 
 use syntax::ast::{BinOpKind, Expr, MetaItem};
 use syntax::ext::base::{Annotatable, ExtCtxt};
-use syntax::ext::build::AstBuilder;
 use syntax::ptr::P;
 use syntax::symbol::sym;
 use syntax_pos::Span;
index 18354e94815b5909ce5f930b0e922f61ca6692e2..0ec30f5924fbe273ef24129976d51d1222325003 100644 (file)
@@ -6,7 +6,6 @@
 
 use syntax::ast::{self, BinOpKind, Expr, MetaItem};
 use syntax::ext::base::{Annotatable, ExtCtxt};
-use syntax::ext::build::AstBuilder;
 use syntax::ptr::P;
 use syntax::symbol::{sym, Symbol};
 use syntax_pos::Span;
index 44ddbb98809b4f0d217bc234df31b15071520e35..0f709630bf41eafda3a4289c7dd839e804bbee36 100644 (file)
@@ -7,7 +7,6 @@
 use syntax::ast::{self, Ident};
 use syntax::ast::{Expr, MetaItem};
 use syntax::ext::base::{Annotatable, ExtCtxt};
-use syntax::ext::build::AstBuilder;
 use syntax::ptr::P;
 use syntax::symbol::sym;
 use syntax_pos::{DUMMY_SP, Span};
index 8009f42b8cf95b8650839101d50d1facb5139fac..27225006a9c724fba44a6e14ef6e39fd592396b9 100644 (file)
@@ -7,7 +7,6 @@
 use syntax::ast;
 use syntax::ast::{Expr, MetaItem, Mutability};
 use syntax::ext::base::{Annotatable, ExtCtxt};
-use syntax::ext::build::AstBuilder;
 use syntax::ptr::P;
 use syntax::symbol::Symbol;
 use syntax_pos::Span;
index e147782db2c06b2661466e34ad77327f073f2573..2fdea10b76f5170a4c3ea84b17acd93f9c3b664f 100644 (file)
@@ -4,7 +4,6 @@
 
 use syntax::ast::{Expr, MetaItem};
 use syntax::ext::base::{Annotatable, DummyResult, ExtCtxt};
-use syntax::ext::build::AstBuilder;
 use syntax::ptr::P;
 use syntax::symbol::{kw, sym};
 use syntax::span_err;
index cd89a42cf82703a083fb0bcfa47b9abe0a7f1eba..ea26e1bdf9a10bc16cd5f60b7a7b8b5bd4bf14d2 100644 (file)
@@ -88,7 +88,6 @@
 
 use syntax::ast::{Expr, ExprKind, MetaItem, Mutability};
 use syntax::ext::base::{Annotatable, ExtCtxt};
-use syntax::ext::build::AstBuilder;
 use syntax::ptr::P;
 use syntax::symbol::Symbol;
 use syntax_pos::Span;
index 1a4fce375498444933bbeee959cd7a29d4dbd9d8..4a0c4a39f785b0c50f38d826536d9588e5e16acb 100644 (file)
 use syntax::ast::{VariantData, GenericParamKind, GenericArg};
 use syntax::attr;
 use syntax::ext::base::{Annotatable, ExtCtxt};
-use syntax::ext::build::AstBuilder;
 use syntax::source_map::{self, respan};
 use syntax::util::map_in_place::MapInPlace;
 use syntax::ptr::P;
index 394beb141712d8b7ad254120a04677da7496e578..399829eaefd14be930e2e48b78e03a30b341a7e0 100644 (file)
@@ -6,7 +6,6 @@
 
 use syntax::ast::{self, Expr, GenericParamKind, Generics, Ident, SelfKind, GenericArg};
 use syntax::ext::base::ExtCtxt;
-use syntax::ext::build::AstBuilder;
 use syntax::source_map::{respan, DUMMY_SP};
 use syntax::ptr::P;
 use syntax_pos::Span;
index 7ad04aebf6e2ea6e4d5bfc2c5c49b0d3f5165216..9787722e81dd065827da3c6f41a80c14b480219d 100644 (file)
@@ -4,7 +4,6 @@
 
 use syntax::ast::{Expr, MetaItem, Mutability};
 use syntax::ext::base::{Annotatable, ExtCtxt};
-use syntax::ext::build::AstBuilder;
 use syntax::ptr::P;
 use syntax::symbol::sym;
 use syntax_pos::Span;
index cad79917af284a623841f5e7104a718482f96a2b..8cd2853e5383ddb81fccccd982ce99d44f54758f 100644 (file)
@@ -2,7 +2,6 @@
 
 use syntax::ast::{self, MetaItem};
 use syntax::ext::base::{Annotatable, ExtCtxt, MultiItemModifier};
-use syntax::ext::build::AstBuilder;
 use syntax::ptr::P;
 use syntax::symbol::{Symbol, sym};
 use syntax_pos::Span;
index 03c60e3f11f03b7d411b3276000a92cbec15b53d..39fc90decc92abccbc511e0fca9633554a60045b 100644 (file)
@@ -5,7 +5,6 @@
 
 use syntax::ast::{self, Ident, GenericArg};
 use syntax::ext::base::{self, *};
-use syntax::ext::build::AstBuilder;
 use syntax::symbol::{kw, sym, Symbol};
 use syntax_pos::Span;
 use syntax::tokenstream;
index e53660b656865ddb87f29650eb1c364da43b4dd3..f1e6cb027ca7a9cb47f732babf83762150750429 100644 (file)
@@ -8,7 +8,6 @@
 
 use syntax::ast;
 use syntax::ext::base::{self, *};
-use syntax::ext::build::AstBuilder;
 use syntax::parse::token;
 use syntax::ptr::P;
 use syntax::symbol::{Symbol, sym};
index 7225ceb8fc9b7156174b6332cd4a44ba971f9704..f788b5138043337452e3d052ea27a155c1de68e0 100644 (file)
@@ -3,7 +3,6 @@
 use syntax::attr::check_builtin_macro_attribute;
 use syntax::ext::allocator::{AllocatorKind, AllocatorMethod, AllocatorTy, ALLOCATOR_METHODS};
 use syntax::ext::base::{Annotatable, ExtCtxt};
-use syntax::ext::build::AstBuilder;
 use syntax::ext::hygiene::SyntaxContext;
 use syntax::ptr::P;
 use syntax::symbol::{kw, sym, Symbol};
index 7c16d82fe3804c97a51c29dec244267486ddf85c..7913a7442edc74eccaa3b4ffd5a60d32f8c1f004 100644 (file)
@@ -4,7 +4,6 @@
 use syntax::attr;
 use syntax::source_map::{ExpnInfo, ExpnKind, respan};
 use syntax::ext::base::{ExtCtxt, MacroKind};
-use syntax::ext::build::AstBuilder;
 use syntax::ext::expand::ExpansionConfig;
 use syntax::ext::hygiene::ExpnId;
 use syntax::ext::proc_macro::is_proc_macro_attr;
index 8ecfd4ddda7bfe7abc78b1f7f96b9137ca47c532..2c8d53a23155071efce24cc046d95012289fb4c6 100644 (file)
@@ -1,6 +1,5 @@
 use syntax::{ast, panictry};
 use syntax::ext::base::{self, *};
-use syntax::ext::build::AstBuilder;
 use syntax::parse::{self, token, DirectoryOwnership};
 use syntax::print::pprust;
 use syntax::ptr::P;
index ed4ea6b1bc90c1c870d7bb78e70aa270a3029d3f..993ef25752757ae24bad867fc6d9a46acef4d93d 100644 (file)
@@ -4,7 +4,6 @@
 use syntax::ast;
 use syntax::attr::{self, check_builtin_macro_attribute};
 use syntax::ext::base::*;
-use syntax::ext::build::AstBuilder;
 use syntax::ext::hygiene::SyntaxContext;
 use syntax::print::pprust;
 use syntax::source_map::respan;
index 8cf043f7e767e396ccb023f401695dc143b8c9c8..4b3903c7ad7d37a851430707c0e33ad029b028bd 100644 (file)
@@ -6,7 +6,6 @@
 use syntax::attr;
 use syntax::entry::{self, EntryPointType};
 use syntax::ext::base::{ExtCtxt, Resolver};
-use syntax::ext::build::AstBuilder;
 use syntax::ext::expand::ExpansionConfig;
 use syntax::ext::hygiene::{ExpnId, MacroKind};
 use syntax::feature_gate::Features;
index 36cee82893a06066e2440f0eddad40eb8f5fdef6..f3cd2397b28fe3ddd769129dc809fae931df6308 100644 (file)
@@ -11,7 +11,6 @@
 
 use std::borrow::ToOwned;
 use syntax::ast;
-use syntax::ext::build::AstBuilder;
 use syntax::ext::base::{SyntaxExtension, SyntaxExtensionKind};
 use syntax::ext::base::{TTMacroExpander, ExtCtxt, MacResult, MacEager};
 use syntax::print::pprust;
index 07302b6e68b31ae1d4a7729a30a774fb9d24b815..77fa5c2cd78981de6881d9550e6838ebc26dba64 100644 (file)
@@ -18,7 +18,6 @@
 use syntax::parse::token::{self, Token};
 use syntax::tokenstream::TokenTree;
 use syntax::ext::base::{ExtCtxt, MacResult, DummyResult, MacEager};
-use syntax::ext::build::AstBuilder;  // A trait for expr_usize.
 use syntax_pos::Span;
 use rustc_plugin::Registry;