Rollup merge of #150064 - Ayush1325:uefi-io-repr-comment, r=bjorn3

std: io: error: Add comment for UEFI unpacked repr use

The following commit adds the comment explaining the rational why UEFI uses unpacked representation on 64-bit platforms as opposed to bit-packed representation used in all other 64-bit platforms.

r? `@bjorn3`
This commit is contained in:
Jonathan Brouwer 2025-12-16 20:21:13 +01:00 committed by GitHub
commit ff84058781
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,6 +1,13 @@
#[cfg(test)]
mod tests;
// On 64-bit platforms, `io::Error` may use a bit-packed representation to
// reduce size. However, this representation assumes that error codes are
// always 32-bit wide.
//
// This assumption is invalid on 64-bit UEFI, where error codes are 64-bit.
// Therefore, the packed representation is explicitly disabled for UEFI
// targets, and the unpacked representation must be used instead.
#[cfg(all(target_pointer_width = "64", not(target_os = "uefi")))]
mod repr_bitpacked;
#[cfg(all(target_pointer_width = "64", not(target_os = "uefi")))]