You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Previously, all Rust targets with std were using i32 for "raw" OS error codes, i.e. io::Error::raw_os_error/from_raw_os_error have accepted i32. We have encoded this assumption in Error::raw_os_error, fmt::Debug/Display, and From<Error> for io::Error implementations.
But in the recently added UEFI std implementation usize is used for error codes instead as per UEFI spec. It's reflected by the new (Nightly-only) type alias RawOsError
For now, we just added cfg-based exceptions for UEFI targets in the relevant internal implementations (see #566). But it may be worth to reconsider our use of NonZeroU32 for Error internal representation and return type of Error::raw_os_error.
This allows us to remove some UEFI-specific exceptions from the code.
This PR only partially resolves#568 since we still use `NonZeroU32` on
UEFI targets, but it should be sufficient to future-proof ourselves for
the v0.3 release.
Previously, all Rust targets with
std
were usingi32
for "raw" OS error codes, i.e.io::Error::raw_os_error/from_raw_os_error
have acceptedi32
. We have encoded this assumption inError::raw_os_error
,fmt::Debug/Display
, andFrom<Error> for io::Error
implementations.But in the recently added UEFI
std
implementationusize
is used for error codes instead as per UEFI spec. It's reflected by the new (Nightly-only) type aliasRawOsError
For now, we just added
cfg
-based exceptions for UEFI targets in the relevant internal implementations (see #566). But it may be worth to reconsider our use ofNonZeroU32
forError
internal representation and return type ofError::raw_os_error
.cc @usamoi
The text was updated successfully, but these errors were encountered: