]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Unify AST::IfLetExprConseqIf{,Let} into AST::IfLetExprConseqElse
authorOwen Avery <powerboat9.gamer@gmail.com>
Thu, 16 Mar 2023 03:30:19 +0000 (23:30 -0400)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:34:08 +0000 (18:34 +0100)
This simplifies the AST's representation of if-let-statements
to match the HIR.

gcc/rust/ChangeLog:

* ast/rust-expr.h
(class IfLetExprConseqElse): Make else_block ExprWithBlock.
(class IfLetExprConseqIf): Remove.
(class IfLetExprConseqIfLet): Remove.
* ast/rust-ast-full-decls.h
(class IfLetExprConseqIf): Remove.
(class IfLetExprConseqIfLet): Remove.
* ast/rust-ast.cc
(IfLetExprConseqElse::as_string): Adjust output.
(IfLetExprConseqIf::as_string): Remove.
(IfLetExprConseqIfLet::as_string): Remove.
(IfLetExprConseqIf::accept_vis): Remove.
(IfLetExprConseqIfLet::accept_vis): Remove.
* ast/rust-ast-visitor.h
(ASTVisitor::visit): Remove IfLetExprConseqIf{,Let} visitors.
* ast/rust-ast-dump.cc
(Dump::visit): Likewise.
* ast/rust-ast-dump.h:
(Dump::visit): Likewise.
* ast/rust-ast-tokenstream.cc
(TokenStream::visit): Likewise.
* ast/rust-ast-tokenstream.h
(TokenStream::visit): Likewise.
* util/rust-attributes.cc
(AttributeChecker::visit): Likewise.
* util/rust-attributes.h:
(AttributeChecker::visit): Likewise.
* resolve/rust-early-name-resolver.cc
(EarlyNameResolver::visit): Likewise.
* resolve/rust-early-name-resolver.h
(EarlyNameResolver::visit): Likewise.
* resolve/rust-ast-resolve-base.h
(ResolverBase::visit): Likewise.
* resolve/rust-ast-resolve-base.cc
(ResolverBase::visit): Likewise.
* checks/errors/rust-feature-gate.h
(FeatureGate::visit): Likewise.
* expand/rust-cfg-strip.cc
(CfgStrip::visit): Likewise.
* expand/rust-cfg-strip.h:
(CfgStrip::visit): Likewise.
* expand/rust-expand-visitor.cc
(ExpandVisitor::visit): Likewise.
* expand/rust-expand-visitor.h
(ExpandVisitor::visit): Likewise.
* hir/rust-ast-lower-base.cc
(ASTLoweringBase::visit): Likewise.
* hir/rust-ast-lower-base.h:
(ASTLoweringBase::visit): Likewise.
* parse/rust-parse-impl.h
(Parser::parse_if_let_expr): Replace IfLetExprConseqIf{,Let} with IfLetExprConseqElse.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
22 files changed:
gcc/rust/ast/rust-ast-dump.cc
gcc/rust/ast/rust-ast-dump.h
gcc/rust/ast/rust-ast-full-decls.h
gcc/rust/ast/rust-ast-tokenstream.cc
gcc/rust/ast/rust-ast-tokenstream.h
gcc/rust/ast/rust-ast-visitor.h
gcc/rust/ast/rust-ast.cc
gcc/rust/ast/rust-expr.h
gcc/rust/checks/errors/rust-feature-gate.h
gcc/rust/expand/rust-cfg-strip.cc
gcc/rust/expand/rust-cfg-strip.h
gcc/rust/expand/rust-expand-visitor.cc
gcc/rust/expand/rust-expand-visitor.h
gcc/rust/hir/rust-ast-lower-base.cc
gcc/rust/hir/rust-ast-lower-base.h
gcc/rust/parse/rust-parse-impl.h
gcc/rust/resolve/rust-ast-resolve-base.cc
gcc/rust/resolve/rust-ast-resolve-base.h
gcc/rust/resolve/rust-early-name-resolver.cc
gcc/rust/resolve/rust-early-name-resolver.h
gcc/rust/util/rust-attributes.cc
gcc/rust/util/rust-attributes.h

index 12cbfacb5d0006890d2637127839070393af7f56..ce934a1ed7aeb0b2be1e57d798ea811862838d33 100644 (file)
@@ -944,14 +944,6 @@ void
 Dump::visit (IfLetExprConseqElse &)
 {}
 
