re: serious answer
@0x57e11a So my best guess as to what's going on there (although I'm not a Rust expert by any stretch of the imagination) is that the closure can be interpreted/typed in multiple ways, and in the first case, it gets a type hint from the specified return signature so it knows the type to interpret it as, but in the second case it doesn't have that information (as I don't think the type hint propagates backwards through `clos`?) and so it guesses the wrong type.
That doesn't really explain the error message, which I think is just wrong/vague and probably should be filed as a bug (error clarity bug at least). Maybe you can get more insight into what it expects by looking at the supposed type that the language server thinks `clos` has, and see how it differs from the return value signature?
re: serious answer
@0x57e11a (Also you could probably force it into the correct shape by providing some sort of explicit type declaration for `clos` but that's... not great, and I'm not sure what declaration that would be exactly)
re: serious answer
re: serious answer
@0x57e11a Yeah, I'm out of suggestions here unfortunately 😔 Pretty much every time I try to work with impl return types I have different but similar issues
re: serious answer
re: serious answer
@joepie91 the code in question