-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Closed
Labels
B-RFC-approvedBlocker: Approved by a merged RFC but not yet implemented.Blocker: Approved by a merged RFC but not yet implemented.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCE-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-langRelevant to the language teamRelevant to the language teamT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
NEW TRACKING ISSUE = #63566
This is a tracking issue for the RFC "Deprecate uninitialized in favor of a new MaybeUninit type" (rust-lang/rfcs#1892).
Steps:
- Implement the RFC (cc @rust-lang/libs)
- Adjust documentation (in stabilize core parts of MaybeUninit #60445)
- Stabilization PR (in stabilize core parts of MaybeUninit #60445)
Unresolved questions:
Should we have a safe setter that returns an&mut T?Should we renameMaybeUninit? (RenameMaybeUninittoMaybeUninitialized#56138)Should we renameinto_inner? Should it be more liketakeinstead and take&mut self?ShouldMaybeUninit<T>beCopyforT: Copy?- Should we allow calling
get_refandget_mut(but not reading from the returned references) before data got initialized? (AKA: "Are references to uninitialized data insta-UB, or only UB when being read from?") Should we rename it similar tointo_inner? Can we make(done)into_inner(or whatever it ends up being called) panic whenTis uninhabited, likemem::uninitializeddoes currently?Seems like we want to not deprecatemem::zeroed. We should however remember to also update its documentation together withMaybeUninit, make sure people are aware that this is insta-UB if all-0-bits does not satisfy the type's validity invariant.
mark-i-m
Metadata
Metadata
Assignees
Labels
B-RFC-approvedBlocker: Approved by a merged RFC but not yet implemented.Blocker: Approved by a merged RFC but not yet implemented.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCE-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-langRelevant to the language teamRelevant to the language teamT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.