diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-03-11 12:55:41 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-11 12:55:41 +0100 |
| commit | 790d9f349b061c8b7d113a3752b7e05c3304bccb (patch) | |
| tree | e21a043993e7023b6a9144d2c91051176547cdfc /compiler/rustc_codegen_llvm/src | |
| parent | e350fe4e608b653da47e8012d13ef701613e717b (diff) | |
| parent | acc876e42fce0dc3d6596f754dcfbc0ce07cabd6 (diff) | |
| download | rust-790d9f349b061c8b7d113a3752b7e05c3304bccb.tar.gz rust-790d9f349b061c8b7d113a3752b7e05c3304bccb.zip | |
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.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions
