@@ -412,20 +412,24 @@ impl<'body, 'tcx> VnState<'body, 'tcx> {
412
412
ImmTy :: from_immediate ( ptr_imm, ty) . into ( )
413
413
} else if matches ! ( kind, AggregateTy :: Array ) {
414
414
let mut mplace = None ;
415
- let alloc_id = self . ecx . intern_with_temp_alloc ( ty, |ecx, dest| {
416
- for ( field_index, op) in fields. iter ( ) . copied ( ) . enumerate ( ) {
417
- // ignore nested arrays
418
- if let Either :: Left ( _) = op. as_mplace_or_imm ( ) {
419
- interpret:: throw_inval!( TooGeneric ) ;
415
+ let alloc_id = self
416
+ . ecx
417
+ . intern_with_temp_alloc ( ty, |ecx, dest| {
418
+ for ( field_index, op) in fields. iter ( ) . copied ( ) . enumerate ( ) {
419
+ // ignore nested arrays
420
+ if let Either :: Left ( _) = op. as_mplace_or_imm ( ) {
421
+ interpret:: throw_inval!( TooGeneric ) ;
422
+ }
423
+ let field_dest = ecx. project_field ( dest, field_index) ?;
424
+ ecx. copy_op ( op, & field_dest) ?;
420
425
}
421
- let field_dest = ecx. project_field ( dest, field_index) ?;
422
- ecx. copy_op ( op, & field_dest) ?;
423
- }
424
426
425
- let dest = dest. assert_mem_place ( ) . map_provenance ( |prov| prov. as_immutable ( ) ) ;
426
- mplace. replace ( dest) ;
427
- Ok ( ( ) )
428
- } ) . ok ( ) ?;
427
+ let dest =
428
+ dest. assert_mem_place ( ) . map_provenance ( |prov| prov. as_immutable ( ) ) ;
429
+ mplace. replace ( dest) ;
430
+ Ok ( ( ) )
431
+ } )
432
+ . ok ( ) ?;
429
433
let GlobalAlloc :: Memory ( _alloc) = self . tcx . global_alloc ( alloc_id) else {
430
434
bug ! ( )
431
435
} ;
@@ -1276,7 +1280,8 @@ fn op_to_prop_const<'tcx>(
1276
1280
}
1277
1281
1278
1282
// Do not synthetize too large constants. Codegen will just memcpy them, which we'd like to avoid.
1279
- if !( op. layout . ty . is_array ( ) || matches ! ( op. layout. abi, Abi :: Scalar ( ..) | Abi :: ScalarPair ( ..) ) ) {
1283
+ if !( op. layout . ty . is_array ( ) || matches ! ( op. layout. abi, Abi :: Scalar ( ..) | Abi :: ScalarPair ( ..) ) )
1284
+ {
1280
1285
return None ;
1281
1286
}
1282
1287
@@ -1345,7 +1350,8 @@ impl<'tcx> VnState<'_, 'tcx> {
1345
1350
Value :: Aggregate ( AggregateTy :: Array , _, fields) => {
1346
1351
for f in fields {
1347
1352
if let Value :: Constant { value : Const :: Val ( const_, _) , .. } = self . get ( * f)
1348
- && let ConstValue :: Indirect { .. } = const_ {
1353
+ && let ConstValue :: Indirect { .. } = const_
1354
+ {
1349
1355
return None ;
1350
1356
}
1351
1357
}
@@ -1356,7 +1362,8 @@ impl<'tcx> VnState<'_, 'tcx> {
1356
1362
&& let ConstValue :: Scalar ( Scalar :: Ptr ( ..) ) = const_
1357
1363
&& let ty:: Ref ( region, ty, _mutability) = ty. kind ( )
1358
1364
&& region. is_erased ( )
1359
- && ty. is_array ( ) {
1365
+ && ty. is_array ( )
1366
+ {
1360
1367
return None ;
1361
1368
}
1362
1369
}
0 commit comments