mozilla/rust — pull request #4801 by z0w0 (2013-02-05 13:06:29+00:00)
Title: rand::Rand: a trait implemented by types that can be randomly generated

Also adds Rng::gen() for generically generating any type that implements the Rand trait. There's no way to generate things with a length (for e.g. strings or vectors), because I can't think of an elegant way to do that. Maybe have a RandLen trait that inherits Rand?

This can be used for a quickcheck mechanism I'm working on.