@@ -970,7 +970,7 @@ fn univariant<
970970 let mut align = if pack. is_some ( ) { dl. i8_align } else { dl. aggregate_align } ;
971971 let mut max_repr_align = repr. align ;
972972 let mut inverse_memory_index: IndexVec < u32 , FieldIdx > = fields. indices ( ) . collect ( ) ;
973- let optimize = !repr. inhibit_struct_field_reordering_opt ( ) ;
973+ let optimize = !repr. inhibit_struct_field_reordering ( ) ;
974974 if optimize && fields. len ( ) > 1 {
975975 let end = if let StructKind :: MaybeUnsized = kind { fields. len ( ) - 1 } else { fields. len ( ) } ;
976976 let optimizing = & mut inverse_memory_index. raw [ ..end] ;
@@ -1007,13 +1007,15 @@ fn univariant<
10071007 // Calculates a sort key to group fields by their alignment or possibly some
10081008 // size-derived pseudo-alignment.
10091009 let alignment_group_key = |layout : & F | {
1010+ // The two branches here return values that cannot be meaningfully compared with
1011+ // each other. However, we know that consistently for all executions of
1012+ // `alignment_group_key`, one or the other branch will be taken, so this is okay.
10101013 if let Some ( pack) = pack {
10111014 // Return the packed alignment in bytes.
10121015 layout. align . abi . min ( pack) . bytes ( )
10131016 } else {
1014- // Returns `log2(effective-align)`. This is ok since `pack` applies to all
1015- // fields equally. The calculation assumes that size is an integer multiple of
1016- // align, except for ZSTs.
1017+ // Returns `log2(effective-align)`. The calculation assumes that size is an
1018+ // integer multiple of align, except for ZSTs.
10171019 let align = layout. align . abi . bytes ( ) ;
10181020 let size = layout. size . bytes ( ) ;
10191021 let niche_size = layout. largest_niche . map ( |n| n. available ( dl) ) . unwrap_or ( 0 ) ;
0 commit comments