Skip to content

Make as{_mut,}_slice on array::IntoIter public - #79194

Merged
bors merged 1 commit into
rust-lang:masterfrom
est31:array_into_iter_slice
Nov 20, 2020
Merged

Make as{_mut,}_slice on array::IntoIter public#79194
bors merged 1 commit into
rust-lang:masterfrom
est31:array_into_iter_slice

Conversation

@est31

@est31est31 commented Nov 19, 2020

Copy link
Copy Markdown
Member

The functions are useful in cases where you want to move data out of the IntoIter in bulk, by transmute_copy'ing the slice and then forgetting the IntoIter.

In the compiler, this is useful for providing a sped up IntoIter implementation. One can alternatively provide a separate allocate_array function but one can avoid duplicating some logic by passing everything through the generic iterator using interface.

As per suggestion in https://github.com/rust-lang/rust/pull/78569/files#r526506964

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @kennytm

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

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 19, 2020
@est31

Copy link
Copy Markdown
MemberAuthor

@scottmcm

Copy link
Copy Markdown
Member

Oh, they were already there? 😂

As I said in the referenced comment, I think these are at least fine as unstable because the slice iterators set the precedent.
r? @scottmcm
@bors r+ rollup

@bors

bors commented Nov 19, 2020

Copy link
Copy Markdown
Collaborator

📌 Commit de08df2 has been approved by scottmcm

@borsbors 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 Nov 19, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Nov 19, 2020
…tmcm
Make as{_mut,}_slice on array::IntoIter public
The functions are useful in cases where you want to move data out of the IntoIter in bulk, by transmute_copy'ing the slice and then forgetting the IntoIter.
In the compiler, this is useful for providing a sped up IntoIter implementation. One can alternatively provide a separate allocate_array function but one can avoid duplicating some logic by passing everything through the generic iterator using interface.
As per suggestion in https://github.com/rust-lang/rust/pull/78569/files#r526506964
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Nov 19, 2020
…tmcm
Make as{_mut,}_slice on array::IntoIter public
The functions are useful in cases where you want to move data out of the IntoIter in bulk, by transmute_copy'ing the slice and then forgetting the IntoIter.
In the compiler, this is useful for providing a sped up IntoIter implementation. One can alternatively provide a separate allocate_array function but one can avoid duplicating some logic by passing everything through the generic iterator using interface.
As per suggestion in https://github.com/rust-lang/rust/pull/78569/files#r526506964
This was referenced Nov 19, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 20, 2020
Rollup of 11 pull requests
Successful merges:
- rust-lang#79119 (Clarify availability of atomic operations)
- rust-lang#79123 (Add u128 and i128 integer tests)
- rust-lang#79177 (Test drop order for (destructuring) assignments)
- rust-lang#79181 (rustdoc: add [src] links to methods on a trait's page)
- rust-lang#79183 (Make compiletest testing use the local sysroot)
- rust-lang#79185 (expand/resolve: Pre-requisites to "Turn `#[derive]` into a regular macro attribute")
- rust-lang#79193 (Revert rust-lang#78969 "Normalize function type during validation")
- rust-lang#79194 (Make as{_mut,}_slice on array::IntoIter public)
- rust-lang#79204 (Add jyn514 email alias to mailmap)
- rust-lang#79212 (Move `rustc_ty` -> `rustc_ty_utils`)
- rust-lang#79217 (Add the "memcpy" doc alias to slice::copy_from_slice)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit 169e221 into rust-lang:masterNov 20, 2020
@rustbotrustbot added this to the 1.50.0 milestone Nov 20, 2020
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: 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.

6 participants

@est31@rust-highfive@scottmcm@bors@kennytm@rustbot