Skip to content

Suggest .iter() for shared projections#155719

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
qaijuang:suggest-iter-for-shared-projections-issue-155365
Apr 26, 2026
Merged

Suggest .iter() for shared projections#155719
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
qaijuang:suggest-iter-for-shared-projections-issue-155365

Conversation

@qaijuang
Copy link
Copy Markdown
Contributor

@qaijuang qaijuang commented Apr 24, 2026

Fixes #155365.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 24, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 24, 2026

r? @ShoyuVanilla

rustbot has assigned @ShoyuVanilla.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 73 candidates
  • Random selection from 18 candidates

@qaijuang
Copy link
Copy Markdown
Contributor Author

cc @DanielEScherzer

Copy link
Copy Markdown
Contributor

@DanielEScherzer DanielEScherzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for working on this - I'm not going to pretend to understand how it all works, but some suggestions/notes

View changes since this review

Comment thread tests/ui/did_you_mean/collect-without-into-iter-call.rs Outdated
Comment thread compiler/rustc_hir_typeck/src/method/suggest.rs Outdated
Comment thread compiler/rustc_hir_typeck/src/method/suggest.rs
Comment thread compiler/rustc_hir_typeck/src/method/suggest.rs
Comment thread tests/ui/did_you_mean/collect-without-into-iter-call.rs
Copy link
Copy Markdown
Member

@ShoyuVanilla ShoyuVanilla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me modulo some nits

View changes since this review

Comment thread compiler/rustc_hir_typeck/src/expr_use_visitor.rs Outdated
Comment thread compiler/rustc_hir_typeck/src/expr_use_visitor.rs
Comment thread compiler/rustc_hir_typeck/src/expr_use_visitor.rs Outdated
@qaijuang qaijuang requested a review from ShoyuVanilla April 26, 2026 13:38
@ShoyuVanilla
Copy link
Copy Markdown
Member

@bors squash

@rust-bors

This comment has been minimized.

* Suggest `.iter()` for shared projections
* address few nits
* a few improvements
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 26, 2026

🔨 3 commits were squashed into 28c079a.

@rust-bors rust-bors Bot force-pushed the suggest-iter-for-shared-projections-issue-155365 branch from be3316e to 28c079a Compare April 26, 2026 14:31
@ShoyuVanilla
Copy link
Copy Markdown
Member

@bors r+ rollup

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 26, 2026

📌 Commit 28c079a has been approved by ShoyuVanilla

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 26, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Apr 26, 2026
…rojections-issue-155365, r=ShoyuVanilla

Suggest `.iter()` for shared projections

Fixes rust-lang#155365.
Copy link
Copy Markdown
Contributor

@DanielEScherzer DanielEScherzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have r+ but this looks good to me now in terms of the results

View changes since this review

rust-bors Bot pushed a commit that referenced this pull request Apr 26, 2026
…uwer

Rollup of 15 pull requests

Successful merges:

 - #152995 (ACP Implementation of PermissionsExt for Windows )
 - #153457 (prevent deref coercions in `pin!`)
 - #155250 (Windows: Cache the pipe filesystem handle)
 - #155574 (Move `std::io::RawOsError` to `core::io`)
 - #155757 (macro_metavar_expr_concat: explain why idents are invalid)
 - #155823 (miri subtree update)
 - #155693 (Suggest enclosing format string with `""` under special cases)
 - #155707 (Fix minor panic-unsoundness in CString::clone_into)
 - #155719 (Suggest `.iter()` for shared projections)
 - #155779 (ssa_range_prop: use `if let` guards)
 - #155789 (Cleanups to `AttributeExt`)
 - #155805 (Mention `DEPRECATED_LLVM_INTRINSIC` lint for internal use)
 - #155806 (Remove the incomplete marker from `impl` restrictions)
 - #155820 (Avoid improper spans when `...` or `..=` is recovered from non-ASCII)
 - #155822 (Add default field values to diagnostic FormatArgs)
@rust-bors rust-bors Bot merged commit 59ca5ae into rust-lang:main Apr 26, 2026
11 checks passed
@rustbot rustbot added this to the 1.97.0 milestone Apr 26, 2026
@qaijuang qaijuang deleted the suggest-iter-for-shared-projections-issue-155365 branch April 27, 2026 07:40
pull Bot pushed a commit to LeeeeeeM/miri that referenced this pull request Apr 30, 2026
…uwer

Rollup of 15 pull requests

Successful merges:

 - rust-lang/rust#152995 (ACP Implementation of PermissionsExt for Windows )
 - rust-lang/rust#153457 (prevent deref coercions in `pin!`)
 - rust-lang/rust#155250 (Windows: Cache the pipe filesystem handle)
 - rust-lang/rust#155574 (Move `std::io::RawOsError` to `core::io`)
 - rust-lang/rust#155757 (macro_metavar_expr_concat: explain why idents are invalid)
 - rust-lang/rust#155823 (miri subtree update)
 - rust-lang/rust#155693 (Suggest enclosing format string with `""` under special cases)
 - rust-lang/rust#155707 (Fix minor panic-unsoundness in CString::clone_into)
 - rust-lang/rust#155719 (Suggest `.iter()` for shared projections)
 - rust-lang/rust#155779 (ssa_range_prop: use `if let` guards)
 - rust-lang/rust#155789 (Cleanups to `AttributeExt`)
 - rust-lang/rust#155805 (Mention `DEPRECATED_LLVM_INTRINSIC` lint for internal use)
 - rust-lang/rust#155806 (Remove the incomplete marker from `impl` restrictions)
 - rust-lang/rust#155820 (Avoid improper spans when `...` or `..=` is recovered from non-ASCII)
 - rust-lang/rust#155822 (Add default field values to diagnostic FormatArgs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

E0599 suggests "call .into_iter() first" on non-mutable reference

4 participants