File tree 1 file changed +3
-7
lines changed
compiler/rustc_ty_utils/src
1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -140,14 +140,10 @@ fn univariant_uninterned<'tcx>(
140
140
let optimizing = & mut inverse_memory_index[ ..end] ;
141
141
let effective_field_align = |f : & TyAndLayout < ' _ > | {
142
142
if let Some ( pack) = pack {
143
- f. align . abi . min ( pack)
144
- } else if f. size . bytes ( ) . is_power_of_two ( ) && f. size . bytes ( ) >= f. align . abi . bytes ( ) {
145
- // Try to put fields which have a 2^n size and smaller alignment together with
146
- // fields that have an alignment matching that size.
147
- // E.g. group [u8; 4] with u32 fields
148
- Align :: from_bytes ( f. align . abi . bytes ( ) ) . unwrap_or ( f. align . abi )
143
+ f. align . abi . min ( pack) . bytes ( )
149
144
} else {
150
- f. align . abi
145
+ // group [u8; 4] with align-4 or [u8; 6] with align-2 fields
146
+ f. align . abi . bytes ( ) . max ( f. size . bytes ( ) ) . trailing_zeros ( ) as u64
151
147
}
152
148
} ;
153
149
You can’t perform that action at this time.
0 commit comments