Open
Description
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 cfg
s to do this correctly, I propose moving the remove_derive_attrs
code to hir_expand
.