@@ -577,24 +577,25 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
577
577
// the last field). Can't have foreign types here, how would we
578
578
// adjust alignment and size for them?
579
579
let field = layout. field ( self , layout. fields . count ( ) - 1 ) ?;
580
- let ( unsized_size, unsized_align) = match self . size_and_align_of ( metadata, & field) ? {
581
- Some ( size_and_align) => size_and_align,
582
- None => {
583
- // A field with extern type. If this field is at offset 0, we behave
584
- // like the underlying extern type.
585
- // FIXME: Once we have made decisions for how to handle size and alignment
586
- // of `extern type`, this should be adapted. It is just a temporary hack
587
- // to get some code to work that probably ought to work.
588
- if sized_size == Size :: ZERO {
589
- return Ok ( None ) ;
590
- } else {
591
- span_bug ! (
592
- self . cur_span( ) ,
593
- "Fields cannot be extern types, unless they are at offset 0"
594
- )
580
+ let ( unsized_size, unsized_align) =
581
+ match self . size_and_align_of ( metadata, & field) ? {
582
+ Some ( size_and_align) => size_and_align,
583
+ None => {
584
+ // A field with extern type. If this field is at offset 0, we behave
585
+ // like the underlying extern type.
586
+ // FIXME: Once we have made decisions for how to handle size and alignment
587
+ // of `extern type`, this should be adapted. It is just a temporary hack
588
+ // to get some code to work that probably ought to work.
589
+ if sized_size == Size :: ZERO {
590
+ return Ok ( None ) ;
591
+ } else {
592
+ span_bug ! (
593
+ self . cur_span( ) ,
594
+ "Fields cannot be extern types, unless they are at offset 0"
595
+ )
596
+ }
595
597
}
596
- }
597
- } ;
598
+ } ;
598
599
599
600
// FIXME (#26403, #27023): We should be adding padding
600
601
// to `sized_size` (to accommodate the `unsized_align`
0 commit comments