]> git.proxmox.com Git - rustc.git/blobdiff - vendor/rustc-rayon/src/slice/quicksort.rs
Merge tag 'debian/1.52.1+dfsg1-1_exp2' into proxmox/buster
[rustc.git] / vendor / rustc-rayon / src / slice / quicksort.rs
index 4fd781316009b33240e09788de08a4497a5f3d81..b985073514d966ac74ce391c1e5a4e5836671021 100644 (file)
@@ -4,7 +4,6 @@
 //! The only difference from the original is that calls to `recurse` are executed in parallel using
 //! `rayon_core::join`.
 
-use rayon_core;
 use std::cmp;
 use std::mem;
 use std::ptr;
@@ -256,14 +255,14 @@ where
     let mut block_l = BLOCK;
     let mut start_l = ptr::null_mut();
     let mut end_l = ptr::null_mut();
-    let mut offsets_l: [u8; BLOCK] = unsafe { mem::uninitialized() };
+    let mut offsets_l = [0u8; BLOCK];
 
     // The current block on the right side (from `r.offset(-block_r)` to `r`).
     let mut r = unsafe { l.add(v.len()) };
     let mut block_r = BLOCK;
     let mut start_r = ptr::null_mut();
     let mut end_r = ptr::null_mut();
-    let mut offsets_r: [u8; BLOCK] = unsafe { mem::uninitialized() };
+    let mut offsets_r = [0u8; BLOCK];
 
     // Returns the number of elements between pointers `l` (inclusive) and `r` (exclusive).
     fn width<T>(l: *mut T, r: *mut T) -> usize {
@@ -767,7 +766,7 @@ mod tests {
 
     #[test]
     fn test_heapsort() {
-        let mut rng = thread_rng();
+        let rng = thread_rng();
 
         for len in (0..25).chain(500..501) {
             for &modulus in &[5, 10, 100] {