Skip to content

Commit

Permalink
fixup! rust: Desugar IfLet* into MatchExpr
Browse files Browse the repository at this point in the history
  • Loading branch information
dkm committed Sep 5, 2024
1 parent c75af31 commit f8883da
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions gcc/rust/hir/rust-ast-lower.cc
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,9 @@ ASTLoweringIfBlock::visit (AST::IfExprConseqElse &expr)
* }
*/
void
ASTLoweringIfLetBlock::desugar_iflet (
AST::IfLetExpr &expr, HIR::Expr **branch_value,
std::vector<HIR::MatchCase> &match_arms)
ASTLoweringIfLetBlock::desugar_iflet (AST::IfLetExpr &expr,
HIR::Expr **branch_value,
std::vector<HIR::MatchCase> &match_arms)
{
HIR::Expr *kase_expr;
std::vector<std::unique_ptr<HIR::Pattern>> match_arm_patterns;
Expand Down Expand Up @@ -262,8 +262,7 @@ ASTLoweringIfLetBlock::visit (AST::IfLetExpr &expr)
HIR::Expr *branch_value;

std::vector<HIR::MatchCase> match_arms;
desugar_iflet (expr, &branch_value,
match_arms);
desugar_iflet (expr, &branch_value, match_arms);

auto crate_num = mappings.get_current_crate ();
Analysis::NodeMapping mapping (crate_num, expr.get_node_id (),
Expand Down Expand Up @@ -295,8 +294,7 @@ ASTLoweringIfLetBlock::visit (AST::IfLetExprConseqElse &expr)
HIR::Expr *branch_value;
std::vector<HIR::MatchCase> match_arms;

desugar_iflet (expr, &branch_value,
match_arms);
desugar_iflet (expr, &branch_value, match_arms);

auto crate_num = mappings.get_current_crate ();
Analysis::NodeMapping mapping (crate_num, expr.get_node_id (),
Expand Down

0 comments on commit f8883da

Please sign in to comment.