mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-28 20:16:58 +03:00
random: add tracking issue, address other comments
This commit is contained in:
@@ -394,7 +394,7 @@ pub mod assert_matches {
|
||||
#[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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user