Issue #2701: The checker accepts Vec::extend with a lent list or part of one, which…

Open and answer this issue on GitHub.

decision, bugs · opened 2026-11-22 · updated 2026-11-22 · 0 comments

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

Found

The checker accepts Vec::extend with a lent list or part of one, which ADR-collections-v3 D3 says takes owned T, and rustc then refuses the lowered code. Probe (fn main() throws { let p: Vec[String] = [f"a{1}", "b"]; let mut shown: Vec[String] = []; shown.extend(p[..<1]); shown.push("x"); println(shown.join(" > ")) }) gives today NK1343 the trait bound List<&str>: Extend<&nikaia_std::block::Text> is not satisfied. A second shape, fn joined(path: ref Array[String]) -> String sync { let mut shown: Vec[String] = []; shown.extend(path); return shown.join(" > ") } called with a Vec[String], gives NK1343 type mismatch resolving <&[Text] as IntoIterator>::Item == Text. It should give a checker refusal that points to .clone() (D4: s.extend(xs.clone()) works and lowers to iter().cloned()), or lower to a list of views. Which of the two is no decision yet. Cause suspected: the Vec::extend contract types items: ? with keeps = ["items"], and nothing in check_core_method asks that a kept argument be owned; to settle it, trace the keeps handling of ? parameters in tools/check_core_method.nika

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