-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsD-papercutDiagnostics: An error or lint that needs small tweaks.Diagnostics: An error or lint that needs small tweaks.P-lowLow priorityLow priorityT-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
When encountering .iter() on an impl Iterator, suggest removing the method call:
serror[E0599]: no method named `iter` found for opaque type `impl std::iter::Iterator<Item = &AssocItem> + '_` in the current scope
--> compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs:3130:67
|
3130 | if !self.tcx.provided_trait_methods(trait_def_id).iter().any(|method| {
| ^^^^
|
help: there is a method `filter` with a similar name, but with different arguments
--> /rustc/ad726b5063362ec9897ef3d67452fc5606ee70fa/library/core/src/iter/traits/iterator.rs:911:4
This can likely be done generally by looking at every method with that name and seeing if their return type matches the impl Trait we already have.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsD-papercutDiagnostics: An error or lint that needs small tweaks.Diagnostics: An error or lint that needs small tweaks.P-lowLow priorityLow priorityT-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.