]> git.lizzy.rs Git - rust.git/blobdiff - src/libsyntax/ext/base.rs
[breaking-change] don't pub export ast::Stmt_ variants
[rust.git] / src / libsyntax / ext / base.rs
index 107626c54cc9da82749d5d4b18c28478c14e511f..ceb7cf69680bd9967875a1c931be8c030f9481ed 100644 (file)
@@ -205,7 +205,7 @@ macro_rules! make_stmts_default {
     ($me:expr) => {
         $me.make_expr().map(|e| {
             SmallVector::one(P(codemap::respan(
-                e.span, ast::StmtExpr(e, ast::DUMMY_NODE_ID))))
+                e.span, ast::StmtKind::Expr(e, ast::DUMMY_NODE_ID))))
         })
     }
 }
@@ -303,7 +303,7 @@ fn make_pat(self: Box<Self>) -> Option<P<ast::Pat>> {
             return Some(p);
         }
         if let Some(e) = self.expr {
-            if let ast::ExprLit(_) = e.node {
+            if let ast::ExprKind::Lit(_) = e.node {
                 return Some(P(ast::Pat {
                     id: ast::DUMMY_NODE_ID,
                     span: e.span,
@@ -349,7 +349,7 @@ pub fn expr(sp: Span) -> Box<MacResult+'static> {
     pub fn raw_expr(sp: Span) -> P<ast::Expr> {
         P(ast::Expr {
             id: ast::DUMMY_NODE_ID,
-            node: ast::ExprLit(P(codemap::respan(sp, ast::LitBool(false)))),
+            node: ast::ExprKind::Lit(P(codemap::respan(sp, ast::LitKind::Bool(false)))),
             span: sp,
             attrs: None,
         })
@@ -367,7 +367,7 @@ pub fn raw_pat(sp: Span) -> ast::Pat {
     pub fn raw_ty(sp: Span) -> P<ast::Ty> {
         P(ast::Ty {
             id: ast::DUMMY_NODE_ID,
-            node: ast::TyInfer,
+            node: ast::TyKind::Infer,
             span: sp
         })
     }
@@ -402,8 +402,8 @@ fn make_impl_items(self: Box<DummyResult>) -> Option<SmallVector<P<ast::ImplItem
     fn make_stmts(self: Box<DummyResult>) -> Option<SmallVector<P<ast::Stmt>>> {
         Some(SmallVector::one(P(
             codemap::respan(self.span,
-                            ast::StmtExpr(DummyResult::raw_expr(self.span),
-                                          ast::DUMMY_NODE_ID)))))
+                            ast::StmtKind::Expr(DummyResult::raw_expr(self.span),
+                                                ast::DUMMY_NODE_ID)))))
     }
 }
 
@@ -773,8 +773,8 @@ pub fn expr_to_string(cx: &mut ExtCtxt, expr: P<ast::Expr>, err_msg: &str)
     // we want to be able to handle e.g. concat("foo", "bar")
     let expr = cx.expander().fold_expr(expr);
     match expr.node {
-        ast::ExprLit(ref l) => match l.node {
-            ast::LitStr(ref s, style) => return Some(((*s).clone(), style)),
+        ast::ExprKind::Lit(ref l) => match l.node {
+            ast::LitKind::Str(ref s, style) => return Some(((*s).clone(), style)),
             _ => cx.span_err(l.span, err_msg)
         },
         _ => cx.span_err(expr.span, err_msg)