Parent
Part of #6 (Phase 4: Implement ownership and move semantics).
Background
Passing a non-Copy value to a function transfers ownership. After the call the original binding is consumed — any subsequent read is a compile error (use-after-move). This is the most basic move-semantics test: one value, one move, one function call.
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 / move-state dataflow; emits use-after-move.
compiler/paco-test-harness/src/lib.rs — golden test harness.
Scope
- Create
tests/conformance/phase_04/move_into_fn/input.paco — a consume(s: string) function plus main that moves a string into it and then attempts a second use.
- Create
tests/conformance/phase_04/move_into_fn/expected.stderr with the use-after-move diagnostic and span pointing at the second use.
- Create
tests/conformance/phase_04/move_into_fn/flags.toml with kind = "fail" and feature_min = 4.
Acceptance Criteria
Key files
tests/conformance/phase_04/move_into_fn/ — new test directory
compiler/paco-borrow/src/lib.rs — move detection
compiler/paco-driver/tests/conformance.rs — conformance runner
Parent
Part of #6 (Phase 4: Implement ownership and move semantics).
Background
Passing a non-
Copyvalue to a function transfers ownership. After the call the original binding is consumed — any subsequent read is a compile error (use-after-move). This is the most basic move-semantics test: one value, one move, one function call.Spec reference:
docs/design/spec.md §3· Lint:use-after-move· Crate:paco-borrowWhat already exists
compiler/paco-borrow/src/lib.rs— definite-assignment / move-state dataflow; emitsuse-after-move.compiler/paco-test-harness/src/lib.rs— golden test harness.Scope
tests/conformance/phase_04/move_into_fn/input.paco— aconsume(s: string)function plusmainthat moves astringinto it and then attempts a second use.tests/conformance/phase_04/move_into_fn/expected.stderrwith theuse-after-movediagnostic and span pointing at the second use.tests/conformance/phase_04/move_into_fn/flags.tomlwithkind = "fail"andfeature_min = 4.Acceptance Criteria
use-after-movediagnostic.expected.stderrmatches actual stderr byte-for-byte.Key files
tests/conformance/phase_04/move_into_fn/— new test directorycompiler/paco-borrow/src/lib.rs— move detectioncompiler/paco-driver/tests/conformance.rs— conformance runner