diff options
Diffstat (limited to 'gcc/rust/ast/rust-stmt.h')
-rw-r--r-- | gcc/rust/ast/rust-stmt.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/rust/ast/rust-stmt.h b/gcc/rust/ast/rust-stmt.h index 0bb1021..167828c 100644 --- a/gcc/rust/ast/rust-stmt.h +++ b/gcc/rust/ast/rust-stmt.h @@ -131,10 +131,15 @@ public: // TODO: is this better? Or is a "vis_block" better? std::unique_ptr<Expr> &get_init_expr () { - rust_assert (init_expr != nullptr); + rust_assert (has_init_expr ()); return init_expr; } + std::unique_ptr<Pattern> &get_pattern () { + rust_assert (variables_pattern != nullptr); + return variables_pattern; + } + protected: /* Use covariance to implement clone function as returning this object rather * than base */ |