about summary refs log tree commit diff
path: root/src/libsyntax/ext
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2016-09-30 17:43:04 +0530
committerManish Goregaokar <manishsmail@gmail.com>2016-10-01 19:22:08 +0530
commita73ba8b98caaec7f7f6281dca9a73ad876f59266 (patch)
tree28b0151c878af5b4ab5d6397f4b3112246fa104b /src/libsyntax/ext
parent5045d4e39621b265eca947277f07e23f62608ad0 (diff)
parent19e6f06818d07c729bbc3522cbb73b66493a03f5 (diff)
downloadrust-a73ba8b98caaec7f7f6281dca9a73ad876f59266.tar.gz
rust-a73ba8b98caaec7f7f6281dca9a73ad876f59266.zip
Rollup merge of #35874 - CensoredUsername:stmt_let_typed_fix, r=Manishearth
 This commit makes the return type of AstBuilder.stmt_let_typed match the return type of other AstBuilder.stmt* functions. This avoids unnecessary boxing/unboxing whenever Stmt's are stored in a Vec, which is the default use case.nnThis is a potentially plugin breaking change.
Diffstat (limited to 'src/libsyntax/ext')
-rw-r--r--src/libsyntax/ext/build.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libsyntax/ext/build.rs b/src/libsyntax/ext/build.rs
index b81d95a6998..08bedd794f6 100644
--- a/src/libsyntax/ext/build.rs
+++ b/src/libsyntax/ext/build.rs
@@ -96,7 +96,7 @@ pub trait AstBuilder {
                       ident: ast::Ident,
                       typ: P<ast::Ty>,
                       ex: P<ast::Expr>)
-                      -> P<ast::Stmt>;
+                      -> 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;
 
@@ -556,7 +556,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
                       ident: ast::Ident,
                       typ: P<ast::Ty>,
                       ex: P<ast::Expr>)
-                      -> P<ast::Stmt> {
+                      -> ast::Stmt {
         let pat = if mutbl {
             let binding_mode = ast::BindingMode::ByValue(ast::Mutability::Mutable);
             self.pat_ident_binding_mode(sp, ident, binding_mode)
@@ -571,11 +571,11 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
             span: sp,
             attrs: ast::ThinVec::new(),
         });
-        P(ast::Stmt {
+        ast::Stmt {
             id: ast::DUMMY_NODE_ID,
             node: ast::StmtKind::Local(local),
             span: sp,
-        })
+        }
     }
 
     // Generate `let _: Type;`, usually used for type assertions.