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

Upgrade array_into_iter lint to include Deref-to-array types. #88512

Merged
merged 3 commits into from
Sep 2, 2021

Conversation

m-ou-se
Copy link
Member

@m-ou-se m-ou-se commented Aug 30, 2021

Fixes #88099

Fixes the issue mentioned here: #84147 (comment)

@m-ou-se m-ou-se added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix`. A-edition-2021 Area: The 2021 edition labels Aug 30, 2021
@rust-highfive
Copy link
Collaborator

r? @cjgillot

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 30, 2021
@m-ou-se
Copy link
Member Author

m-ou-se commented Aug 31, 2021

cc @estebank because diagnostics

Comment on lines -82 to -85
help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
|
LL | IntoIterator::into_iter(Box::new(small));
| ++++++++++++++++++++++++ ~
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we still emit this suggestion in any case?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, for [1, 2, 3].into_iter(). See line 65 in this file.

Copy link
Contributor

@estebank estebank left a comment

Choose a reason for hiding this comment

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

The changes look reasonable to me.

@cjgillot
Copy link
Contributor

cjgillot commented Sep 1, 2021

r? @estebank

@rust-highfive rust-highfive assigned estebank and unassigned cjgillot Sep 1, 2021
@m-ou-se m-ou-se added this to Not-really blockers (?) in 2021 Edition Blockers Sep 2, 2021
@estebank
Copy link
Contributor

estebank commented Sep 2, 2021

@bors r+

@bors
Copy link
Contributor

bors commented Sep 2, 2021

📌 Commit 96d4666 has been approved by estebank

@bors bors 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 Sep 2, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 2, 2021
Rollup of 12 pull requests

Successful merges:

 - rust-lang#88177 (Stabilize std::os::unix::fs::chroot)
 - rust-lang#88505 (Use `unwrap_unchecked` where possible)
 - rust-lang#88512 (Upgrade array_into_iter lint to include Deref-to-array types.)
 - rust-lang#88532 (Remove single use variables)
 - rust-lang#88543 (Improve closure dummy capture suggestion in macros.)
 - rust-lang#88560 (`fmt::Formatter::pad`: don't call chars().count() more than one time)
 - rust-lang#88565 (Add regression test for issue 83190)
 - rust-lang#88567 (Remove redundant `Span` in `QueryJobInfo`)
 - rust-lang#88573 (rustdoc: Don't panic on ambiguous inherent associated types)
 - rust-lang#88582 (Implement rust-lang#88581)
 - rust-lang#88589 (Correct doc comments inside `use_expr_visitor.rs`)
 - rust-lang#88592 (Fix ICE in const check)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit ea82d06 into rust-lang:master Sep 2, 2021
2021 Edition Blockers automation moved this from Not-really blockers (?) to Completed items Sep 2, 2021
@rustbot rustbot added this to the 1.56.0 milestone Sep 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-edition-2021 Area: The 2021 edition A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix`. 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
2021 Edition Blockers
  
Completed items
Development

Successfully merging this pull request may close these issues.

array_into_iter does not fire for lazy_static arrays
6 participants