@@ -408,20 +408,24 @@ impl<'body, 'tcx> VnState<'body, 'tcx> {
408
408
ImmTy :: from_immediate ( ptr_imm, ty) . into ( )
409
409
} else if matches ! ( kind, AggregateTy :: Array ) {
410
410
let mut mplace = None ;
411
- let alloc_id = self . ecx . intern_with_temp_alloc ( ty, |ecx, dest| {
412
- for ( field_index, op) in fields. iter ( ) . copied ( ) . enumerate ( ) {
413
- // ignore nested arrays
414
- if let Either :: Left ( _) = op. as_mplace_or_imm ( ) {
415
- interpret:: throw_inval!( TooGeneric ) ;
411
+ let alloc_id = self
412
+ . ecx
413
+ . intern_with_temp_alloc ( ty, |ecx, dest| {
414
+ for ( field_index, op) in fields. iter ( ) . copied ( ) . enumerate ( ) {
415
+ // ignore nested arrays
416
+ if let Either :: Left ( _) = op. as_mplace_or_imm ( ) {
417
+ interpret:: throw_inval!( TooGeneric ) ;
418
+ }
419
+ let field_dest = ecx. project_field ( dest, field_index) ?;
420
+ ecx. copy_op ( op, & field_dest) ?;
416
421
}
417
- let field_dest = ecx. project_field ( dest, field_index) ?;
418
- ecx. copy_op ( op, & field_dest) ?;
419
- }
420
422
421
- let dest = dest. assert_mem_place ( ) . map_provenance ( |prov| prov. as_immutable ( ) ) ;
422
- mplace. replace ( dest) ;
423
- Ok ( ( ) )
424
- } ) . ok ( ) ?;
423
+ let dest =
424
+ dest. assert_mem_place ( ) . map_provenance ( |prov| prov. as_immutable ( ) ) ;
425
+ mplace. replace ( dest) ;
426
+ Ok ( ( ) )
427
+ } )
428
+ . ok ( ) ?;
425
429
let GlobalAlloc :: Memory ( _alloc) = self . tcx . global_alloc ( alloc_id) else {
426
430
bug ! ( )
427
431
} ;
@@ -1385,7 +1389,8 @@ fn op_to_prop_const<'tcx>(
1385
1389
}
1386
1390
1387
1391
// Do not synthetize too large constants. Codegen will just memcpy them, which we'd like to avoid.
1388
- if !( op. layout . ty . is_array ( ) || matches ! ( op. layout. abi, Abi :: Scalar ( ..) | Abi :: ScalarPair ( ..) ) ) {
1392
+ if !( op. layout . ty . is_array ( ) || matches ! ( op. layout. abi, Abi :: Scalar ( ..) | Abi :: ScalarPair ( ..) ) )
1393
+ {
1389
1394
return None ;
1390
1395
}
1391
1396
@@ -1471,7 +1476,8 @@ impl<'tcx> VnState<'_, 'tcx> {
1471
1476
Value :: Aggregate ( AggregateTy :: Array , _, fields) => {
1472
1477
for f in fields {
1473
1478
if let Value :: Constant { value : Const :: Val ( const_, _) , .. } = self . get ( * f)
1474
- && let ConstValue :: Indirect { .. } = const_ {
1479
+ && let ConstValue :: Indirect { .. } = const_
1480
+ {
1475
1481
return None ;
1476
1482
}
1477
1483
}
@@ -1482,7 +1488,8 @@ impl<'tcx> VnState<'_, 'tcx> {
1482
1488
&& let ConstValue :: Scalar ( Scalar :: Ptr ( ..) ) = const_
1483
1489
&& let ty:: Ref ( region, ty, _mutability) = ty. kind ( )
1484
1490
&& region. is_erased ( )
1485
- && ty. is_array ( ) {
1491
+ && ty. is_array ( )
1492
+ {
1486
1493
return None ;
1487
1494
}
1488
1495
}
0 commit comments