]> gcc.gnu.org Git - gcc.git/commitdiff
Revert "Marklive: support match expr"
authorPhilip Herron <philip.herron@embecosm.com>
Sat, 21 May 2022 16:00:51 +0000 (17:00 +0100)
committerPhilip Herron <philip.herron@embecosm.com>
Sat, 21 May 2022 16:00:51 +0000 (17:00 +0100)
This reverts commit 75c9f9f61cb2d69f39d490c47a3b42810c31c1ff. Which was
accidently pushed to master outside of the PR system. No harm done :).

Happy hacking.

gcc/rust/hir/tree/rust-hir-expr.h
gcc/rust/lint/rust-lint-marklive.h
gcc/testsuite/rust/compile/match6.rs [deleted file]

index f6f035e21345083f54f6224b214e677336b3ce35..e585dd2a3317e49169ce78802cb0f9beb6fe47b5 100644 (file)
@@ -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; }
 };
 
index 89a6d7e94f149897337ffa86b4fd129f652a55be..aeecda5f73c32b5b2e41193c02dd976c4f1d60a0 100644 (file)
@@ -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 (file)
index eec775b..0000000
+++ /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();
-}
-
-
-
This page took 0.081402 seconds and 5 git commands to generate.