Description
This is a tracking issue for the RFC "Deprecate uninitialized
in favor of a new MaybeUninit
type" (rust-lang/rfcs#1892).
This issue specifically tracks the following unstable methods:
impl<T> MaybeUninit<T> {
pub unsafe fn assume_init_read(&self) -> T { ... }
pub unsafe fn assume_init_drop(&mut self) { ... }
}
and it tracks const-ness of
impl<T> MaybeUninit<T> {
pub const fn write(&mut self, val: T) -> &mut T { ... }
}
Metadata
Metadata
Assignees
Labels
Area: raw pointers, MaybeUninit, NonNullBlocker: Implemented in the nightly compiler and unstable.Category: An issue tracking the progress of sth. like the implementation of an RFCLibs issues that are tracked on the team's project board.Relevant to the library API team, which will review and decide on the PR/issue.This issue / PR is in PFCP or FCP with a disposition to merge it.The final comment period is finished for this PR / Issue.This issue requires a nightly compiler in some way.
Activity
MaybeUninit<T>
gates #63570RalfJung commentedon Aug 14, 2019
Latest status here:
I am beginning to think that
read
should probably be renamed toread_init
orread_assume_init
or so, something that indicates that this may only be done after initialization is complete.Rollup merge of rust-lang#63570 - rust-lang:maybe-uninit-gates, r=Ral…
Rollup merge of rust-lang#63570 - rust-lang:maybe-uninit-gates, r=Ral…
SimonSapin commentedon Oct 18, 2019
@RalfJung Should the same logic apply to
get_ref
andget_mut
? #63568#![feature(maybe_uninit_ref)]
#63568RalfJung commentedon Oct 19, 2019
That depends on whether references to invalid data are UB or not. If yes, then certainly. If not, then maybe.
Currently they are UB but that's just because it is the more conservative choice.
142 remaining items