rust/library/alloc
许杰友 Jieyou Xu (Joe) 9f4039fcd5
Rollup merge of #127415 - AljoschaMeyer:master, r=dtolnay
Add missing try_new_uninit_slice_in and try_new_zeroed_slice_in

The methods for fallible slice allocation in a given allocator were missing from `Box`, which was an oversight according to https://github.com/rust-lang/wg-allocators/issues/130

This PR adds them as `try_new_uninit_slice_in` and `try_new_zeroed_slice_in`. I simply copy-pasted the implementations of `try_new_uninit_slice` and `try_new_zeroed_slice` and adusted doc comment, typings, and the allocator it uses internally.

Also adds missing punctuation to the doc comments of `try_new_uninit_slice` and `try_new_zeroed_slice`.

Related issue is https://github.com/rust-lang/rust/issues/32838 (Allocator traits and std::heap) *I think*. Also relevant is https://github.com/rust-lang/rust/issues/63291, but I did not add the corresponding `#[unstable]` proc macro, since `try_new_uninit_slice` and `try_new_zeroed_slice` are also not annotated with it.
2024-07-22 16:44:03 +08:00
..
benches disable benches in Miri 2024-04-07 09:58:10 +02:00
src Rollup merge of #127415 - AljoschaMeyer:master, r=dtolnay 2024-07-22 16:44:03 +08:00
tests Mark format! with must_use hint 2024-07-06 14:24:20 +02:00
Cargo.toml Cleanup bootstrap check-cfg 2024-06-27 11:30:03 +02:00