.collect() (NK1105)Open and answer this issue on GitHub.
ready · opened 2026-11-02 · updated 2026-11-02 · 0 comments
This came up in the M10 move of check/mod.rs (#125).
self.field = xs.drain().collect() is refused with NK1105. Writing let v: T = xs.drain().collect() and then self.field = v compiles. So the type of the assignment target is not used to infer the type of collect, although the field’s type is known.
To build
let already does.tests/compiler/: a field assigned from .collect().