Compiler should reject union field definitions having default values #142555
Labels
C-bug
Category: This is a bug.
F-default_field_values
`#![feature(default_field_values)]`
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I tried this code:
I expected to see this happen:
The compiler rejects the program. The default field values RFC does not mention unions,
Default
cannot be derived for unions, and there appears to be no way to use these default field values.Instead, this happened:
The compiler accepts the program.
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: