Commit e6510ba
authored
Rollup merge of rust-lang#72584 - CAD97:stabilize-58957, r=dtolnay
Stabilize vec::Drain::as_slice
and add `AsRef<[T]> for Drain<'_, T>`.
Tracking issue: rust-lang#58957. Does not stabilize `slice::IterMut::as_slice` yet. cc @cuviper
This PR proposes stabilizing just the `vec::Drain::as_slice` part of that tracking issue.
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.)1 file changed
+8
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2779 | 2779 | | |
2780 | 2780 | | |
2781 | 2781 | | |
2782 | | - | |
2783 | 2782 | | |
2784 | 2783 | | |
2785 | 2784 | | |
2786 | 2785 | | |
2787 | 2786 | | |
2788 | 2787 | | |
2789 | | - | |
| 2788 | + | |
2790 | 2789 | | |
2791 | 2790 | | |
2792 | 2791 | | |
2793 | 2792 | | |
2794 | 2793 | | |
| 2794 | + | |
| 2795 | + | |
| 2796 | + | |
| 2797 | + | |
| 2798 | + | |
| 2799 | + | |
| 2800 | + | |
2795 | 2801 | | |
2796 | 2802 | | |
2797 | 2803 | | |
| |||
0 commit comments