Closed
Description
In #35168, we might like to deaggregate enums like:
x = Foo::Bar{a: 0, b: 0};
Into:
(x as Foo::Bar).0 = 0;
(x as Foo:Bar).1 = 0;
The problem (as far I know) is that the deaggregated version never sets the discrimnant.
I had some code that at least did the casting:
// if we handled enums:
let lhs_cast = if adt_def.variants.len() > 1 {
Lvalue::Projection(Box::new(LvalueProjection {
base: ai.lhs.clone(),
elem: ProjectionElem::Downcast(ai.adt_def, ai.variant),
}))
} else {
lhs_cast
};