suggest into_iter() when Iterator method called on impl IntoIterator#119928
suggest into_iter() when Iterator method called on impl IntoIterator#119928bors merged 1 commit intorust-lang:masterfrom d-sonuga:into-iter-sugg
into_iter() when Iterator method called on impl IntoIterator#119928Conversation
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @TaKO8Ki (or someone else) soon. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
|
r? compiler |
|
☔ The latest upstream changes (presumably #120722) made this pull request unmergeable. Please resolve the merge conflicts. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| tcx.def_path_str(trait_pred.trait_ref.def_id) | ||
| == tcx.def_path_str(into_iterator_trait) |
There was a problem hiding this comment.
Why are you using string comparison here? Just compare the def ids directly.
| tcx.def_path_str(trait_pred.trait_ref.def_id) | |
| == tcx.def_path_str(into_iterator_trait) | |
| trait_pred.trait_ref.def_id == into_iterator_trait |
| } | ||
| _ => return false, | ||
| } | ||
| false |
There was a problem hiding this comment.
I feel like this whole approach could be simplified by just checking if {ty}: IntoIterator holds. You can use predicate_must_hold_modulo_regions to do this.
|
@bors r+ rollup |
…llaumeGomez Rollup of 6 pull requests Successful merges: - rust-lang#119928 (suggest `into_iter()` when `Iterator` method called on `impl IntoIterator`) - rust-lang#121020 (Avoid an ICE in diagnostics) - rust-lang#121111 (For E0038, suggest associated type if available) - rust-lang#121137 (Add clippy into the known `cfg` list) - rust-lang#121179 (allow mutable references in const values when they point to no memory) - rust-lang#121181 (Fix an ICE in the recursion lint) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#119928 - d-sonuga:into-iter-sugg, r=compiler-errors suggest `into_iter()` when `Iterator` method called on `impl IntoIterator` Fix for issue rust-lang#117711.
Fix for issue #117711.