-void
-Dump::visit (IfLetExprConseqIf &)
-{}
-
-void
-Dump::visit (IfLetExprConseqIfLet &)
-{}
-
 void
 Dump::visit (MatchExpr &)
 {}
index a48d4761bb6e93e4340a9ce59ecbb90e28abc0b5..b8b5e960035ca72eec740ccac06c0984559909d8 100644 (file)
@@ -186,8 +186,6 @@ private:
   void visit (IfExprConseqElse &expr);
   void visit (IfLetExpr &expr);
   void visit (IfLetExprConseqElse &expr);
-  void visit (IfLetExprConseqIf &expr);
-  void visit (IfLetExprConseqIfLet &expr);
   void visit (MatchExpr &expr);
   void visit (AwaitExpr &expr);
   void visit (AsyncBlockExpr &expr);
index 94691f980a6d368d0fdf5335abdc3f3517a03c92..bd59c526ddc3786c7ec4e6227d26f0b23c07053e 100644 (file)
@@ -137,8 +137,6 @@ class IfExpr;
 class IfExprConseqElse;
 class IfLetExpr;
 class IfLetExprConseqElse;
-class IfLetExprConseqIf;
-class IfLetExprConseqIfLet;
 struct MatchArm;
 // class MatchCase;
 // class MatchCaseBlockExpr;
index cdfd8701c6de1262984b52f7f6d3d99b72e109bb..78b53852658f0f3556109f313424c0011463b134 100644 (file)
@@ -1448,24 +1448,6 @@ TokenStream::visit (IfLetExprConseqElse &expr)
   visit (expr.get_else_block ());
 }
 
-void
-TokenStream::visit (IfLetExprConseqIf &expr)
-{
-  visit (static_cast<IfLetExpr &> (expr));
-  indentation ();
-  tokens.push_back (Rust::Token::make (ELSE, expr.get_locus ()));
-  visit (expr.get_conseq_if_expr ());
-}
-
-void
-TokenStream::visit (IfLetExprConseqIfLet &expr)
-{
-  visit (static_cast<IfLetExpr &> (expr));
-  indentation ();
-  tokens.push_back (Rust::Token::make (ELSE, expr.get_locus ()));
-  visit (expr.get_conseq_if_let_expr ());
-}
-
 void
 TokenStream::visit (MatchArm &arm)
 {
index 83fdece70528c5604c948e697a609be8a25a5b0d..24be831009a94326ab33a9945dad0ab31d04bcbf 100644 (file)
@@ -200,8 +200,6 @@ private:
   void visit (IfExprConseqElse &expr);
   void visit (IfLetExpr &expr);
   void visit (IfLetExprConseqElse &expr);
-  void visit (IfLetExprConseqIf &expr);
-  void visit (IfLetExprConseqIfLet &expr);
   void visit (MatchArm &arm);
   void visit (MatchCase &arm);
   void visit (MatchExpr &expr);
index 621f09ef62b18c4485207f45e19adb5f1727159c..f11c9c31ae2db8fd580de5d6ed897bb675b53c69 100644 (file)
@@ -117,8 +117,6 @@ public:
   virtual void visit (IfExprConseqElse &expr) = 0;
   virtual void visit (IfLetExpr &expr) = 0;
   virtual void visit (IfLetExprConseqElse &expr) = 0;
-  virtual void visit (IfLetExprConseqIf &expr) = 0;
-  virtual void visit (IfLetExprConseqIfLet &expr) = 0;
   // virtual void visit(MatchCase& match_case) = 0;
   // virtual void visit (MatchCaseBlockExpr &match_case) = 0;
   // virtual void visit (MatchCaseExpr &match_case) = 0;
index dbbeda38a44ab15d00251cf9cb581710c6b23475..a664a319513a2c4ea2fc5f1b84c51eff8e71f74e 100644 (file)
@@ -1673,27 +1673,7 @@ IfLetExprConseqElse::as_string () const
 {
   std::string str = IfLetExpr::as_string ();
 
-  str += "\n Else block expr: " + else_block->as_string ();
-
-  return str;
-}
-
-std::string
-IfLetExprConseqIf::as_string () const
-{
-  std::string str = IfLetExpr::as_string ();
-
-  str += "\n Else if expr: \n  " + if_expr->as_string ();
-
-  return str;
-}
-
-std::string
-IfLetExprConseqIfLet::as_string () const
-{
-  std::string str = IfLetExpr::as_string ();
-
-  str += "\n Else if let expr: \n  " + if_let_expr->as_string ();
+  str += "\n Else expr: " + else_block->as_string ();
 
   return str;
 }
@@ -4567,18 +4547,6 @@ IfLetExprConseqElse::accept_vis (ASTVisitor &vis)
   vis.visit (*this);
 }
 
