Currently if you want to handle subsets of enums you have to use something like:
enum Pet { Dog, Cat, Fish }
enum Animal { Bear, Giraffe, Other(Pet) }
fn foo(x: Animal) {}
fn main() {
foo(Animal::Other(Pet::Cat));
}
But if subsets of enums are used very commonly, then another way to handle them could be:
enum Pet { Dog, Cat, Fish }
enum Animal = Pet + { Bear, Giraffe }
fn foo(x: Animal) {}
fn main() {
foo(Pet::Cat);
}
Even subtractions:
enum Animal { Dog, Cat, Fish, Bear, Giraffe }
enum Pet = Animal - { Bear, Giraffe }