random: add tracking issue, address other comments

This commit is contained in:
joboet 2024-09-22 16:33:58 +02:00
parent a21ff017f4
commit e94dd9b712
No known key found for this signature in database
GPG key ID: 704E0149B0194B3C
4 changed files with 19 additions and 14 deletions

View file

@ -394,7 +394,7 @@ pub mod panicking;
#[unstable(feature = "core_pattern_types", issue = "123646")]
pub mod pat;
pub mod pin;
#[unstable(feature = "random", issue = "none")]
#[unstable(feature = "random", issue = "130703")]
pub mod random;
#[unstable(feature = "new_range_api", issue = "125687")]
pub mod range;

View file

@ -4,7 +4,7 @@
//! given [`RandomSource`].
/// A source of randomness.
#[unstable(feature = "random", issue = "none")]
#[unstable(feature = "random", issue = "130703")]
pub trait RandomSource {
/// Fills `bytes` with random bytes.
fn fill_bytes(&mut self, bytes: &mut [u8]);
@ -17,7 +17,7 @@ pub trait RandomSource {
/// distribution, so a value of 1 is just as likely as [`i32::MAX`]. By using
/// modulo operations, some of the resulting values can become more likely than
/// others. Use audited crates when in doubt.
#[unstable(feature = "random", issue = "none")]
#[unstable(feature = "random", issue = "130703")]
pub trait Random: Sized {
/// Generates a random value.
fn random(source: &mut (impl RandomSource + ?Sized)) -> Self;