mirror of
https://github.com/rust-lang/rust.git
synced 2025-11-27 13:17:58 +00:00
Previously for enums using the `Variants::Single` layout, the variant
index was being confused with its discriminant. For example, in the case
of `enum E { A = 1 }`.
Use `discriminant_for_variant` to avoid the issue.