Adding non_exhaustive should disable missing_copy_implementations #116766
Labels
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
C-bug
Category: This is a bug.
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I have the following minimal example:
It does as I expect and gives the error:
However, since this enum is going to have more options added to it in the future, for example,
B(String),
I go ahead and label it asnon_exhaustive
:I would expect that this would disable the
missing_copy_implementations
lint in this case. This is because, otherwise adding aCopy
implementation, e.g.:would then break when, in the future, I add my
B
variant:with:
In short, I would expect that adding
non_exhaustive
would disable themissing_copy_implementations
lint as it's not future-proof, and the whole point of thenon_exhaustive
attribute is to say "that a type or variant may have more fields or variants added in the future".The text was updated successfully, but these errors were encountered: