File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77## Unreleased
88### API changes
99- Relax ` Sized ` bound on impls of ` SeedableRng ` (#1641 )
10+ - Fix ` OsError::raw_os_error ` on UEFI targets by returning ` Option<usize> ` (#1665 )
1011- Move ` rand_core::impls::* ` to ` rand_core::le ` module (#1667 )
1112- Use Edition 2024 and MSRV 1.85 (#1668 )
1213- Remove fn ` TryRngCore::read_adapter(..) -> RngReadAdapter ` (replaced with ` rand::RngReader ` ) (#1669 )
Original file line number Diff line number Diff line change @@ -66,6 +66,14 @@ impl std::error::Error for OsError {
6666 }
6767}
6868
69+ // If [`RawOsError`](https://doc.rust-lang.org/std/io/type.RawOsError.html) is stablized, we can use it.
70+
71+ #[ cfg( not( target_os = "uefi" ) ) ]
72+ type RawOsError = i32 ;
73+
74+ #[ cfg( target_os = "uefi" ) ]
75+ type RawOsError = usize ;
76+
6977impl OsError {
7078 /// Extract the raw OS error code (if this error came from the OS)
7179 ///
@@ -75,7 +83,7 @@ impl OsError {
7583 ///
7684 /// [1]: https://doc.rust-lang.org/std/io/struct.Error.html#method.raw_os_error
7785 #[ inline]
78- pub fn raw_os_error ( self ) -> Option < i32 > {
86+ pub fn raw_os_error ( self ) -> Option < RawOsError > {
7987 self . 0 . raw_os_error ( )
8088 }
8189}
You can’t perform that action at this time.
0 commit comments