diff --git a/rand_core/CHANGELOG.md b/rand_core/CHANGELOG.md index 9f6f91c4955..a33247ddafe 100644 --- a/rand_core/CHANGELOG.md +++ b/rand_core/CHANGELOG.md @@ -8,9 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Bump MSRV to 1.36, various code improvements (#1011) - Update to getrandom v0.2 (#1041) -- Fix: `next_u32_via_fill` and `next_u64_via_fill` now use LE as documented (#?) +- Fix: `next_u32_via_fill` and `next_u64_via_fill` now use LE as documented (#1061) - Reduce usage of `unsafe` (#962, #963, #1011) - Annotate feature-gates in documentation (#1019) +- Document available error codes (#1061) - Various documentation tweaks - Fix some clippy warnings (#1036) - Apply rustfmt (#926) diff --git a/rand_core/src/error.rs b/rand_core/src/error.rs index d2e467da84d..a64c430da8b 100644 --- a/rand_core/src/error.rs +++ b/rand_core/src/error.rs @@ -29,6 +29,9 @@ impl Error { /// Codes at or above this point can be used by users to define their own /// custom errors. /// + /// This has a fixed value of `(1 << 31) + (1 << 30) = 0xC000_0000`, + /// therefore the number of values available for custom codes is `1 << 30`. + /// /// This is identical to [`getrandom::Error::CUSTOM_START`](https://docs.rs/getrandom/latest/getrandom/struct.Error.html#associatedconstant.CUSTOM_START). pub const CUSTOM_START: u32 = (1 << 31) + (1 << 30); /// Codes below this point represent OS Errors (i.e. positive i32 values).