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 Weak { #[stable(feature = "downgraded_weak", since = "1.10.0")] pub fn new() -> Weak { 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 Weak { // 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 { #[unstable(feature = "fnbox", reason = "will be deprecated if and when Box becomes usable", issue = "28796")] -impl FnBox for F where F: FnOnce +impl FnBox for F + where F: FnOnce { 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;