diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-05-26 02:13:25 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-05-26 02:13:25 +0200 |
| commit | f185ee5fda65a82d0efdfe0504e2712cecf18cdf (patch) | |
| tree | dca8502ddbd51edb1ff99893a7ae193121ad73da /src/test/ui/thinlto | |
| parent | 24cc368118e434719bee711ad34f0a370b27231d (diff) | |
| parent | 428ab7e1bd77b82db30dc574b3f9c4fe0a7c77f6 (diff) | |
| download | rust-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/ui/thinlto')
0 files changed, 0 insertions, 0 deletions
