Skip to content

Commit c3e1f77

Browse files
committed
Auto merge of #21892 - huonw:deprecate-rand, r=alexcrichton
Use [`rand`](https://crates.io/crates/rand) and [`derive_rand`](https://crates.io/crates/derive_rand) from crates.io. [breaking-change]
2 parents d6c15d9 + df1ac7a commit c3e1f77

File tree

21 files changed

+26
-100
lines changed

21 files changed

+26
-100
lines changed

src/etc/generate-deriving-span-tests.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,7 @@ def write_file(name, string):
114114
'Encodable': (0, [], 0), # FIXME: quoting gives horrible spans
115115
}
116116

117-
for (trait, supers, errs) in [('Rand', [], 1),
118-
('Clone', [], 1),
117+
for (trait, supers, errs) in [('Clone', [], 1),
119118
('PartialEq', [], 2),
120119
('PartialOrd', ['PartialEq'], 8),
121120
('Eq', ['PartialEq'], 1),

src/libcollections/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#![feature(unicode)]
3333
#![feature(unsafe_destructor, slicing_syntax)]
3434
#![cfg_attr(test, feature(test))]
35+
#![cfg_attr(test, allow(deprecated))] // rand
3536

3637
#![no_std]
3738

src/libcoretest/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#![feature(int_uint)]
1313
#![feature(unboxed_closures)]
1414
#![feature(unsafe_destructor, slicing_syntax)]
15+
#![allow(deprecated)] // rand
1516

1617
extern crate core;
1718
extern crate test;

src/libflate/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ pub fn inflate_bytes_zlib(bytes: &[u8]) -> Option<Bytes> {
130130

131131
#[cfg(test)]
132132
mod tests {
133+
#![allow(deprecated)]
133134
use super::{inflate_bytes, deflate_bytes};
134135
use std::rand;
135136
use std::rand::Rng;

src/librand/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
#![feature(staged_api)]
2929
#![staged_api]
3030
#![feature(core)]
31+
#![deprecated(reason = "use the crates.io `rand` library instead",
32+
since = "1.0.0-alpha")]
33+
34+
#![allow(deprecated)]
3135

3236
#[macro_use]
3337
extern crate core;

src/librustc_back/sha2.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,7 @@ static H256: [u32; 8] = [
528528

529529
#[cfg(test)]
530530
mod tests {
531+
#![allow(deprecated)]
531532
extern crate rand;
532533

533534
use self::rand::Rng;

src/libstd/collections/hash/map.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1593,6 +1593,7 @@ pub struct RandomState {
15931593
impl RandomState {
15941594
/// Construct a new `RandomState` that is initialized with random keys.
15951595
#[inline]
1596+
#[allow(deprecated)]
15961597
pub fn new() -> RandomState {
15971598
let mut r = rand::thread_rng();
15981599
RandomState { k0: r.gen(), k1: r.gen() }

src/libstd/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ extern crate core;
140140
#[macro_reexport(vec)]
141141
extern crate "collections" as core_collections;
142142

143-
extern crate "rand" as core_rand;
143+
#[allow(deprecated)] extern crate "rand" as core_rand;
144144
extern crate alloc;
145145
extern crate unicode;
146146
extern crate libc;

src/libstd/num/strconv.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,7 @@ mod tests {
459459

460460
#[cfg(test)]
461461
mod bench {
462+
#![allow(deprecated)] // rand
462463
extern crate test;
463464

464465
mod uint {

src/libstd/old_io/fs.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -822,6 +822,7 @@ fn access_string(access: FileAccess) -> &'static str {
822822
#[allow(unused_imports)]
823823
#[allow(unused_variables)]
824824
#[allow(unused_mut)]
825+
#[allow(deprecated)] // rand
825826
mod test {
826827
use prelude::v1::*;
827828
use old_io::{SeekSet, SeekCur, SeekEnd, Read, Open, ReadWrite, FileType};

0 commit comments

Comments
 (0)