about summary refs log tree commit diff
path: root/src/test/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2020-06-08 09:55:20 +0200
committerGitHub <noreply@github.com>2020-06-08 09:55:20 +0200
commitb0559bebd800b763700063a6610f6416ea5679c0 (patch)
treecd879799beb234464da4076fc7042a63f8efcdea /src/test/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs
parent8484b9935c4d0a8e2209511a0094cc92ba09f561 (diff)
parent91f52a51a23f8c5e8c82c49bbf3ab1bb781d3b02 (diff)
downloadrust-b0559bebd800b763700063a6610f6416ea5679c0.tar.gz
rust-b0559bebd800b763700063a6610f6416ea5679c0.zip
Rollup merge of #72583 - CAD97:vec-iter-asref-slice, r=dtolnay
impl AsRef<[T]> for vec::IntoIter<T>

Adds `impl<T> AsRef<[T]> for vec::IntoIter<T>`. This mirrors the same trait impl for [`slice::Iter`](https://doc.rust-lang.org/nightly/std/slice/struct.Iter.html). Both types already offer `fn as_slice(&self) -> &[T]`, this just adds the trait impl for `vec::IntoIter`.

If/when `fn as_slice(&self) -> &[T]` stabilizes for `vec::Drain` and `slice::IterMut`, they should get `AsRef<[T]>` impls as well. As thus, tangentially related to #58957.

My ultimate goal here: being able to use `for<T, I: Iterator<Item=T> + AsRef<[T]>> I` to refer to `vec::IntoIter`, `vec::Drain`, and eventually `array::IntoIter`, as an approximation of the set of by-value iterators that can be "previewed" as by-ref iterators. (Actually expressing that as a trait requires GAT.)
Diffstat (limited to 'src/test/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs')
0 files changed, 0 insertions, 0 deletions