-
Couldn't load subscription status.
- Fork 13.9k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
In #100227, someone was a little confused by <&[T]>::contains not being accessible asVec::<T>::contains.
fn test() {
let vec = Vec::new();
Vec::contains(&vec, &0);
}The current output is:
error[E0599]: no function or associated item named `contains` found for struct `Vec<_, _>` in the current scope
--> src/lib.rs:3:10
|
3 | Vec::contains(&vec, &0);
| ^^^^^^^^ function or associated item not found in `Vec<_, _>`
For more information about this error, try `rustc --explain E0599`.
Ideally, it would add a note about the method being found on a type that Vec<_, _> can deref to.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.