-void
-IfLetExprConseqIf::accept_vis (ASTVisitor &vis)
-{
-  vis.visit (*this);
-}
-
-void
-IfLetExprConseqIfLet::accept_vis (ASTVisitor &vis)
-{
-  vis.visit (*this);
-}
-
 void
 MatchExpr::accept_vis (ASTVisitor &vis)
 {
index f91d9e9ceb2000859dfd364f340f8ae0523c5f6e..abe6e03ce45b23759e98b2502067eef783809b19 100644 (file)
@@ -3945,7 +3945,7 @@ protected:
  * end */
 class IfLetExprConseqElse : public IfLetExpr
 {
-  std::unique_ptr<BlockExpr> else_block;
+  std::unique_ptr<ExprWithBlock> else_block;
 
 public:
   std::string as_string () const override;
@@ -3953,8 +3953,8 @@ public:
   IfLetExprConseqElse (
     std::vector<std::unique_ptr<Pattern> > match_arm_patterns,
     std::unique_ptr<Expr> value, std::unique_ptr<BlockExpr> if_block,
-    std::unique_ptr<BlockExpr> else_block, std::vector<Attribute> outer_attrs,
-    Location locus)
+    std::unique_ptr<ExprWithBlock> else_block,
+    std::vector<Attribute> outer_attrs, Location locus)
     : IfLetExpr (std::move (match_arm_patterns), std::move (value),
                 std::move (if_block), std::move (outer_attrs), locus),
       else_block (std::move (else_block))
@@ -3963,7 +3963,7 @@ public:
 
   // copy constructor with clone
   IfLetExprConseqElse (IfLetExprConseqElse const &other)
-    : IfLetExpr (other), else_block (other.else_block->clone_block_expr ())
+    : IfLetExpr (other), else_block (other.else_block->clone_expr_with_block ())
   {}
 
   // overload assignment operator to clone
@@ -3973,7 +3973,7 @@ public:
     // match_arm_patterns = other.match_arm_patterns;
     // value = other.value->clone_expr();
     // if_block = other.if_block->clone_block_expr();
-    else_block = other.else_block->clone_block_expr ();
+    else_block = other.else_block->clone_expr_with_block ();
     // outer_attrs = other.outer_attrs;
 
     return *this;
@@ -3986,7 +3986,7 @@ public:
   void accept_vis (ASTVisitor &vis) override;
 
   // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<BlockExpr> &get_else_block ()
+  std::unique_ptr<ExprWithBlock> &get_else_block ()
   {
     rust_assert (else_block != nullptr);
     return else_block;
@@ -4001,124 +4001,6 @@ protected:
   }
 };
 
-/* AST node representing "if let" expression with an "else if" expression at the
- * end */
-class IfLetExprConseqIf : public IfLetExpr
-{
-  std::unique_ptr<IfExpr> if_expr;
-
-public:
-  std::string as_string () const override;
-
-  IfLetExprConseqIf (std::vector<std::unique_ptr<Pattern> > match_arm_patterns,
-                    std::unique_ptr<Expr> value,
-                    std::unique_ptr<BlockExpr> if_block,
-                    std::unique_ptr<IfExpr> if_expr,
-                    std::vector<Attribute> outer_attrs, Location locus)
-    : IfLetExpr (std::move (match_arm_patterns), std::move (value),
-                std::move (if_block), std::move (outer_attrs), locus),
-      if_expr (std::move (if_expr))
-  {}
-  // again, outer attributes not allowed
-
-  // copy constructor with clone
-  IfLetExprConseqIf (IfLetExprConseqIf const &other)
-    : IfLetExpr (other), if_expr (other.if_expr->clone_if_expr ())
-  {}
-
-  // overload assignment operator to clone
-  IfLetExprConseqIf &operator= (IfLetExprConseqIf const &other)
-  {
-    IfLetExpr::operator= (other);
-    // match_arm_patterns = other.match_arm_patterns;
-    // value = other.value->clone_expr();
-    // if_block = other.if_block->clone_block_expr();
-    if_expr = other.if_expr->clone_if_expr ();
-
-    return *this;
-  }
-
-  // move constructors
-  IfLetExprConseqIf (IfLetExprConseqIf &&other) = default;
-  IfLetExprConseqIf &operator= (IfLetExprConseqIf &&other) = default;
-
-  void accept_vis (ASTVisitor &vis) override;
-
-  // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<IfExpr> &get_conseq_if_expr ()
-  {
-    rust_assert (if_expr != nullptr);
-    return if_expr;
-  }
-
-protected:
-  /* Use covariance to implement clone function as returning this object rather
-   * than base */
-  IfLetExprConseqIf *clone_if_let_expr_impl () const override
-  {
-    return new IfLetExprConseqIf (*this);
-  }
-};
-
-/* AST node representing "if let" expression with an "else if let" expression at
- * the end */
-class IfLetExprConseqIfLet : public IfLetExpr
-{
-  std::unique_ptr<IfLetExpr> if_let_expr;
-
-public:
-  std::string as_string () const override;
-
-  IfLetExprConseqIfLet (
-    std::vector<std::unique_ptr<Pattern> > match_arm_patterns,
-    std::unique_ptr<Expr> value, std::unique_ptr<BlockExpr> if_block,
-    std::unique_ptr<IfLetExpr> if_let_expr, std::vector<Attribute> outer_attrs,
-    Location locus)
-    : IfLetExpr (std::move (match_arm_patterns), std::move (value),
-                std::move (if_block), std::move (outer_attrs), locus),
-      if_let_expr (std::move (if_let_expr))
-  {}
-  // outer attributes not allowed
-
-  // copy constructor with clone
-  IfLetExprConseqIfLet (IfLetExprConseqIfLet const &other)
-    : IfLetExpr (other), if_let_expr (other.if_let_expr->clone_if_let_expr ())
-  {}
-
-  // overload assignment operator to clone
-  IfLetExprConseqIfLet &operator= (IfLetExprConseqIfLet const &other)
-  {
-    IfLetExpr::operator= (other);
-    // match_arm_patterns = other.match_arm_patterns;
-    // value = other.value->clone_expr();
-    // if_block = other.if_block->clone_block_expr();
-    if_let_expr = other.if_let_expr->clone_if_let_expr ();
-
-    return *this;
-  }
-
-  // move constructors
-  IfLetExprConseqIfLet (IfLetExprConseqIfLet &&other) = default;
-  IfLetExprConseqIfLet &operator= (IfLetExprConseqIfLet &&other) = default;
-
-  void accept_vis (ASTVisitor &vis) override;
-
-  // TODO: is this better? Or is a "vis_block" better?
-  std::unique_ptr<IfLetExpr> &get_conseq_if_let_expr ()
-  {
-    rust_assert (if_let_expr != nullptr);
-    return if_let_expr;
-  }
-
-protected:
-  /* Use covariance to implement clone function as returning this object rather
-   * than base */
-  IfLetExprConseqIfLet *clone_if_let_expr_impl () const override
-  {
-    return new IfLetExprConseqIfLet (*this);
-  }
-};
-
 // Match arm expression
 struct MatchArm
 {
index a4e2f90f0cf178895ae197981161e29893b75d49..5d747047e189a3e81bc12a0c5979da2d9fb5cfa7 100644 (file)
@@ -97,8 +97,6 @@ public:
   void visit (AST::IfExprConseqElse &expr) override {}
   void visit (AST::IfLetExpr &expr) override {}
   void visit (AST::IfLetExprConseqElse &expr) override {}
-  void visit (AST::IfLetExprConseqIf &expr) override {}
-  void visit (AST::IfLetExprConseqIfLet &expr) override {}
   void visit (AST::MatchExpr &expr) override {}
   void visit (AST::AwaitExpr &expr) override {}
   void visit (AST::AsyncBlockExpr &expr) override {}
index 926367aff0f204ca0a480249cfa4cfeb5aee1d5c..0aebb6f19d43a2ddf700f1a0cfee34608418fc4e 100644 (file)
@@ -1779,93 +1779,6 @@ CfgStrip::visit (AST::IfLetExprConseqElse &expr)
                   "attributes not allowed");
 }
 void
-CfgStrip::visit (AST::IfLetExprConseqIf &expr)
-{
-  // initial strip test based on outer attrs
-  expand_cfg_attrs (expr.get_outer_attrs ());
-  if (fails_cfg_with_expand (expr.get_outer_attrs ()))
-    {
-      expr.mark_for_strip ();
-      return;
-    }
-
-  for (auto &pattern : expr.get_patterns ())
-    {
-      pattern->accept_vis (*this);
-      if (pattern->is_marked_for_strip ())
-       rust_error_at (pattern->get_locus (),
-                      "cannot strip pattern in this position");
-    }
-
-  // can't strip value expr itself, but can strip sub-expressions
-  auto &value_expr = expr.get_value_expr ();
-  value_expr->accept_vis (*this);
-  if (value_expr->is_marked_for_strip ())
-    rust_error_at (value_expr->get_locus (),
-                  "cannot strip expression in this position - outer "
-                  "attributes not allowed");
-
-  // can't strip if block itself, but can strip sub-expressions
-  auto &if_block = expr.get_if_block ();
-  if_block->accept_vis (*this);
-  if (if_block->is_marked_for_strip ())
-    rust_error_at (if_block->get_locus (),
-                  "cannot strip block expression in this position - outer "
-                  "attributes not allowed");
-
-  // can't strip if expr itself, but can strip sub-expressions
-  auto &conseq_if_expr = expr.get_conseq_if_expr ();
-  conseq_if_expr->accept_vis (*this);
-  if (conseq_if_expr->is_marked_for_strip ())
-    rust_error_at (conseq_if_expr->get_locus (),
-                  "cannot strip consequent if expression in this "
-                  "position - outer attributes not allowed");
-}
-void
-CfgStrip::visit (AST::IfLetExprConseqIfLet &expr)
-{
-  // initial strip test based on outer attrs
-  expand_cfg_attrs (expr.get_outer_attrs ());
-  if (fails_cfg_with_expand (expr.get_outer_attrs ()))
-    {
-      expr.mark_for_strip ();
-      return;
-    }
-
-  for (auto &pattern : expr.get_patterns ())
-    {
-      pattern->accept_vis (*this);
-      if (pattern->is_marked_for_strip ())
-       rust_error_at (pattern->get_locus (),
-                      "cannot strip pattern in this position");
-    }
-
-  // can't strip value expr itself, but can strip sub-expressions
-  auto &value_expr = expr.get_value_expr ();
-  value_expr->accept_vis (*this);
-  if (value_expr->is_marked_for_strip ())
-    rust_error_at (value_expr->get_locus (),
-                  "cannot strip expression in this position - outer "
-                  "attributes not allowed");
-
-  // can't strip if block itself, but can strip sub-expressions
-  auto &if_block = expr.get_if_block ();
-  if_block->accept_vis (*this);
-  if (if_block->is_marked_for_strip ())
-    rust_error_at (if_block->get_locus (),
-                  "cannot strip block expression in this position - outer "
-                  "attributes not allowed");
-
-  // can't strip if let expr itself, but can strip sub-expressions
-  auto &conseq_if_let_expr = expr.get_conseq_if_let_expr ();
-  conseq_if_let_expr->accept_vis (*this);
-  if (conseq_if_let_expr->is_marked_for_strip ())
-    rust_error_at (conseq_if_let_expr->get_locus (),
-                  "cannot strip consequent if let expression in this "
-                  "position - outer attributes not "
-                  "allowed");
-}
-void
 CfgStrip::visit (AST::MatchExpr &expr)
 {
   // initial strip test based on outer attrs
index 41b548b51c26ce41bf126b2504b812d823dff0ca..d631b5a95100dce48ed7e1705435fada320f4db7 100644 (file)
@@ -133,8 +133,6 @@ public:
   void visit (AST::IfExprConseqElse &expr) override;
   void visit (AST::IfLetExpr &expr) override;
   void visit (AST::IfLetExprConseqElse &expr) override;
-  void visit (AST::IfLetExprConseqIf &expr) override;
-  void visit (AST::IfLetExprConseqIfLet &expr) override;
   void visit (AST::MatchExpr &expr) override;
   void visit (AST::AwaitExpr &expr) override;
   void visit (AST::AsyncBlockExpr &expr) override;
index 04013da8fffceed700f6ae35d85e1db3ad99faff..c4191ce68d1a2fdbeb49d6e543359ffebe01e2bc 100644 (file)
@@ -699,24 +699,6 @@ ExpandVisitor::visit (AST::IfLetExprConseqElse &expr)
   visit (expr.get_else_block ());
 }
 
