Is the idea that destructuring would prevent the Destruct
glue from being invoked? Is there an idea that you could destructure enums that have Destruct
glue? I guess the syntax for that would be something like:
match self { _ => () };
But that would change current behavior. Is there an alternative syntax for enums that doesn’t rely on knowing each variant? (This would have the desired destructuring behavior, I think, but relies on knowing each available variant for the enum.)
FWIW, @eddyb also had an Interior<T>
proposal which I probably won’t do justice to here, but which would allow an unsafe move from a value T
into a value Interior<T>
. Interior<T>
does not implement Drop
, so that by-value moves are allowed from Interior<T>
. A DropValue
trait(?) would take Interior<T>
as an argument. This would work with enums that implement Drop
very naturally.