rust/library/alloctests
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
..
benches Move all alloc integration tests to a new alloctests crate 2025-03-07 19:11:11 +00:00
testing Fully test the alloc crate through alloctests 2025-03-07 19:11:13 +00:00
tests Rollup merge of #138546 - GuillaumeGomez:integer-to-string-tests, r=Amanieu 2025-04-05 13:18:14 +11:00
Cargo.toml Fully test the alloc crate through alloctests 2025-03-07 19:11:13 +00:00
lib.rs Swap usize -> ptr transmute for strict_pov API 2025-03-26 21:41:11 +00:00