about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-05-26 02:13:25 +0200
committerGitHub <noreply@github.com>2019-05-26 02:13:25 +0200
commitf185ee5fda65a82d0efdfe0504e2712cecf18cdf (patch)
treedca8502ddbd51edb1ff99893a7ae193121ad73da /src/test
parent24cc368118e434719bee711ad34f0a370b27231d (diff)
parent428ab7e1bd77b82db30dc574b3f9c4fe0a7c77f6 (diff)
downloadrust-f185ee5fda65a82d0efdfe0504e2712cecf18cdf.tar.gz
rust-f185ee5fda65a82d0efdfe0504e2712cecf18cdf.zip
Rollup merge of #61114 - RalfJung:vec, r=Gankro
Vec: avoid creating slices to the elements

Instead of `self.deref_mut().as_mut_ptr()` to get a raw pointer to the buffer, use `self.buf.ptr_mut()`. This (a) avoids creating a unique reference to all existing elements without any need, and (b) creates a pointer that can actually be used for the *entire* buffer, and not just for the part of it covered by `self.deref_mut()`.

I also got worried about `RawVec::ptr` returning a `*mut T` from an `&self`, so I added both a mutable and an immutable version.

Cc @Gankro in particular for the `assume` changes -- I don't know why that is not in `Unique`, but I moved it up from `Vec::deref` to `RawVec::ptr` to avoid having to repeat it everywhere.

Fixes https://github.com/rust-lang/rust/issues/60847
Diffstat (limited to 'src/test')
0 files changed, 0 insertions, 0 deletions