rust/library/alloc/src
Guillaume Gomez 1c5db28ec3
Rollup merge of #123254 - stepancheg:thin-box-0-const-alloc, r=oli-obk
Do not allocate for ZST ThinBox (attempt 2 using const_allocate)

There's PR https://github.com/rust-lang/rust/pull/123184 which avoids allocation for ZST ThinBox.

That PR has an issue with unsoundness with padding in `MaybeUninit` (see comments in that PR). Also that PR relies on `Freeze` trait.

This PR is much simpler implementation which does not have this problem, but it uses `const_allocate` feature.

`@oli-obk` suggested that `const_allocate` should not be used for that feature. But I like how easy it to do this feature with `const_allocate`. Maybe it's OK to use `const_allocate` while `ThinBox` is unstable? Or, well, we can abandon this PR.

r? `@oli-obk`
2024-04-09 13:39:21 +02:00
..
alloc run alloc benchmarks in Miri and fix UB 2022-11-07 10:34:04 +01:00
boxed Do not allocate for ZST ThinBox attempt 2 (using const_allocate) 2024-04-05 19:55:00 +01:00
collections Add invariant to VecDeque::pop_* that len < cap if pop successful 2024-04-08 12:12:13 +02:00
ffi lib: fix some unnecessary_cast clippy lint 2024-03-25 23:19:40 +03:00
raw_vec try_with_capacity for RawVec 2024-03-01 18:20:48 +00:00
rc remove redundant imports 2023-12-10 10:56:22 +08:00
slice ignore core, alloc and test tests that require unwinding on panic=abort 2023-06-13 15:53:24 +02:00
sync Fix some Arc allocator leaks 2024-01-28 18:33:34 +01:00
testing Share testing utilities with non-btree test cases 2022-05-02 10:07:50 +02:00
vec Rename reserve_for_push to grow_one and fix comment. 2024-03-28 16:38:01 -07:00
alloc.rs step cfgs 2024-03-20 08:49:13 -04:00
borrow.rs Add more diagnostic items for clippy 2023-10-05 18:21:47 -04:00
boxed.rs Require DerefPure for patterns 2024-03-25 19:39:45 -04:00
fmt.rs docs: use correct link, use secondary example 2024-02-12 20:17:47 -05: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 Rollup merge of #123254 - stepancheg:thin-box-0-const-alloc, r=oli-obk 2024-04-09 13:39:21 +02:00
macros.rs Update doc for alloc::format! and core::concat! 2023-09-06 15:11:21 +02:00
raw_vec.rs Rename reserve_for_push to grow_one and fix comment. 2024-03-28 16:38:01 -07:00
rc.rs Require DerefPure for patterns 2024-03-25 19:39:45 -04:00
slice.rs lib: fix some unnecessary_cast clippy lint 2024-03-25 23:19:40 +03:00
str.rs Export core::str::from_raw_parts{,_mut} into alloc::str and std::str 2024-01-25 18:11:54 -08:00
string.rs doc: mention heap allocation earlier in String docs 2024-04-01 00:04:57 +03:00
sync.rs make a doctest less slow in Miri 2024-04-07 10:06:06 +02:00
task.rs lib: fix some unnecessary_cast clippy lint 2024-03-25 23:19:40 +03:00
tests.rs remove redundant imports 2023-12-10 10:56:22 +08:00