From ff089c0e79ab07322a9bcf491c1c5ae2a90a731a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=9F=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2=20=5BArtyom=20Pavlov=5D?= Date: Fri, 23 Jan 2026 17:30:12 +0300 Subject: [PATCH 1/2] Use `core::error::Error` bound for `TryRng::Error` --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 668da0e4..4d656816 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -13,7 +13,7 @@ clippy::undocumented_unsafe_blocks )] -use core::{fmt, ops::DerefMut}; +use core::ops::DerefMut; pub use core::convert::Infallible; @@ -186,7 +186,7 @@ pub trait TryRng { /// The type returned in the event of a RNG error. /// /// Use type [`Infallible`] (re-exported by `rand_core`) for infallible implementations. - type Error: fmt::Debug + fmt::Display; + type Error: core::error::Error; /// Return the next random `u32`. fn try_next_u32(&mut self) -> Result; From 35b21afd577c9d86a40491bce059acc183ed76fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=9F=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2=20=5BArtyom=20Pavlov=5D?= Date: Fri, 23 Jan 2026 17:32:37 +0300 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d47bf37..33cd57ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Re-export of `core::convert::Infallible` ([#56]) +### Changed +- `TryRng::Error` is bound on `core::error::Error` instead of `Debug + Display` ([#58]) + ### Other - Changed repository from [rust-random/rand] to [rust-random/core]. @@ -56,6 +59,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [#45]: https://github.com/rust-random/rand-core/pull/45 [#53]: https://github.com/rust-random/rand-core/pull/53 [#56]: https://github.com/rust-random/rand-core/pull/56 +[#58]: https://github.com/rust-random/rand-core/pull/58 [rust-random/rand]: https://github.com/rust-random/rand [rust-random/core]: https://github.com/rust-random/core