My qualm with providing this functionality under the guise of unsafe enum, “an enum without the discriminant”, is that this is taking out the very part that makes it enum-like.
From a familiarity perspective, Rust aims to make ADTs / sum types approachable to C-family programmers by presenting them as an enum, with the addition that each enumerator can have associated data. But if you have data without enumerators, then this analogy no longer makes sense. But that’s the smaller issue, as you can just name it something other than unsafe enum.
The other issue is that Rust’s enums have named variants because they are positional. If I have enum Bool { True, False }, then True is different from False, likewise if I have enum Integer { Positive(Natural), Negative(Natural) }, then Positive and Negative are distinguishable, despite both containing a Natural. WIth unsafe enum this is no longer the case, and the only thing that matters is the contained type, so packaging them in variants just fundamentally doesn’t make sense, in my opinion.
If the provided-as-a-library-type UnsafeUnion<A, B> I proposed at some point is too minimalist to be ergonomic, then something like union Foo { usize, *mut Bar, MyType } with the ability to unsafely cast between Foo and any of the listed types using as would still make more sense, imho.