diff options
author | lrh2000 <lrh2000@pku.edu.cn> | 2021-04-10 22:53:32 +0800 |
---|---|---|
committer | lrh2000 <lrh2000@pku.edu.cn> | 2021-04-18 10:11:53 +0800 |
commit | c5fdf8cc544f9647e2cf28a2da431bfa1faacd15 (patch) | |
tree | f67b95885d2f3573acd86e815750e0e1ec92b58f /gcc/rust/ast/rust-expr.h | |
parent | 498758a1c238a539b364ac2c632742a9b64ab4a5 (diff) | |
download | gcc-c5fdf8cc544f9647e2cf28a2da431bfa1faacd15.zip gcc-c5fdf8cc544f9647e2cf28a2da431bfa1faacd15.tar.gz gcc-c5fdf8cc544f9647e2cf28a2da431bfa1faacd15.tar.bz2 |
The trailing expression is not necessarily without a block
Diffstat (limited to 'gcc/rust/ast/rust-expr.h')
-rw-r--r-- | gcc/rust/ast/rust-expr.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/rust/ast/rust-expr.h b/gcc/rust/ast/rust-expr.h index dde833f..eb56b65 100644 --- a/gcc/rust/ast/rust-expr.h +++ b/gcc/rust/ast/rust-expr.h @@ -2828,7 +2828,7 @@ class BlockExpr : public ExprWithBlock std::vector<Attribute> outer_attrs; std::vector<Attribute> inner_attrs; std::vector<std::unique_ptr<Stmt> > statements; - std::unique_ptr<ExprWithoutBlock> expr; + std::unique_ptr<Expr> expr; Location locus; bool marked_for_strip = false; @@ -2842,7 +2842,7 @@ public: bool has_tail_expr () const { return expr != nullptr; } BlockExpr (std::vector<std::unique_ptr<Stmt> > block_statements, - std::unique_ptr<ExprWithoutBlock> block_expr, + std::unique_ptr<Expr> block_expr, std::vector<Attribute> inner_attribs, std::vector<Attribute> outer_attribs, Location locus) : outer_attrs (std::move (outer_attribs)), @@ -2859,7 +2859,7 @@ public: { // guard to protect from null pointer dereference if (other.expr != nullptr) - expr = other.expr->clone_expr_without_block (); + expr = other.expr->clone_expr (); statements.reserve (other.statements.size ()); for (const auto &e : other.statements) @@ -2877,7 +2877,7 @@ public: // guard to protect from null pointer dereference if (other.expr != nullptr) - expr = other.expr->clone_expr_without_block (); + expr = other.expr->clone_expr (); else expr = nullptr; @@ -2929,7 +2929,7 @@ public: std::vector<std::unique_ptr<Stmt> > &get_statements () { return statements; } // TODO: is this better? Or is a "vis_block" better? - std::unique_ptr<ExprWithoutBlock> &get_tail_expr () + std::unique_ptr<Expr> &get_tail_expr () { rust_assert (has_tail_expr ()); return expr; |