Support phantom void enum
L-as opened this issue · comments
Las Safin commented
Title.
David Tolnay commented
I'm not sure what you mean. Could you give an example of the enum use case you have in mind?
Las Safin commented
Sorry for late reply, here's an example:
enum MyEnum<T> {}
Today this won't work since T
isn't used. You can't use PhantomData
here as easily, since you'd need to create a variant, which you don't want.
David Tolnay commented
It is not currently implemented but the same technique would work. I would be prepared to consider a PR adding support for zero-variant enums.
David Tolnay commented
Upon revisiting this, I think I'll leave this functionality to a different crate.