-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
B-RFC-approvedBlocker: Approved by a merged RFC but not yet implemented.Blocker: Approved by a merged RFC but not yet implemented.B-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.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 RFCF-untagged_unions`#![feature(untagged_unions)]``#![feature(untagged_unions)]`T-langRelevant to the language teamRelevant to the language teamdisposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.
Description
Tracking issue for rust-lang/rfcs#1444.
Unresolved questions:
- Does assigning directly to a union field trigger a drop of the previous contents?
- When moving out of one field of a union, are the others considered invalidated? (1, 2, 3, 4)
- Answered by Union initialization and Drop rfcs#2514.
- Under what conditions can you implement
Copy
for a union? For example, what if some variants are of non-Copy type? All variants? - What interaction is there between unions and enum layout optimizations? (Unions interacting with Enum layout optimization #36394)
Open issues of high import:
- Matching on uninhabited unsafe places (union fields, raw pointer dereferences, etc.) allowed in safe code. #47412 -- MIR-based unsafety checker sometimes accepts unsafe accesses to union fields in presence of uninhabited fields
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.B-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.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 RFCF-untagged_unions`#![feature(untagged_unions)]``#![feature(untagged_unions)]`T-langRelevant to the language teamRelevant to the language teamdisposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.