rust/library/alloc/src
Dylan DPC c731157395
Rollup merge of #95376 - WaffleLapkin:drain_keep_rest, r=dtolnay
Add `vec::Drain{,Filter}::keep_rest`

This PR adds `keep_rest` methods to `vec::Drain` and `vec::DrainFilter` under `drain_keep_rest` feature gate:
```rust
// mod alloc::vec

impl<T, A: Allocator> Drain<'_, T, A> {
    pub fn keep_rest(self);
}

impl<T, F, A: Allocator> DrainFilter<'_, T, F, A>
where
    F: FnMut(&mut T) -> bool,
{
    pub fn keep_rest(self);
}
```

Both these methods cancel draining of elements that were not yet yielded from the iterators. While this needs more testing & documentation, I want at least start the discussion. This may be a potential way out of the "should `DrainFilter` exhaust itself on drop?" argument.
2022-08-30 11:26:47 +05:30
..
alloc Replace most uses of pointer::offset with add and sub 2022-08-21 02:21:41 +04:00
boxed Move error trait into core 2022-08-22 13:28:25 -07:00
collections Rollup merge of #95005 - ssomers:btree_static_assert, r=thomcc 2022-08-26 14:08:43 +02:00
ffi Move error trait into core 2022-08-22 13:28:25 -07:00
raw_vec Add a unit test for zero-sized types in RawVec. 2021-11-26 19:30:45 +11:00
rc Use Box::new() instead of box syntax in alloc tests 2022-05-29 00:41:14 +02:00
sync add some Miri-only tests 2022-08-18 18:07:39 -04:00
vec Rollup merge of #95376 - WaffleLapkin:drain_keep_rest, r=dtolnay 2022-08-30 11:26:47 +05:30
alloc.rs Adjust cfgs 2022-08-12 16:28:15 -04:00
borrow.rs Intra-doc-link-ify reference to Clone::clone_from 2022-07-08 22:47:07 +02:00
boxed.rs Rollup merge of #99570 - XrXr:box-from-slice-docs, r=thomcc 2022-08-28 09:35:13 +02:00
fmt.rs remove useless cold 2022-05-29 20:40:56 +01:00
lib.rs Move error trait into core 2022-08-22 13:28:25 -07:00
macros.rs Extra documentation for new formatting feature 2022-08-21 15:28:27 -04:00
raw_vec.rs alloc: fix no_global_oom_handling warnings 2022-06-29 04:44:23 +02:00
rc.rs Use byte_sub in [a]rc impl 2022-07-10 15:16:51 +04:00
slice.rs Rollup merge of #93162 - camsteffen:std-prim-docs, r=Mark-Simulacrum 2022-08-22 11:45:40 +05:30
str.rs Rollup merge of #93162 - camsteffen:std-prim-docs, r=Mark-Simulacrum 2022-08-22 11:45:40 +05:30
string.rs Auto merge of #99917 - yaahc:error-in-core-move, r=thomcc 2022-08-23 19:48:55 +00:00
sync.rs Move error trait into core 2022-08-22 13:28:25 -07:00
task.rs Document From implementations for Waker and RawWaker 2021-04-22 14:16:33 -07:00
tests.rs Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00