Issue #627: View structs: two programs Nikaia accepts and rustc refuses, left after ADR-353 (#614)

Open and answer this issue on GitHub.

ready · opened 2026-10-15 · updated 2026-11-03 · 0 comments

Found while building ADR-353 (#614, closed by 0.0.969 / 871f98b). Both cases are Part III C.1 defects: Nikaia accepts the program and rustc refuses the Rust it lowers to. No decision is needed. ADR-353 D1-D7 already say what these programs mean.

  1. A struct parameter with a pub struct result. fn outer(p: Pair, n: ref String) -> Outer, where Pair and Outer hold views, lowers with elided lifetimes that rustc refuses. Not yet checked: whether a private struct does the same. This shape was taken out of the nested test in result_source.rs, which now builds Outer inline.
  2. let mut z = y; z = other while a view of y is used. This is untested. It probably breaks the lowering, because an owned value goes into what is lowered as a kept view (ADR-353 D3, the move into a local).

To build

  1. Reproduce each case with nikaia run. Fix the lowering (lifetimes for a struct parameter feeding a struct result; reassignment of a moved-into local). Add a test in crates/nikaia/tests/result_source.rs for each.

Generated by Claude Code

Back to Open Issues