mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-11 06:37:57 +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.