From 962d5c16b5bb8103785781e61e578ab5a784b1c4 Mon Sep 17 00:00:00 2001 From: Jeffrey Seyfried Date: Fri, 17 Jun 2016 02:30:01 +0000 Subject: Fix fallout --- src/libsyntax_ext/deriving/debug.rs | 9 ++++++--- src/libsyntax_ext/format.rs | 12 +++++++----- 2 files changed, 13 insertions(+), 8 deletions(-) (limited to 'src/libsyntax_ext') diff --git a/src/libsyntax_ext/deriving/debug.rs b/src/libsyntax_ext/deriving/debug.rs index d86eae820a8..a2d01d008b9 100644 --- a/src/libsyntax_ext/deriving/debug.rs +++ b/src/libsyntax_ext/deriving/debug.rs @@ -13,7 +13,7 @@ use deriving::generic::ty::*; use syntax::ast; use syntax::ast::{MetaItem, Expr}; -use syntax::codemap::{Span, respan, DUMMY_SP}; +use syntax::codemap::{Span, DUMMY_SP}; use syntax::ext::base::{ExtCtxt, Annotatable}; use syntax::ext::build::AstBuilder; use syntax::parse::token; @@ -151,6 +151,9 @@ fn stmt_let_undescore(cx: &mut ExtCtxt, span: sp, attrs: None, }); - let decl = respan(sp, ast::DeclKind::Local(local)); - respan(sp, ast::StmtKind::Decl(P(decl), ast::DUMMY_NODE_ID)) + ast::Stmt { + id: ast::DUMMY_NODE_ID, + node: ast::StmtKind::Local(local), + span: sp, + } } diff --git a/src/libsyntax_ext/format.rs b/src/libsyntax_ext/format.rs index abfa6558064..ca968f10e2e 100644 --- a/src/libsyntax_ext/format.rs +++ b/src/libsyntax_ext/format.rs @@ -14,7 +14,7 @@ use self::Position::*; use fmt_macros as parse; use syntax::ast; -use syntax::codemap::{Span, respan, DUMMY_SP}; +use syntax::codemap::{Span, DUMMY_SP}; use syntax::ext::base::*; use syntax::ext::base; use syntax::ext::build::AstBuilder; @@ -441,12 +441,14 @@ impl<'a, 'b> Context<'a, 'b> { let name = ecx.ident_of(name); let item = ecx.item(sp, name, vec![], st); - let decl = respan(sp, ast::DeclKind::Item(item)); + let stmt = ast::Stmt { + id: ast::DUMMY_NODE_ID, + node: ast::StmtKind::Item(item), + span: sp, + }; // Wrap the declaration in a block so that it forms a single expression. - ecx.expr_block(ecx.block(sp, - vec![respan(sp, ast::StmtKind::Decl(P(decl), ast::DUMMY_NODE_ID))], - Some(ecx.expr_ident(sp, name)))) + ecx.expr_block(ecx.block(sp, vec![stmt], Some(ecx.expr_ident(sp, name)))) } /// Actually builds the expression which the iformat! block will be expanded -- cgit 1.4.1-3-g733a5