Parent
Part of #6 (Phase 4: Implement ownership and move semantics).
Background
A double-move — moving the same value into two separate consumers — must be rejected at compile time. The borrow checker tracks the move state of each binding; once a value is marked MovedOut, any further use emits use-after-move. This test targets the most explicit form: two consecutive function calls each consuming the same variable.
Spec reference: docs/design/spec.md §3 · Lint: use-after-move · Crate: paco-borrow
What already exists
compiler/paco-borrow/src/lib.rs — definite-assignment dataflow; MovedOut state blocks subsequent reads.
compiler/paco-test-harness/src/lib.rs — golden test harness.
Scope
- Create
tests/conformance/phase_04/double_move/input.paco — a consume(s: string) function and main that passes the same string to consume twice.
- Create
tests/conformance/phase_04/double_move/expected.stderr with the use-after-move diagnostic on the second call.
- Create
tests/conformance/phase_04/double_move/flags.toml with kind = "fail" and feature_min = 4.
Acceptance Criteria
Key files
tests/conformance/phase_04/double_move/ — new test directory
compiler/paco-borrow/src/lib.rs — move-state tracking
compiler/paco-driver/tests/conformance.rs — conformance runner
Parent
Part of #6 (Phase 4: Implement ownership and move semantics).
Background
A double-move — moving the same value into two separate consumers — must be rejected at compile time. The borrow checker tracks the move state of each binding; once a value is marked
MovedOut, any further use emitsuse-after-move. This test targets the most explicit form: two consecutive function calls each consuming the same variable.Spec reference:
docs/design/spec.md §3· Lint:use-after-move· Crate:paco-borrowWhat already exists
compiler/paco-borrow/src/lib.rs— definite-assignment dataflow;MovedOutstate blocks subsequent reads.compiler/paco-test-harness/src/lib.rs— golden test harness.Scope
tests/conformance/phase_04/double_move/input.paco— aconsume(s: string)function andmainthat passes the samestringtoconsumetwice.tests/conformance/phase_04/double_move/expected.stderrwith theuse-after-movediagnostic on the second call.tests/conformance/phase_04/double_move/flags.tomlwithkind = "fail"andfeature_min = 4.Acceptance Criteria
use-after-moveon the second call.expected.stderrmatches actual stderr byte-for-byte.Key files
tests/conformance/phase_04/double_move/— new test directorycompiler/paco-borrow/src/lib.rs— move-state trackingcompiler/paco-driver/tests/conformance.rs— conformance runner