In
#[derive(Derive)]
#[cfg_attr(never, derive(Clone))]
struct S {
#[cfg(never)]
invisible_field: u8,
#[cfg(not(never))]
visible_field: u8,
}
The Derive macro should be passed the token stream corresponding to
struct S {
#[cfg(not(never))]
visible_field: u8,
}
Currently, we pass
#[cfg_attr(never, derive(Clone))]
struct S {
#[cfg(never)]
invisible_field: u8,
#[cfg(not(never))]
visible_field: u8,
}
Since we have to evalutate cfgs to do this correctly, I propose moving the remove_derive_attrs code to hir_expand.
In
The
Derivemacro should be passed the token stream corresponding toCurrently, we pass
Since we have to evalutate
cfgs to do this correctly, I propose moving theremove_derive_attrscode tohir_expand.