Skip to content

Commit ff84058

Browse files
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`
2 parents 02c0e8f + 4efe268 commit ff84058

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

library/std/src/io/error.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
#[cfg(test)]
22
mod tests;
33

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

0 commit comments

Comments
 (0)