Result: done
Files: crates/nikaia-std/src/tools/check_state.nika crates/nikaia-std/src/tools/lowered/check_state.rs crates/nikaia-std/src/tools/check_takes.nika crates/nikaia-std/src/tools/lowered/check_takes.rs crates/nikaia-std/src/tools/check_reads.nika crates/nikaia-std/src/tools/lowered/check_reads.rs crates/nikaia-std/src/tools/check_items.nika crates/nikaia-std/src/tools/lowered/check_items.rs crates/nikaia-std/src/tools/check_facts.nika crates/nikaia-std/src/tools/lowered/check_facts.rs crates/nikaia-std/src/tools/check_arm_leaves.nika crates/nikaia-std/src/tools/lowered/check_arm_leaves.rs crates/nikaia-std/src/tools/check_core_stmt.nika crates/nikaia-std/src/tools/lowered/check_core_stmt.rs crates/nikaia-std/src/tools/check_core_expr.nika crates/nikaia-std/src/tools/lowered/check_core_expr.rs crates/nikaia-std/src/tools/check_core_leaves.nika crates/nikaia-std/src/tools/lowered/check_core_leaves.rs crates/nikaia-std/src/tools/emit_core_places.nika crates/nikaia-std/src/tools/lowered/emit_core_places.rs crates/nikaia/src/check/core.rs tests/compiler/tests/a_failing_call_while_a_views_part_is_out_is_refused.nika tests/compiler/tests/a_failing_call_while_a_views_part_is_out_is_refused.stderr tests/compiler/tests/a_for_mut_element_left_without_its_part_is_refused.nika tests/compiler/tests/a_for_mut_element_left_without_its_part_is_refused.stderr tests/compiler/tests/a_for_mut_element_takes_a_part_out_and_gives_it_back.nika tests/compiler/tests/a_for_mut_element_takes_a_part_out_and_gives_it_back.stdout tests/compiler/tests/a_let_mut_view_given_away_whole_is_refused.nika tests/compiler/tests/a_let_mut_view_given_away_whole_is_refused.stderr tests/compiler/tests/a_let_mut_view_left_with_a_part_out_is_refused.nika tests/compiler/tests/a_let_mut_view_left_with_a_part_out_is_refused.stderr tests/compiler/tests/a_let_mut_view_of_a_hashmap_entry_gives_its_part_back_each_turn.nika tests/compiler/tests/a_let_mut_view_of_a_hashmap_entry_gives_its_part_back_each_turn.stdout tests/compiler/tests/a_mut_parameters_field_handed_to_a_keeper_is_given_back.nika tests/compiler/tests/a_mut_parameters_field_handed_to_a_keeper_is_given_back.stdout tests/compiler/tests/a_mut_parameters_field_left_out_is_refused.nika tests/compiler/tests/a_mut_parameters_field_left_out_is_refused.stderr tests/compiler/tests/a_part_taken_out_of_a_let_mut_view_is_given_back.nika tests/compiler/tests/a_part_taken_out_of_a_let_mut_view_is_given_back.stdout docs/briefs/b949.md.step1.report.md
Commit: a part taken out of a let mut view or a mut parameter is given back before its block is left (ADR-views-1)
Part: #949
Tests: 9 new tests/compiler programs, all failed on the unfixed compiler (NK1131 + NK2106 on the view’s part; rustc “cannot move out of … behind a mutable reference” for the mut parameter; rustc mismatched types for the whole view); nikaia test –both-settings –project tests/compiler 326 ok, 1 failed: commit_dry_run, environmental (run with a binary copy not named nikaia, its toolchain() falls back to target/fast/nikaia in a temp dir); it nullable:: generics:: defects_found_running:: borrowed_part:: text_tiers:: mut_parameter_parts:: traits:: borrowed_subject:: keeps:: handed_over:: 277 ok; guard set 23 ok; clippy clean; pre-push-check ok; lower-std fixpoint
Gate: green
Deviation: steps 1-5 in one commit, as the issue’s step 5 orders (checker, message, lowering and tests do not stand apart: the checker alone lets rustc refuse); the take rule also applies to a field of a mut parameter handed to a keeper, which Part I 6.5 already specified but was not built (accepted without NK2108, lowered as a move out of &mut); self (ref mut self) left as it was
Found: the view’s ways out: a break or continue of a loop around the view’s frame, its block’s end, return, throw, a failing call; a whole let mut view handed to a keeper reached rustc (mismatched types), now NK1131; lowered/check_core_call_on.rs and lowered.rs re-lower with foreign changes (entry() form; comptime_tree names), not staged
Needs: none
Changelog: A part of a let mut view of a place (let mut c = m[k] ?? continue, a for mut element) or of a mut parameter handed to something that keeps it is taken out with no copy (std::mem::take, or mem::replace with a stand-in) and must be given back by assignment before the view’s block is left (NK2108, naming the view and its place); the whole view handed over is NK1131 (ADR-views-1, #949)
Rs2nika: none
Model: Opus 5.5
Pushed: 2dd2e6d631bfcb49f9da7f318f6d5a2ed75d662f