@@ -571,7 +571,7 @@ impl<'a> Context<'a> {
571
571
AcirValue :: Array ( _) => {
572
572
let block_id = self . block_id ( param_id) ;
573
573
let len = if matches ! ( typ, Type :: Array ( _, _) ) {
574
- typ. flattened_size ( )
574
+ typ. flattened_size ( ) as usize
575
575
} else {
576
576
return Err ( InternalError :: Unexpected {
577
577
expected : "Block params should be an array" . to_owned ( ) ,
@@ -816,7 +816,9 @@ impl<'a> Context<'a> {
816
816
let inputs = vecmap ( arguments, |arg| self . convert_value ( * arg, dfg) ) ;
817
817
let output_count = result_ids
818
818
. iter ( )
819
- . map ( |result_id| dfg. type_of_value ( * result_id) . flattened_size ( ) )
819
+ . map ( |result_id| {
820
+ dfg. type_of_value ( * result_id) . flattened_size ( ) as usize
821
+ } )
820
822
. sum ( ) ;
821
823
822
824
let Some ( acir_function_id) =
@@ -948,7 +950,7 @@ impl<'a> Context<'a> {
948
950
let block_id = self . block_id ( & array_id) ;
949
951
let array_typ = dfg. type_of_value ( array_id) ;
950
952
let len = if matches ! ( array_typ, Type :: Array ( _, _) ) {
951
- array_typ. flattened_size ( )
953
+ array_typ. flattened_size ( ) as usize
952
954
} else {
953
955
Self :: flattened_value_size ( & output)
954
956
} ;
@@ -1444,7 +1446,7 @@ impl<'a> Context<'a> {
1444
1446
// a separate SSA value and restrictions on slice indices should be generated elsewhere in the SSA.
1445
1447
let array_typ = dfg. type_of_value ( array) ;
1446
1448
let array_len = if !array_typ. contains_slice_element ( ) {
1447
- array_typ. flattened_size ( )
1449
+ array_typ. flattened_size ( ) as usize
1448
1450
} else {
1449
1451
self . flattened_slice_size ( array, dfg)
1450
1452
} ;
@@ -1539,7 +1541,7 @@ impl<'a> Context<'a> {
1539
1541
let value = self . convert_value ( array, dfg) ;
1540
1542
let array_typ = dfg. type_of_value ( array) ;
1541
1543
let len = if !array_typ. contains_slice_element ( ) {
1542
- array_typ. flattened_size ( )
1544
+ array_typ. flattened_size ( ) as usize
1543
1545
} else {
1544
1546
self . flattened_slice_size ( array, dfg)
1545
1547
} ;
@@ -1810,7 +1812,7 @@ impl<'a> Context<'a> {
1810
1812
1811
1813
return_values
1812
1814
. iter ( )
1813
- . fold ( 0 , |acc, value_id| acc + dfg. type_of_value ( * value_id) . flattened_size ( ) )
1815
+ . fold ( 0 , |acc, value_id| acc + dfg. type_of_value ( * value_id) . flattened_size ( ) as usize )
1814
1816
}
1815
1817
1816
1818
/// Converts an SSA terminator's return values into their ACIR representations
@@ -2156,7 +2158,7 @@ impl<'a> Context<'a> {
2156
2158
let inputs = vecmap ( & arguments_no_slice_len, |arg| self . convert_value ( * arg, dfg) ) ;
2157
2159
2158
2160
let output_count = result_ids. iter ( ) . fold ( 0usize , |sum, result_id| {
2159
- sum + dfg. try_get_array_length ( * result_id) . unwrap_or ( 1 )
2161
+ sum + dfg. try_get_array_length ( * result_id) . unwrap_or ( 1 ) as usize
2160
2162
} ) ;
2161
2163
2162
2164
let vars = self . acir_context . black_box_function ( black_box, inputs, output_count) ?;
@@ -2180,7 +2182,7 @@ impl<'a> Context<'a> {
2180
2182
endian,
2181
2183
field,
2182
2184
radix,
2183
- array_length as u32 ,
2185
+ array_length,
2184
2186
result_type[ 0 ] . clone ( ) . into ( ) ,
2185
2187
)
2186
2188
. map ( |array| vec ! [ array] )
@@ -2194,12 +2196,7 @@ impl<'a> Context<'a> {
2194
2196
} ;
2195
2197
2196
2198
self . acir_context
2197
- . bit_decompose (
2198
- endian,
2199
- field,
2200
- array_length as u32 ,
2201
- result_type[ 0 ] . clone ( ) . into ( ) ,
2202
- )
2199
+ . bit_decompose ( endian, field, array_length, result_type[ 0 ] . clone ( ) . into ( ) )
2203
2200
. map ( |array| vec ! [ array] )
2204
2201
}
2205
2202
Intrinsic :: ArrayLen => {
@@ -2220,7 +2217,7 @@ impl<'a> Context<'a> {
2220
2217
let acir_value = self . convert_value ( slice_contents, dfg) ;
2221
2218
2222
2219
let array_len = if !slice_typ. contains_slice_element ( ) {
2223
- slice_typ. flattened_size ( )
2220
+ slice_typ. flattened_size ( ) as usize
2224
2221
} else {
2225
2222
self . flattened_slice_size ( slice_contents, dfg)
2226
2223
} ;
0 commit comments