Skip to content

Commit bfd1826

Browse files
authored
SeedableRng docs: add note on (lack of) reproducibility (#1572)
1 parent c01aee7 commit bfd1826

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

rand_core/src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,13 @@ impl<R: TryCryptoRng> CryptoRng for UnwrapErr<R> {}
306306
/// This trait encapsulates the low-level functionality common to all
307307
/// pseudo-random number generators (PRNGs, or algorithmic generators).
308308
///
309+
/// A generator implementing `SeedableRng` will usually be deterministic, but
310+
/// beware that portability and reproducibility of results **is not implied**.
311+
/// Refer to documentation of the generator, noting that generators named after
312+
/// a specific algorithm are usually tested for reproducibility against a
313+
/// reference vector, while `SmallRng` and `StdRng` specifically opt out of
314+
/// reproducibility guarantees.
315+
///
309316
/// [`rand`]: https://docs.rs/rand
310317
pub trait SeedableRng: Sized {
311318
/// Seed type, which is restricted to types mutably-dereferenceable as `u8`

0 commit comments

Comments
 (0)