Issue #2990: A list declared with view elements given an owned local’s text by push…

Open and answer this issue on GitHub.

ready, bugs, queued · opened 2026-11-30 · updated 2026-11-30 · 0 comments

Filed by the driver from the Found: of the run of issue-2756 (#2756) (owner, 2026-11-06).

Found

A list declared with view elements given an owned local’s text by push lowers without the borrow: fn main() throws { let mut v: Vec[ref String] = []; let mut n = String(); n.push_str("x"); v.push(n); println(v.len()) } gives today (HEAD 8f82c0ee4, target/fast build) error[NK1343] at v.push(n), rustc “mismatched types, consider borrowing here” (lowered v.push(n) into Vec<&str>); the same with a tuple let mut v: Vec[(u32, ref String)] = []; ... v.push((1, n)), with n declared before or after v; it should print 1, the element being a view of n (ADR-282 D2) or be refused with an NK code, never NK1343; cause unknown (suspected: the emitter’s push argument for a declared view element, emit_core_args, does not lend a local String)

To build

Done when

The probe or check gives the expected output the first item names from its ADR or Part I-III section, and a tests/compiler/tests/ test (or the named check) that failed on the unfixed tree is green; or the probe already passes on develop and a test pins it, naming the commit that fixed it; or the issue is closed as by design, naming the function or ADR.


Generated by Claude Code

Back to Open Issues