diff options
author | Thomas Young <wenzhang5800@gmail.com> | 2021-06-25 23:20:16 +0800 |
---|---|---|
committer | Thomas Young <wenzhang5800@gmail.com> | 2021-06-26 12:00:08 +0800 |
commit | 8a458543eb3a2775adaa3ffcf16be7e24a3c7b21 (patch) | |
tree | eff48dff347ec4563d0f4f3dac27b88e710c3b9e | |
parent | 476f0c67db80ffd8eb2465462c77d4d9fdc3a9f0 (diff) | |
download | gcc-8a458543eb3a2775adaa3ffcf16be7e24a3c7b21.zip gcc-8a458543eb3a2775adaa3ffcf16be7e24a3c7b21.tar.gz gcc-8a458543eb3a2775adaa3ffcf16be7e24a3c7b21.tar.bz2 |
mark live symbol in groupedExpr
-rw-r--r-- | gcc/rust/lint/rust-lint-marklive.h | 5 | ||||
-rw-r--r-- | gcc/testsuite/rust/compile/torture/grouped_expr_function.rs | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/gcc/rust/lint/rust-lint-marklive.h b/gcc/rust/lint/rust-lint-marklive.h index cf15218..979ad77 100644 --- a/gcc/rust/lint/rust-lint-marklive.h +++ b/gcc/rust/lint/rust-lint-marklive.h @@ -65,6 +65,11 @@ public: expr.get_expr ().get ()->accept_vis (*this); } + void visit (HIR::GroupedExpr &expr) override + { + expr.get_expr_in_parens()->accept_vis(*this); + } + void visit (HIR::BlockExpr &expr) override { expr.iterate_stmts ([&] (HIR::Stmt *s) mutable -> bool { diff --git a/gcc/testsuite/rust/compile/torture/grouped_expr_function.rs b/gcc/testsuite/rust/compile/torture/grouped_expr_function.rs new file mode 100644 index 0000000..eca7178 --- /dev/null +++ b/gcc/testsuite/rust/compile/torture/grouped_expr_function.rs @@ -0,0 +1,6 @@ +fn foo() {} + + +fn main() { + let _a = (foo()); +}
\ No newline at end of file |