use enum_macros::NextVariant; #[derive(NextVariant)] enum Complex { A { val: T }, B(u8), } fn main() {}