Issue #958: A tuple with a text literal pushed into a Vec[(i64, String)] local, then moved into a struct field, reaches rustc (E0308)

Open and answer this issue on GitHub.

ready · opened 2026-10-29 · updated 2026-10-29 · 0 comments

Found while

Building #948 (a builder’s side finding), re-checked on develop at 0.0.1279 (2f73c24), after #929 step 4 taught the text tiers to follow tuples.

struct LoopFound { parts: Vec[(i64, String)] }

fn text_of(found: LoopFound) -> String {
    let mut out: String = ""
    for (n, s) in found.parts {
        out.push_str(f"{n} {s};")
    }
    return out
}

fn main() {
    let guesses = [1, 2]
    let mut parts: Vec[(i64, String)] = []
    for guess in guesses {
        parts.push((guess, "guess and check"))
    }
    println(text_of(LoopFound { parts: parts }))
}

nikaia check accepts it; nikaia run stops in rustc:

error: Mismatched types.
 15 |         parts.push((guess, "guess and check"))
    = note: Consider dereferencing the borrow.

The same shape occurs in tools/bounds_walk.nika (around line 2293), where the #929 builder met it as NK1106. Related: #909 (a lent loop element moved into a tuple literal, also E0308).

To build

  1. The literal in the tuple is constructed where the field’s list keeps it (ADR-282 D3-D4), or the tuple’s part is a view where the tiers make it one; the program runs. Test: the probe above in tests/compiler/.

The commit that builds the last step says Fixes #N.

Back to Open Issues