use derivative::Derivative;
#[derive(Derivative)]
#[derivative(Debug)]
struct Foo {}

cargo check and cargo build both pass.
rust-analyzer version: 427061d 2022-06-19
rustc version: I tested both rustc 1.61.0 (fe5b13d68 2022-05-18) & rustc 1.63.0-nightly (5750a6aa2 2022-06-20)
Possibly-related issue: #12582