3 ms·
Why does Rust incorrectly use the name "enum" for "tagged union" or "sum type"?
by sukilot 12y ago
Why does Rust incorrectly use the name "enum" for "tagged union" or "sum type"?
- kibwen 12y agoBecause in the simplest case when no variant has any associated data they are indistinguishable from C-style enums. The `enum` keyword was originally `tag` in ancient versions of Rust, and at least twice in the past three years there have been massive bikesheds to reconsider the keyword. You are free to dig through Rust's history if you'd like to understand why `enum` won out every time.