Repository navigation
Commit 433cccc
committed
fix(types): mark match scrutinee as moved for linear ownership
Bug 6: Expr::Match scrutinee was never marked as moved, allowing linear
values used directly as match scrutinees to escape unconsumed. This broke
the linear ownership invariant for match expressions.
Fix: Add self.mark_expr_as_moved(env, &match_expr.expr) in the
mark_expr_as_moved Match arm, so the scrutinee is consumed before arm
values are processed. This is analogous to how If expressions handle
their branches.
Also fix: allow clippy::only_used_in_recursion on types_equal to satisfy
CI clippy -D warnings.
All 646 tests pass. All three acceptance gates pass.1 parent 05f15d7 commit 433cccc
1 file changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4032 | 4032 | | |
4033 | 4033 | | |
4034 | 4034 | | |
| 4035 | + | |
4035 | 4036 | | |
4036 | 4037 | | |
4037 | 4038 | | |
| |||
5036 | 5037 | | |
5037 | 5038 | | |
5038 | 5039 | | |
| 5040 | + | |
5039 | 5041 | | |
5040 | 5042 | | |
5041 | 5043 | | |
| |||
0 commit comments