Tracking Issue for pointer methods returning MaybeUninit<T>
#75402
Open
Description
opened on Aug 11, 2020
This is a tracking issue for methods on pointer types returning MaybeUninit
: as_uninit_ref/mut
and as_uninit_slice(_mut)
on mutable and const raw pointers and NonNull
.
The feature gate for the issue is #![feature(ptr_as_uninit)]
.
About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also uses as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Steps
- Merge Implementation (cc @rust-lang/T-libs, cc @RalfJung)
- Adjust documentation (see instructions on rustc-dev-guide)
- Stabilization PR (see instructions on rustc-dev-guide)
Unresolved Questions
- Currently, there is no unchecked non-null version for raw pointers without pointer casts. Either we want
as_uninit_ref_unchecked
orOption::unwrap_unchecked
- Should these operations on
NonNull
takeself
,&self
,&mut self
? Also see the discussion at ChangeNonNull::as_uninit_*
to take self by value (as opposed to reference), matching primitive pointers. #96100.
Implementation history
- Initial implementation: Add
as_uninit
-like methods to pointer types and unify documentation ofas_ref
methods #75392
Activity