rust/library/alloc/src
bors da1e0d1d75 Auto merge of #116218 - tgross35:const-maybe-uninit-zeroed, r=dtolnay
Stabilize `const_maybe_uninit_zeroed` and `const_mem_zeroed`

Make `MaybeUninit::zeroed` and `mem::zeroed` const stable. Newly stable API:

```rust
// core::mem
pub const unsafe fn zeroed<T>() ->;

impl<T> MaybeUninit<T> {
    pub const fn zeroed() -> MaybeUninit<T>;
}
```

This relies on features based around `const_mut_refs`. Per `@RalfJung,` this should be OK since we do not leak any `&mut` to the user.

For this to be possible, intrinsics `assert_zero_valid` and `assert_mem_uninitialized_valid` were made const stable.

Tracking issue: #91850
Zulip discussion: https://rust-lang.zulipchat.com/#narrow/stream/146212-t-compiler.2Fconst-eval/topic/.60const_mut_refs.60.20dependents

r? libs-api
`@rustbot` label -T-libs +T-libs-api +A-const-eval
cc `@RalfJung`  `@oli-obk` `@rust-lang/wg-const-eval`
2023-11-05 05:56:21 +00:00
..
alloc run alloc benchmarks in Miri and fix UB 2022-11-07 10:34:04 +01:00
boxed More IS_ZST in library 2023-04-21 16:29:27 -07:00
collections mark constructor of BinaryHeap as const fn 2023-10-28 21:30:43 +08:00
ffi fixed documentation of from<CString> for Rc<CStr>: Arc -> Rc 2023-07-02 10:07:52 +06:00
raw_vec Add a unit test for zero-sized types in RawVec. 2021-11-26 19:30:45 +11:00
rc Introduce alloc::::UniqueRc 2023-06-19 12:24:06 -07:00
slice ignore core, alloc and test tests that require unwinding on panic=abort 2023-06-13 15:53:24 +02:00
sync Add Arc::into_inner for safely discarding Arcs without calling the destructor on the inner type. 2023-01-22 01:43:25 +09:00
testing Share testing utilities with non-btree test cases 2022-05-02 10:07:50 +02:00
vec Increase the reach of panic_immediate_abort 2023-10-29 09:31:07 -04:00
alloc.rs Increase the reach of panic_immediate_abort 2023-10-29 09:31:07 -04:00
borrow.rs Add more diagnostic items for clippy 2023-10-05 18:21:47 -04:00
boxed.rs delegate box error provide 2023-10-31 16:35:59 +08:00
fmt.rs Improve documentation on when signes are printed by default 2023-09-03 00:13:44 +02:00
lib.rs Auto merge of #116218 - tgross35:const-maybe-uninit-zeroed, r=dtolnay 2023-11-05 05:56:21 +00:00
macros.rs Update doc for alloc::format! and core::concat! 2023-09-06 15:11:21 +02:00
raw_vec.rs Auto merge of #117503 - kornelski:hint-try-reserved, r=workingjubilee 2023-11-05 00:03:41 +00:00
rc.rs Auto merge of #116407 - Mark-Simulacrum:bootstrap-bump, r=onur-ozkan 2023-10-14 05:44:48 +00:00
slice.rs Add suggestion for some #[deprecated] items 2023-08-21 12:51:51 +03:00
str.rs [nit] Fix a comment typo. 2023-08-15 14:26:14 -05:00
string.rs Rollup merge of #95967 - CAD97:from-utf16, r=dtolnay 2023-10-11 03:53:16 +03:00
sync.rs Auto merge of #116407 - Mark-Simulacrum:bootstrap-bump, r=onur-ozkan 2023-10-14 05:44:48 +00:00
task.rs Updating Wake example to use new 'pin!' macro 2023-04-25 13:50:50 +02:00
tests.rs fix an alloc test 2023-03-03 17:47:48 +00:00