public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/rust/master] Revert "Marklive: support match expr"
@ 2022-06-08 12:48 Thomas Schwinge
0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2022-06-08 12:48 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:93e59035536616ca7b1e9be4a8ed3eeddd0d8fee
commit 93e59035536616ca7b1e9be4a8ed3eeddd0d8fee
Author: Philip Herron <philip.herron@embecosm.com>
Date: Sat May 21 17:00:51 2022 +0100
Revert "Marklive: support match expr"
This reverts commit 75c9f9f61cb2d69f39d490c47a3b42810c31c1ff. Which was
accidently pushed to master outside of the PR system. No harm done :).
Happy hacking.
Diff:
---
gcc/rust/hir/tree/rust-hir-expr.h | 6 ------
gcc/rust/lint/rust-lint-marklive.h | 15 ---------------
gcc/testsuite/rust/compile/match6.rs | 21 ---------------------
3 files changed, 42 deletions(-)
diff --git a/gcc/rust/hir/tree/rust-hir-expr.h b/gcc/rust/hir/tree/rust-hir-expr.h
index f6f035e2134..e585dd2a331 100644
--- a/gcc/rust/hir/tree/rust-hir-expr.h
+++ b/gcc/rust/hir/tree/rust-hir-expr.h
@@ -3842,12 +3842,6 @@ public:
return match_arm_patterns;
}
- std::unique_ptr<Expr> &get_guard_expr ()
- {
- rust_assert (has_match_arm_guard ());
- return guard_expr;
- }
-
Location get_locus () const { return locus; }
};
diff --git a/gcc/rust/lint/rust-lint-marklive.h b/gcc/rust/lint/rust-lint-marklive.h
index 89a6d7e94f1..aeecda5f73c 100644
--- a/gcc/rust/lint/rust-lint-marklive.h
+++ b/gcc/rust/lint/rust-lint-marklive.h
@@ -204,21 +204,6 @@ public:
expr.get_else_block ()->accept_vis (*this);
}
- void visit (HIR::MatchExpr &expr) override
- {
- expr.get_scrutinee_expr ()->accept_vis (*this);
- std::vector<HIR::MatchCase> &cases = expr.get_match_cases ();
- for (auto &&caz : cases)
- {
- auto case_arm = caz.get_arm ();
- if (case_arm.has_match_arm_guard ())
- {
- case_arm.get_guard_expr ()->accept_vis (*this);
- }
- caz.get_expr ()->accept_vis (*this);
- }
- }
-
void visit (HIR::IfExprConseqIf &expr) override
{
expr.get_if_condition ()->accept_vis (*this);
diff --git a/gcc/testsuite/rust/compile/match6.rs b/gcc/testsuite/rust/compile/match6.rs
deleted file mode 100644
index eec775ba94b..00000000000
--- a/gcc/testsuite/rust/compile/match6.rs
+++ /dev/null
@@ -1,21 +0,0 @@
-fn foo() -> bool {
- true
-}
-
-fn int32() -> i32 {
- 1
-}
-
-fn bar() -> i32 {
- match foo() {
- true => int32(),
- false => 0
- }
-}
-
-fn main() -> () {
- bar();
-}
-
-
-
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-06-08 12:48 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-08 12:48 [gcc/devel/rust/master] Revert "Marklive: support match expr" Thomas Schwinge
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).