rust-lang/rust — pull request #20199 by nagisa (2014-12-24 13:58:51+00:00)
Title: Make PRNGs implement Clone instead of Copy

Remove derivations of `Copy` trait from `ChaChaRng`, `IsaacRng`, `Isaac64Rng`
and `StdRng` and implement the `Clone` trait instead.

Copying is an implicit operation and the copy shares its internal state with
the original generator. This means the the two generators will yield exactly
the same sequence of values. This behaviour is considerably easy to trigger
by, for example, passing the generator by value to a function.

`Clone` trait, on the other hand, does no implicit copying. The user will only
be able to either move the generator or ask for a copy explicitly, via the
`clone` method.

The only downside to this patch is the fact that the implementations of
`Clone::clone` methods do not optimise down to a single memcpy, like the
derived `Copy` implementations did.

Although the `Copy` implementations of these random number generators are
suspected to not be used much, this is a [breaking-change].

Fixes #20170.