os-rust/library/alloc
Matthias Krüger 790d9f349b
Rollup merge of #106276 - Sp00ph:unify_slice_ranges, r=the8472
Fix `vec_deque::Drain` FIXME

In my original `VecDeque` rewrite, I didn't use `VecDeque::slice_ranges` in `Drain::as_slices`, even though that's basically the exact use case for `slice_ranges`. The reason for this was that a `VecDeque` wrapped in a `Drain` actually has its length set to `drain_start`, so that there's no potential use after free if you `mem::forget` the `Drain`. I modified `slice_ranges` to accept an explicit `len` parameter instead, which it now uses to bounds check the given range. This way, `Drain::as_slices` can use `slice_ranges` internally instead of having to basically just copy paste the `slice_ranges` code. Since `slice_ranges` is just an internal helper function, this shouldn't change the user facing behavior in any way.
2023-03-11 12:55:41 +01:00
..
benches Auto merge of #106241 - Sp00ph:vec_deque_iter_methods, r=the8472 2023-02-18 20:12:35 +00:00
src Rollup merge of #106276 - Sp00ph:unify_slice_ranges, r=the8472 2023-03-11 12:55:41 +01:00
tests Add test for VecDeque::append ZST capacity overflow 2023-02-25 13:50:56 -05:00
Cargo.toml Update rand in the stdlib tests, and remove the getrandom feature from it 2023-01-04 14:52:41 -08:00