Result: done for steps 5 and 6; step 4 blocked by a lowering defect (rs2nika does not build with today’s compiler)
Pushed: 1cee2be1 (step 5), 734f3a2f (step 6, says Part #951, not Fixes)
Tests: step 5: tests/compiler –both-settings 315 ok; it guard set + bounds_checks sharing element_views views_kept ledger_spelling map_ledger warnings_once 110 ok; nikaia-std –lib tools:: ok; clippy clean; pre-push-check ok; lower-std fixpoint. Step 4 (in a scratch copy, the one blocking line rewritten locally, never committed): converter tests 139 of 139 ok with 5 stdouts updated (corpus drained filter_mut_loop tree_places tree_shapes)
Rs2nika: corpus all kept 219 of 928 (was 220): program 33 -> 32 of 137 (floor 30), the others unchanged; the corpus finals still hold index loops, a draft’s for mut no longer matches them
Deviation: step 4 not committed: its patch is docs/briefs/b951b-step4.patch (git apply; applies to 734f3a2f). Step 4 decided: tree and line engines write for x in xs.iter_mut() / for x in &mut xs as for mut x in xs (R262 now normalises in &mut v to v.iter_mut(), its M2 drain-and-rebuild is gone; R226 iter_mut().filter(|f| c) -> for mut x in xs + if !c { continue }); a pair over iter_mut is a map unless the declared type is not (param, typed let, struct field); a map’s iter_mut/values_mut gets a TODO line naming ADR-views-2 section 6 and NK1307, an adapter over iter_mut (enumerate, skip) keeps the expression TODO with the same pointer (tree_places’ .skip(from) index loop is gone); Rust’s owned for mut x in v -> for mut x in v.drain(), drain(..) -> drain(), a range keeps for mut i. New rule text R333; the tree’s index aliases removed. TODOs are draft markers, not .notes lines (.notes holds only twins and missing callees). Step 5: 15 loops rewritten; left as index loops: check_takes.nika failing_cleanups_bound (body calls self.binding_id: NK2305, D6); the 147 other grep hits use the index otherwise; no site met #967 or #968; check_core_call_on.nika and comptime_tree.nika skipped as told. Two step-2 tests (a_for_mut_element_takes_a_part_out_and_gives_it_back, a_for_mut_element_left_without_its_part_is_refused, NK2108) move to #949: the supervisor comments there
Found: (1) lowering defect, blocks step 4 and every rs2nika push (CI’s rs2nika job): an owned text from a call is put in the frame’s keep as a view, and an if with a literal arm then mixes &str and String. Probe: fn pat(n: i64) -> String { return f"{n}" } / fn main() { let written = pat(1); let w = if written == "0" { "_" } else { written }; println(w) } -> rustc “if and else have incompatible types” (lowered let written = __keep_frame.put(pat(1)), String::from("_")); without the call (let written = f"{1}") it runs. Hits crates/rs2nika/convert/src/tr_expr.nika:1080 at HEAD too. Needs an issue (ready). (2) the for-mut element is lowered (*x) everywhere: rustc unused_parens in user programs (for mut (a, b) in ps { a += b } warns) and in lowered tools (allowed on the tools module in step 5). Needs an issue (ready). (3) NK2305’s help for a for-mut over self.cleanups_pending says for i in 0..<self.len(): it should name the list, not its root
Needs: fix of Found (1), then apply docs/briefs/b951b-step4.patch, rebuild the converter, rerun its tests, commit with Fixes #951. Supervisor: issues for Found (1)-(3); comment on #949 for the two NK2108 tests
Changelog: none (no version raise: converter, tools rewrite, docs)
Gate: green (step 5)
Disk: target/nikaia-project-tests 3.4G, / 6.9G free (not removed); new entry over 100 MB: run-bundle/194302eb3b5f1d47 339 MB
Comment for #951: steps 4-6: 5 and 6 built (1cee2be1, 734f3a2f); step 4 ready as docs/briefs/b951b-step4.patch, waiting for the keep-frame text defect (Found 1) that stops the converter from building; close #951 with that commit