rust-lang / wg-allocators

Home of the Allocators working group: Paving a path for a standard set of allocator traits to be used in collections!
http://bit.ly/hello-wg-allocators
207 stars 9 forks source link

Box is missing `try_new_uninit_slice_in` #130

Open AljoschaMeyer opened 1 month ago

AljoschaMeyer commented 1 month ago

Hi,

while Box has both try_new_uninit_slice and new_uninit_slice_in, it lacks try_new_uninit_slice_in to fallibly allocate a slice of uninitialized memory with a given allocator. Is this deliberate or an oversight? What could be a good workaround for implementing this oneself?

Apologies if this is not the appropriate repo for this sort of question/feature suggestion.

Cheers, Aljoscha

Amanieu commented 1 month ago

This is an oversight, a PR to add it is welcome.

AljoschaMeyer commented 1 month ago

Would be happy to make a PR. Please tell me if a PR to the main branch of https://github.com/rust-lang/rust is not what to do here. Done! https://github.com/rust-lang/rust/pull/127415

Random piece of feedback: https://std-dev-guide.rust-lang.org/about.html never tells the reader which repository, branches, directories, etc to interact with.

AljoschaMeyer commented 1 month ago

Here we go: https://github.com/rust-lang/rust/pull/127415

Amanieu commented 1 month ago

That's perfect thank you.