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

Simplify array::IntoIter #75271

Merged
merged 1 commit into from
Aug 8, 2020
Merged

Simplify array::IntoIter #75271

merged 1 commit into from
Aug 8, 2020

Conversation

cuviper
Copy link
Member

@cuviper cuviper commented Aug 7, 2020

  • Initialization can use transmute_copy to do the bitwise copy.
  • as_slice can use get_unchecked and MaybeUninit::slice_get_ref,
    and as_mut_slice can do similar.
  • next and next_back can use the corresponding Range methods.
  • Clone doesn't need any unsafety, and we can dynamically update the
    new range to get partial drops if T::clone panics.

r? @LukasKalbertodt

- Initialization can use `transmute_copy` to do the bitwise copy.
- `as_slice` can use `get_unchecked` and `MaybeUninit::slice_get_ref`,
  and `as_mut_slice` can do similar.
- `next` and `next_back` can use the corresponding `Range` methods.
- `Clone` doesn't need any unsafety, and we can dynamically update the
  new range to get partial drops if `T::clone` panics.
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 7, 2020
Copy link
Member

@LukasKalbertodt LukasKalbertodt 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, thanks :)

@LukasKalbertodt
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Aug 8, 2020

📌 Commit a2cfc74 has been approved by LukasKalbertodt

@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 Aug 8, 2020
@bors
Copy link
Contributor

bors commented Aug 8, 2020

⌛ Testing commit a2cfc74 with merge ceedf1d...

@bors
Copy link
Contributor

bors commented Aug 8, 2020

☀️ Test successful - checks-actions, checks-azure
Approved by: LukasKalbertodt
Pushing ceedf1d to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 8, 2020
@bors bors merged commit ceedf1d into rust-lang:master Aug 8, 2020
@cuviper cuviper deleted the array-iter branch August 9, 2020 23:36
@cuviper cuviper added this to the 1.47.0 milestone May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants