diff options
| author | bors <bors@rust-lang.org> | 2025-04-06 23:07:48 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-04-06 23:07:48 +0000 |
| commit | 25a615bf829b9f6d6f22da537e3851043f92e5f2 (patch) | |
| tree | 80edbfd363563909d4d3e6fd2eab056b9c919f34 /compiler/rustc_pattern_analysis/src | |
| parent | 2fa8b11f0933dae9b4e5d287cc10c989218e8b36 (diff) | |
| parent | aadfd810f62e2e07440672cc20a0540c9904d69b (diff) | |
| download | rust-25a615bf829b9f6d6f22da537e3851043f92e5f2.tar.gz rust-25a615bf829b9f6d6f22da537e3851043f92e5f2.zip | |
Auto merge of #138951 - jwnrt:alloc-raw-vec-strict-prov, r=Noratrieb
Replace last `usize` -> `ptr` transmute in `alloc` with strict provenance API This replaces the `usize -> ptr` transmute in `RawVecInner::new_in` with a strict provenance API (`NonNull::without_provenance`). The API is changed to take an `Alignment` which encodes the non-null constraint needed for `Unique` and allows us to do the construction safely. Two internal-only APIs were added to let us avoid UB-checking in this hot code: `Layout::alignment` to get the `Alignment` type directly rather than as a `usize`, and `Unique::from_non_null` to create `Unique` in const context without a transmute.
Diffstat (limited to 'compiler/rustc_pattern_analysis/src')
0 files changed, 0 insertions, 0 deletions
