I am writing a proc_macro attribute that add fields to a struct and also implement my trait (and other by adding a #[derive(...)]) to the expanded struct
Here a simplified version of what I want to do:
#[foo("some value")]
#[derive(Debug)]
struct A {
bar: u32,
}
After expansion:
#[derive(Debug, Default, Serialize)]
struct A {
foo: u64
bar: u32,
}
impl FooTrait for A {
...
}
How can I parse the derive attribute in order to add the Debug trait with all the rest of the trait that I add with the foo proc_macro?