0
0
mirror of https://github.com/rust-lang/rust.git synced 2024-12-01 13:18:54 +01:00

Don't generate move-by-init in AST builder

This commit is contained in:
Tim Chevalier 2012-10-23 11:16:31 -07:00
parent 11e92f37c1
commit 46fef3d601

View File

@ -105,6 +105,13 @@ impl ext_ctxt: ext_ctxt_ast_builder {
span: self.empty_span()}
}
fn move_expr(e: @ast::expr) -> @ast::expr {
@{id: self.next_id(),
callee_id: self.next_id(),
node: ast::expr_unary_move(e),
span: e.span}
}
fn stmt_expr(e: @ast::expr) -> @ast::stmt {
@{node: ast::stmt_expr(e, self.next_id()),
span: self.empty_span()}
@ -126,8 +133,7 @@ impl ext_ctxt: ext_ctxt_ast_builder {
self.empty_span()),
None),
span: self.empty_span()},
init: Some({op: ast::init_move,
expr: e}),
init: Some(self.move_expr(e)),
id: self.next_id()},
span: self.empty_span()}]),
span: self.empty_span()}, self.next_id()),