about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorSrinivas Reddy Thatiparthy <thatiparthysreenivas@gmail.com>2016-05-28 02:25:16 +0530
committerSrinivas Reddy Thatiparthy <thatiparthysreenivas@gmail.com>2016-05-28 02:25:16 +0530
commit3fd0e4c7f2eafa4382ff33a3274cec03e8b207f2 (patch)
treeb1e49d44350cc71af150d272b6e04159f1e9a5e7 /src/liballoc
parentab7c35fa0fcd725cdc207487b760d85fd07ecdd7 (diff)
downloadrust-3fd0e4c7f2eafa4382ff33a3274cec03e8b207f2.tar.gz
rust-3fd0e4c7f2eafa4382ff33a3274cec03e8b207f2.zip
rustfmt liballoc folder
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/arc.rs22
-rw-r--r--src/liballoc/boxed.rs5
-rw-r--r--src/liballoc/boxed_test.rs2
-rw-r--r--src/liballoc/heap.rs2
-rw-r--r--src/liballoc/rc.rs8
5 files changed, 22 insertions, 17 deletions
diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs
index d0a51e320cc..729d9218a29 100644
--- a/src/liballoc/arc.rs
+++ b/src/liballoc/arc.rs
@@ -72,7 +72,7 @@
 use boxed::Box;
 
 use core::sync::atomic;
-use core::sync::atomic::Ordering::{Relaxed, Release, Acquire, SeqCst};
+use core::sync::atomic::Ordering::{Acquire, Relaxed, Release, SeqCst};
 use core::borrow;
 use core::fmt;
 use core::cmp::Ordering;
@@ -85,7 +85,7 @@ use core::ops::CoerceUnsized;
 use core::ptr::{self, Shared};
 use core::marker::Unsize;
 use core::hash::{Hash, Hasher};
-use core::{usize, isize};
+use core::{isize, usize};
 use core::convert::From;
 use heap::deallocate;
 
@@ -608,11 +608,13 @@ impl<T> Weak<T> {
     #[stable(feature = "downgraded_weak", since = "1.10.0")]
     pub fn new() -> Weak<T> {
         unsafe {
-            Weak { ptr: Shared::new(Box::into_raw(box ArcInner {
-                strong: atomic::AtomicUsize::new(0),
-                weak: atomic::AtomicUsize::new(1),
-                data: uninitialized(),
-            }))}
+            Weak {
+                ptr: Shared::new(Box::into_raw(box ArcInner {
+                    strong: atomic::AtomicUsize::new(0),
+                    weak: atomic::AtomicUsize::new(1),
+                    data: uninitialized(),
+                })),
+            }
         }
     }
 }
@@ -655,7 +657,9 @@ impl<T: ?Sized> Weak<T> {
 
             // See comments in `Arc::clone` for why we do this (for `mem::forget`).
             if n > MAX_REFCOUNT {
-                unsafe { abort(); }
+                unsafe {
+                    abort();
+                }
             }
 
             // Relaxed is valid for the same reason it is on Arc's Clone impl
@@ -946,7 +950,7 @@ mod tests {
     use std::mem::drop;
     use std::ops::Drop;
     use std::option::Option;
-    use std::option::Option::{Some, None};
+    use std::option::Option::{None, Some};
     use std::sync::atomic;
     use std::sync::atomic::Ordering::{Acquire, SeqCst};
     use std::thread;
diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs
index 10e4ea1c3f0..51523ca8dc6 100644
--- a/src/liballoc/boxed.rs
+++ b/src/liballoc/boxed.rs
@@ -64,7 +64,7 @@ use core::hash::{self, Hash};
 use core::marker::{self, Unsize};
 use core::mem;
 use core::ops::{CoerceUnsized, Deref, DerefMut};
-use core::ops::{Placer, Boxed, Place, InPlace, BoxPlace};
+use core::ops::{BoxPlace, Boxed, InPlace, Place, Placer};
 use core::ptr::{self, Unique};
 use core::raw::TraitObject;
 use core::convert::From;
@@ -535,7 +535,8 @@ pub trait FnBox<A> {
 
 #[unstable(feature = "fnbox",
            reason = "will be deprecated if and when Box<FnOnce> becomes usable", issue = "28796")]
-impl<A, F> FnBox<A> for F where F: FnOnce<A>
+impl<A, F> FnBox<A> for F
+    where F: FnOnce<A>
 {
     type Output = F::Output;
 
diff --git a/src/liballoc/boxed_test.rs b/src/liballoc/boxed_test.rs
index 120301afa44..8d68ce3c1f6 100644
--- a/src/liballoc/boxed_test.rs
+++ b/src/liballoc/boxed_test.rs
@@ -12,7 +12,7 @@
 
 use core::any::Any;
 use core::ops::Deref;
-use core::result::Result::{Ok, Err};
+use core::result::Result::{Err, Ok};
 use core::clone::Clone;
 
 use std::boxed::Box;
diff --git a/src/liballoc/heap.rs b/src/liballoc/heap.rs
index 08b403a60f3..bfed8a8e83a 100644
--- a/src/liballoc/heap.rs
+++ b/src/liballoc/heap.rs
@@ -17,7 +17,7 @@
 
 use core::{isize, usize};
 #[cfg(not(test))]
-use core::intrinsics::{size_of, min_align_of};
+use core::intrinsics::{min_align_of, size_of};
 
 #[allow(improper_ctypes)]
 extern "C" {
diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs
index b92f5af05e3..cf4fb459bc1 100644
--- a/src/liballoc/rc.rs
+++ b/src/liballoc/rc.rs
@@ -159,11 +159,11 @@ use core::borrow;
 use core::cell::Cell;
 use core::cmp::Ordering;
 use core::fmt;
-use core::hash::{Hasher, Hash};
-use core::intrinsics::{assume, abort};
+use core::hash::{Hash, Hasher};
+use core::intrinsics::{abort, assume};
 use core::marker;
 use core::marker::Unsize;
-use core::mem::{self, align_of_val, size_of_val, forget, uninitialized};
+use core::mem::{self, align_of_val, forget, size_of_val, uninitialized};
 use core::ops::Deref;
 use core::ops::CoerceUnsized;
 use core::ptr::{self, Shared};
@@ -935,7 +935,7 @@ mod tests {
     use std::boxed::Box;
     use std::cell::RefCell;
     use std::option::Option;
-    use std::option::Option::{Some, None};
+    use std::option::Option::{None, Some};
     use std::result::Result::{Err, Ok};
     use std::mem::drop;
     use std::clone::Clone;