-
Notifications
You must be signed in to change notification settings - Fork 9
Box is missing try_new_uninit_slice_in
#130
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
This is an oversight, a PR to add it is welcome. |
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
added a commit
to AljoschaMeyer/rust
that referenced
this issue
Jul 6, 2024
The methods for fallible slice allocation in a given allocator were missing, which was an oversight according to rust-lang/wg-allocators#130 This PR adds them as `try_new_uninit_slice_in` and `try_new_zeroed_slice_in`. Also adds missing punctuation to the doc comments of ` try_new_uninit_slice` and `try_new_zeroed_slice`
Here we go: rust-lang/rust#127415 |
That's perfect thank you. |
jieyouxu
added a commit
to jieyouxu/rust
that referenced
this issue
Jul 22, 2024
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 rust-lang/wg-allocators#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 rust-lang#32838 (Allocator traits and std::heap) *I think*. Also relevant is rust-lang#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.
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Jul 22, 2024
Rollup merge of rust-lang#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 rust-lang/wg-allocators#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 rust-lang#32838 (Allocator traits and std::heap) *I think*. Also relevant is rust-lang#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.
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Hi,
while
Box
has bothtry_new_uninit_slice
andnew_uninit_slice_in
, it lackstry_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
The text was updated successfully, but these errors were encountered: