about summary refs log tree commit diff
path: root/src/liballoc/sync.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/liballoc/sync.rs')
-rw-r--r--src/liballoc/sync.rs78
1 files changed, 36 insertions, 42 deletions
diff --git a/src/liballoc/sync.rs b/src/liballoc/sync.rs
index 52f8879d184..5bdb3616ed2 100644
--- a/src/liballoc/sync.rs
+++ b/src/liballoc/sync.rs
@@ -6,34 +6,28 @@
 //!
 //! [arc]: struct.Arc.html
 
-use core::{
-    any::Any,
-    sync::atomic::{
-        self,
-        Ordering::{Acquire, Relaxed, Release, SeqCst}
-    },
-    borrow,
-    fmt,
-    cmp::{self, Ordering},
-    intrinsics::abort,
-    mem::{self, align_of_val, size_of_val},
-    ops::{Deref, Receiver, CoerceUnsized, DispatchFromDyn},
-    pin::Pin,
-    ptr::{self, NonNull},
-    marker::{Unpin, Unsize, PhantomData},
-    hash::{Hash, Hasher},
-    isize, usize,
-    convert::From,
-    slice::from_raw_parts_mut,
-};
-
-use crate::{
-    alloc::{Global, Alloc, Layout, box_free, handle_alloc_error},
-    boxed::Box,
-    rc::is_dangling,
-    string::String,
-    vec::Vec,
-};
+use core::any::Any;
+use core::sync::atomic;
+use core::sync::atomic::Ordering::{Acquire, Relaxed, Release, SeqCst};
+use core::borrow;
+use core::fmt;
+use core::cmp::{self, Ordering};
+use core::intrinsics::abort;
+use core::mem::{self, align_of_val, size_of_val};
+use core::ops::{Deref, Receiver, CoerceUnsized, DispatchFromDyn};
+use core::pin::Pin;
+use core::ptr::{self, NonNull};
+use core::marker::{Unpin, Unsize, PhantomData};
+use core::hash::{Hash, Hasher};
+use core::{isize, usize};
+use core::convert::From;
+use core::slice::from_raw_parts_mut;
+
+use crate::alloc::{Global, Alloc, Layout, box_free, handle_alloc_error};
+use crate::boxed::Box;
+use crate::rc::is_dangling;
+use crate::string::String;
+use crate::vec::Vec;
 
 /// A soft limit on the amount of references that may be made to an `Arc`.
 ///
@@ -1654,18 +1648,16 @@ impl<T> From<Vec<T>> for Arc<[T]> {
 
 #[cfg(test)]
 mod tests {
-    use std::{
-        boxed::Box,
-        clone::Clone,
-        sync::mpsc::channel,
-        mem::drop,
-        ops::Drop,
-        option::Option::{self, None, Some},
-        sync::atomic::{self, Ordering::{Acquire, SeqCst}},
-        thread,
-        sync::Mutex,
-        convert::From,
-    };
+    use std::boxed::Box;
+    use std::clone::Clone;
+    use std::sync::mpsc::channel;
+    use std::mem::drop;
+    use std::ops::Drop;
+    use std::option::Option::{self, None, Some};
+    use std::sync::atomic::{self, Ordering::{Acquire, SeqCst}};
+    use std::thread;
+    use std::sync::Mutex;
+    use std::convert::From;
 
     use super::{Arc, Weak};
     use crate::vec::Vec;
@@ -1774,7 +1766,8 @@ mod tests {
 
     #[test]
     fn test_into_from_raw_unsized() {
-        use std::{fmt::Display, string::ToString};
+        use std::fmt::Display;
+        use std::string::ToString;
 
         let arc: Arc<str> = Arc::from("foo");
 
@@ -2086,7 +2079,8 @@ mod tests {
 
     #[test]
     fn test_from_box_trait() {
-        use std::{fmt::Display, string::ToString};
+        use std::fmt::Display;
+        use std::string::ToString;
 
         let b: Box<dyn Display> = box 123;
         let r: Arc<dyn Display> = Arc::from(b);