diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/hir/rust-ast-lower-block.h | 5 | ||||
-rw-r--r-- | gcc/testsuite/rust.test/compilable/scoping1.rs | 10 |
2 files changed, 15 insertions, 0 deletions
diff --git a/gcc/rust/hir/rust-ast-lower-block.h b/gcc/rust/hir/rust-ast-lower-block.h index 1ef581e..f81a242 100644 --- a/gcc/rust/hir/rust-ast-lower-block.h +++ b/gcc/rust/hir/rust-ast-lower-block.h @@ -129,6 +129,11 @@ public: translated = ASTLoweringIfBlock::translate (&expr, &terminated); } + void visit (AST::BlockExpr &expr) + { + translated = ASTLoweringBlock::translate (&expr, &terminated); + } + private: ASTLoweringExprWithBlock () : ASTLoweringBase (), translated (nullptr), terminated (false) diff --git a/gcc/testsuite/rust.test/compilable/scoping1.rs b/gcc/testsuite/rust.test/compilable/scoping1.rs new file mode 100644 index 0000000..02b5f93 --- /dev/null +++ b/gcc/testsuite/rust.test/compilable/scoping1.rs @@ -0,0 +1,10 @@ +fn main() { + let x = 1; + { + let x = true; + { + x = false; + } + } + let x = x + 1; +} |