-void
-ExpandVisitor::visit (AST::IfLetExprConseqIf &expr)
-{
-  maybe_expand_expr (expr.get_value_expr ());
-
-  visit (expr.get_if_block ());
-  visit (expr.get_conseq_if_expr ());
-}
-
-void
-ExpandVisitor::visit (AST::IfLetExprConseqIfLet &expr)
-{
-  maybe_expand_expr (expr.get_value_expr ());
-
-  visit (expr.get_if_block ());
-  visit (expr.get_conseq_if_let_expr ());
-}
-
 void
 ExpandVisitor::visit (AST::MatchExpr &expr)
 {
index 67c9a5558b6e381df988c109cec433d2cf4b73d0..f3123767213fb1558151ab4b837edc1921f979c9 100644 (file)
@@ -218,8 +218,6 @@ public:
   void visit (AST::IfExprConseqElse &expr) override;
   void visit (AST::IfLetExpr &expr) override;
   void visit (AST::IfLetExprConseqElse &expr) override;
-  void visit (AST::IfLetExprConseqIf &expr) override;
-  void visit (AST::IfLetExprConseqIfLet &expr) override;
   void visit (AST::MatchExpr &expr) override;
   void visit (AST::AwaitExpr &expr) override;
   void visit (AST::AsyncBlockExpr &expr) override;
index 9c04c21881c3c58e5a243a94ef9a9f1f1575e56e..70f57c3441748cb4070fb9824948590e5310417d 100644 (file)
@@ -235,12 +235,6 @@ ASTLoweringBase::visit (AST::IfLetExpr &)
 void
 ASTLoweringBase::visit (AST::IfLetExprConseqElse &)
 {}
-void
-ASTLoweringBase::visit (AST::IfLetExprConseqIf &)
-{}
-void
-ASTLoweringBase::visit (AST::IfLetExprConseqIfLet &)
-{}
 //  void ASTLoweringBase::visit(MatchCasematch_case) {}
 // void ASTLoweringBase:: (AST::MatchCaseBlockExpr &) {}
 // void ASTLoweringBase:: (AST::MatchCaseExpr &) {}
index 212277960a6b0bf3880132896241c595c876ef22..f839eae21807113828d8d65d252117ca5be92b66 100644 (file)
@@ -145,8 +145,6 @@ public:
   virtual void visit (AST::IfExprConseqElse &expr);
   virtual void visit (AST::IfLetExpr &expr);
   virtual void visit (AST::IfLetExprConseqElse &expr);
-  virtual void visit (AST::IfLetExprConseqIf &expr);
-  virtual void visit (AST::IfLetExprConseqIfLet &expr);
   //  virtual void visit(MatchCase& match_case);
   // virtual void visit (AST::MatchCaseBlockExpr &match_case);
   // virtual void visit (AST::MatchCaseExpr &match_case);
index c48c71f6ca33a55b4f7ba7204819887ca6f9b669..e636252c2558c4349fa0248b40628b9afb67e8a3 100644 (file)
@@ -8219,8 +8219,8 @@ Parser<ManagedTokenSource>::parse_if_let_expr (AST::AttrVec outer_attrs,
                    return nullptr;
                  }
 
-               return std::unique_ptr<AST::IfLetExprConseqIfLet> (
-                 new AST::IfLetExprConseqIfLet (
+               return std::unique_ptr<AST::IfLetExprConseqElse> (
+                 new AST::IfLetExprConseqElse (
                    std::move (match_arm_patterns), std::move (scrutinee_expr),
                    std::move (if_let_body), std::move (if_let_expr),
                    std::move (outer_attrs), locus));
@@ -8240,12 +8240,11 @@ Parser<ManagedTokenSource>::parse_if_let_expr (AST::AttrVec outer_attrs,
                    return nullptr;
                  }
 
-               return std::unique_ptr<AST::IfLetExprConseqIf> (
-                 new AST::IfLetExprConseqIf (std::move (match_arm_patterns),
-                                             std::move (scrutinee_expr),
-                                             std::move (if_let_body),
-                                             std::move (if_expr),
-                                             std::move (outer_attrs), locus));
+               return std::unique_ptr<AST::IfLetExprConseqElse> (
+                 new AST::IfLetExprConseqElse (
+                   std::move (match_arm_patterns), std::move (scrutinee_expr),
+                   std::move (if_let_body), std::move (if_expr),
+                   std::move (outer_attrs), locus));
              }
          }
        default:
index 06aeb06f967e63089eb10a7c61aac37342cd7ee0..997a1538e4dc2b8fbff4b2a0a38e874dce8d003d 100644 (file)
@@ -302,14 +302,6 @@ void
 ResolverBase::visit (AST::IfLetExprConseqElse &)
 {}
 
-void
-ResolverBase::visit (AST::IfLetExprConseqIf &)
-{}
-
-void
-ResolverBase::visit (AST::IfLetExprConseqIfLet &)
-{}
-
 void
 ResolverBase::visit (AST::MatchExpr &)
 {}
index dc8796549c2a1283c39e33ca2dae1befbc8ae76c..136d637385898e1e55c5b0bd045fd3d1c8bce635 100644 (file)
@@ -97,8 +97,6 @@ public:
   void visit (AST::IfExprConseqElse &);
   void visit (AST::IfLetExpr &);
   void visit (AST::IfLetExprConseqElse &);
-  void visit (AST::IfLetExprConseqIf &);
-  void visit (AST::IfLetExprConseqIfLet &);
 
   void visit (AST::MatchExpr &);
   void visit (AST::AwaitExpr &);
index f06f1bc8198594c7eae04c5cf8d841a8354c7ec7..6e869d6a7c9207290153f456c373f8a0e84cd3f7 100644 (file)
@@ -473,22 +473,6 @@ EarlyNameResolver::visit (AST::IfLetExprConseqElse &expr)
   expr.get_else_block ()->accept_vis (*this);
 }
 
