-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RustAnalayzer mistakenly gives error on a.max(b) #6409
Comments
It would be helpful to see a more complete snippet. Are you using any local imports(as in |
I'm not using
Why is that? :o |
Hmmm that being said, it looks like we could still improve the method inference when the type is |
I don't know about that, but we should avoid giving follow-up errors when we have unknown types. |
Closing in favour of #6975. |
It seems to beleive
max
ina.max(b)
is aboutIterator::max
, whereas it's aboutOrd::max
, and as a consequence gives the error:expected 0 arguments, found 1
(and also when hovering with the mouse, doc points tocore::iter::traits::iterator::Iterator
). Using std::cmp::max(a, b) makes the error disappear.Note that the feature that writes inferred types in light gray mentions
&{unknown}
instead of&Something
(despite the type I'm iterating on being explicitlyVec<Something>
), I suspect that is linked.The text was updated successfully, but these errors were encountered: