diff options
author | SimplyTheOther <simplytheother@gmail.com> | 2020-11-29 22:47:31 +0800 |
---|---|---|
committer | SimplyTheOther <simplytheother@gmail.com> | 2020-12-08 21:10:34 +0800 |
commit | db39766514144dbbad34d9db3977c3a72d1216c3 (patch) | |
tree | c7c470e4bf94ccb0105f8ad80ff85c7582ee9358 /gcc/rust/ast/rust-stmt.h | |
parent | 9b252167a77316750f34c455222e5f30724e51e4 (diff) | |
download | gcc-db39766514144dbbad34d9db3977c3a72d1216c3.zip gcc-db39766514144dbbad34d9db3977c3a72d1216c3.tar.gz gcc-db39766514144dbbad34d9db3977c3a72d1216c3.tar.bz2 |
Added new pattern stripping
Fixed get_locus_slow call in StructPatternField compile error
Added and improved cfg stripping
Fixed compilation errors
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 */ |