Result: done Files: crates/nikaia-std/src/tools/check_reads.nika crates/nikaia-std/src/tools/lowered/check_reads.rs crates/nikaia-std/src/tools/check_core_flow.nika crates/nikaia-std/src/tools/lowered/check_core_flow.rs crates/nikaia-std/src/tools/check_state.nika crates/nikaia-std/src/tools/lowered/check_state.rs crates/nikaia/src/check/core.rs crates/nikaia-std/src/tools/project_tests.nika crates/nikaia-std/src/tools/lowered/project_tests.rs tests/compiler/tests/an_arm_name_lent_in_an_iter_loop_compares_as_a_view.nika tests/compiler/tests/an_arm_name_lent_in_an_iter_loop_compares_as_a_view.stdout docs/briefs/b954.md.report.md Commit: check: a name an arm binds by ref is a view in the comparisons of its body Body: #954: an arm over a value that is no view (an option field of an .iter() loop variable) learns only after its body is checked that it writes ref got (lent_bindings), so the comparisons inside had read got as a value: got != *want beside a view, got != name() beside a value, both refused by rustc. A comparison beside an arm-bound name now waits in CheckState::arm_compared; when the arm writes ref name, check_core_flow_arm_names_compared drops the other side’s * (beside a view) or reads the name (*got, beside a value). project_tests.nika’s file comparison walks output.files.iter().zip(outcome.files.iter()) (ADR-293 D20, #953 step 2’s last site). Built in two cycles: the old compiler mis-lowers the zip form, so the fix was built first. Fixes: #954 Tests: new tests/compiler an_arm_name_lent_in_an_iter_loop_compares_as_a_view (four comparisons, both sides) failed on the unfixed compiler (rustc E0277 at all four), passes after; nikaia test –both-settings –project tests/compiler 263 of 263 ok at both settings; it guard set 23 ok; nikaia –lib check:: and nikaia-std –lib tools:: ok; clippy clean; pre-push-check ok; lower-std fixpoint reached Gate: green Deviation: none Found: a null inside a tuple of a typed list literal is refused, probe let c: Vec[(String, String?)] = [("a", "y"), ("b", null)] is NK1154 “mixes (ref String, ref String) and (ref String, ??)” (Vec[String?] = ["a", null] works); and let other = if c { "rhs" } else { "lhs" } handed to set.remove((n, other)) of a BTreeSet[(i64, String)] lowers other as &str (E0308), written with the literals in two branches instead Needs: none Changelog: A match arm name bound by reference over a value (an option field of an .iter() loop variable) compares with a view or a value as it should (#954) Owner: none Disk freed: none Rs2nika: none

This site is open source. Improve this page.