about summary refs log tree commit diff
path: root/src/librand
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-04-01 18:37:54 -0700
committerAlex Crichton <alex@alexcrichton.com>2015-04-01 18:37:54 -0700
commitf92e7abefd0231f80d16062e5ff6aaf8cc3bc861 (patch)
treee8c5150252807a3b65c231c338627aaaef025f92 /src/librand
parent05654e528d9835f5b994241970bb4b6162665750 (diff)
parent449643301c1b30adf6b338174351219a58ffdb36 (diff)
downloadrust-f92e7abefd0231f80d16062e5ff6aaf8cc3bc861.tar.gz
rust-f92e7abefd0231f80d16062e5ff6aaf8cc3bc861.zip
rollup merge of #23860: nikomatsakis/copy-requires-clone
Conflicts:
	src/test/compile-fail/coherence-impls-copy.rs
Diffstat (limited to 'src/librand')
-rw-r--r--src/librand/distributions/exponential.rs4
-rw-r--r--src/librand/distributions/normal.rs6
-rw-r--r--src/librand/reseeding.rs2
3 files changed, 6 insertions, 6 deletions
diff --git a/src/librand/distributions/exponential.rs b/src/librand/distributions/exponential.rs
index 0c5f5cb0d44..2ba3164e1b0 100644
--- a/src/librand/distributions/exponential.rs
+++ b/src/librand/distributions/exponential.rs
@@ -29,7 +29,7 @@ use distributions::{ziggurat, ziggurat_tables, Sample, IndependentSample};
 /// Generate Normal Random
 /// Samples*](http://www.doornik.com/research/ziggurat.pdf). Nuffield
 /// College, Oxford
-#[derive(Copy)]
+#[derive(Copy, Clone)]
 pub struct Exp1(pub f64);
 
 // This could be done via `-rng.gen::<f64>().ln()` but that is slower.
@@ -68,7 +68,7 @@ impl Rand for Exp1 {
 /// let v = exp.ind_sample(&mut rand::thread_rng());
 /// println!("{} is from a Exp(2) distribution", v);
 /// ```
-#[derive(Copy)]
+#[derive(Copy, Clone)]
 pub struct Exp {
     /// `lambda` stored as `1/lambda`, since this is what we scale by.
     lambda_inverse: f64
diff --git a/src/librand/distributions/normal.rs b/src/librand/distributions/normal.rs
index 7cecc6ac611..fa41c3edfe5 100644
--- a/src/librand/distributions/normal.rs
+++ b/src/librand/distributions/normal.rs
@@ -28,7 +28,7 @@ use distributions::{ziggurat, ziggurat_tables, Sample, IndependentSample};
 /// Generate Normal Random
 /// Samples*](http://www.doornik.com/research/ziggurat.pdf). Nuffield
 /// College, Oxford
-#[derive(Copy)]
+#[derive(Copy, Clone)]
 pub struct StandardNormal(pub f64);
 
 impl Rand for StandardNormal {
@@ -85,7 +85,7 @@ impl Rand for StandardNormal {
 /// let v = normal.ind_sample(&mut rand::thread_rng());
 /// println!("{} is from a N(2, 9) distribution", v)
 /// ```
-#[derive(Copy)]
+#[derive(Copy, Clone)]
 pub struct Normal {
     mean: f64,
     std_dev: f64,
@@ -134,7 +134,7 @@ impl IndependentSample<f64> for Normal {
 /// let v = log_normal.ind_sample(&mut rand::thread_rng());
 /// println!("{} is from an ln N(2, 9) distribution", v)
 /// ```
-#[derive(Copy)]
+#[derive(Copy, Clone)]
 pub struct LogNormal {
     norm: Normal
 }
diff --git a/src/librand/reseeding.rs b/src/librand/reseeding.rs
index ab4939f57d4..98d1bbf5af9 100644
--- a/src/librand/reseeding.rs
+++ b/src/librand/reseeding.rs
@@ -134,7 +134,7 @@ pub trait Reseeder<R> {
 
 /// Reseed an RNG using a `Default` instance. This reseeds by
 /// replacing the RNG with the result of a `Default::default` call.
-#[derive(Copy)]
+#[derive(Copy, Clone)]
 pub struct ReseedWithDefault;
 
 impl<R: Rng + Default> Reseeder<R> for ReseedWithDefault {