]> git.lizzy.rs Git - rust.git/commitdiff
Breaking change upgrades
authorMark Rousskov <mark.simulacrum@gmail.com>
Sat, 4 Aug 2018 22:24:39 +0000 (16:24 -0600)
committerMark Rousskov <mark.simulacrum@gmail.com>
Tue, 4 Sep 2018 19:22:08 +0000 (13:22 -0600)
26 files changed:
src/Cargo.lock
src/liballoc/Cargo.toml
src/liballoc/collections/linked_list.rs
src/liballoc/tests/slice.rs
src/libcore/Cargo.toml
src/libcore/tests/num/flt2dec/random.rs
src/libcore/tests/slice.rs
src/librustc/Cargo.toml
src/librustc/mir/cache.rs
src/librustc/mir/mod.rs
src/librustc/ty/steal.rs
src/librustc_cratesio_shim/Cargo.toml
src/librustc_cratesio_shim/src/lib.rs
src/librustc_data_structures/Cargo.toml
src/librustc_data_structures/sync.rs
src/librustc_errors/Cargo.toml
src/librustc_incremental/Cargo.toml
src/librustc_incremental/persist/fs.rs
src/libstd/Cargo.toml
src/libstd/fs.rs
src/libstd/sync/rwlock.rs
src/libstd/sys_common/io.rs
src/libstd/tests/env.rs
src/libsyntax/source_map.rs
src/tools/compiletest/Cargo.toml
src/tools/tidy/src/deps.rs

index 2239f8b9478a4568dc0e857eeae6c0aa42b00149..951745bf5bbb5e4590a193639d2c980177b03b6a 100644 (file)
@@ -12,7 +12,7 @@ version = "0.0.0"
 dependencies = [
  "compiler_builtins 0.0.0",
  "core 0.0.0",
- "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -391,7 +391,7 @@ dependencies = [
  "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "miow 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "rustfix 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde_derive 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -421,7 +421,7 @@ dependencies = [
 name = "core"
 version = "0.0.0"
 dependencies = [
- "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -1092,6 +1092,15 @@ dependencies = [
 name = "linkchecker"
 version = "0.1.0"
 
+[[package]]
+name = "lock_api"
+version = "0.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
 [[package]]
 name = "log"
 version = "0.3.9"
@@ -1397,6 +1406,15 @@ dependencies = [
  "parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
+[[package]]
+name = "parking_lot"
+version = "0.6.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "lock_api 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "parking_lot_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
 [[package]]
 name = "parking_lot_core"
 version = "0.2.14"
@@ -1408,6 +1426,17 @@ dependencies = [
  "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
+[[package]]
+name = "parking_lot_core"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
 [[package]]
 name = "percent-encoding"
 version = "1.0.1"
@@ -1821,7 +1850,7 @@ dependencies = [
  "jobserver 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
  "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "parking_lot 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "polonius-engine 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "proc_macro 0.0.0",
  "rustc-rayon 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2072,6 +2101,7 @@ version = "0.0.0"
 dependencies = [
  "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -2081,7 +2111,7 @@ dependencies = [
  "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
  "ena 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "parking_lot 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
  "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "rustc-rayon 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2131,10 +2161,11 @@ name = "rustc_errors"
 version = "0.0.0"
 dependencies = [
  "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc_cratesio_shim 0.0.0",
  "rustc_data_structures 0.0.0",
  "serialize 0.0.0",
  "syntax_pos 0.0.0",
- "termcolor 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "termcolor 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -2148,7 +2179,7 @@ version = "0.0.0"
 dependencies = [
  "graphviz 0.0.0",
  "log 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "rustc 0.0.0",
  "rustc_data_structures 0.0.0",
  "rustc_fs_util 0.0.0",
@@ -2580,7 +2611,7 @@ dependencies = [
  "panic_abort 0.0.0",
  "panic_unwind 0.0.0",
  "profiler_builtins 0.0.0",
- "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "rustc_asan 0.0.0",
  "rustc_lsan 0.0.0",
  "rustc_msan 0.0.0",
@@ -3156,6 +3187,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 "checksum libgit2-sys 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)" = "6ab62b46003ba97701554631fa570d9f7e7947e2480ae3d941e555a54a2c0f05"
 "checksum libssh2-sys 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "10dbc0957a27626444f5a3f523e6b97a70c3d702999bf1c7161cfbe7a25a9368"
 "checksum libz-sys 1.0.20 (registry+https://github.com/rust-lang/crates.io-index)" = "f5f9aba969b3c45fe9c94bec65895868a9ceca9a600699f4054b75747a19c7c6"
+"checksum lock_api 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "949826a5ccf18c1b3a7c3d57692778d21768b79e46eb9dd07bfc4c2160036c54"
 "checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b"
 "checksum log 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "cba860f648db8e6f269df990180c2217f333472b4a6e901e97446858487971e2"
 "checksum log_settings 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "19af41f0565d7c19b2058153ad0b42d4d5ce89ec4dbf06ed6741114a8b63e7cd"
@@ -3188,7 +3220,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 "checksum ordslice 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dd20eec3dbe4376829cb7d80ae6ac45e0a766831dca50202ff2d40db46a8a024"
 "checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37"
 "checksum parking_lot 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d4d05f1349491390b1730afba60bb20d55761bef489a954546b58b4b34e1e2ac"
+"checksum parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f0802bff09003b291ba756dc7e79313e51cc31667e94afbe847def490424cde5"
 "checksum parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "4db1a8ccf734a7bce794cc19b3df06ed87ab2f3907036b693c68f56b4d4537fa"
+"checksum parking_lot_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "06a2b6aae052309c2fd2161ef58f5067bc17bb758377a0de9d4b279d603fdd8a"
 "checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831"
 "checksum pest 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0fce5d8b5cc33983fc74f78ad552b5522ab41442c4ca91606e4236eb4b5ceefc"
 "checksum pest_derive 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "ab94faafeb93f4c5e3ce81ca0e5a779529a602ad5d09ae6d21996bfb8b6a52bf"
index 1dad323769a07b95f0ae315544cc68dd26df1b4f..642a43d4d9c2bc1a8d53a2db094183da8ffc8066 100644 (file)
@@ -14,7 +14,7 @@ core = { path = "../libcore" }
 compiler_builtins = { path = "../rustc/compiler_builtins_shim" }
 
 [dev-dependencies]
-rand = "0.4"
+rand = "0.5"
 
 [[test]]
 name = "collectionstests"
index 9844de9a57d70274c4bf91cc93d79da0e381acf4..2ef84dbade0fbc480f96529db85988407f45e241 100644 (file)
@@ -1222,7 +1222,7 @@ mod tests {
     use std::thread;
     use std::vec::Vec;
 
-    use rand::{thread_rng, Rng};
+    use rand::{thread_rng, RngCore};
 
     use super::{LinkedList, Node};
 
index df5e18a9a184ecc60a9afa90c19cf4a508109d28..f33bf64d40bdef79e987a809039b44891e0aad13 100644 (file)
@@ -18,7 +18,8 @@
 use std::sync::atomic::{ATOMIC_USIZE_INIT, AtomicUsize};
 use std::thread;
 
-use rand::{Rng, thread_rng};
+use rand::{Rng, RngCore, thread_rng};
+use rand::distributions::Standard;
 
 fn square(n: usize) -> usize {
     n * n
@@ -405,7 +406,7 @@ fn test_sort() {
     for len in (2..25).chain(500..510) {
         for &modulus in &[5, 10, 100, 1000] {
             for _ in 0..10 {
-                let orig: Vec<_> = rng.gen_iter::<i32>()
+                let orig: Vec<_> = rng.sample_iter::<i32, _>(&Standard)
                     .map(|x| x % modulus)
                     .take(len)
                     .collect();
index 321ed892ea9a986337baa7ea902215e27202f816..0b01cfc488bbaf83fd80b02ce4361957f4967456 100644 (file)
@@ -20,4 +20,4 @@ name = "corebenches"
 path = "../libcore/benches/lib.rs"
 
 [dev-dependencies]
-rand = "0.4"
+rand = "0.5"
index a1928657dabc480413d361950f8234d60ab8474b..ab619093d9d85b77969fc2ee9b0999cb8e5e56e5 100644 (file)
@@ -18,8 +18,8 @@
 use core::num::flt2dec::strategy::grisu::format_shortest_opt;
 use core::num::flt2dec::{decode, DecodableFloat, FullDecoded, Decoded};
 
-use rand::{self, Rand, XorShiftRng};
-use rand::distributions::{IndependentSample, Range};
+use rand::{FromEntropy, XorShiftRng};
+use rand::distributions::{Distribution, Uniform};
 
 pub fn decode_finite<T: DecodableFloat>(v: T) -> Decoded {
     match decode(v).1 {
@@ -71,10 +71,10 @@ fn iterate<F, G, V>(func: &str, k: usize, n: usize, mut f: F, mut g: G, mut v: V
 pub fn f32_random_equivalence_test<F, G>(f: F, g: G, k: usize, n: usize)
         where F: FnMut(&Decoded, &mut [u8]) -> Option<(usize, i16)>,
               G: FnMut(&Decoded, &mut [u8]) -> (usize, i16) {
-    let mut rng: XorShiftRng = Rand::rand(&mut rand::thread_rng());
-    let f32_range = Range::new(0x0000_0001u32, 0x7f80_0000);
+    let mut rng = XorShiftRng::from_entropy();
+    let f32_range = Uniform::new(0x0000_0001u32, 0x7f80_0000);
     iterate("f32_random_equivalence_test", k, n, f, g, |_| {
-        let x = f32::from_bits(f32_range.ind_sample(&mut rng));
+        let x = f32::from_bits(f32_range.sample(&mut rng));
         decode_finite(x)
     });
 }
@@ -82,10 +82,10 @@ pub fn f32_random_equivalence_test<F, G>(f: F, g: G, k: usize, n: usize)
 pub fn f64_random_equivalence_test<F, G>(f: F, g: G, k: usize, n: usize)
         where F: FnMut(&Decoded, &mut [u8]) -> Option<(usize, i16)>,
               G: FnMut(&Decoded, &mut [u8]) -> (usize, i16) {
-    let mut rng: XorShiftRng = Rand::rand(&mut rand::thread_rng());
-    let f64_range = Range::new(0x0000_0000_0000_0001u64, 0x7ff0_0000_0000_0000);
+    let mut rng = XorShiftRng::from_entropy();
+    let f64_range = Uniform::new(0x0000_0000_0000_0001u64, 0x7ff0_0000_0000_0000);
     iterate("f64_random_equivalence_test", k, n, f, g, |_| {
-        let x = f64::from_bits(f64_range.ind_sample(&mut rng));
+        let x = f64::from_bits(f64_range.sample(&mut rng));
         decode_finite(x)
     });
 }
index b087ec81f59c67004ef049027eb2aafad792368a..012dc9bf5e0b93751c40ea628adf19adcce71459 100644 (file)
@@ -802,11 +802,11 @@ fn test_rotate_right() {
 fn sort_unstable() {
     use core::cmp::Ordering::{Equal, Greater, Less};
     use core::slice::heapsort;
-    use rand::{Rng, XorShiftRng};
+    use rand::{FromEntropy, Rng, XorShiftRng};
 
     let mut v = [0; 600];
     let mut tmp = [0; 600];
-    let mut rng = XorShiftRng::new_unseeded();
+    let mut rng = XorShiftRng::from_entropy();
 
     for len in (2..25).chain(500..510) {
         let v = &mut v[0..len];
index fc5d4a9c92331bb606e535b23a9f5b55eca2168c..6c3b52196a3a2bb03c459e4f96b8a821fda5864d 100644 (file)
@@ -29,7 +29,7 @@ serialize = { path = "../libserialize" }
 syntax = { path = "../libsyntax" }
 syntax_pos = { path = "../libsyntax_pos" }
 backtrace = "0.3.3"
-parking_lot = "0.5.5"
+parking_lot = "0.6"
 byteorder = { version = "1.1", features = ["i128"]}
 chalk-engine = { version = "0.7.0", default-features=false }
 rustc_fs_util = { path = "../librustc_fs_util" }
index 41ba526b73fefdafd3d707eac79698e10da0ddd9..d1f050fcd424d23201142bd3453440a245c4b931 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 use rustc_data_structures::indexed_vec::IndexVec;
-use rustc_data_structures::sync::{RwLock, ReadGuard};
+use rustc_data_structures::sync::{RwLock, MappedReadGuard, ReadGuard};
 use rustc_data_structures::stable_hasher::{HashStable, StableHasher,
                                            StableHasherResult};
 use ich::StableHashingContext;
@@ -55,7 +55,10 @@ pub fn invalidate(&self) {
         *self.predecessors.borrow_mut() = None;
     }
 
-    pub fn predecessors(&self, mir: &Mir) -> ReadGuard<IndexVec<BasicBlock, Vec<BasicBlock>>> {
+    pub fn predecessors(
+        &self,
+        mir: &Mir
+    ) -> MappedReadGuard<IndexVec<BasicBlock, Vec<BasicBlock>>> {
         if self.predecessors.borrow().is_none() {
             *self.predecessors.borrow_mut() = Some(calculate_predecessors(mir));
         }
index 44730c19dd3e8a52a5e5bd0002ce6d934f15c7fb..f66be6dc54d37e3c883d062c5cfd44a0aeb6e12f 100644 (file)
@@ -25,7 +25,7 @@
 use rustc_data_structures::graph::{self, GraphPredecessors, GraphSuccessors};
 use rustc_data_structures::indexed_vec::{Idx, IndexVec};
 use rustc_data_structures::sync::Lrc;
-use rustc_data_structures::sync::ReadGuard;
+use rustc_data_structures::sync::MappedReadGuard;
 use rustc_serialize as serialize;
 use smallvec::SmallVec;
 use std::borrow::Cow;
@@ -194,13 +194,13 @@ pub fn basic_blocks_and_local_decls_mut(
     }
 
     #[inline]
-    pub fn predecessors(&self) -> ReadGuard<'_, IndexVec<BasicBlock, Vec<BasicBlock>>> {
+    pub fn predecessors(&self) -> MappedReadGuard<'_, IndexVec<BasicBlock, Vec<BasicBlock>>> {
         self.cache.predecessors(self)
     }
 
     #[inline]
-    pub fn predecessors_for(&self, bb: BasicBlock) -> ReadGuard<'_, Vec<BasicBlock>> {
-        ReadGuard::map(self.predecessors(), |p| &p[bb])
+    pub fn predecessors_for(&self, bb: BasicBlock) -> MappedReadGuard<'_, Vec<BasicBlock>> {
+        MappedReadGuard::map(self.predecessors(), |p| &p[bb])
     }
 
     #[inline]
index 842c0d6573432fb962057b3432bb4707f75f3048..3ff3cb4cae1d499dddf592c8a9db4854d0f00fcd 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use rustc_data_structures::sync::{RwLock, ReadGuard};
+use rustc_data_structures::sync::{RwLock, ReadGuard, MappedReadGuard};
 use std::mem;
 
 /// The `Steal` struct is intended to used as the value for a query.
@@ -42,7 +42,7 @@ pub fn new(value: T) -> Self {
         }
     }
 
-    pub fn borrow(&self) -> ReadGuard<T> {
+    pub fn borrow(&self) -> MappedReadGuard<T> {
         ReadGuard::map(self.value.borrow(), |opt| match *opt {
             None => bug!("attempted to read from stolen value"),
             Some(ref v) => v
index 342c7d1b67866b73573050a2bda970a2cb6b216b..b8e494e4040ec829e52baa89347883c04a287e7a 100644 (file)
@@ -22,3 +22,4 @@ crate-type = ["dylib"]
 [dependencies]
 bitflags = "1.0"
 log = "0.4"
+unicode-width = "0.1.4"
index 481f2f54c5e44abbc9aa322bb6a3854189a1b32a..ebceb00cca8b0b72c7a65bc4af1f944cdc62e170 100644 (file)
@@ -16,3 +16,4 @@
 
 extern crate bitflags;
 extern crate log;
+extern crate unicode_width;
index 0376cf8115756bf43e89d0d2c31d61df566ae25f..5a72fde6a2c8a1d917fb3d6d1efebf12a31084ae 100644 (file)
@@ -22,5 +22,5 @@ rustc-hash = "1.0.1"
 smallvec = { version = "0.6.5", features = ["union"] }
 
 [dependencies.parking_lot]
-version = "0.5"
+version = "0.6"
 features = ["nightly"]
index 6989cdc0a9a15afaf1e545cb3a10068f918d40b5..a2893a60cb680722c7e8eea40268f06dd767d93d 100644 (file)
@@ -93,8 +93,11 @@ pub fn par_iter<T: IntoIterator>(t: T) -> T::IntoIter {
         pub use std::rc::Rc as Lrc;
         pub use std::rc::Weak as Weak;
         pub use std::cell::Ref as ReadGuard;
+        pub use std::cell::Ref as MappedReadGuard;
         pub use std::cell::RefMut as WriteGuard;
+        pub use std::cell::RefMut as MappedWriteGuard;
         pub use std::cell::RefMut as LockGuard;
+        pub use std::cell::RefMut as MappedLockGuard;
 
         use std::cell::RefCell as InnerRwLock;
         use std::cell::RefCell as InnerLock;
@@ -213,9 +216,12 @@ pub fn take(&self) -> Option<T> {
         pub use std::marker::Sync as Sync;
 
         pub use parking_lot::RwLockReadGuard as ReadGuard;
+        pub use parking_lot::MappedRwLockReadGuard as MappedReadGuard;
         pub use parking_lot::RwLockWriteGuard as WriteGuard;
+        pub use parking_lot::MappedRwLockWriteGuard as MappedWriteGuard;
 
         pub use parking_lot::MutexGuard as LockGuard;
+        pub use parking_lot::MappedMutexGuard as MappedLockGuard;
 
         pub use std::sync::Arc as Lrc;
         pub use std::sync::Weak as Weak;
index e412d1749d1b2608c880d317c920c9caf23bd177..101ca0650c8a4247d281eb8d06534c52c3105b99 100644 (file)
@@ -12,6 +12,7 @@ crate-type = ["dylib"]
 serialize = { path = "../libserialize" }
 syntax_pos = { path = "../libsyntax_pos" }
 rustc_data_structures = { path = "../librustc_data_structures" }
+rustc_cratesio_shim = { path = "../librustc_cratesio_shim" }
 unicode-width = "0.1.4"
 atty = "0.2"
-termcolor = "0.3"
+termcolor = "1.0"
index c3f6062e799d96b6b3628363820df819922c5f7e..b8519ee1ab1a5bff1c839d55e4bb8d2db46abd6e 100644 (file)
@@ -11,7 +11,7 @@ crate-type = ["dylib"]
 [dependencies]
 graphviz = { path = "../libgraphviz" }
 log = "0.4"
-rand = "0.4"
+rand = "0.5"
 rustc = { path = "../librustc" }
 rustc_data_structures = { path = "../librustc_data_structures" }
 serialize = { path = "../libserialize" }
index 28d53dc7fb3c47a1fe5d2fa5406c1bb60a8b6622..ec25aef8080593800aea6305b4bfff01546a2764 100644 (file)
 use std::path::{Path, PathBuf};
 use std::time::{UNIX_EPOCH, SystemTime, Duration};
 
-use rand::{thread_rng, Rng};
+use rand::{RngCore, thread_rng};
 
 const LOCK_FILE_EXT: &'static str = ".lock";
 const DEP_GRAPH_FILENAME: &'static str = "dep-graph.bin";
index 5348c9a0f349842e057985b7fdfce779d3714082..bcdd1b4b088029fea45a223e733b9a27b60da69f 100644 (file)
@@ -25,7 +25,7 @@ profiler_builtins = { path = "../libprofiler_builtins", optional = true }
 unwind = { path = "../libunwind" }
 
 [dev-dependencies]
-rand = "0.4"
+rand = "0.5"
 
 [target.x86_64-apple-darwin.dependencies]
 rustc_asan = { path = "../librustc_asan" }
index 7632fbc41f5a322e64fe0ddfca7050178ce94e22..e177d4a988ae7d9c5ac943307f42f323ffe37a3b 100644 (file)
@@ -2076,7 +2076,7 @@ mod tests {
     use fs::{self, File, OpenOptions};
     use io::{ErrorKind, SeekFrom};
     use path::Path;
-    use rand::{StdRng, Rng};
+    use rand::{StdRng, FromEntropy, RngCore};
     use str;
     use sys_common::io::test::{TempDir, tmpdir};
     use thread;
@@ -3110,7 +3110,7 @@ fn _assert_send_sync<T: Send + Sync>() {}
     #[test]
     fn binary_file() {
         let mut bytes = [0; 1024];
-        StdRng::new().unwrap().fill_bytes(&mut bytes);
+        StdRng::from_entropy().fill_bytes(&mut bytes);
 
         let tmpdir = tmpdir();
 
@@ -3123,7 +3123,7 @@ fn binary_file() {
     #[test]
     fn write_then_read() {
         let mut bytes = [0; 1024];
-        StdRng::new().unwrap().fill_bytes(&mut bytes);
+        StdRng::from_entropy().fill_bytes(&mut bytes);
 
         let tmpdir = tmpdir();
 
index e3db60cff8474767167eb02e5e6bb56c20f73ae2..ed3a3865a6caee0f2b5d0d49bd4204f479dc10f6 100644 (file)
@@ -597,7 +597,7 @@ fn frob() {
             thread::spawn(move || {
                 let mut rng = rand::thread_rng();
                 for _ in 0..M {
-                    if rng.gen_weighted_bool(N) {
+                    if rng.gen_bool(1.0 / (N as f64)) {
                         drop(r.write().unwrap());
                     } else {
                         drop(r.read().unwrap());
index ab23936358e7872c15eeb793a908aed39880fde4..a96fb19213999cf7affeea0d2029497e4a0e44c1 100644 (file)
@@ -14,7 +14,7 @@
 pub mod test {
     use path::{Path, PathBuf};
     use env;
-    use rand::{self, Rng};
+    use rand::{self, RngCore};
     use fs;
 
     pub struct TempDir(PathBuf);
index 8acb8a46d7bf229ff81105161c44a03fb25b659e..7302a794480aba5d3157ae71e7af8606ff10c600 100644 (file)
 use std::env::*;
 use std::ffi::{OsString, OsStr};
 
-use rand::Rng;
+use rand::{thread_rng, Rng};
+use rand::distributions::Alphanumeric;
 
 fn make_rand_name() -> OsString {
-    let mut rng = rand::thread_rng();
-    let n = format!("TEST{}", rng.gen_ascii_chars().take(10)
+    let mut rng = thread_rng();
+    let n = format!("TEST{}", rng.sample_iter(&Alphanumeric).take(10)
                                  .collect::<String>());
     let n = OsString::from(n);
     assert!(var_os(&n).is_none());
index 8f91db8efa71a66a9096560dd73557040a29f0a3..95839f94b9efea279e3437c1d06d7817a5eee1fe 100644 (file)
@@ -24,7 +24,7 @@
 
 use rustc_data_structures::fx::FxHashMap;
 use rustc_data_structures::stable_hasher::StableHasher;
-use rustc_data_structures::sync::{Lrc, Lock, LockGuard};
+use rustc_data_structures::sync::{Lrc, Lock, LockGuard, MappedLockGuard};
 use std::cmp;
 use std::hash::Hash;
 use std::path::{Path, PathBuf};
@@ -194,7 +194,7 @@ pub fn load_file(&self, path: &Path) -> io::Result<Lrc<SourceFile>> {
         Ok(self.new_source_file(filename, src))
     }
 
-    pub fn files(&self) -> LockGuard<Vec<Lrc<SourceFile>>> {
+    pub fn files(&self) -> MappedLockGuard<Vec<Lrc<SourceFile>>> {
         LockGuard::map(self.files.borrow(), |files| &mut files.file_maps)
     }
 
index 6639ba51b12816a13944dd2bb2fe58c11aa59dac..7fec2e003a4452ee5ee7ffbe51ff24d1fd325958 100644 (file)
@@ -9,7 +9,7 @@ env_logger = { version = "0.5", default-features = false }
 filetime = "0.2"
 getopts = "0.2"
 log = "0.4"
-regex = "0.2"
+regex = "1.0"
 serde = "1.0"
 serde_json = "1.0"
 serde_derive = "1.0"
index b9549968db4ba22ae8176a03f2c9e29efc76ca73..d6a2c17d6f6f9a6d2b265180313840d927e296db 100644 (file)
@@ -91,6 +91,7 @@
     Crate("kernel32-sys"),
     Crate("lazy_static"),
     Crate("libc"),
+    Crate("lock_api"),
     Crate("log"),
     Crate("log_settings"),
     Crate("memchr"),
     Crate("owning_ref"),
     Crate("parking_lot"),
     Crate("parking_lot_core"),
-    Crate("polonius-engine"),
     Crate("pkg-config"),
+    Crate("polonius-engine"),
     Crate("quick-error"),
     Crate("rand"),
     Crate("rand_core"),
     Crate("winapi"),
     Crate("winapi-build"),
     Crate("winapi-i686-pc-windows-gnu"),
+    Crate("winapi-util"),
     Crate("winapi-x86_64-pc-windows-gnu"),
     Crate("wincolor"),
 ];