@@ -1019,7 +1019,7 @@ struct MemberDescription<'ll> {
10191019 size : Size ,
10201020 align : Align ,
10211021 flags : DIFlags ,
1022- discriminant : Option < u64 > ,
1022+ discriminant : Option < u128 > ,
10231023}
10241024
10251025impl < ' ll > MemberDescription < ' ll > {
@@ -1039,7 +1039,7 @@ impl<'ll> MemberDescription<'ll> {
10391039 self . offset . bits ( ) ,
10401040 match self . discriminant {
10411041 None => None ,
1042- Some ( value) => Some ( cx. const_u64 ( value) ) ,
1042+ Some ( value) => Some ( cx. const_uint_big ( cx . type_i128 ( ) , value) ) ,
10431043 } ,
10441044 self . flags ,
10451045 self . type_metadata )
@@ -1418,7 +1418,7 @@ impl EnumMemberDescriptionFactory<'ll, 'tcx> {
14181418 align : self . layout . align . abi ,
14191419 flags : DIFlags :: FlagZero ,
14201420 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
14221422 ) ,
14231423 }
14241424 } ) . collect ( )
@@ -1521,12 +1521,7 @@ impl EnumMemberDescriptionFactory<'ll, 'tcx> {
15211521 let value = ( i. as_u32 ( ) as u128 )
15221522 . wrapping_sub ( niche_variants. start ( ) . as_u32 ( ) as u128 )
15231523 . 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) ) )
15301525 } ;
15311526
15321527 MemberDescription {
0 commit comments