public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Thomas Schwinge <tschwinge@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc/devel/rust/master] Revert "Marklive: support match expr"
Date: Wed,  8 Jun 2022 12:48:43 +0000 (GMT)	[thread overview]
Message-ID: <20220608124843.2D1693810AC7@sourceware.org> (raw)

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();
-}
-
-
-


                 reply	other threads:[~2022-06-08 12:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220608124843.2D1693810AC7@sourceware.org \
    --to=tschwinge@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).