Skip to content

Commit 0072e6b

Browse files
committed
Rollup merge of rust-lang#33917 - srinivasreddy:rustfmt_liballoc, r=GuillaumeGomez
rustfmt liballoc folder
2 parents c41e9d9 + 3fd0e4c commit 0072e6b

File tree

5 files changed

+22
-17
lines changed

5 files changed

+22
-17
lines changed

src/liballoc/arc.rs

+13-9
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
use boxed::Box;
7373

7474
use core::sync::atomic;
75-
use core::sync::atomic::Ordering::{Relaxed, Release, Acquire, SeqCst};
75+
use core::sync::atomic::Ordering::{Acquire, Relaxed, Release, SeqCst};
7676
use core::borrow;
7777
use core::fmt;
7878
use core::cmp::Ordering;
@@ -85,7 +85,7 @@ use core::ops::CoerceUnsized;
8585
use core::ptr::{self, Shared};
8686
use core::marker::Unsize;
8787
use core::hash::{Hash, Hasher};
88-
use core::{usize, isize};
88+
use core::{isize, usize};
8989
use core::convert::From;
9090
use heap::deallocate;
9191

@@ -608,11 +608,13 @@ impl<T> Weak<T> {
608608
#[stable(feature = "downgraded_weak", since = "1.10.0")]
609609
pub fn new() -> Weak<T> {
610610
unsafe {
611-
Weak { ptr: Shared::new(Box::into_raw(box ArcInner {
612-
strong: atomic::AtomicUsize::new(0),
613-
weak: atomic::AtomicUsize::new(1),
614-
data: uninitialized(),
615-
}))}
611+
Weak {
612+
ptr: Shared::new(Box::into_raw(box ArcInner {
613+
strong: atomic::AtomicUsize::new(0),
614+
weak: atomic::AtomicUsize::new(1),
615+
data: uninitialized(),
616+
})),
617+
}
616618
}
617619
}
618620
}
@@ -655,7 +657,9 @@ impl<T: ?Sized> Weak<T> {
655657

656658
// See comments in `Arc::clone` for why we do this (for `mem::forget`).
657659
if n > MAX_REFCOUNT {
658-
unsafe { abort(); }
660+
unsafe {
661+
abort();
662+
}
659663
}
660664

661665
// Relaxed is valid for the same reason it is on Arc's Clone impl
@@ -946,7 +950,7 @@ mod tests {
946950
use std::mem::drop;
947951
use std::ops::Drop;
948952
use std::option::Option;
949-
use std::option::Option::{Some, None};
953+
use std::option::Option::{None, Some};
950954
use std::sync::atomic;
951955
use std::sync::atomic::Ordering::{Acquire, SeqCst};
952956
use std::thread;

src/liballoc/boxed.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ use core::hash::{self, Hash};
6464
use core::marker::{self, Unsize};
6565
use core::mem;
6666
use core::ops::{CoerceUnsized, Deref, DerefMut};
67-
use core::ops::{Placer, Boxed, Place, InPlace, BoxPlace};
67+
use core::ops::{BoxPlace, Boxed, InPlace, Place, Placer};
6868
use core::ptr::{self, Unique};
6969
use core::raw::TraitObject;
7070
use core::convert::From;
@@ -535,7 +535,8 @@ pub trait FnBox<A> {
535535

536536
#[unstable(feature = "fnbox",
537537
reason = "will be deprecated if and when Box<FnOnce> becomes usable", issue = "28796")]
538-
impl<A, F> FnBox<A> for F where F: FnOnce<A>
538+
impl<A, F> FnBox<A> for F
539+
where F: FnOnce<A>
539540
{
540541
type Output = F::Output;
541542

src/liballoc/boxed_test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
1313
use core::any::Any;
1414
use core::ops::Deref;
15-
use core::result::Result::{Ok, Err};
15+
use core::result::Result::{Err, Ok};
1616
use core::clone::Clone;
1717

1818
use std::boxed::Box;

src/liballoc/heap.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
use core::{isize, usize};
1919
#[cfg(not(test))]
20-
use core::intrinsics::{size_of, min_align_of};
20+
use core::intrinsics::{min_align_of, size_of};
2121

2222
#[allow(improper_ctypes)]
2323
extern "C" {

src/liballoc/rc.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,11 @@ use core::borrow;
159159
use core::cell::Cell;
160160
use core::cmp::Ordering;
161161
use core::fmt;
162-
use core::hash::{Hasher, Hash};
163-
use core::intrinsics::{assume, abort};
162+
use core::hash::{Hash, Hasher};
163+
use core::intrinsics::{abort, assume};
164164
use core::marker;
165165
use core::marker::Unsize;
166-
use core::mem::{self, align_of_val, size_of_val, forget, uninitialized};
166+
use core::mem::{self, align_of_val, forget, size_of_val, uninitialized};
167167
use core::ops::Deref;
168168
use core::ops::CoerceUnsized;
169169
use core::ptr::{self, Shared};
@@ -935,7 +935,7 @@ mod tests {
935935
use std::boxed::Box;
936936
use std::cell::RefCell;
937937
use std::option::Option;
938-
use std::option::Option::{Some, None};
938+
use std::option::Option::{None, Some};
939939
use std::result::Result::{Err, Ok};
940940
use std::mem::drop;
941941
use std::clone::Clone;

0 commit comments

Comments
 (0)