@@ -1630,6 +1630,9 @@ AttrVisitor::visit (AST::IfExpr &expr)
1630
1630
// can't strip condition expr itself, but can strip sub-expressions
1631
1631
auto &condition_expr = expr.get_condition_expr ();
1632
1632
condition_expr->accept_vis (*this );
1633
+ auto cond_fragment = expander.take_expanded_fragment (*this );
1634
+ if (cond_fragment.should_expand ())
1635
+ condition_expr = cond_fragment.take_expression_fragment ();
1633
1636
if (condition_expr->is_marked_for_strip ())
1634
1637
rust_error_at (condition_expr->get_locus (),
1635
1638
" cannot strip expression in this position - outer "
@@ -1657,6 +1660,9 @@ AttrVisitor::visit (AST::IfExprConseqElse &expr)
1657
1660
// can't strip condition expr itself, but can strip sub-expressions
1658
1661
auto &condition_expr = expr.get_condition_expr ();
1659
1662
condition_expr->accept_vis (*this );
1663
+ auto cond_fragment = expander.take_expanded_fragment (*this );
1664
+ if (cond_fragment.should_expand ())
1665
+ condition_expr = cond_fragment.take_expression_fragment ();
1660
1666
if (condition_expr->is_marked_for_strip ())
1661
1667
rust_error_at (condition_expr->get_locus (),
1662
1668
" cannot strip expression in this position - outer "
@@ -1692,6 +1698,9 @@ AttrVisitor::visit (AST::IfExprConseqIf &expr)
1692
1698
// can't strip condition expr itself, but can strip sub-expressions
1693
1699
auto &condition_expr = expr.get_condition_expr ();
1694
1700
condition_expr->accept_vis (*this );
1701
+ auto cond_fragment = expander.take_expanded_fragment (*this );
1702
+ if (cond_fragment.should_expand ())
1703
+ condition_expr = cond_fragment.take_expression_fragment ();
1695
1704
if (condition_expr->is_marked_for_strip ())
1696
1705
rust_error_at (condition_expr->get_locus (),
1697
1706
" cannot strip expression in this position - outer "
@@ -1727,6 +1736,9 @@ AttrVisitor::visit (AST::IfExprConseqIfLet &expr)
1727
1736
// can't strip condition expr itself, but can strip sub-expressions
1728
1737
auto &condition_expr = expr.get_condition_expr ();
1729
1738
condition_expr->accept_vis (*this );
1739
+ auto cond_fragment = expander.take_expanded_fragment (*this );
1740
+ if (cond_fragment.should_expand ())
1741
+ condition_expr = cond_fragment.take_expression_fragment ();
1730
1742
if (condition_expr->is_marked_for_strip ())
1731
1743
rust_error_at (condition_expr->get_locus (),
1732
1744
" cannot strip expression in this position - outer "
0 commit comments