field_reassign_with_default lint suggest invalid code #6344
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
I tried this code:
I expected to see this happen: no field_reassign_with_default warning
Instead, this happened:
Field assignment outside of initializer for an instance created with Default::default()
Suggestion implies the following:
This doesn't compile, since z is private and Foo cannot be initialized in this way.
Meta
cargo clippy -V
: clippy 0.0.212 (5404efc 2020-11-11)rustc -Vv
:The text was updated successfully, but these errors were encountered: