rust/mk
Alex Crichton 925ff65118 std: Recreate a rand module
This commit shuffles around some of the `rand` code, along with some
reorganization. The new state of the world is as follows:

* The librand crate now only depends on libcore. This interface is experimental.
* The standard library has a new module, `std::rand`. This interface will
  eventually become stable.

Unfortunately, this entailed more of a breaking change than just shuffling some
names around. The following breaking changes were made to the rand library:

* Rng::gen_vec() was removed. This has been replaced with Rng::gen_iter() which
  will return an infinite stream of random values. Previous behavior can be
  regained with `rng.gen_iter().take(n).collect()`

* Rng::gen_ascii_str() was removed. This has been replaced with
  Rng::gen_ascii_chars() which will return an infinite stream of random ascii
  characters. Similarly to gen_iter(), previous behavior can be emulated with
  `rng.gen_ascii_chars().take(n).collect()`

* {IsaacRng, Isaac64Rng, XorShiftRng}::new() have all been removed. These all
  relied on being able to use an OSRng for seeding, but this is no longer
  available in librand (where these types are defined). To retain the same
  functionality, these types now implement the `Rand` trait so they can be
  generated with a random seed from another random number generator. This allows
  the stdlib to use an OSRng to create seeded instances of these RNGs.

* Rand implementations for `Box<T>` and `@T` were removed. These seemed to be
  pretty rare in the codebase, and it allows for librand to not depend on
  liballoc.  Additionally, other pointer types like Rc<T> and Arc<T> were not
  supported.  If this is undesirable, librand can depend on liballoc and regain
  these implementations.

* The WeightedChoice structure is no longer built with a `Vec<Weighted<T>>`,
  but rather a `&mut [Weighted<T>]`. This means that the WeightedChoice
  structure now has a lifetime associated with it.

* The `sample` method on `Rng` has been moved to a top-level function in the
  `rand` module due to its dependence on `Vec`.

cc #13851

[breaking-change]
2014-05-29 16:18:26 -07:00
..
clean.mk mk: Don't rm 'dist' during clean, just its contents 2014-03-24 14:29:19 -07:00
crates.mk std: Recreate a rand module 2014-05-29 16:18:26 -07:00
ctags.mk
dist.mk mk: Bundle jemalloc with make dist 2014-05-11 17:41:36 -04:00
docs.mk mk: Don't build any docs with --disable-docs. 2014-05-27 20:17:17 -04:00
host.mk mk: Add libcore 2014-05-07 08:12:48 -07:00
install.mk Made 'make install' include libs for additional targets 2014-04-08 00:03:12 -07:00
llvm.mk llvm: Add an option to statically link libstdc++ 2014-04-17 11:39:51 -07:00
main.mk Refactoring: Introduce distinct host and target rpath var setters. 2014-05-18 22:56:26 +02:00
perf.mk
platform.mk Add clang specific flag more selectively. 2014-05-23 17:27:13 -07:00
prepare.mk mk: Fix make install 2014-05-07 23:23:17 -07:00
reconfig.mk
rt.mk mk: Don't build jemalloc with -g3 2014-05-15 15:45:55 -07:00
rustllvm.mk
snap.mk
stage0.mk configure: Make rustlibdir non-configurable 2014-03-25 21:35:10 -07:00
target.mk mk: Replace 'oxidize' with 'rustc'. Closes #13781 2014-05-21 11:01:59 -07:00
tests.mk mk: Replace 'oxidize' with 'rustc'. Closes #13781 2014-05-21 11:01:59 -07:00
util.mk