diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2015-02-03 20:11:38 +1100 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2015-02-04 09:39:40 +1100 |
| commit | df1ac7aa63ea89a067c57663eab035f7b83f6933 (patch) | |
| tree | f053537b23c43f7e1badcc0409e740202461bb9b /src/libstd | |
| parent | eaf4c5c784637f3df8bdebc6ec21dbd4bc69420a (diff) | |
| download | rust-df1ac7aa63ea89a067c57663eab035f7b83f6933.tar.gz rust-df1ac7aa63ea89a067c57663eab035f7b83f6933.zip | |
Deprecate in-tree `rand`, `std::rand` and `#[derive(Rand)]`.
Use the crates.io crate `rand` (version 0.1 should be a drop in replacement for `std::rand`) and `rand_macros` (`#[derive_Rand]` should be a drop-in replacement). [breaking-change]
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/collections/hash/map.rs | 1 | ||||
| -rw-r--r-- | src/libstd/lib.rs | 2 | ||||
| -rw-r--r-- | src/libstd/num/strconv.rs | 1 | ||||
| -rw-r--r-- | src/libstd/old_io/fs.rs | 1 | ||||
| -rw-r--r-- | src/libstd/old_io/tempfile.rs | 1 | ||||
| -rw-r--r-- | src/libstd/os.rs | 2 | ||||
| -rw-r--r-- | src/libstd/rand/mod.rs | 3 | ||||
| -rw-r--r-- | src/libstd/sync/rwlock.rs | 2 |
8 files changed, 12 insertions, 1 deletions
diff --git a/src/libstd/collections/hash/map.rs b/src/libstd/collections/hash/map.rs index 3e2c7627dbe..449c8a9e5dc 100644 --- a/src/libstd/collections/hash/map.rs +++ b/src/libstd/collections/hash/map.rs @@ -1566,6 +1566,7 @@ pub struct RandomState { impl RandomState { /// Construct a new `RandomState` that is initialized with random keys. #[inline] + #[allow(deprecated)] pub fn new() -> RandomState { let mut r = rand::thread_rng(); RandomState { k0: r.gen(), k1: r.gen() } diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 96aebb735ef..21197f639ad 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -142,7 +142,7 @@ extern crate core; #[macro_reexport(vec)] extern crate "collections" as core_collections; -extern crate "rand" as core_rand; +#[allow(deprecated)] extern crate "rand" as core_rand; extern crate alloc; extern crate unicode; extern crate libc; diff --git a/src/libstd/num/strconv.rs b/src/libstd/num/strconv.rs index 1d3bf484edb..9c4741b3ce3 100644 --- a/src/libstd/num/strconv.rs +++ b/src/libstd/num/strconv.rs @@ -459,6 +459,7 @@ mod tests { #[cfg(test)] mod bench { + #![allow(deprecated)] // rand extern crate test; mod uint { diff --git a/src/libstd/old_io/fs.rs b/src/libstd/old_io/fs.rs index 0a9aeb849be..82ede30cb91 100644 --- a/src/libstd/old_io/fs.rs +++ b/src/libstd/old_io/fs.rs @@ -822,6 +822,7 @@ fn access_string(access: FileAccess) -> &'static str { #[allow(unused_imports)] #[allow(unused_variables)] #[allow(unused_mut)] +#[allow(deprecated)] // rand mod test { use prelude::v1::*; use old_io::{SeekSet, SeekCur, SeekEnd, Read, Open, ReadWrite, FileType}; diff --git a/src/libstd/old_io/tempfile.rs b/src/libstd/old_io/tempfile.rs index 20cbde5db71..d2c3a8e60ad 100644 --- a/src/libstd/old_io/tempfile.rs +++ b/src/libstd/old_io/tempfile.rs @@ -9,6 +9,7 @@ // except according to those terms. //! Temporary files and directories +#![allow(deprecated)] // rand use old_io::{fs, IoError, IoErrorKind, IoResult}; use old_io; diff --git a/src/libstd/os.rs b/src/libstd/os.rs index 600ca60349a..7a9f61f1d64 100644 --- a/src/libstd/os.rs +++ b/src/libstd/os.rs @@ -1425,6 +1425,8 @@ mod arch_consts { #[cfg(test)] mod tests { + #![allow(deprecated)] // rand + use prelude::v1::*; use iter::repeat; diff --git a/src/libstd/rand/mod.rs b/src/libstd/rand/mod.rs index 211abc2fc83..48ff6db4392 100644 --- a/src/libstd/rand/mod.rs +++ b/src/libstd/rand/mod.rs @@ -220,6 +220,9 @@ //! ``` #![unstable(feature = "rand")] +#![deprecated(reason = "use the crates.io `rand` library instead", + since = "1.0.0-alpha")] +#![allow(deprecated)] use cell::RefCell; use clone::Clone; diff --git a/src/libstd/sync/rwlock.rs b/src/libstd/sync/rwlock.rs index 95b570dd9c8..63ca5b5669a 100644 --- a/src/libstd/sync/rwlock.rs +++ b/src/libstd/sync/rwlock.rs @@ -383,6 +383,8 @@ impl<'a, T> Drop for RwLockWriteGuard<'a, T> { #[cfg(test)] mod tests { + #![allow(deprecated)] // rand + use prelude::v1::*; use rand::{self, Rng}; |
