Open and answer this issue on GitHub.
bug, ready · opened 2026-11-30 · updated 2026-11-30 · 0 comments
use std::io
fn width(l: ref String) -> i64 throws {
if l.len() > 100 { throw io::IoError::Other("long") }
return l.len()
}
fn main() throws {
let s = io::lines().map(fn(l) { width(l) })
println(f"{s.count()}")
}
It should print the line count, the same way a chain over a list with a throwing lambda does (ADR-loop-failure-v1 D1). It stops with NK1343: rustc reports “nikaia_std::io::Lines is not an iterator”.
The same happens with .filter(..).collect() after the map, and with for n in io::lines().map(fn(l) { width(l) }). It fails on b36e564a and on the binary from before run 6 of #2927 alike.
emit_stream_chain and emit_stream_kept_steps refuse a step in failing_through_calls (“which the general walk carries”). The general walk then writes io::lines().await.map(|l| -> Result<..> ..), an Iterator adapter that Lines does not have.
tests/compiler/tests/ with the probe above, the filter.collect form and the for form, with stdin, passing in both settings.All three forms print what the same chain over a list prints, and the lines, stream, failing and chain test groups stay green.
Found in run 6 of “Chains over lists, maps and std’s other producers are one loop the compiler writes, and seq.rs leaves Rust (ADR-chain-loop-v1 D6, D7)” (#2927).