@@ -777,7 +777,7 @@ impl<'tcx> GotocCtx<'tcx> {
777
777
}
778
778
ty:: Foreign ( defid) => self . codegen_foreign ( ty, * defid) ,
779
779
ty:: Array ( et, len) => {
780
- let evaluated_len = len. try_eval_usize ( self . tcx , self . param_env ( ) ) . unwrap ( ) ;
780
+ let evaluated_len = len. try_eval_target_usize ( self . tcx , self . param_env ( ) ) . unwrap ( ) ;
781
781
let array_name = format ! ( "[{}; {evaluated_len}]" , self . ty_mangled_name( * et) ) ;
782
782
let array_pretty_name = format ! ( "[{}; {evaluated_len}]" , self . ty_pretty_name( * et) ) ;
783
783
// wrap arrays into struct so that one can take advantage of struct copy in C
@@ -902,7 +902,7 @@ impl<'tcx> GotocCtx<'tcx> {
902
902
fn codegen_alignment_padding (
903
903
& self ,
904
904
size : Size ,
905
- layout : & LayoutS < VariantIdx > ,
905
+ layout : & LayoutS ,
906
906
idx : usize ,
907
907
) -> Option < DatatypeComponent > {
908
908
let align = Size :: from_bits ( layout. align . abi . bits ( ) ) ;
@@ -927,7 +927,7 @@ impl<'tcx> GotocCtx<'tcx> {
927
927
fn codegen_struct_fields (
928
928
& mut self ,
929
929
flds : Vec < ( String , Ty < ' tcx > ) > ,
930
- layout : & LayoutS < VariantIdx > ,
930
+ layout : & LayoutS ,
931
931
initial_offset : Size ,
932
932
) -> Vec < DatatypeComponent > {
933
933
match & layout. fields {
@@ -1385,7 +1385,7 @@ impl<'tcx> GotocCtx<'tcx> {
1385
1385
& mut self ,
1386
1386
variant : & VariantDef ,
1387
1387
subst : & ' tcx InternalSubsts < ' tcx > ,
1388
- layout : & LayoutS < VariantIdx > ,
1388
+ layout : & LayoutS ,
1389
1389
initial_offset : Size ,
1390
1390
) -> Vec < DatatypeComponent > {
1391
1391
let flds: Vec < _ > =
@@ -1554,7 +1554,7 @@ impl<'tcx> GotocCtx<'tcx> {
1554
1554
ty : Ty < ' tcx > ,
1555
1555
adtdef : & ' tcx AdtDef ,
1556
1556
subst : & ' tcx InternalSubsts < ' tcx > ,
1557
- variants : & IndexVec < VariantIdx , LayoutS < VariantIdx > > ,
1557
+ variants : & IndexVec < VariantIdx , LayoutS > ,
1558
1558
) -> Type {
1559
1559
let non_zst_count = variants. iter ( ) . filter ( |layout| layout. size . bytes ( ) > 0 ) . count ( ) ;
1560
1560
let mangled_name = self . ty_mangled_name ( ty) ;
@@ -1573,7 +1573,7 @@ impl<'tcx> GotocCtx<'tcx> {
1573
1573
1574
1574
pub ( crate ) fn variant_min_offset (
1575
1575
& self ,
1576
- variants : & IndexVec < VariantIdx , LayoutS < VariantIdx > > ,
1576
+ variants : & IndexVec < VariantIdx , LayoutS > ,
1577
1577
) -> Option < Size > {
1578
1578
variants
1579
1579
. iter ( )
@@ -1657,7 +1657,7 @@ impl<'tcx> GotocCtx<'tcx> {
1657
1657
pretty_name : InternedString ,
1658
1658
def : & ' tcx AdtDef ,
1659
1659
subst : & ' tcx InternalSubsts < ' tcx > ,
1660
- layouts : & IndexVec < VariantIdx , LayoutS < VariantIdx > > ,
1660
+ layouts : & IndexVec < VariantIdx , LayoutS > ,
1661
1661
initial_offset : Size ,
1662
1662
) -> Vec < DatatypeComponent > {
1663
1663
def. variants ( )
@@ -1689,7 +1689,7 @@ impl<'tcx> GotocCtx<'tcx> {
1689
1689
pretty_name : InternedString ,
1690
1690
case : & VariantDef ,
1691
1691
subst : & ' tcx InternalSubsts < ' tcx > ,
1692
- variant : & LayoutS < VariantIdx > ,
1692
+ variant : & LayoutS ,
1693
1693
initial_offset : Size ,
1694
1694
) -> Type {
1695
1695
let case_name = format ! ( "{name}::{}" , case. name) ;
0 commit comments