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
..
boxed library: Use size_of from the prelude instead of imported 2025-03-06 20:20:38 -08:00
collections Rollup merge of #138161 - HeroicKatora:heap-peek-mut-refresh, r=dtolnay 2025-03-12 08:06:46 +01:00
ffi Fully test the alloc crate through alloctests 2025-03-07 19:11:13 +00:00
raw_vec Swap usize -> ptr transmute for strict_pov API 2025-03-26 21:41:11 +00:00
vec Delete unreacheable #[rustc_on_unimplemented] 2025-03-30 15:25:27 +02:00
alloc.rs Mark imports of #[rustc_std_internal_symbol] items with this attribute 2025-03-17 14:06:56 +00:00
borrow.rs Fully test the alloc crate through alloctests 2025-03-07 19:11:13 +00:00
boxed.rs remove remnants of const_box feature 2025-03-21 21:02:06 +01:00
bstr.rs Fully test the alloc crate through alloctests 2025-03-07 19:11:13 +00:00
fmt.rs Added struct fmt::FormattingOptions 2024-12-05 21:48:01 +01:00
lib.miri.rs add 'x.py miri', and make it work for 'library/{core,alloc,std}' 2024-04-03 20:27:20 +02:00
lib.rs Pass Alignment for RawVecInner::new_in 2025-03-26 21:41:11 +00:00
macros.rs Fully test the alloc crate through alloctests 2025-03-07 19:11:13 +00:00
rc.rs fix copy typo 2025-03-10 16:46:18 +08:00
slice.rs Fully test the alloc crate through alloctests 2025-03-07 19:11:13 +00:00
str.rs Fully test the alloc crate through alloctests 2025-03-07 19:11:13 +00:00
string.rs Stabilize const_vec_string_slice 2025-03-08 17:03:52 +01:00
sync.rs Remove PartialEq::ne for UniqueArc 2025-03-22 15:14:49 +08:00
task.rs Stabilize noop_waker 2024-12-05 14:14:17 -08:00