diff options
| author | CensoredUsername <cens.username@gmail.com> | 2016-08-21 18:57:43 +0200 |
|---|---|---|
| committer | CensoredUsername <cens.username@gmail.com> | 2016-09-17 01:17:02 +0200 |
| commit | 19e6f06818d07c729bbc3522cbb73b66493a03f5 (patch) | |
| tree | 30a73d4408405be9a62fba21a9096773dc5c369f /src/libsyntax | |
| parent | 55a61a1175b2a403d2b34ec2b2f904cc51a8952d (diff) | |
| download | rust-19e6f06818d07c729bbc3522cbb73b66493a03f5.tar.gz rust-19e6f06818d07c729bbc3522cbb73b66493a03f5.zip | |
Make the return type of AstBuilder.stmt_let_typed match the return type of other AstBuilder.stmt* functions
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ext/build.rs | 8 |
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. |
