Skip to content

Commit 4001339

Browse files
authored
Mark RawOsError type alias as public (#739)
See rust-random/rand#1665
1 parent c5ae0a2 commit 4001339

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [Unreleased]
8+
9+
### Added
10+
- `RawOsError` type alias [#739]
11+
12+
[#739]: https://github.com/rust-random/getrandom/pull/739
13+
714
## [0.3.4] - 2025-10-14
815

916
### Major change to `wasm_js` backend
@@ -631,6 +638,7 @@ Publish initial implementation.
631638
## [0.0.0] - 2019-01-19
632639
Publish an empty template library.
633640

641+
[Unreleased]: https://github.com/rust-random/getrandom/compare/v0.3.4...master
634642
[0.3.4]: https://github.com/rust-random/getrandom/compare/v0.3.3...v0.3.4
635643
[0.3.3]: https://github.com/rust-random/getrandom/compare/v0.3.2...v0.3.3
636644
[0.3.2]: https://github.com/rust-random/getrandom/compare/v0.3.1...v0.3.2

src/error.rs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,26 @@ extern crate std;
33

44
use core::fmt;
55

6-
// This private alias mirrors `std::io::RawOsError`:
7-
// https://doc.rust-lang.org/std/io/type.RawOsError.html)
86
cfg_if::cfg_if!(
97
if #[cfg(target_os = "uefi")] {
108
// See the UEFI spec for more information:
119
// https://uefi.org/specs/UEFI/2.10/Apx_D_Status_Codes.html
12-
type RawOsError = usize;
10+
11+
/// Raw error code.
12+
///
13+
/// This alias mirrors unstable [`std::io::RawOsError`].
14+
///
15+
/// [`std::io::RawOsError`]: https://doc.rust-lang.org/std/io/type.RawOsError.html
16+
pub type RawOsError = usize;
1317
type NonZeroRawOsError = core::num::NonZeroUsize;
1418
const UEFI_ERROR_FLAG: RawOsError = 1 << (RawOsError::BITS - 1);
1519
} else {
16-
type RawOsError = i32;
20+
/// Raw error code.
21+
///
22+
/// This alias mirrors unstable [`std::io::RawOsError`].
23+
///
24+
/// [`std::io::RawOsError`]: https://doc.rust-lang.org/std/io/type.RawOsError.html
25+
pub type RawOsError = i32;
1726
type NonZeroRawOsError = core::num::NonZeroI32;
1827
}
1928
);

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ mod util;
3939
#[cfg(feature = "std")]
4040
mod error_std_impls;
4141

42-
pub use crate::error::Error;
42+
pub use crate::error::{Error, RawOsError};
4343

4444
/// Fill `dest` with random bytes from the system's preferred random number source.
4545
///

0 commit comments

Comments
 (0)