The type of
x is correctly resolved as
let x = iter::repeat(5).map(|x| Some(x)).next();
Whereas here, it can't be resolved:
let x = iter::repeat(5).map(Some).next();
I'm not sure whether this is a known issue. I'm having trouble finding it in the GitHub issues.
(Nothing special about enum constructors here; the same behavior holds with normal functions)
I think that would be https://github.com/rust-analyzer/rust-analyzer/issues/4281
This is particularly bad for our codebase since we have a style guideline not to introduce unnecessary closures in cases like this. @matklad is this an easy fix that you could give me pointers to? I can try to do it if so.
I don't think this has an easy fix, it needs some groundwork on the chalk's side (see the linked chalk issues in the issue)
Ok, thanks for letting me know.