Skip to content

Commit a28cdff

Browse files
Reformat using the new identifier sorting from rustfmt
1 parent b3d4fde commit a28cdff

File tree

236 files changed

+622
-654
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

236 files changed

+622
-654
lines changed

alloc/benches/binary_heap.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::collections::BinaryHeap;
22

33
use rand::seq::SliceRandom;
4-
use test::{black_box, Bencher};
4+
use test::{Bencher, black_box};
55

66
#[bench]
77
fn bench_find_smallest_1000(b: &mut Bencher) {

alloc/benches/btree/map.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
use std::collections::BTreeMap;
22
use std::ops::RangeBounds;
33

4-
use rand::seq::SliceRandom;
54
use rand::Rng;
6-
use test::{black_box, Bencher};
5+
use rand::seq::SliceRandom;
6+
use test::{Bencher, black_box};
77

88
macro_rules! map_insert_rand_bench {
99
($name: ident, $n: expr, $map: ident) => {

alloc/benches/slice.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use std::{mem, ptr};
22

3-
use rand::distributions::{Alphanumeric, DistString, Standard};
43
use rand::Rng;
5-
use test::{black_box, Bencher};
4+
use rand::distributions::{Alphanumeric, DistString, Standard};
5+
use test::{Bencher, black_box};
66

77
#[bench]
88
fn iterator(b: &mut Bencher) {

alloc/benches/str.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use test::{black_box, Bencher};
1+
use test::{Bencher, black_box};
22

33
#[bench]
44
fn char_iterator(b: &mut Bencher) {

alloc/benches/string.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::iter::repeat;
22

3-
use test::{black_box, Bencher};
3+
use test::{Bencher, black_box};
44

55
#[bench]
66
fn bench_with_capacity(b: &mut Bencher) {

alloc/benches/vec.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::iter::repeat;
22

33
use rand::RngCore;
4-
use test::{black_box, Bencher};
4+
use test::{Bencher, black_box};
55

66
#[bench]
77
fn bench_new(b: &mut Bencher) {

alloc/benches/vec_deque.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
use std::collections::{vec_deque, VecDeque};
1+
use std::collections::{VecDeque, vec_deque};
22
use std::mem;
33

4-
use test::{black_box, Bencher};
4+
use test::{Bencher, black_box};
55

66
#[bench]
77
fn bench_new(b: &mut Bencher) {

alloc/src/boxed.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ use core::ops::{
199199
DerefPure, DispatchFromDyn, Receiver,
200200
};
201201
use core::pin::{Pin, PinCoerceUnsized};
202-
use core::ptr::{self, addr_of_mut, NonNull, Unique};
202+
use core::ptr::{self, NonNull, Unique, addr_of_mut};
203203
use core::task::{Context, Poll};
204204
use core::{borrow, fmt, slice};
205205

@@ -2480,7 +2480,10 @@ impl<Args: Tuple, F: AsyncFnOnce<Args> + ?Sized, A: Allocator> AsyncFnOnce<Args>
24802480

24812481
#[unstable(feature = "async_fn_traits", issue = "none")]
24822482
impl<Args: Tuple, F: AsyncFnMut<Args> + ?Sized, A: Allocator> AsyncFnMut<Args> for Box<F, A> {
2483-
type CallRefFuture<'a> = F::CallRefFuture<'a> where Self: 'a;
2483+
type CallRefFuture<'a>
2484+
= F::CallRefFuture<'a>
2485+
where
2486+
Self: 'a;
24842487

24852488
extern "rust-call" fn async_call_mut(&mut self, args: Args) -> Self::CallRefFuture<'_> {
24862489
F::async_call_mut(self, args)

alloc/src/collections/binary_heap/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@
145145

146146
use core::alloc::Allocator;
147147
use core::iter::{FusedIterator, InPlaceIterable, SourceIter, TrustedFused, TrustedLen};
148-
use core::mem::{self, swap, ManuallyDrop};
148+
use core::mem::{self, ManuallyDrop, swap};
149149
use core::num::NonZero;
150150
use core::ops::{Deref, DerefMut};
151151
use core::{fmt, ptr};

alloc/src/collections/binary_heap/tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::panic::{catch_unwind, AssertUnwindSafe};
1+
use std::panic::{AssertUnwindSafe, catch_unwind};
22

33
use super::*;
44
use crate::boxed::Box;

alloc/src/collections/btree/fix.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use core::alloc::Allocator;
33
use super::map::MIN_LEN;
44
use super::node::ForceResult::*;
55
use super::node::LeftOrRight::*;
6-
use super::node::{marker, Handle, NodeRef, Root};
6+
use super::node::{Handle, NodeRef, Root, marker};
77

88
impl<'a, K: 'a, V: 'a> NodeRef<marker::Mut<'a>, K, V, marker::LeafOrInternal> {
99
/// Stocks up a possibly underfull node by merging with or stealing from a

alloc/src/collections/btree/map.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use super::borrow::DormantMutRef;
1313
use super::dedup_sorted_iter::DedupSortedIter;
1414
use super::navigate::{LazyLeafRange, LeafRange};
1515
use super::node::ForceResult::*;
16-
use super::node::{self, marker, Handle, NodeRef, Root};
16+
use super::node::{self, Handle, NodeRef, Root, marker};
1717
use super::search::SearchBound;
1818
use super::search::SearchResult::*;
1919
use super::set_val::SetValZST;
@@ -22,9 +22,9 @@ use crate::vec::Vec;
2222

2323
mod entry;
2424

25+
use Entry::*;
2526
#[stable(feature = "rust1", since = "1.0.0")]
2627
pub use entry::{Entry, OccupiedEntry, OccupiedError, VacantEntry};
27-
use Entry::*;
2828

2929
/// Minimum number of elements in a node that is not a root.
3030
/// We might temporarily have fewer elements during methods.

alloc/src/collections/btree/map/entry.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use core::mem;
55
use Entry::*;
66

77
use super::super::borrow::DormantMutRef;
8-
use super::super::node::{marker, Handle, NodeRef};
8+
use super::super::node::{Handle, NodeRef, marker};
99
use super::BTreeMap;
1010
use crate::alloc::{Allocator, Global};
1111

alloc/src/collections/btree/map/tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use core::assert_matches::assert_matches;
22
use std::iter;
33
use std::ops::Bound::{Excluded, Included, Unbounded};
4-
use std::panic::{catch_unwind, AssertUnwindSafe};
4+
use std::panic::{AssertUnwindSafe, catch_unwind};
55
use std::sync::atomic::AtomicUsize;
66
use std::sync::atomic::Ordering::SeqCst;
77

alloc/src/collections/btree/navigate.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use core::ops::RangeBounds;
33
use core::{hint, ptr};
44

55
use super::node::ForceResult::*;
6-
use super::node::{marker, Handle, NodeRef};
6+
use super::node::{Handle, NodeRef, marker};
77
use super::search::SearchBound;
88
use crate::alloc::Allocator;
99
// `front` and `back` are always both `None` or both `Some`.

alloc/src/collections/btree/remove.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use core::alloc::Allocator;
33
use super::map::MIN_LEN;
44
use super::node::ForceResult::*;
55
use super::node::LeftOrRight::*;
6-
use super::node::{marker, Handle, NodeRef};
6+
use super::node::{Handle, NodeRef, marker};
77

88
impl<'a, K: 'a, V: 'a> Handle<NodeRef<marker::Mut<'a>, K, V, marker::LeafOrInternal>, marker::KV> {
99
/// Removes a key-value pair from the tree, and returns that pair, as well as

alloc/src/collections/btree/search.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use SearchBound::*;
66
use SearchResult::*;
77

88
use super::node::ForceResult::*;
9-
use super::node::{marker, Handle, NodeRef};
9+
use super::node::{Handle, NodeRef, marker};
1010

1111
pub enum SearchBound<T> {
1212
/// An inclusive bound to look for, just like `Bound::Included(T)`.

alloc/src/collections/btree/set.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ use core::iter::{FusedIterator, Peekable};
77
use core::mem::ManuallyDrop;
88
use core::ops::{BitAnd, BitOr, BitXor, Bound, RangeBounds, Sub};
99

10+
use super::Recover;
1011
use super::map::{BTreeMap, Keys};
1112
use super::merge_iter::MergeIterInner;
1213
use super::set_val::SetValZST;
13-
use super::Recover;
1414
use crate::alloc::{Allocator, Global};
1515
use crate::vec::Vec;
1616

alloc/src/collections/btree/set/tests.rs

+7-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use std::ops::Bound::{Excluded, Included};
2-
use std::panic::{catch_unwind, AssertUnwindSafe};
2+
use std::panic::{AssertUnwindSafe, catch_unwind};
33

44
use super::*;
55
use crate::testing::crash_test::{CrashTestDummy, Panic};
@@ -132,11 +132,9 @@ fn test_difference() {
132132
check_difference(&[1, 3, 5, 9, 11], &[3, 6, 9], &[1, 5, 11]);
133133
check_difference(&[1, 3, 5, 9, 11], &[0, 1], &[3, 5, 9, 11]);
134134
check_difference(&[1, 3, 5, 9, 11], &[11, 12], &[1, 3, 5, 9]);
135-
check_difference(
136-
&[-5, 11, 22, 33, 40, 42],
137-
&[-12, -5, 14, 23, 34, 38, 39, 50],
138-
&[11, 22, 33, 40, 42],
139-
);
135+
check_difference(&[-5, 11, 22, 33, 40, 42], &[-12, -5, 14, 23, 34, 38, 39, 50], &[
136+
11, 22, 33, 40, 42,
137+
]);
140138

141139
if cfg!(miri) {
142140
// Miri is too slow
@@ -252,11 +250,9 @@ fn test_union() {
252250
check_union(&[], &[], &[]);
253251
check_union(&[1, 2, 3], &[2], &[1, 2, 3]);
254252
check_union(&[2], &[1, 2, 3], &[1, 2, 3]);
255-
check_union(
256-
&[1, 3, 5, 9, 11, 16, 19, 24],
257-
&[-2, 1, 5, 9, 13, 19],
258-
&[-2, 1, 3, 5, 9, 11, 13, 16, 19, 24],
259-
);
253+
check_union(&[1, 3, 5, 9, 11, 16, 19, 24], &[-2, 1, 5, 9, 13, 19], &[
254+
-2, 1, 3, 5, 9, 11, 13, 16, 19, 24,
255+
]);
260256
}
261257

262258
#[test]

alloc/src/collections/linked_list/tests.rs

+13-17
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// FIXME(static_mut_refs): Do not allow `static_mut_refs` lint
22
#![allow(static_mut_refs)]
33

4-
use std::panic::{catch_unwind, AssertUnwindSafe};
4+
use std::panic::{AssertUnwindSafe, catch_unwind};
55
use std::thread;
66

77
use rand::RngCore;
@@ -696,10 +696,9 @@ fn test_cursor_mut_insert() {
696696
cursor.splice_after(p);
697697
cursor.splice_before(q);
698698
check_links(&m);
699-
assert_eq!(
700-
m.iter().cloned().collect::<Vec<_>>(),
701-
&[200, 201, 202, 203, 1, 100, 101, 102, 103, 8, 2, 3, 4, 5, 6]
702-
);
699+
assert_eq!(m.iter().cloned().collect::<Vec<_>>(), &[
700+
200, 201, 202, 203, 1, 100, 101, 102, 103, 8, 2, 3, 4, 5, 6
701+
]);
703702
let mut cursor = m.cursor_front_mut();
704703
cursor.move_prev();
705704
let tmp = cursor.split_before();
@@ -916,10 +915,9 @@ fn extract_if_complex() {
916915
assert_eq!(removed, vec![2, 4, 6, 18, 20, 22, 24, 26, 34, 36]);
917916

918917
assert_eq!(list.len(), 14);
919-
assert_eq!(
920-
list.into_iter().collect::<Vec<_>>(),
921-
vec![1, 7, 9, 11, 13, 15, 17, 27, 29, 31, 33, 35, 37, 39]
922-
);
918+
assert_eq!(list.into_iter().collect::<Vec<_>>(), vec![
919+
1, 7, 9, 11, 13, 15, 17, 27, 29, 31, 33, 35, 37, 39
920+
]);
923921
}
924922

925923
{
@@ -934,10 +932,9 @@ fn extract_if_complex() {
934932
assert_eq!(removed, vec![2, 4, 6, 18, 20, 22, 24, 26, 34, 36]);
935933

936934
assert_eq!(list.len(), 13);
937-
assert_eq!(
938-
list.into_iter().collect::<Vec<_>>(),
939-
vec![7, 9, 11, 13, 15, 17, 27, 29, 31, 33, 35, 37, 39]
940-
);
935+
assert_eq!(list.into_iter().collect::<Vec<_>>(), vec![
936+
7, 9, 11, 13, 15, 17, 27, 29, 31, 33, 35, 37, 39
937+
]);
941938
}
942939

943940
{
@@ -952,10 +949,9 @@ fn extract_if_complex() {
952949
assert_eq!(removed, vec![2, 4, 6, 18, 20, 22, 24, 26, 34, 36]);
953950

954951
assert_eq!(list.len(), 11);
955-
assert_eq!(
956-
list.into_iter().collect::<Vec<_>>(),
957-
vec![7, 9, 11, 13, 15, 17, 27, 29, 31, 33, 35]
958-
);
952+
assert_eq!(list.into_iter().collect::<Vec<_>>(), vec![
953+
7, 9, 11, 13, 15, 17, 27, 29, 31, 33, 35
954+
]);
959955
}
960956

961957
{

alloc/src/collections/vec_deque/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
use core::cmp::{self, Ordering};
1111
use core::hash::{Hash, Hasher};
12-
use core::iter::{repeat_n, repeat_with, ByRefSized};
12+
use core::iter::{ByRefSized, repeat_n, repeat_with};
1313
// This is used in a bunch of intra-doc links.
1414
// FIXME: For some reason, `#[cfg(doc)]` wasn't sufficient, resulting in
1515
// failures in linkchecker even though rustdoc built the docs just fine.

alloc/src/collections/vec_deque/tests.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -562,10 +562,9 @@ fn make_contiguous_head_to_end() {
562562
tester.push_front(i as char);
563563
}
564564

565-
assert_eq!(
566-
tester,
567-
['P', 'O', 'N', 'M', 'L', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K']
568-
);
565+
assert_eq!(tester, [
566+
'P', 'O', 'N', 'M', 'L', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K'
567+
]);
569568

570569
// ABCDEFGHIJKPONML
571570
let expected_start = 0;

alloc/src/ffi/c_str.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
mod tests;
55

66
use core::borrow::Borrow;
7-
use core::ffi::{c_char, CStr};
7+
use core::ffi::{CStr, c_char};
88
use core::num::NonZero;
99
use core::slice::memchr;
1010
use core::str::{self, Utf8Error};

alloc/src/fmt.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -580,10 +580,8 @@
580580
pub use core::fmt::Alignment;
581581
#[stable(feature = "rust1", since = "1.0.0")]
582582
pub use core::fmt::Error;
583-
#[unstable(feature = "debug_closure_helpers", issue = "117729")]
584-
pub use core::fmt::{from_fn, FromFn};
585583
#[stable(feature = "rust1", since = "1.0.0")]
586-
pub use core::fmt::{write, Arguments};
584+
pub use core::fmt::{Arguments, write};
587585
#[stable(feature = "rust1", since = "1.0.0")]
588586
pub use core::fmt::{Binary, Octal};
589587
#[stable(feature = "rust1", since = "1.0.0")]
@@ -592,6 +590,8 @@ pub use core::fmt::{Debug, Display};
592590
pub use core::fmt::{DebugList, DebugMap, DebugSet, DebugStruct, DebugTuple};
593591
#[stable(feature = "rust1", since = "1.0.0")]
594592
pub use core::fmt::{Formatter, Result, Write};
593+
#[unstable(feature = "debug_closure_helpers", issue = "117729")]
594+
pub use core::fmt::{FromFn, from_fn};
595595
#[stable(feature = "rust1", since = "1.0.0")]
596596
pub use core::fmt::{LowerExp, UpperExp};
597597
#[stable(feature = "rust1", since = "1.0.0")]

alloc/src/rc.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -251,13 +251,13 @@ use core::intrinsics::abort;
251251
#[cfg(not(no_global_oom_handling))]
252252
use core::iter;
253253
use core::marker::{PhantomData, Unsize};
254-
use core::mem::{self, align_of_val_raw, ManuallyDrop};
254+
use core::mem::{self, ManuallyDrop, align_of_val_raw};
255255
use core::ops::{CoerceUnsized, Deref, DerefMut, DerefPure, DispatchFromDyn, Receiver};
256256
use core::panic::{RefUnwindSafe, UnwindSafe};
257257
#[cfg(not(no_global_oom_handling))]
258258
use core::pin::Pin;
259259
use core::pin::PinCoerceUnsized;
260-
use core::ptr::{self, drop_in_place, NonNull};
260+
use core::ptr::{self, NonNull, drop_in_place};
261261
#[cfg(not(no_global_oom_handling))]
262262
use core::slice::from_raw_parts_mut;
263263
use core::{borrow, fmt, hint};

alloc/src/slice.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,6 @@ pub use core::slice::ArrayWindows;
4343
pub use core::slice::EscapeAscii;
4444
#[stable(feature = "slice_get_slice", since = "1.28.0")]
4545
pub use core::slice::SliceIndex;
46-
#[stable(feature = "from_ref", since = "1.28.0")]
47-
pub use core::slice::{from_mut, from_ref};
48-
#[unstable(feature = "slice_from_ptr_range", issue = "89792")]
49-
pub use core::slice::{from_mut_ptr_range, from_ptr_range};
50-
#[stable(feature = "rust1", since = "1.0.0")]
51-
pub use core::slice::{from_raw_parts, from_raw_parts_mut};
52-
#[unstable(feature = "slice_range", issue = "76393")]
53-
pub use core::slice::{range, try_range};
5446
#[stable(feature = "slice_group_by", since = "1.77.0")]
5547
pub use core::slice::{ChunkBy, ChunkByMut};
5648
#[stable(feature = "rust1", since = "1.0.0")]
@@ -69,6 +61,14 @@ pub use core::slice::{RSplit, RSplitMut};
6961
pub use core::slice::{RSplitN, RSplitNMut, SplitN, SplitNMut};
7062
#[stable(feature = "split_inclusive", since = "1.51.0")]
7163
pub use core::slice::{SplitInclusive, SplitInclusiveMut};
64+
#[stable(feature = "from_ref", since = "1.28.0")]
65+
pub use core::slice::{from_mut, from_ref};
66+
#[unstable(feature = "slice_from_ptr_range", issue = "89792")]
67+
pub use core::slice::{from_mut_ptr_range, from_ptr_range};
68+
#[stable(feature = "rust1", since = "1.0.0")]
69+
pub use core::slice::{from_raw_parts, from_raw_parts_mut};
70+
#[unstable(feature = "slice_range", issue = "76393")]
71+
pub use core::slice::{range, try_range};
7272

7373
////////////////////////////////////////////////////////////////////////////////
7474
// Basic slice extension methods

0 commit comments

Comments
 (0)