Commit 4239b70
gccrs: remove match arm pattern vector to single pattern
This patch refactors all uses of vector patterns since a vector of
patterns would be considered as an alt pattern, a vector is considered
useless.
gcc/rust/ChangeLog:
* ast/rust-ast-builder.cc (Builder::match_arm): Moves the vector of patterns
to a single pattern.
* ast/rust-ast-collector.cc (TokenCollector::visit):Likewise.
* ast/rust-ast-pointer-visitor.cc (PointerVisitor::visit):Likewise.
* ast/rust-ast-visitor.cc (DefaultASTVisitor::visit):Likewise.
* ast/rust-ast.cc (IfLetExpr::as_string):Likewise.
(WhileLetLoopExpr::as_string):Likewise.
(MatchArm::as_string):Likewise.
* ast/rust-desugar-question-mark.cc (make_match_arm):Likewise.
* ast/rust-desugar-while-let.cc (DesugarWhileLet::desugar):Likewise.
* ast/rust-expr.h (class WhileLetLoopExpr):Likewise.
(class IfLetExpr):Likewise.
* backend/rust-compile-expr.cc (CompileExpr::visit):Likewise.
* checks/errors/rust-hir-pattern-analysis.cc (lower_arm):Likewise.
* expand/rust-cfg-strip.cc (CfgStrip::visit):Likewise.
* hir/rust-ast-lower.cc (ASTLoweringIfLetBlock::desugar_iflet):Likewise.
(ASTLoweringExprWithBlock::visit):Likewise.
* hir/rust-hir-dump.cc (Dump::do_matcharm):Likewise.
(Dump::visit):Likewise.
* hir/tree/rust-hir-expr.cc (OperatorExpr::operator=):Likewise.
(ArithmeticOrLogicalExpr::operator=):Likewise.
(ComparisonExpr::operator=):Likewise.
(LazyBooleanExpr::operator=):Likewise.
(TypeCastExpr::operator=):Likewise.
(AssignmentExpr::operator=):Likewise.
(CompoundAssignmentExpr::operator=):Likewise.
(GroupedExpr::operator=):Likewise.
(ArrayExpr::operator=):Likewise.
(ArrayIndexExpr::operator=):Likewise.
(CallExpr::operator=):Likewise.
(MethodCallExpr::operator=):Likewise.
(FieldAccessExpr::operator=):Likewise.
(BlockExpr::operator=):Likewise.
(BreakExpr::operator=):Likewise.
(ReturnExpr::operator=):Likewise.
(UnsafeBlockExpr::operator=):Likewise.
(BaseLoopExpr::operator=):Likewise.
(WhileLetLoopExpr::WhileLetLoopExpr):Likewise.
(WhileLetLoopExpr::operator=):Likewise.
(MatchArm::MatchArm):Likewise.
(MatchArm::operator=):Likewise.
(MatchExpr::operator=):Likewise.
* hir/tree/rust-hir-expr.h (class WhileLetLoopExpr):Likewise.
* hir/tree/rust-hir-visitor.cc (DefaultHIRVisitor::walk):Likewise.
(DefaultHIRVisitor::visit_match_arm):Likewise.
* hir/tree/rust-hir.cc (WhileLetLoopExpr::as_string):Likewise.
(MatchArm::as_string):Likewise.
* parse/rust-parse-impl-expr.hxx: Likewise.
* parse/rust-parse-impl.hxx: Likewise.
* parse/rust-parse.h:Likewise.
* resolve/rust-default-resolver.cc (DefaultResolver::visit_if_let_patterns):Likewise.
* resolve/rust-late-name-resolver-2.0.cc (Late::visit):Likewise.
* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):Likewise.
Signed-off-by: Lucas Ly Ba <[email protected]>1 parent 11c436c commit 4239b70
File tree
23 files changed
+194
-359
lines changed- gcc/rust
- ast
- backend
- checks/errors
- expand
- hir
- tree
- parse
- resolve
- typecheck
23 files changed
+194
-359
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
484 | 484 | | |
485 | 485 | | |
486 | 486 | | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
| 487 | + | |
491 | 488 | | |
492 | 489 | | |
493 | 490 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1617 | 1617 | | |
1618 | 1618 | | |
1619 | 1619 | | |
1620 | | - | |
1621 | | - | |
1622 | | - | |
1623 | | - | |
1624 | | - | |
| 1620 | + | |
1625 | 1621 | | |
1626 | 1622 | | |
1627 | 1623 | | |
| |||
1669 | 1665 | | |
1670 | 1666 | | |
1671 | 1667 | | |
1672 | | - | |
1673 | | - | |
1674 | | - | |
1675 | | - | |
| 1668 | + | |
1676 | 1669 | | |
1677 | 1670 | | |
1678 | 1671 | | |
| |||
1695 | 1688 | | |
1696 | 1689 | | |
1697 | 1690 | | |
1698 | | - | |
1699 | | - | |
1700 | | - | |
1701 | | - | |
| 1691 | + | |
1702 | 1692 | | |
1703 | 1693 | | |
1704 | 1694 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
587 | 587 | | |
588 | 588 | | |
589 | 589 | | |
590 | | - | |
591 | | - | |
| 590 | + | |
592 | 591 | | |
593 | 592 | | |
594 | 593 | | |
| |||
627 | 626 | | |
628 | 627 | | |
629 | 628 | | |
630 | | - | |
631 | | - | |
| 629 | + | |
632 | 630 | | |
633 | 631 | | |
634 | 632 | | |
| |||
644 | 642 | | |
645 | 643 | | |
646 | 644 | | |
647 | | - | |
648 | | - | |
| 645 | + | |
649 | 646 | | |
650 | 647 | | |
651 | 648 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
607 | 607 | | |
608 | 608 | | |
609 | 609 | | |
610 | | - | |
611 | | - | |
| 610 | + | |
612 | 611 | | |
613 | 612 | | |
614 | 613 | | |
| |||
647 | 646 | | |
648 | 647 | | |
649 | 648 | | |
650 | | - | |
651 | | - | |
| 649 | + | |
652 | 650 | | |
653 | 651 | | |
654 | 652 | | |
| |||
664 | 662 | | |
665 | 663 | | |
666 | 664 | | |
667 | | - | |
668 | | - | |
| 665 | + | |
669 | 666 | | |
670 | 667 | | |
671 | 668 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1943 | 1943 | | |
1944 | 1944 | | |
1945 | 1945 | | |
1946 | | - | |
| 1946 | + | |
1947 | 1947 | | |
1948 | 1948 | | |
1949 | 1949 | | |
1950 | 1950 | | |
1951 | 1951 | | |
1952 | | - | |
1953 | | - | |
| 1952 | + | |
1954 | 1953 | | |
1955 | 1954 | | |
1956 | 1955 | | |
| |||
2167 | 2166 | | |
2168 | 2167 | | |
2169 | 2168 | | |
2170 | | - | |
| 2169 | + | |
2171 | 2170 | | |
2172 | 2171 | | |
2173 | 2172 | | |
2174 | 2173 | | |
2175 | 2174 | | |
2176 | | - | |
2177 | | - | |
| 2175 | + | |
2178 | 2176 | | |
2179 | 2177 | | |
2180 | 2178 | | |
| |||
2253 | 2251 | | |
2254 | 2252 | | |
2255 | 2253 | | |
2256 | | - | |
| 2254 | + | |
2257 | 2255 | | |
2258 | 2256 | | |
2259 | 2257 | | |
2260 | 2258 | | |
2261 | 2259 | | |
2262 | | - | |
2263 | | - | |
| 2260 | + | |
2264 | 2261 | | |
2265 | 2262 | | |
2266 | 2263 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
| 42 | + | |
47 | 43 | | |
48 | 44 | | |
49 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
0 commit comments