Skip to content

Commit ea7545b

Browse files
committed
don't inhibit random field reordering on repr(packed(1))
1 parent e875391 commit ea7545b

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

compiler/rustc_abi/src/lib.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,8 @@ impl ReprOptions {
138138
}
139139

140140
/// Returns `true` if this `#[repr()]` should inhibit struct field reordering
141-
/// optimizations, such as with `repr(C)`, `repr(packed(1))`, or `repr(<int>)`.
141+
/// optimizations, such as with `repr(C)` or `repr(<int>)`.
142142
pub fn inhibit_struct_field_reordering_opt(&self) -> bool {
143-
if let Some(pack) = self.pack {
144-
if pack.bytes() == 1 {
145-
return true;
146-
}
147-
}
148-
149143
self.flags.intersects(ReprFlags::IS_UNOPTIMISABLE) || self.int.is_some()
150144
}
151145

0 commit comments

Comments
 (0)