Files
rust/library/alloc/src
bors 25a615bf82 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.
2025-04-06 23:07:48 +00:00
..
2025-03-21 21:02:06 +01:00
2024-12-05 21:48:01 +01:00
2025-03-26 21:41:11 +00:00
2025-03-10 16:46:18 +08:00
2025-03-08 17:03:52 +01:00
2025-03-22 15:14:49 +08:00
2024-12-05 14:14:17 -08:00