about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-03-11 19:31:57 -0700
committerbors <bors@rust-lang.org>2014-03-11 19:31:57 -0700
commit0aa3b888568661eabd9994ad902eff8d44d59261 (patch)
treef1b124415b95601fb001fe922b4e98b62f893c78 /src/libsyntax/parse
parent74bfa7108a62c053fdeae2bb093f8035e19e2ef2 (diff)
parent689f19722fabd9aab61e826e00140a7fe7084afa (diff)
downloadrust-0aa3b888568661eabd9994ad902eff8d44d59261.tar.gz
rust-0aa3b888568661eabd9994ad902eff8d44d59261.zip
auto merge of #12650 : huonw/rust/librand, r=alexcrichton
Move std::rand to a separate rand crate

This functionality is not super-core and so doesn't need to be included
in std. It's possible that std may need rand (it does a little bit now,
for io::test) in which case the functionality required could be moved to
a secret hidden module and reexposed by librand.

Unfortunately, using #[deprecated] here is hard: there's too much to
mock to make it feasible, since we have to ensure that programs still
typecheck to reach the linting phase.

Also, deprecates/removes `rand::rng` (this time using `#[deprecated]`), since it's too easy to accidentally use inside a loop, making things very slow (have to read randomness from the OS and seed the RNG each time.)
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/token.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs
index 71ee32b4aad..cd52ff4b0ac 100644
--- a/src/libsyntax/parse/token.rs
+++ b/src/libsyntax/parse/token.rs
@@ -670,7 +670,7 @@ pub fn fresh_name(src: &ast::Ident) -> Name {
     // following: debug version. Could work in final except that it's incompatible with
     // good error messages and uses of struct names in ambiguous could-be-binding
     // locations. Also definitely destroys the guarantee given above about ptr_eq.
-    /*let num = rand::rng().gen_uint_range(0,0xffff);
+    /*let num = rand::task_rng().gen_uint_range(0,0xffff);
     gensym(format!("{}_{}",ident_to_str(src),num))*/
 }