Tracking Issue for box_vec_non_null
· Issue #130364 · rust-lang/rust (original) (raw)
Feature gate: #![feature(box_vec_non_null)]
This is a tracking issue for convenience methods for conversion between NonNull
and Vec
/Box
.
Public API
impl<T: ?Sized> Box { pub unsafe fn from_non_null(ptr: NonNull) -> Self { .... } } impl<T: ?Sized, A: Allocator> Box<T, A> { pub const unsafe fn from_non_null_in(raw: NonNull, alloc: A) -> Self { .... } pub fn into_non_null(b: Self) -> NonNull { .... } pub fn into_non_null_with_allocator(b: Self) -> (NonNull, A) { .... } } impl Vec { pub unsafe fn from_parts(ptr: NonNull, length: usize, capacity: usize) -> Self { .... } } impl<T, A: Allocator> Vec<T, A> { pub unsafe fn from_parts_in(ptr: NonNull, length: usize, capacity: usize, alloc: A) -> Self { .... } pub fn into_parts(self) -> (NonNull, usize, usize) { .... } pub fn into_parts_with_alloc(self) -> (NonNull, usize, usize, A) { .... } pub const fn as_non_null(&mut self) -> NonNull { .... } }
Steps / History
- Implementation:
- ACP: Box/Vec/slice convenience NonNull methods libs-team#418
- Implementation PR: Add NonNull convenience methods to Box and Vec #130061
- ACP 2: Vec::as_non_null() method libs-team#440
- Implementation PR 2: Add Vec::as_non_null #130624
- Final comment period (FCP)1
- Stabilization PR
Unresolved Questions
- None yet.