Say I want to my derive trait Builder. This creates another type FooBuilder. FooBuilder should implement Debug iff Foo also derives Debug.
#[derive(Debug, Builder)]
struct Foo {
bar: String
}
fn main() {
println!("{:?}", Foo::builder(); // Returns the type `FooBuilder`, works
}
#[derive(Builder)]
struct Foo {
bar: String
}
fn main() {
println!("{:?}", Foo::builder(); // Doesn't work, because Foo doesn't derive Debug
// so FooBuilder doesn't derive Debug
}
I was trying to check the syn::DeriveInput { attrs, ... } but couldn't find the derive statements in there.