Skip to content
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

Extend explicit_iter_loop and explicit_into_iter_loop #10416

Merged
merged 4 commits into from
Jun 12, 2023

Conversation

Jarcho
Copy link
Contributor

@Jarcho Jarcho commented Feb 27, 2023

fixes #1518

Some included cleanups

  • Split for_loop test into different files for each lint (partially).
  • Move handling of some into_iter cases from explicit_into_iter.

changelog: Enhancement: [explicit_iter_loop]: Now also handles types that implement IntoIterator.
#10416

changelog: Sugg: [explicit_into_iter_loop]: The suggestion now works on mutable references.
#10416

@rustbot
Copy link
Collaborator

rustbot commented Feb 27, 2023

r? @Manishearth

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Feb 27, 2023
@Jarcho Jarcho force-pushed the explicit_iter_loop_ext branch 3 times, most recently from 171a5a8 to cd21cf7 Compare February 27, 2023 19:59
@bors
Copy link
Contributor

bors commented Mar 14, 2023

☔ The latest upstream changes (presumably #10350) made this pull request unmergeable. Please resolve the merge conflicts.

@Jarcho Jarcho force-pushed the explicit_iter_loop_ext branch from cd21cf7 to 45a2958 Compare June 9, 2023 23:35
@Jarcho
Copy link
Contributor Author

Jarcho commented Jun 9, 2023

ping @Manishearth

@Jarcho Jarcho force-pushed the explicit_iter_loop_ext branch 2 times, most recently from 0b24607 to d107146 Compare June 10, 2023 00:46
@Jarcho Jarcho force-pushed the explicit_iter_loop_ext branch from d107146 to 949712c Compare June 10, 2023 01:43
use rustc_span::symbol::sym;

#[derive(Clone, Copy)]
enum AdjustKind {
Copy link
Member

Choose a reason for hiding this comment

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

sugestion: would it be possible to make these adjustkind APIs generally useful in utils?

Copy link
Contributor Author

@Jarcho Jarcho Jun 12, 2023

Choose a reason for hiding this comment

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

I'm not sure how much can be pulled out. Every time I've had to handle adjustments there's always been some weird cases to handle. Something I'll keep in mind to do if it ever comes up.

Copy link
Member

@Manishearth Manishearth left a comment

Choose a reason for hiding this comment

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

overall lgtm, nice improvement

r=me whether or not you decide to move stuff into utils

@Jarcho
Copy link
Contributor Author

Jarcho commented Jun 12, 2023

@bors r=Manishearth

@bors
Copy link
Contributor

bors commented Jun 12, 2023

📌 Commit 949712c has been approved by Manishearth

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Jun 12, 2023

⌛ Testing commit 949712c with merge 841f219...

@bors
Copy link
Contributor

bors commented Jun 12, 2023

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: Manishearth
Pushing 841f219 to master...

@bors bors merged commit 841f219 into rust-lang:master Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

explicit_iter_loop should warn &[T].iter()
4 participants