Change tag_field to FieldIdx in Variants::Multiple

It was already available as a generic parameter anyway, and it's not like we'll ever put a tag in the 5-billionth field.
This commit is contained in:
Scott McMurray
2025-06-03 23:42:21 -07:00
parent 792fc2b033
commit ee9901e65c
14 changed files with 33 additions and 31 deletions

View File

@@ -451,7 +451,7 @@ pub(crate) mod rustc {
// For enums (but not coroutines), the tag field is
// currently always the first field of the layout.
assert_eq!(*tag_field, 0);
assert_eq!(*tag_field, FieldIdx::ZERO);
let variants = def.discriminants(cx.tcx()).try_fold(
Self::uninhabited(),