Result: done
Files: crates/nikaia-std/src/tools/buffers.nika crates/nikaia-std/src/tools/lowered/buffers.rs tests/compiler/tests/a_call_result_moved_through_an_if_arm_stays_owned.nika tests/compiler/tests/a_call_result_moved_through_an_if_arm_stays_owned.stdout docs/briefs/b969.md.report.md
Commit: buffers: a text handed whole to push through an if or match arm is moved, not put in the frame’s keep
Fixes: #969
Tests: a_call_result_moved_through_an_if_arm_stays_owned fails on the unfixed compiler (rustc mismatched types at the method push in a loop and the free-function push, match arms incompatible); passes after; nikaia test –both-settings –project tests/compiler 318 ok; it guard set 23 ok; clippy clean; pre-push-check ok; lower-std fixpoint (only lowered/buffers.rs changes); converter crates/rs2nika/convert builds again and its nikaia test 139 ok
Gate: green
Deviation: the issue’s probe (let w = if .. { "_" } else { written }) already ran at HEAD; the failing form is a push of that if (ps.push(if written == "()" { "_" } else { written }), tr_expr.nika:1086); the test holds both. lowered.rs not staged: its only diff is the foreign comptime_tree hunk, the new helpers are private
Found: introduced by 34519e7 (#933): a local bound to a package method’s owned text became a frame buffer, as one bound to a free function’s call already was; put_by_method skipped only an argument that is the buffer itself, so an if/match/block whose arm is the buffer counted as a view of it and was put into __keep_frame (the free-function form failed before 34519e7 too). Fix: moved_origins/moved_tail_origins in buffers.nika see through if, match and block arms. Struct, list, tuple literals, return and assignment were probed and already moved
Needs: none
Changelog: Text a call returned, handed whole to push or insert through an if or match arm beside a literal arm (ps.push(if w == "()" { "_" } else { w })), is moved as its own instead of being kept as a view, which rustc refused (#969)
Owner: none
Disk freed: none (target/nikaia-project-tests 3.5G; / 8.4G free; no new cache entry over 100 MB)
Rs2nika: none