@@ -1019,7 +1019,7 @@ struct MemberDescription<'ll> {
1019
1019
size : Size ,
1020
1020
align : Align ,
1021
1021
flags : DIFlags ,
1022
- discriminant : Option < u64 > ,
1022
+ discriminant : Option < u128 > ,
1023
1023
}
1024
1024
1025
1025
impl < ' ll > MemberDescription < ' ll > {
@@ -1039,7 +1039,7 @@ impl<'ll> MemberDescription<'ll> {
1039
1039
self . offset . bits ( ) ,
1040
1040
match self . discriminant {
1041
1041
None => None ,
1042
- Some ( value) => Some ( cx. const_u64 ( value) ) ,
1042
+ Some ( value) => Some ( cx. const_uint_big ( cx . type_i128 ( ) , value) ) ,
1043
1043
} ,
1044
1044
self . flags ,
1045
1045
self . type_metadata )
@@ -1418,7 +1418,7 @@ impl EnumMemberDescriptionFactory<'ll, 'tcx> {
1418
1418
align : self . layout . align . abi ,
1419
1419
flags : DIFlags :: FlagZero ,
1420
1420
discriminant : Some (
1421
- self . layout . ty . discriminant_for_variant ( cx. tcx , i) . unwrap ( ) . val as u64
1421
+ self . layout . ty . discriminant_for_variant ( cx. tcx , i) . unwrap ( ) . val
1422
1422
) ,
1423
1423
}
1424
1424
} ) . collect ( )
@@ -1521,12 +1521,7 @@ impl EnumMemberDescriptionFactory<'ll, 'tcx> {
1521
1521
let value = ( i. as_u32 ( ) as u128 )
1522
1522
. wrapping_sub ( niche_variants. start ( ) . as_u32 ( ) as u128 )
1523
1523
. wrapping_add ( niche_start) ;
1524
- let value = truncate ( value, discr. value . size ( cx) ) ;
1525
- // NOTE(eddyb) do *NOT* remove this assert, until
1526
- // we pass the full 128-bit value to LLVM, otherwise
1527
- // truncation will be silent and remain undetected.
1528
- assert_eq ! ( value as u64 as u128 , value) ;
1529
- Some ( value as u64 )
1524
+ Some ( truncate ( value, discr. value . size ( cx) ) )
1530
1525
} ;
1531
1526
1532
1527
MemberDescription {
0 commit comments