diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2014-03-02 12:59:35 +1100 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2014-03-12 11:31:43 +1100 |
| commit | 689f19722fabd9aab61e826e00140a7fe7084afa (patch) | |
| tree | f1b124415b95601fb001fe922b4e98b62f893c78 /src/libsyntax/parse | |
| parent | 198caa87cd870f8fd52bf0bd5fe471cf439c12f0 (diff) | |
| download | rust-689f19722fabd9aab61e826e00140a7fe7084afa.tar.gz rust-689f19722fabd9aab61e826e00140a7fe7084afa.zip | |
rand: deprecate `rng`.
This should be called far less than it is because it does expensive OS interactions and seeding of the internal RNG, `task_rng` amortises this cost. The main problem is the name is so short and suggestive. The direct equivalent is `StdRng::new`, which does precisely the same thing. The deprecation will make migrating away from the function easier.
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/token.rs | 2 |
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))*/ } |
