Right, but maybe there’s a solution here aping how we have structs with field names and tuple structs.
Strawman:
enum IpAddrAlt ( Ipv4Addr, Ipv6Addr );
impl From<Ipv4Addr> for IpAddrAlt {
fn from(x: Ipv4Addr) -> Self { x as Self }
}
impl From<Ipv6Addr> for IpAddrAlt { ··· }
match foo {
v4: Ipv4Addr => ···,
v6: Ipv6Addr => ···,
}
if let x: Ipv6Addr = foo { ··· }