-void
-EarlyNameResolver::visit (AST::IfLetExprConseqIf &expr)
-{
-  expr.get_value_expr ()->accept_vis (*this);
-  expr.get_if_block ()->accept_vis (*this);
-  expr.get_conseq_if_expr ()->accept_vis (*this);
-}
-
-void
-EarlyNameResolver::visit (AST::IfLetExprConseqIfLet &expr)
-{
-  expr.get_value_expr ()->accept_vis (*this);
-  expr.get_if_block ()->accept_vis (*this);
-  expr.get_conseq_if_let_expr ()->accept_vis (*this);
-}
-
 void
 EarlyNameResolver::visit (AST::MatchExpr &expr)
 {
index c6f800490d7cf48a69cf4807bec4bf33c5dff0fd..07281378c5bb202200b5e378c676d1742c9f7b31 100644 (file)
@@ -179,8 +179,6 @@ private:
   virtual void visit (AST::IfExprConseqElse &expr);
   virtual void visit (AST::IfLetExpr &expr);
   virtual void visit (AST::IfLetExprConseqElse &expr);
-  virtual void visit (AST::IfLetExprConseqIf &expr);
-  virtual void visit (AST::IfLetExprConseqIfLet &expr);
   virtual void visit (AST::MatchExpr &expr);
   virtual void visit (AST::AwaitExpr &expr);
   virtual void visit (AST::AsyncBlockExpr &expr);
index 4281f298644985b4fee86a474455bd4dc04c1b3f..03afad72bdd1b7fae655efb86eb784bd008f969d 100644 (file)
@@ -476,14 +476,6 @@ void
 AttributeChecker::visit (AST::IfLetExprConseqElse &)
 {}
 
-void
-AttributeChecker::visit (AST::IfLetExprConseqIf &)
-{}
-
-void
-AttributeChecker::visit (AST::IfLetExprConseqIfLet &)
-{}
-
 void
 AttributeChecker::visit (AST::MatchExpr &)
 {}
index 1c642cdbac92f2f5d6a8173b012fcc43d84c25ce..e8a1d273aea0a66256c9adc252d6052d06f36a43 100644 (file)
@@ -162,8 +162,6 @@ private:
   void visit (AST::IfExprConseqElse &expr);
   void visit (AST::IfLetExpr &expr);
   void visit (AST::IfLetExprConseqElse &expr);
-  void visit (AST::IfLetExprConseqIf &expr);
-  void visit (AST::IfLetExprConseqIfLet &expr);
   void visit (AST::MatchExpr &expr);
   void visit (AST::AwaitExpr &expr);
   void visit (AST::AsyncBlockExpr &expr);