derive(Clone, Debug) should not prevent "field is never read" from firing · Issue #84647 · rust-lang/rust (original) (raw)

struct A { f: () } #[derive(Clone)] struct B { f: () }

fn main() { let _ = A { f: () }; let _ = B { f: () }; }

https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=ddbb661ad3a117642c4f750b31da4b18

Only A's field triggers the warning. It's clear why B doesn't do this, but it clearly should. Doesn't seem easy to fix though :(