sum, fold and any after a step over a pausing sequence are accepted by the checker and refused by rustcOpen and answer this issue on GitHub.
bug, ready · opened 2026-11-28 · updated 2026-11-28 · 0 comments
Found while “A combinator over io::lines() walks views, not a copy per line” (#2881), builder’s report, on HEAD d25729e4 and after ddc41bf0 alike.
use std::io
fn main() throws {
let total = io::lines().map(fn(l) { l.len() }).sum()
println(total)
}
The checker accepts it; rustc refuses the lowered code (NK1343: “the method sum exists for struct Failing<OkMap<Lines, ...>>, but its trait bounds were not satisfied”). The same holds for .fold(0, fn(a, n) { a + n }) and .any(...). Traced: crates/nikaia-std/src/seq.rs’s Failing (and Paused) has collect, count, nth and join, but no sum, fold, any, all, find, max or min. An NK1343 is the compiler’s own defect: what it accepts must build.
Seq offers (sum, fold, any, all, find, max, min) work after a lazy step over a pausing or failing sequence, as collect and count do. Under the Nikaia-only rule, in Nikaia where the walk can be said there; Rust only where the existing seq.rs code is changed and cannot be converted.tests/compiler/tests/ with .stdin and .stdout: io::lines().map(...).sum(), .fold(...) and .any(...) print their results.The probe prints the sum, the test passes, and the commit carries Fixes #N.
crates/nikaia-std/src/seq.rs or its Nikaia replacement, the test. No other change.
Facts: Lowering and lower-std