Skip to content

Commit

Permalink
Document available error codes
Browse files Browse the repository at this point in the history
  • Loading branch information
dhardy authored and vks committed Oct 27, 2020
1 parent d8f4ec8 commit fde4113
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rand_core/CHANGELOG.md
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions rand_core/src/error.rs
Expand Up @@ -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).
Expand Down

0 comments on commit fde4113

Please sign in to comment.