summary refs log tree commit diff
path: root/src/librand/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/librand/lib.rs')
-rw-r--r--src/librand/lib.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/librand/lib.rs b/src/librand/lib.rs
index 915c70bbf8c..7588bf7c515 100644
--- a/src/librand/lib.rs
+++ b/src/librand/lib.rs
@@ -41,6 +41,7 @@ extern crate core;
 #[cfg(test)] #[macro_use] extern crate log;
 
 use core::prelude::*;
+use core::marker::PhantomData;
 
 pub use isaac::{IsaacRng, Isaac64Rng};
 pub use chacha::ChaChaRng;
@@ -206,7 +207,7 @@ pub trait Rng : Sized {
     ///                     .collect::<Vec<(f64, bool)>>());
     /// ```
     fn gen_iter<'a, T: Rand>(&'a mut self) -> Generator<'a, T, Self> {
-        Generator { rng: self }
+        Generator { rng: self, _marker: PhantomData }
     }
 
     /// Generate a random value in the range [`low`, `high`).
@@ -317,6 +318,7 @@ pub trait Rng : Sized {
 /// This iterator is created via the `gen_iter` method on `Rng`.
 pub struct Generator<'a, T, R:'a> {
     rng: &'a mut R,
+    _marker: PhantomData<T>
 }
 
 impl<'a, T: Rand, R: Rng> Iterator for Generator<'a, T, R> {