-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Universal function call syntax for Vec::contains
does not work.
#100227
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
Comments
Can you elaborate on how it doesn't work? |
|
error[E0599]: no function or associated item named `contains` found for struct `Vec<_, _>` in the current scope
--> src/lib.rs:4:10
|
4 | Vec::contains(&vec, &0); // doesn't work
| ^^^^^^^^ function or associated item not found in `Vec<_, _>`
For more information about this error, try `rustc --explain E0599`.
error: could not compile `playground` due to previous error But the error is definitely not good here and could be improved to say there the methods does exist on something that the type derefs to. |
You are right, I've been stupid |
Would you like opening an issue for the diagnostic? A hint telling that the method exists on a deref would be quite nice. |
I've opened an issue. |
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: