field_reassign_with_default on struct with #[non_exhaustive]
or private fields is false positive
#6559
Labels
C-bug
Category: Clippy is not doing the correct thing
I-false-positive
Issue: The lint was triggered on code it shouldn't have
Lint name:
field_reassign_with_default
Given a library that contains a struct with a
#[non_exhaustive]
attribute on it:Code like this causes a clippy warning:
Clippy would prefer to see the following code, which is a compiler error.
Note that due to the rules of
#[non_exhaustive]
application, this is only an error when the struct is defined in a different crate (which is why I'm not able to provide a playground link).Meta
cargo clippy -V
:clippy 0.0.212 (e1884a8e 2020-12-29)
rustc -Vv
:The text was updated successfully, but these errors were encountered: