Closed
Description
This is a tracking issue for the RFC "Future-proofing enums/structs with #[non_exhaustive] attribute" (rust-lang/rfcs#2008).
Steps:
- Implement the RFC (mentoring instructions below) -- done in PR RFC 2008: Future-proofing enums/structs with #[non_exhaustive] attribute #45394
- Adjust documentation (see instructions on forge)
- Stabilization PR (see instructions on forge)
Issues to be resolved prior to stabilization
-
#[non_exhaustive]
is not yet implemented for enum variants. - Current behavior on unions. The current implementation (Tracking issue for RFC 2008: Future-proofing enums/structs with #[non_exhaustive] attribute #44109) sometimes ignores non_exhaustive on unions, sometimes reports an error.
- In addition, the attribute is not currently validated (neither syntactic form nor location), so it can be written in weird forms (
#[non_exhaustive(foo)]
) and in arbitrary locations, including suspicious ones like traits(#[non_exhaustive] trait Trait {}
). - Fix [nightly regression] E0639 + adding #[non_exhaustive] to io::ErrorKind is a breaking change #53549
Metadata
Metadata
Assignees
Labels
Blocker: Approved by a merged RFC and implemented but not stabilized.Blocker: Implemented in the nightly compiler and unstable.Category: An issue tracking the progress of sth. like the implementation of an RFCCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.`#![feature(non_exhaustive)]`Relevant to the language 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.