diff options
| author | Brian Anderson <banderson@mozilla.com> | 2015-03-13 15:28:35 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2015-03-23 14:40:26 -0700 |
| commit | e9019101a82dd7f61dcdcd52bcc0123d5ed25d22 (patch) | |
| tree | 6553b47da56745ce8cab9e17265bba143608aa97 /src/librand | |
| parent | df290f127e923e0aacfe8223dd77f0fa222f0bc8 (diff) | |
| download | rust-e9019101a82dd7f61dcdcd52bcc0123d5ed25d22.tar.gz rust-e9019101a82dd7f61dcdcd52bcc0123d5ed25d22.zip | |
Add #![feature] attributes to doctests
Diffstat (limited to 'src/librand')
| -rw-r--r-- | src/librand/distributions/exponential.rs | 1 | ||||
| -rw-r--r-- | src/librand/distributions/gamma.rs | 4 | ||||
| -rw-r--r-- | src/librand/distributions/mod.rs | 1 | ||||
| -rw-r--r-- | src/librand/distributions/normal.rs | 2 | ||||
| -rw-r--r-- | src/librand/distributions/range.rs | 1 | ||||
| -rw-r--r-- | src/librand/lib.rs | 12 | ||||
| -rw-r--r-- | src/librand/reseeding.rs | 1 |
7 files changed, 22 insertions, 0 deletions
diff --git a/src/librand/distributions/exponential.rs b/src/librand/distributions/exponential.rs index 3180f03cfd3..0c5f5cb0d44 100644 --- a/src/librand/distributions/exponential.rs +++ b/src/librand/distributions/exponential.rs @@ -60,6 +60,7 @@ impl Rand for Exp1 { /// # Examples /// /// ``` +/// # #![feature(rand)] /// use std::rand; /// use std::rand::distributions::{Exp, IndependentSample}; /// diff --git a/src/librand/distributions/gamma.rs b/src/librand/distributions/gamma.rs index 8eaac203fb4..d04e83e84f7 100644 --- a/src/librand/distributions/gamma.rs +++ b/src/librand/distributions/gamma.rs @@ -40,6 +40,7 @@ use super::{IndependentSample, Sample, Exp}; /// # Examples /// /// ``` +/// # #![feature(rand)] /// use std::rand; /// use std::rand::distributions::{IndependentSample, Gamma}; /// @@ -187,6 +188,7 @@ impl IndependentSample<f64> for GammaLargeShape { /// # Examples /// /// ``` +/// # #![feature(rand)] /// use std::rand; /// use std::rand::distributions::{ChiSquared, IndependentSample}; /// @@ -244,6 +246,7 @@ impl IndependentSample<f64> for ChiSquared { /// # Examples /// /// ``` +/// # #![feature(rand)] /// use std::rand; /// use std::rand::distributions::{FisherF, IndependentSample}; /// @@ -288,6 +291,7 @@ impl IndependentSample<f64> for FisherF { /// # Examples /// /// ``` +/// # #![feature(rand)] /// use std::rand; /// use std::rand::distributions::{StudentT, IndependentSample}; /// diff --git a/src/librand/distributions/mod.rs b/src/librand/distributions/mod.rs index a46709932e2..5cafb8d2e5e 100644 --- a/src/librand/distributions/mod.rs +++ b/src/librand/distributions/mod.rs @@ -94,6 +94,7 @@ pub struct Weighted<T> { /// # Examples /// /// ``` +/// # #![feature(rand)] /// use std::rand; /// use std::rand::distributions::{Weighted, WeightedChoice, IndependentSample}; /// diff --git a/src/librand/distributions/normal.rs b/src/librand/distributions/normal.rs index d07964624bf..7cecc6ac611 100644 --- a/src/librand/distributions/normal.rs +++ b/src/librand/distributions/normal.rs @@ -76,6 +76,7 @@ impl Rand for StandardNormal { /// # Examples /// /// ``` +/// # #![feature(rand)] /// use std::rand; /// use std::rand::distributions::{Normal, IndependentSample}; /// @@ -124,6 +125,7 @@ impl IndependentSample<f64> for Normal { /// # Examples /// /// ``` +/// # #![feature(rand)] /// use std::rand; /// use std::rand::distributions::{LogNormal, IndependentSample}; /// diff --git a/src/librand/distributions/range.rs b/src/librand/distributions/range.rs index 4086e149e78..e6f27a28ffa 100644 --- a/src/librand/distributions/range.rs +++ b/src/librand/distributions/range.rs @@ -36,6 +36,7 @@ use distributions::{Sample, IndependentSample}; /// # Examples /// /// ``` +/// # #![feature(rand)] /// use std::rand::distributions::{IndependentSample, Range}; /// /// fn main() { diff --git a/src/librand/lib.rs b/src/librand/lib.rs index 8de773e9fec..9f6399ff12d 100644 --- a/src/librand/lib.rs +++ b/src/librand/lib.rs @@ -149,6 +149,7 @@ pub trait Rng : Sized { /// # Examples /// /// ``` + /// # #![feature(rand, core)] /// use std::rand::{thread_rng, Rng}; /// /// let mut v = [0; 13579]; @@ -184,6 +185,7 @@ pub trait Rng : Sized { /// # Examples /// /// ``` + /// # #![feature(rand)] /// use std::rand::{thread_rng, Rng}; /// /// let mut rng = thread_rng(); @@ -202,6 +204,7 @@ pub trait Rng : Sized { /// # Examples /// /// ``` + /// # #![feature(rand)] /// use std::rand::{thread_rng, Rng}; /// /// let mut rng = thread_rng(); @@ -229,6 +232,7 @@ pub trait Rng : Sized { /// # Examples /// /// ``` + /// # #![feature(rand)] /// use std::rand::{thread_rng, Rng}; /// /// let mut rng = thread_rng(); @@ -247,6 +251,7 @@ pub trait Rng : Sized { /// # Examples /// /// ``` + /// # #![feature(rand)] /// use std::rand::{thread_rng, Rng}; /// /// let mut rng = thread_rng(); @@ -261,6 +266,7 @@ pub trait Rng : Sized { /// # Examples /// /// ``` + /// # #![feature(rand)] /// use std::rand::{thread_rng, Rng}; /// /// let s: String = thread_rng().gen_ascii_chars().take(10).collect(); @@ -277,6 +283,7 @@ pub trait Rng : Sized { /// # Examples /// /// ``` + /// # #![feature(rand)] /// use std::rand::{thread_rng, Rng}; /// /// let choices = [1, 2, 4, 8, 16, 32]; @@ -297,6 +304,7 @@ pub trait Rng : Sized { /// # Examples /// /// ``` + /// # #![feature(rand, core)] /// use std::rand::{thread_rng, Rng}; /// /// let mut rng = thread_rng(); @@ -360,6 +368,7 @@ pub trait SeedableRng<Seed>: Rng { /// # Examples /// /// ``` + /// # #![feature(rand)] /// use std::rand::{Rng, SeedableRng, StdRng}; /// /// let seed: &[_] = &[1, 2, 3, 4]; @@ -375,6 +384,7 @@ pub trait SeedableRng<Seed>: Rng { /// # Examples /// /// ``` + /// # #![feature(rand)] /// use std::rand::{Rng, SeedableRng, StdRng}; /// /// let seed: &[_] = &[1, 2, 3, 4]; @@ -480,6 +490,7 @@ impl Rand for XorShiftRng { /// # Examples /// /// ``` +/// # #![feature(rand)] /// use std::rand::{random, Open01}; /// /// let Open01(val) = random::<Open01<f32>>(); @@ -497,6 +508,7 @@ pub struct Open01<F>(pub F); /// # Examples /// /// ``` +/// # #![feature(rand)] /// use std::rand::{random, Closed01}; /// /// let Closed01(val) = random::<Closed01<f32>>(); diff --git a/src/librand/reseeding.rs b/src/librand/reseeding.rs index 81e65da37fc..95dd986d2e3 100644 --- a/src/librand/reseeding.rs +++ b/src/librand/reseeding.rs @@ -103,6 +103,7 @@ impl<S, R: SeedableRng<S>, Rsdr: Reseeder<R> + Default> /// # Examples /// /// ``` +/// # #![feature(rand)] /// use std::rand::{Rng, SeedableRng, StdRng}; /// use std::rand::reseeding::{Reseeder, ReseedingRng}; /// |
