about summary refs log tree commit diff
path: root/library
diff options
context:
space:
mode:
Diffstat (limited to 'library')
-rw-r--r--library/alloc/benches/btree/map.rs3
-rw-r--r--library/alloc/benches/linked_list.rs1
-rw-r--r--library/alloc/benches/string.rs1
-rw-r--r--library/alloc/benches/vec.rs3
-rw-r--r--library/alloc/benches/vec_deque.rs7
-rw-r--r--library/alloc/benches/vec_deque_append.rs3
-rw-r--r--library/alloc/src/alloc.rs8
-rw-r--r--library/alloc/src/alloc/tests.rs3
-rw-r--r--library/alloc/src/borrow.rs7
-rw-r--r--library/alloc/src/boxed.rs17
-rw-r--r--library/alloc/src/boxed/thin.rs6
-rw-r--r--library/alloc/src/collections/binary_heap/mod.rs3
-rw-r--r--library/alloc/src/collections/binary_heap/tests.rs6
-rw-r--r--library/alloc/src/collections/btree/append.rs5
-rw-r--r--library/alloc/src/collections/btree/fix.rs7
-rw-r--r--library/alloc/src/collections/btree/map.rs12
-rw-r--r--library/alloc/src/collections/btree/map/entry.rs5
-rw-r--r--library/alloc/src/collections/btree/map/tests.rs12
-rw-r--r--library/alloc/src/collections/btree/mem.rs4
-rw-r--r--library/alloc/src/collections/btree/navigate.rs7
-rw-r--r--library/alloc/src/collections/btree/remove.rs7
-rw-r--r--library/alloc/src/collections/btree/search.rs5
-rw-r--r--library/alloc/src/collections/btree/set.rs3
-rw-r--r--library/alloc/src/collections/btree/set/tests.rs5
-rw-r--r--library/alloc/src/collections/btree/split.rs6
-rw-r--r--library/alloc/src/collections/linked_list.rs3
-rw-r--r--library/alloc/src/collections/linked_list/tests.rs12
-rw-r--r--library/alloc/src/collections/mod.rs7
-rw-r--r--library/alloc/src/collections/vec_deque/drain.rs3
-rw-r--r--library/alloc/src/collections/vec_deque/into_iter.rs7
-rw-r--r--library/alloc/src/collections/vec_deque/mod.rs12
-rw-r--r--library/alloc/src/collections/vec_deque/spec_extend.rs4
-rw-r--r--library/alloc/src/ffi/c_str.rs18
-rw-r--r--library/alloc/src/ffi/c_str/tests.rs6
-rw-r--r--library/alloc/src/ffi/mod.rs7
-rw-r--r--library/alloc/src/raw_vec.rs3
-rw-r--r--library/alloc/src/raw_vec/tests.rs3
-rw-r--r--library/alloc/src/rc.rs13
-rw-r--r--library/alloc/src/rc/tests.rs4
-rw-r--r--library/alloc/src/slice.rs1
-rw-r--r--library/alloc/src/slice/tests.rs21
-rw-r--r--library/alloc/src/str.rs20
-rw-r--r--library/alloc/src/string.rs5
-rw-r--r--library/alloc/src/sync.rs4
-rw-r--r--library/alloc/src/sync/tests.rs4
-rw-r--r--library/alloc/src/task.rs6
-rw-r--r--library/alloc/src/testing/crash_test.rs6
-rw-r--r--library/alloc/src/tests.rs1
-rw-r--r--library/alloc/src/vec/cow.rs3
-rw-r--r--library/alloc/src/vec/drain.rs2
-rw-r--r--library/alloc/src/vec/extract_if.rs5
-rw-r--r--library/alloc/src/vec/in_place_collect.rs5
-rw-r--r--library/alloc/src/vec/in_place_drop.rs3
-rw-r--r--library/alloc/src/vec/into_iter.rs16
-rw-r--r--library/alloc/src/vec/mod.rs5
-rw-r--r--library/alloc/src/vec/partial_eq.rs3
-rw-r--r--library/alloc/src/vec/spec_extend.rs2
-rw-r--r--library/alloc/src/vec/spec_from_elem.rs3
-rw-r--r--library/alloc/src/vec/spec_from_iter_nested.rs6
-rw-r--r--library/alloc/src/vec/splice.rs2
-rw-r--r--library/alloc/tests/btree_set_hash.rs3
-rw-r--r--library/alloc/tests/slice.rs7
-rw-r--r--library/alloc/tests/str.rs3
-rw-r--r--library/alloc/tests/string.rs6
-rw-r--r--library/alloc/tests/vec.rs6
-rw-r--r--library/alloc/tests/vec_deque.rs7
-rw-r--r--library/alloc/tests/vec_deque_alloc_error.rs10
-rw-r--r--library/core/benches/any.rs1
-rw-r--r--library/core/benches/array.rs3
-rw-r--r--library/core/benches/ascii.rs4
-rw-r--r--library/core/benches/ascii/is_ascii.rs4
-rw-r--r--library/core/benches/fmt.rs1
-rw-r--r--library/core/benches/hash/sip.rs1
-rw-r--r--library/core/benches/iter.rs1
-rw-r--r--library/core/benches/num/flt2dec/mod.rs4
-rw-r--r--library/core/benches/num/flt2dec/strategy/dragon.rs3
-rw-r--r--library/core/benches/num/flt2dec/strategy/grisu.rs3
-rw-r--r--library/core/benches/num/mod.rs1
-rw-r--r--library/core/benches/ops.rs1
-rw-r--r--library/core/benches/pattern.rs3
-rw-r--r--library/core/benches/slice.rs4
-rw-r--r--library/core/benches/str.rs1
-rw-r--r--library/core/benches/str/char_count.rs3
-rw-r--r--library/core/benches/str/debug.rs1
-rw-r--r--library/core/benches/str/iter.rs3
-rw-r--r--library/core/src/alloc/global.rs3
-rw-r--r--library/core/src/alloc/layout.rs4
-rw-r--r--library/core/src/alloc/mod.rs2
-rw-r--r--library/core/src/any.rs4
-rw-r--r--library/core/src/array/iter.rs13
-rw-r--r--library/core/src/array/mod.rs1
-rw-r--r--library/core/src/ascii.rs3
-rw-r--r--library/core/src/asserting.rs6
-rw-r--r--library/core/src/async_iter/from_iter.rs3
-rw-r--r--library/core/src/cell/lazy.rs3
-rw-r--r--library/core/src/cell/once.rs3
-rw-r--r--library/core/src/char/methods.rs3
-rw-r--r--library/core/src/char/mod.rs3
-rw-r--r--library/core/src/ffi/c_str.rs9
-rw-r--r--library/core/src/ffi/mod.rs13
-rw-r--r--library/core/src/ffi/va_list.rs1
-rw-r--r--library/core/src/fmt/float.rs3
-rw-r--r--library/core/src/fmt/mod.rs10
-rw-r--r--library/core/src/fmt/num.rs5
-rw-r--r--library/core/src/future/mod.rs20
-rw-r--r--library/core/src/hash/mod.rs9
-rw-r--r--library/core/src/hash/sip.rs4
-rw-r--r--library/core/src/hint.rs3
-rw-r--r--library/core/src/intrinsics.rs6
-rw-r--r--library/core/src/intrinsics/mir.rs3
-rw-r--r--library/core/src/iter/adapters/cloned.rs8
-rw-r--r--library/core/src/iter/adapters/copied.rs8
-rw-r--r--library/core/src/iter/adapters/cycle.rs3
-rw-r--r--library/core/src/iter/adapters/enumerate.rs5
-rw-r--r--library/core/src/iter/adapters/filter.rs10
-rw-r--r--library/core/src/iter/adapters/filter_map.rs3
-rw-r--r--library/core/src/iter/adapters/flatten.rs8
-rw-r--r--library/core/src/iter/adapters/inspect.rs3
-rw-r--r--library/core/src/iter/adapters/map.rs5
-rw-r--r--library/core/src/iter/adapters/map_while.rs3
-rw-r--r--library/core/src/iter/adapters/map_windows.rs9
-rw-r--r--library/core/src/iter/adapters/mod.rs37
-rw-r--r--library/core/src/iter/adapters/peekable.rs3
-rw-r--r--library/core/src/iter/adapters/scan.rs3
-rw-r--r--library/core/src/iter/adapters/skip.rs4
-rw-r--r--library/core/src/iter/adapters/skip_while.rs3
-rw-r--r--library/core/src/iter/adapters/step_by.rs10
-rw-r--r--library/core/src/iter/adapters/take.rs6
-rw-r--r--library/core/src/iter/adapters/take_while.rs3
-rw-r--r--library/core/src/iter/adapters/zip.rs5
-rw-r--r--library/core/src/iter/mod.rs77
-rw-r--r--library/core/src/iter/range.rs7
-rw-r--r--library/core/src/iter/sources.rs32
-rw-r--r--library/core/src/iter/sources/empty.rs3
-rw-r--r--library/core/src/iter/sources/successors.rs3
-rw-r--r--library/core/src/iter/traits/iterator.rs17
-rw-r--r--library/core/src/iter/traits/mod.rs16
-rw-r--r--library/core/src/marker.rs3
-rw-r--r--library/core/src/mem/maybe_uninit.rs5
-rw-r--r--library/core/src/mem/mod.rs7
-rw-r--r--library/core/src/net/display_buffer.rs3
-rw-r--r--library/core/src/net/ip_addr.rs3
-rw-r--r--library/core/src/net/socket_addr.rs3
-rw-r--r--library/core/src/num/bignum.rs6
-rw-r--r--library/core/src/num/dec2flt/mod.rs7
-rw-r--r--library/core/src/num/flt2dec/mod.rs1
-rw-r--r--library/core/src/num/flt2dec/strategy/dragon.rs4
-rw-r--r--library/core/src/num/mod.rs32
-rw-r--r--library/core/src/num/nonzero.rs9
-rw-r--r--library/core/src/num/saturating.rs8
-rw-r--r--library/core/src/num/wrapping.rs8
-rw-r--r--library/core/src/ops/mod.rs55
-rw-r--r--library/core/src/option.rs7
-rw-r--r--library/core/src/panic.rs3
-rw-r--r--library/core/src/pin.rs4
-rw-r--r--library/core/src/ptr/metadata.rs3
-rw-r--r--library/core/src/ptr/mod.rs12
-rw-r--r--library/core/src/ptr/non_null.rs5
-rw-r--r--library/core/src/range.rs6
-rw-r--r--library/core/src/range/iter.rs5
-rw-r--r--library/core/src/slice/ascii.rs8
-rw-r--r--library/core/src/slice/cmp.rs4
-rw-r--r--library/core/src/slice/index.rs3
-rw-r--r--library/core/src/slice/iter.rs6
-rw-r--r--library/core/src/slice/mod.rs59
-rw-r--r--library/core/src/slice/raw.rs4
-rw-r--r--library/core/src/slice/rotate.rs3
-rw-r--r--library/core/src/slice/sort/select.rs1
-rw-r--r--library/core/src/slice/sort/shared/smallsort.rs5
-rw-r--r--library/core/src/slice/sort/stable/drift.rs4
-rw-r--r--library/core/src/slice/sort/stable/merge.rs3
-rw-r--r--library/core/src/slice/sort/stable/mod.rs4
-rw-r--r--library/core/src/slice/sort/stable/quicksort.rs4
-rw-r--r--library/core/src/slice/sort/unstable/heapsort.rs3
-rw-r--r--library/core/src/slice/sort/unstable/mod.rs1
-rw-r--r--library/core/src/slice/sort/unstable/quicksort.rs4
-rw-r--r--library/core/src/str/converts.rs3
-rw-r--r--library/core/src/str/iter.rs25
-rw-r--r--library/core/src/str/lossy.rs8
-rw-r--r--library/core/src/str/mod.rs68
-rw-r--r--library/core/src/str/pattern.rs6
-rw-r--r--library/core/src/str/traits.rs7
-rw-r--r--library/core/src/str/validations.rs3
-rw-r--r--library/core/src/sync/atomic.rs5
-rw-r--r--library/core/src/task/wake.rs3
-rw-r--r--library/core/src/tuple.rs4
-rw-r--r--library/core/src/ub_checks.rs1
-rw-r--r--library/core/tests/array.rs3
-rw-r--r--library/core/tests/clone.rs3
-rw-r--r--library/core/tests/cmp.rs6
-rw-r--r--library/core/tests/hash/sip.rs3
-rw-r--r--library/core/tests/iter/adapters/chain.rs3
-rw-r--r--library/core/tests/iter/adapters/flatten.rs3
-rw-r--r--library/core/tests/iter/adapters/map_windows.rs6
-rw-r--r--library/core/tests/iter/adapters/peekable.rs3
-rw-r--r--library/core/tests/iter/adapters/zip.rs6
-rw-r--r--library/core/tests/iter/range.rs3
-rw-r--r--library/core/tests/iter/sources.rs3
-rw-r--r--library/core/tests/lazy.rs7
-rw-r--r--library/core/tests/mem.rs1
-rw-r--r--library/core/tests/net/ip_addr.rs3
-rw-r--r--library/core/tests/num/flt2dec/mod.rs10
-rw-r--r--library/core/tests/num/flt2dec/random.rs7
-rw-r--r--library/core/tests/num/flt2dec/strategy/dragon.rs3
-rw-r--r--library/core/tests/num/flt2dec/strategy/grisu.rs3
-rw-r--r--library/core/tests/ops.rs5
-rw-r--r--library/core/tests/pin_macro.rs8
-rw-r--r--library/core/tests/result.rs3
-rw-r--r--library/core/tests/slice.rs1
-rw-r--r--library/core/tests/waker.rs8
-rw-r--r--library/panic_unwind/src/emcc.rs5
-rw-r--r--library/proc_macro/src/bridge/arena.rs5
-rw-r--r--library/proc_macro/src/bridge/client.rs7
-rw-r--r--library/proc_macro/src/bridge/fxhash.rs3
-rw-r--r--library/proc_macro/src/bridge/mod.rs12
-rw-r--r--library/proc_macro/src/bridge/server.rs4
-rw-r--r--library/proc_macro/src/lib.rs9
-rw-r--r--library/std/benches/hash/map.rs1
-rw-r--r--library/std/benches/hash/set_ops.rs1
-rw-r--r--library/std/src/alloc.rs3
-rw-r--r--library/std/src/ascii.rs5
-rw-r--r--library/std/src/backtrace.rs6
-rw-r--r--library/std/src/collections/hash/map.rs6
-rw-r--r--library/std/src/collections/hash/map/tests.rs6
-rw-r--r--library/std/src/collections/hash/set.rs3
-rw-r--r--library/std/src/collections/hash/set/tests.rs1
-rw-r--r--library/std/src/collections/mod.rs29
-rw-r--r--library/std/src/env.rs4
-rw-r--r--library/std/src/error.rs6
-rw-r--r--library/std/src/error/tests.rs3
-rw-r--r--library/std/src/f128.rs6
-rw-r--r--library/std/src/f128/tests.rs3
-rw-r--r--library/std/src/f16.rs6
-rw-r--r--library/std/src/f16/tests.rs3
-rw-r--r--library/std/src/f32.rs10
-rw-r--r--library/std/src/f32/tests.rs3
-rw-r--r--library/std/src/f64.rs10
-rw-r--r--library/std/src/f64/tests.rs3
-rw-r--r--library/std/src/ffi/c_str.rs21
-rw-r--r--library/std/src/ffi/mod.rs52
-rw-r--r--library/std/src/ffi/os_str.rs5
-rw-r--r--library/std/src/fs/tests.rs26
-rw-r--r--library/std/src/hash/random.rs3
-rw-r--r--library/std/src/io/buffered/bufreader.rs3
-rw-r--r--library/std/src/io/buffered/bufwriter.rs4
-rw-r--r--library/std/src/io/buffered/linewriter.rs3
-rw-r--r--library/std/src/io/buffered/linewritershim.rs3
-rw-r--r--library/std/src/io/buffered/mod.rs12
-rw-r--r--library/std/src/io/buffered/tests.rs3
-rw-r--r--library/std/src/io/copy/tests.rs7
-rw-r--r--library/std/src/io/cursor.rs3
-rw-r--r--library/std/src/io/error.rs5
-rw-r--r--library/std/src/io/error/repr_bitpacked.rs3
-rw-r--r--library/std/src/io/error/tests.rs6
-rw-r--r--library/std/src/io/impls.rs5
-rw-r--r--library/std/src/io/mod.rs18
-rw-r--r--library/std/src/io/stdio.rs3
-rw-r--r--library/std/src/io/tests.rs5
-rw-r--r--library/std/src/io/util/tests.rs1
-rw-r--r--library/std/src/lib.rs85
-rw-r--r--library/std/src/net/ip_addr.rs10
-rw-r--r--library/std/src/net/mod.rs6
-rw-r--r--library/std/src/net/socket_addr.rs13
-rw-r--r--library/std/src/net/tcp.rs6
-rw-r--r--library/std/src/net/tcp/tests.rs3
-rw-r--r--library/std/src/net/udp.rs3
-rw-r--r--library/std/src/num.rs17
-rw-r--r--library/std/src/os/aix/raw.rs1
-rw-r--r--library/std/src/os/android/fs.rs3
-rw-r--r--library/std/src/os/android/net.rs2
-rw-r--r--library/std/src/os/darwin/fs.rs5
-rw-r--r--library/std/src/os/dragonfly/fs.rs3
-rw-r--r--library/std/src/os/emscripten/fs.rs3
-rw-r--r--library/std/src/os/espidf/fs.rs3
-rw-r--r--library/std/src/os/fd/owned.rs4
-rw-r--r--library/std/src/os/fd/raw.rs8
-rw-r--r--library/std/src/os/fortanix_sgx/arch.rs3
-rw-r--r--library/std/src/os/fortanix_sgx/mod.rs20
-rw-r--r--library/std/src/os/freebsd/fs.rs3
-rw-r--r--library/std/src/os/haiku/fs.rs3
-rw-r--r--library/std/src/os/hermit/io/net.rs3
-rw-r--r--library/std/src/os/illumos/fs.rs3
-rw-r--r--library/std/src/os/ios/mod.rs1
-rw-r--r--library/std/src/os/l4re/fs.rs3
-rw-r--r--library/std/src/os/linux/fs.rs3
-rw-r--r--library/std/src/os/linux/net.rs2
-rw-r--r--library/std/src/os/macos/mod.rs1
-rw-r--r--library/std/src/os/net/linux_ext/tcp.rs3
-rw-r--r--library/std/src/os/net/linux_ext/tests.rs14
-rw-r--r--library/std/src/os/netbsd/fs.rs3
-rw-r--r--library/std/src/os/openbsd/fs.rs3
-rw-r--r--library/std/src/os/redox/fs.rs3
-rw-r--r--library/std/src/os/solaris/fs.rs3
-rw-r--r--library/std/src/os/solid/io.rs4
-rw-r--r--library/std/src/os/uefi/env.rs3
-rw-r--r--library/std/src/os/unix/fs.rs14
-rw-r--r--library/std/src/os/unix/net/datagram.rs28
-rw-r--r--library/std/src/os/unix/net/tests.rs10
-rw-r--r--library/std/src/os/unix/net/ucred.rs16
-rw-r--r--library/std/src/os/unix/net/ucred/tests.rs3
-rw-r--r--library/std/src/os/unix/process.rs8
-rw-r--r--library/std/src/os/wasi/fs.rs7
-rw-r--r--library/std/src/os/wasi/net/mod.rs3
-rw-r--r--library/std/src/os/windows/ffi.rs5
-rw-r--r--library/std/src/os/windows/fs.rs3
-rw-r--r--library/std/src/os/windows/io/handle.rs6
-rw-r--r--library/std/src/os/windows/io/raw.rs6
-rw-r--r--library/std/src/os/windows/io/socket.rs4
-rw-r--r--library/std/src/os/windows/process.rs3
-rw-r--r--library/std/src/os/xous/services.rs3
-rw-r--r--library/std/src/os/xous/services/dns.rs3
-rw-r--r--library/std/src/os/xous/services/log.rs3
-rw-r--r--library/std/src/os/xous/services/net.rs3
-rw-r--r--library/std/src/os/xous/services/systime.rs3
-rw-r--r--library/std/src/os/xous/services/ticktimer.rs3
-rw-r--r--library/std/src/panic.rs15
-rw-r--r--library/std/src/panicking.rs21
-rw-r--r--library/std/src/path.rs9
-rw-r--r--library/std/src/path/tests.rs4
-rw-r--r--library/std/src/pipe.rs6
-rw-r--r--library/std/src/process.rs7
-rw-r--r--library/std/src/process/tests.rs3
-rw-r--r--library/std/src/sync/lazy_lock.rs3
-rw-r--r--library/std/src/sync/lazy_lock/tests.rs15
-rw-r--r--library/std/src/sync/mod.rs19
-rw-r--r--library/std/src/sync/mpmc/array.rs1
-rw-r--r--library/std/src/sync/mpmc/context.rs1
-rw-r--r--library/std/src/sync/mpmc/counter.rs3
-rw-r--r--library/std/src/sync/mpmc/error.rs4
-rw-r--r--library/std/src/sync/mpmc/list.rs1
-rw-r--r--library/std/src/sync/mpmc/mod.rs3
-rw-r--r--library/std/src/sync/mpmc/waker.rs1
-rw-r--r--library/std/src/sync/mpmc/zero.rs1
-rw-r--r--library/std/src/sync/mpsc/mod.rs3
-rw-r--r--library/std/src/sync/mpsc/sync_tests.rs3
-rw-r--r--library/std/src/sync/mpsc/tests.rs3
-rw-r--r--library/std/src/sync/once/tests.rs3
-rw-r--r--library/std/src/sync/once_lock/tests.rs14
-rw-r--r--library/std/src/sync/poison.rs1
-rw-r--r--library/std/src/sync/rwlock/tests.rs3
-rw-r--r--library/std/src/sys/anonymous_pipe/tests.rs6
-rw-r--r--library/std/src/sys/anonymous_pipe/unix.rs15
-rw-r--r--library/std/src/sys/anonymous_pipe/unsupported.rs9
-rw-r--r--library/std/src/sys/anonymous_pipe/windows.rs17
-rw-r--r--library/std/src/sys/backtrace.rs4
-rw-r--r--library/std/src/sys/os_str/bytes.rs4
-rw-r--r--library/std/src/sys/os_str/wtf8.rs3
-rw-r--r--library/std/src/sys/pal/common/alloc.rs3
-rw-r--r--library/std/src/sys/pal/common/small_c_string.rs3
-rw-r--r--library/std/src/sys/pal/common/tests.rs3
-rw-r--r--library/std/src/sys/pal/hermit/args.rs10
-rw-r--r--library/std/src/sys/pal/hermit/fd.rs7
-rw-r--r--library/std/src/sys/pal/hermit/fs.rs12
-rw-r--r--library/std/src/sys/pal/hermit/io.rs4
-rw-r--r--library/std/src/sys/pal/hermit/net.rs7
-rw-r--r--library/std/src/sys/pal/hermit/os.rs8
-rw-r--r--library/std/src/sys/pal/hermit/thread.rs3
-rw-r--r--library/std/src/sys/pal/hermit/time.rs3
-rw-r--r--library/std/src/sys/pal/itron/error.rs4
-rw-r--r--library/std/src/sys/pal/itron/spin.rs8
-rw-r--r--library/std/src/sys/pal/itron/task.rs7
-rw-r--r--library/std/src/sys/pal/itron/thread.rs27
-rw-r--r--library/std/src/sys/pal/itron/time.rs6
-rw-r--r--library/std/src/sys/pal/sgx/abi/mod.rs3
-rw-r--r--library/std/src/sys/pal/sgx/abi/panic.rs3
-rw-r--r--library/std/src/sys/pal/sgx/abi/tls/mod.rs3
-rw-r--r--library/std/src/sys/pal/sgx/abi/usercalls/alloc.rs10
-rw-r--r--library/std/src/sys/pal/sgx/abi/usercalls/tests.rs3
-rw-r--r--library/std/src/sys/pal/sgx/alloc.rs4
-rw-r--r--library/std/src/sys/pal/sgx/args.rs6
-rw-r--r--library/std/src/sys/pal/sgx/net.rs6
-rw-r--r--library/std/src/sys/pal/sgx/os.rs8
-rw-r--r--library/std/src/sys/pal/sgx/thread.rs3
-rw-r--r--library/std/src/sys/pal/sgx/thread_parking.rs3
-rw-r--r--library/std/src/sys/pal/sgx/waitqueue/mod.rs12
-rw-r--r--library/std/src/sys/pal/solid/abi/fs.rs3
-rw-r--r--library/std/src/sys/pal/solid/abi/mod.rs1
-rw-r--r--library/std/src/sys/pal/solid/abi/sockets.rs3
-rw-r--r--library/std/src/sys/pal/solid/alloc.rs6
-rw-r--r--library/std/src/sys/pal/solid/error.rs3
-rw-r--r--library/std/src/sys/pal/solid/fs.rs23
-rw-r--r--library/std/src/sys/pal/solid/io.rs6
-rw-r--r--library/std/src/sys/pal/solid/mod.rs3
-rw-r--r--library/std/src/sys/pal/solid/net.rs24
-rw-r--r--library/std/src/sys/pal/solid/os.rs18
-rw-r--r--library/std/src/sys/pal/solid/time.rs7
-rw-r--r--library/std/src/sys/pal/teeos/os.rs7
-rw-r--r--library/std/src/sys/pal/teeos/stdio.rs3
-rw-r--r--library/std/src/sys/pal/teeos/thread.rs4
-rw-r--r--library/std/src/sys/pal/uefi/args.rs3
-rw-r--r--library/std/src/sys/pal/uefi/helpers.rs4
-rw-r--r--library/std/src/sys/pal/uefi/mod.rs3
-rw-r--r--library/std/src/sys/pal/uefi/os.rs8
-rw-r--r--library/std/src/sys/pal/uefi/process.rs15
-rw-r--r--library/std/src/sys/pal/uefi/time.rs6
-rw-r--r--library/std/src/sys/pal/unix/args.rs3
-rw-r--r--library/std/src/sys/pal/unix/fd.rs12
-rw-r--r--library/std/src/sys/pal/unix/fd/tests.rs3
-rw-r--r--library/std/src/sys/pal/unix/fs.rs51
-rw-r--r--library/std/src/sys/pal/unix/io.rs4
-rw-r--r--library/std/src/sys/pal/unix/kernel_copy.rs11
-rw-r--r--library/std/src/sys/pal/unix/kernel_copy/tests.rs4
-rw-r--r--library/std/src/sys/pal/unix/mod.rs14
-rw-r--r--library/std/src/sys/pal/unix/net.rs7
-rw-r--r--library/std/src/sys/pal/unix/os.rs27
-rw-r--r--library/std/src/sys/pal/unix/process/process_common.rs14
-rw-r--r--library/std/src/sys/pal/unix/process/process_common/tests.rs4
-rw-r--r--library/std/src/sys/pal/unix/process/process_fuchsia.rs10
-rw-r--r--library/std/src/sys/pal/unix/process/process_unix.rs36
-rw-r--r--library/std/src/sys/pal/unix/process/process_unsupported.rs4
-rw-r--r--library/std/src/sys/pal/unix/process/process_unsupported/wait_status.rs3
-rw-r--r--library/std/src/sys/pal/unix/process/process_vxworks.rs7
-rw-r--r--library/std/src/sys/pal/unix/process/zircon.rs4
-rw-r--r--library/std/src/sys/pal/unix/rand.rs8
-rw-r--r--library/std/src/sys/pal/unix/stack_overflow.rs27
-rw-r--r--library/std/src/sys/pal/unix/thread.rs15
-rw-r--r--library/std/src/sys/pal/unix/thread_parking.rs3
-rw-r--r--library/std/src/sys/pal/unix/weak.rs3
-rw-r--r--library/std/src/sys/pal/unsupported/os.rs3
-rw-r--r--library/std/src/sys/pal/unsupported/pipe.rs6
-rw-r--r--library/std/src/sys/pal/unsupported/process.rs6
-rw-r--r--library/std/src/sys/pal/wasi/args.rs3
-rw-r--r--library/std/src/sys/pal/wasi/fs.rs7
-rw-r--r--library/std/src/sys/pal/wasi/helpers.rs3
-rw-r--r--library/std/src/sys/pal/wasi/mod.rs5
-rw-r--r--library/std/src/sys/pal/wasi/os.rs8
-rw-r--r--library/std/src/sys/pal/wasi/thread.rs3
-rw-r--r--library/std/src/sys/pal/wasip2/mod.rs5
-rw-r--r--library/std/src/sys/pal/wasm/alloc.rs6
-rw-r--r--library/std/src/sys/pal/windows/alloc.rs3
-rw-r--r--library/std/src/sys/pal/windows/args.rs6
-rw-r--r--library/std/src/sys/pal/windows/c.rs3
-rw-r--r--library/std/src/sys/pal/windows/fs.rs15
-rw-r--r--library/std/src/sys/pal/windows/futex.rs9
-rw-r--r--library/std/src/sys/pal/windows/handle.rs10
-rw-r--r--library/std/src/sys/pal/windows/io.rs3
-rw-r--r--library/std/src/sys/pal/windows/mod.rs3
-rw-r--r--library/std/src/sys/pal/windows/net.rs14
-rw-r--r--library/std/src/sys/pal/windows/os.rs13
-rw-r--r--library/std/src/sys/pal/windows/pipe.rs9
-rw-r--r--library/std/src/sys/pal/windows/process.rs17
-rw-r--r--library/std/src/sys/pal/windows/process/tests.rs3
-rw-r--r--library/std/src/sys/pal/windows/stdio.rs11
-rw-r--r--library/std/src/sys/pal/windows/thread.rs17
-rw-r--r--library/std/src/sys/pal/windows/time.rs12
-rw-r--r--library/std/src/sys/pal/xous/alloc.rs6
-rw-r--r--library/std/src/sys/pal/xous/net/dns.rs3
-rw-r--r--library/std/src/sys/pal/xous/net/tcplistener.rs8
-rw-r--r--library/std/src/sys/pal/xous/net/tcpstream.rs3
-rw-r--r--library/std/src/sys/pal/xous/net/udp.rs8
-rw-r--r--library/std/src/sys/pal/xous/os.rs3
-rw-r--r--library/std/src/sys/pal/xous/thread.rs3
-rw-r--r--library/std/src/sys/pal/xous/time.rs6
-rw-r--r--library/std/src/sys/pal/zkvm/os.rs3
-rw-r--r--library/std/src/sys/pal/zkvm/stdio.rs3
-rw-r--r--library/std/src/sys/path/unix.rs3
-rw-r--r--library/std/src/sys/path/windows.rs3
-rw-r--r--library/std/src/sys/personality/dwarf/eh.rs4
-rw-r--r--library/std/src/sys/personality/emcc.rs3
-rw-r--r--library/std/src/sys/personality/gcc.rs3
-rw-r--r--library/std/src/sys/sync/condvar/futex.rs3
-rw-r--r--library/std/src/sys/sync/condvar/itron.rs12
-rw-r--r--library/std/src/sys/sync/condvar/pthread.rs3
-rw-r--r--library/std/src/sys/sync/condvar/teeos.rs3
-rw-r--r--library/std/src/sys/sync/condvar/windows7.rs3
-rw-r--r--library/std/src/sys/sync/condvar/xous.rs3
-rw-r--r--library/std/src/sys/sync/mutex/fuchsia.rs6
-rw-r--r--library/std/src/sys/sync/mutex/itron.rs8
-rw-r--r--library/std/src/sys/sync/mutex/xous.rs6
-rw-r--r--library/std/src/sys/sync/once/futex.rs6
-rw-r--r--library/std/src/sys/sync/once/queue.rs4
-rw-r--r--library/std/src/sys/sync/rwlock/futex.rs6
-rw-r--r--library/std/src/sys/sync/rwlock/queue.rs6
-rw-r--r--library/std/src/sys/sync/rwlock/solid.rs10
-rw-r--r--library/std/src/sys/sync/thread_parking/darwin.rs6
-rw-r--r--library/std/src/sys/sync/thread_parking/id.rs6
-rw-r--r--library/std/src/sys/sync/thread_parking/windows7.rs20
-rw-r--r--library/std/src/sys/sync/thread_parking/xous.rs6
-rw-r--r--library/std/src/sys/thread_local/guard/solid.rs3
-rw-r--r--library/std/src/sys/thread_local/guard/windows.rs3
-rw-r--r--library/std/src/sys/thread_local/key/windows.rs6
-rw-r--r--library/std/src/sys/thread_local/key/xous.rs9
-rw-r--r--library/std/src/sys/thread_local/native/eager.rs3
-rw-r--r--library/std/src/sys/thread_local/native/lazy.rs3
-rw-r--r--library/std/src/sys_common/io.rs7
-rw-r--r--library/std/src/sys_common/lazy_box.rs6
-rw-r--r--library/std/src/sys_common/net.rs11
-rw-r--r--library/std/src/sys_common/process.rs4
-rw-r--r--library/std/src/sys_common/wtf8.rs6
-rw-r--r--library/std/src/thread/mod.rs10
-rw-r--r--library/std/src/thread/scoped.rs3
-rw-r--r--library/std/src/thread/tests.rs14
-rw-r--r--library/std/src/time.rs11
-rw-r--r--library/std/src/time/tests.rs4
-rw-r--r--library/std/tests/common/mod.rs7
-rw-r--r--library/std/tests/create_dir_all_bare.rs3
-rw-r--r--library/std/tests/env.rs3
-rw-r--r--library/std/tests/pipe_subprocess.rs4
-rw-r--r--library/std/tests/process_spawning.rs5
-rw-r--r--library/std/tests/switch-stdout.rs5
-rw-r--r--library/std/tests/windows.rs4
-rw-r--r--library/test/src/bench.rs19
-rw-r--r--library/test/src/cli.rs2
-rw-r--r--library/test/src/console.rs24
-rw-r--r--library/test/src/formatters/json.rs14
-rw-r--r--library/test/src/formatters/junit.rs13
-rw-r--r--library/test/src/formatters/mod.rs13
-rw-r--r--library/test/src/formatters/pretty.rs16
-rw-r--r--library/test/src/formatters/terse.rs17
-rw-r--r--library/test/src/helpers/concurrency.rs3
-rw-r--r--library/test/src/helpers/shuffle.rs5
-rw-r--r--library/test/src/lib.rs49
-rw-r--r--library/test/src/stats/tests.rs3
-rw-r--r--library/test/src/term.rs3
-rw-r--r--library/test/src/term/terminfo/mod.rs12
-rw-r--r--library/test/src/term/terminfo/parm.rs4
-rw-r--r--library/test/src/term/terminfo/parser/compiled.rs3
-rw-r--r--library/test/src/term/terminfo/searcher.rs3
-rw-r--r--library/test/src/term/win.rs3
-rw-r--r--library/test/src/test_result.rs6
-rw-r--r--library/test/src/tests.rs4
-rw-r--r--library/test/src/time.rs6
-rw-r--r--library/test/src/types.rs9
-rw-r--r--library/unwind/src/unwinding.rs4
524 files changed, 1546 insertions, 2192 deletions
diff --git a/library/alloc/benches/btree/map.rs b/library/alloc/benches/btree/map.rs
index 4fe07eb0213..3bddef5045a 100644
--- a/library/alloc/benches/btree/map.rs
+++ b/library/alloc/benches/btree/map.rs
@@ -1,7 +1,8 @@
 use std::collections::BTreeMap;
 use std::ops::RangeBounds;
 
-use rand::{seq::SliceRandom, Rng};
+use rand::seq::SliceRandom;
+use rand::Rng;
 use test::{black_box, Bencher};
 
 macro_rules! map_insert_rand_bench {
diff --git a/library/alloc/benches/linked_list.rs b/library/alloc/benches/linked_list.rs
index 29c5ad2bc6e..b9322b6d4c3 100644
--- a/library/alloc/benches/linked_list.rs
+++ b/library/alloc/benches/linked_list.rs
@@ -1,4 +1,5 @@
 use std::collections::LinkedList;
+
 use test::Bencher;
 
 #[bench]
diff --git a/library/alloc/benches/string.rs b/library/alloc/benches/string.rs
index 5c95160ba2d..e0dbe80d288 100644
--- a/library/alloc/benches/string.rs
+++ b/library/alloc/benches/string.rs
@@ -1,4 +1,5 @@
 use std::iter::repeat;
+
 use test::{black_box, Bencher};
 
 #[bench]
diff --git a/library/alloc/benches/vec.rs b/library/alloc/benches/vec.rs
index 8ebfe313dc5..13d784d3fd4 100644
--- a/library/alloc/benches/vec.rs
+++ b/library/alloc/benches/vec.rs
@@ -1,5 +1,6 @@
-use rand::RngCore;
 use std::iter::repeat;
+
+use rand::RngCore;
 use test::{black_box, Bencher};
 
 #[bench]
diff --git a/library/alloc/benches/vec_deque.rs b/library/alloc/benches/vec_deque.rs
index 35939f489b4..fb1e2685cc3 100644
--- a/library/alloc/benches/vec_deque.rs
+++ b/library/alloc/benches/vec_deque.rs
@@ -1,7 +1,6 @@
-use std::{
-    collections::{vec_deque, VecDeque},
-    mem,
-};
+use std::collections::{vec_deque, VecDeque};
+use std::mem;
+
 use test::{black_box, Bencher};
 
 #[bench]
diff --git a/library/alloc/benches/vec_deque_append.rs b/library/alloc/benches/vec_deque_append.rs
index 30b6e600e5a..7c805da9737 100644
--- a/library/alloc/benches/vec_deque_append.rs
+++ b/library/alloc/benches/vec_deque_append.rs
@@ -1,4 +1,5 @@
-use std::{collections::VecDeque, time::Instant};
+use std::collections::VecDeque;
+use std::time::Instant;
 
 const VECDEQUE_LEN: i32 = 100000;
 const WARMUP_N: usize = 100;
diff --git a/library/alloc/src/alloc.rs b/library/alloc/src/alloc.rs
index f7d10339689..db2d752cfde 100644
--- a/library/alloc/src/alloc.rs
+++ b/library/alloc/src/alloc.rs
@@ -2,16 +2,14 @@
 
 #![stable(feature = "alloc_module", since = "1.28.0")]
 
+#[stable(feature = "alloc_module", since = "1.28.0")]
+#[doc(inline)]
+pub use core::alloc::*;
 #[cfg(not(test))]
 use core::hint;
-
 #[cfg(not(test))]
 use core::ptr::{self, NonNull};
 
-#[stable(feature = "alloc_module", since = "1.28.0")]
-#[doc(inline)]
-pub use core::alloc::*;
-
 #[cfg(test)]
 mod tests;
 
diff --git a/library/alloc/src/alloc/tests.rs b/library/alloc/src/alloc/tests.rs
index 1a5938fd34c..5d6077f057a 100644
--- a/library/alloc/src/alloc/tests.rs
+++ b/library/alloc/src/alloc/tests.rs
@@ -1,9 +1,10 @@
 use super::*;
 
 extern crate test;
-use crate::boxed::Box;
 use test::Bencher;
 
+use crate::boxed::Box;
+
 #[test]
 fn allocate_zeroed() {
     unsafe {
diff --git a/library/alloc/src/borrow.rs b/library/alloc/src/borrow.rs
index 42f8a08a9e4..f86face3f90 100644
--- a/library/alloc/src/borrow.rs
+++ b/library/alloc/src/borrow.rs
@@ -2,21 +2,20 @@
 
 #![stable(feature = "rust1", since = "1.0.0")]
 
+#[stable(feature = "rust1", since = "1.0.0")]
+pub use core::borrow::{Borrow, BorrowMut};
 use core::cmp::Ordering;
 use core::hash::{Hash, Hasher};
 #[cfg(not(no_global_oom_handling))]
 use core::ops::{Add, AddAssign};
 use core::ops::{Deref, DerefPure};
 
-#[stable(feature = "rust1", since = "1.0.0")]
-pub use core::borrow::{Borrow, BorrowMut};
+use Cow::*;
 
 use crate::fmt;
 #[cfg(not(no_global_oom_handling))]
 use crate::string::String;
 
-use Cow::*;
-
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<'a, B: ?Sized> Borrow<B> for Cow<'a, B>
 where
diff --git a/library/alloc/src/boxed.rs b/library/alloc/src/boxed.rs
index 0fc016aa32b..ef40d3b203f 100644
--- a/library/alloc/src/boxed.rs
+++ b/library/alloc/src/boxed.rs
@@ -187,26 +187,26 @@
 
 use core::any::Any;
 use core::async_iter::AsyncIterator;
-use core::borrow;
 #[cfg(not(no_global_oom_handling))]
 use core::clone::CloneToUninit;
 use core::cmp::Ordering;
 use core::error::Error;
-use core::fmt;
 use core::future::Future;
 use core::hash::{Hash, Hasher};
 use core::iter::FusedIterator;
-use core::marker::Tuple;
-use core::marker::Unsize;
+use core::marker::{Tuple, Unsize};
 use core::mem::{self, SizedTypeProperties};
-use core::ops::{AsyncFn, AsyncFnMut, AsyncFnOnce};
 use core::ops::{
-    CoerceUnsized, Coroutine, CoroutineState, Deref, DerefMut, DerefPure, DispatchFromDyn, Receiver,
+    AsyncFn, AsyncFnMut, AsyncFnOnce, CoerceUnsized, Coroutine, CoroutineState, Deref, DerefMut,
+    DerefPure, DispatchFromDyn, Receiver,
 };
 use core::pin::Pin;
 use core::ptr::{self, addr_of_mut, NonNull, Unique};
-use core::slice;
 use core::task::{Context, Poll};
+use core::{borrow, fmt, slice};
+
+#[unstable(feature = "thin_box", issue = "92791")]
+pub use thin::ThinBox;
 
 #[cfg(not(no_global_oom_handling))]
 use crate::alloc::handle_alloc_error;
@@ -222,9 +222,6 @@ use crate::vec;
 #[cfg(not(no_global_oom_handling))]
 use crate::vec::Vec;
 
-#[unstable(feature = "thin_box", issue = "92791")]
-pub use thin::ThinBox;
-
 mod thin;
 
 /// A pointer type that uniquely owns a heap allocation of type `T`.
diff --git a/library/alloc/src/boxed/thin.rs b/library/alloc/src/boxed/thin.rs
index e9bfecba160..9baded3a521 100644
--- a/library/alloc/src/boxed/thin.rs
+++ b/library/alloc/src/boxed/thin.rs
@@ -2,7 +2,6 @@
 //! <https://github.com/matthieu-m/rfc2580/blob/b58d1d3cba0d4b5e859d3617ea2d0943aaa31329/examples/thin.rs>
 //! by matthieu-m
 
-use crate::alloc::{self, Layout, LayoutError};
 use core::error::Error;
 use core::fmt::{self, Debug, Display, Formatter};
 #[cfg(not(no_global_oom_handling))]
@@ -14,8 +13,9 @@ use core::mem;
 #[cfg(not(no_global_oom_handling))]
 use core::mem::SizedTypeProperties;
 use core::ops::{Deref, DerefMut};
-use core::ptr::Pointee;
-use core::ptr::{self, NonNull};
+use core::ptr::{self, NonNull, Pointee};
+
+use crate::alloc::{self, Layout, LayoutError};
 
 /// ThinBox.
 ///
diff --git a/library/alloc/src/collections/binary_heap/mod.rs b/library/alloc/src/collections/binary_heap/mod.rs
index 11aef5f913e..cc5f33c3685 100644
--- a/library/alloc/src/collections/binary_heap/mod.rs
+++ b/library/alloc/src/collections/binary_heap/mod.rs
@@ -144,12 +144,11 @@
 #![stable(feature = "rust1", since = "1.0.0")]
 
 use core::alloc::Allocator;
-use core::fmt;
 use core::iter::{FusedIterator, InPlaceIterable, SourceIter, TrustedFused, TrustedLen};
 use core::mem::{self, swap, ManuallyDrop};
 use core::num::NonZero;
 use core::ops::{Deref, DerefMut};
-use core::ptr;
+use core::{fmt, ptr};
 
 use crate::alloc::Global;
 use crate::collections::TryReserveError;
diff --git a/library/alloc/src/collections/binary_heap/tests.rs b/library/alloc/src/collections/binary_heap/tests.rs
index d4bc6226a14..1cb07c62149 100644
--- a/library/alloc/src/collections/binary_heap/tests.rs
+++ b/library/alloc/src/collections/binary_heap/tests.rs
@@ -1,7 +1,8 @@
+use std::panic::{catch_unwind, AssertUnwindSafe};
+
 use super::*;
 use crate::boxed::Box;
 use crate::testing::crash_test::{CrashTestDummy, Panic};
-use std::panic::{catch_unwind, AssertUnwindSafe};
 
 #[test]
 fn test_iterator() {
@@ -504,11 +505,12 @@ fn test_retain_catch_unwind() {
 #[cfg(not(target_os = "emscripten"))]
 #[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
 fn panic_safe() {
-    use rand::seq::SliceRandom;
     use std::cmp;
     use std::panic::{self, AssertUnwindSafe};
     use std::sync::atomic::{AtomicUsize, Ordering};
 
+    use rand::seq::SliceRandom;
+
     static DROP_COUNTER: AtomicUsize = AtomicUsize::new(0);
 
     #[derive(Eq, PartialEq, Ord, Clone, Debug)]
diff --git a/library/alloc/src/collections/btree/append.rs b/library/alloc/src/collections/btree/append.rs
index b6989afb625..47372938fbe 100644
--- a/library/alloc/src/collections/btree/append.rs
+++ b/library/alloc/src/collections/btree/append.rs
@@ -1,8 +1,9 @@
-use super::merge_iter::MergeIterInner;
-use super::node::{self, Root};
 use core::alloc::Allocator;
 use core::iter::FusedIterator;
 
+use super::merge_iter::MergeIterInner;
+use super::node::{self, Root};
+
 impl<K, V> Root<K, V> {
     /// Appends all key-value pairs from the union of two ascending iterators,
     /// incrementing a `length` variable along the way. The latter makes it
diff --git a/library/alloc/src/collections/btree/fix.rs b/library/alloc/src/collections/btree/fix.rs
index 91b61218005..4c1e19ead40 100644
--- a/library/alloc/src/collections/btree/fix.rs
+++ b/library/alloc/src/collections/btree/fix.rs
@@ -1,7 +1,10 @@
-use super::map::MIN_LEN;
-use super::node::{marker, ForceResult::*, Handle, LeftOrRight::*, NodeRef, Root};
 use core::alloc::Allocator;
 
+use super::map::MIN_LEN;
+use super::node::ForceResult::*;
+use super::node::LeftOrRight::*;
+use super::node::{marker, Handle, NodeRef, Root};
+
 impl<'a, K: 'a, V: 'a> NodeRef<marker::Mut<'a>, K, V, marker::LeafOrInternal> {
     /// Stocks up a possibly underfull node by merging with or stealing from a
     /// sibling. If successful but at the cost of shrinking the parent node,
diff --git a/library/alloc/src/collections/btree/map.rs b/library/alloc/src/collections/btree/map.rs
index 3875f61efaf..8fe4cd7144b 100644
--- a/library/alloc/src/collections/btree/map.rs
+++ b/library/alloc/src/collections/btree/map.rs
@@ -1,4 +1,3 @@
-use crate::vec::Vec;
 use core::borrow::Borrow;
 use core::cmp::Ordering;
 use core::error::Error;
@@ -10,20 +9,21 @@ use core::mem::{self, ManuallyDrop};
 use core::ops::{Bound, Index, RangeBounds};
 use core::ptr;
 
-use crate::alloc::{Allocator, Global};
-
 use super::borrow::DormantMutRef;
 use super::dedup_sorted_iter::DedupSortedIter;
 use super::navigate::{LazyLeafRange, LeafRange};
-use super::node::{self, marker, ForceResult::*, Handle, NodeRef, Root};
-use super::search::{SearchBound, SearchResult::*};
+use super::node::ForceResult::*;
+use super::node::{self, marker, Handle, NodeRef, Root};
+use super::search::SearchBound;
+use super::search::SearchResult::*;
 use super::set_val::SetValZST;
+use crate::alloc::{Allocator, Global};
+use crate::vec::Vec;
 
 mod entry;
 
 #[stable(feature = "rust1", since = "1.0.0")]
 pub use entry::{Entry, OccupiedEntry, OccupiedError, VacantEntry};
-
 use Entry::*;
 
 /// Minimum number of elements in a node that is not a root.
diff --git a/library/alloc/src/collections/btree/map/entry.rs b/library/alloc/src/collections/btree/map/entry.rs
index b5b389bbd25..d128ad8ee5f 100644
--- a/library/alloc/src/collections/btree/map/entry.rs
+++ b/library/alloc/src/collections/btree/map/entry.rs
@@ -2,13 +2,12 @@ use core::fmt::{self, Debug};
 use core::marker::PhantomData;
 use core::mem;
 
-use crate::alloc::{Allocator, Global};
+use Entry::*;
 
 use super::super::borrow::DormantMutRef;
 use super::super::node::{marker, Handle, NodeRef};
 use super::BTreeMap;
-
-use Entry::*;
+use crate::alloc::{Allocator, Global};
 
 /// A view into a single entry in a map, which may either be vacant or occupied.
 ///
diff --git a/library/alloc/src/collections/btree/map/tests.rs b/library/alloc/src/collections/btree/map/tests.rs
index ba1f38dcc3e..ff1254a5a0c 100644
--- a/library/alloc/src/collections/btree/map/tests.rs
+++ b/library/alloc/src/collections/btree/map/tests.rs
@@ -1,3 +1,10 @@
+use core::assert_matches::assert_matches;
+use std::iter;
+use std::ops::Bound::{Excluded, Included, Unbounded};
+use std::panic::{catch_unwind, AssertUnwindSafe};
+use std::sync::atomic::AtomicUsize;
+use std::sync::atomic::Ordering::SeqCst;
+
 use super::*;
 use crate::boxed::Box;
 use crate::fmt::Debug;
@@ -6,11 +13,6 @@ use crate::string::{String, ToString};
 use crate::testing::crash_test::{CrashTestDummy, Panic};
 use crate::testing::ord_chaos::{Cyclic3, Governed, Governor};
 use crate::testing::rng::DeterministicRng;
-use core::assert_matches::assert_matches;
-use std::iter;
-use std::ops::Bound::{Excluded, Included, Unbounded};
-use std::panic::{catch_unwind, AssertUnwindSafe};
-use std::sync::atomic::{AtomicUsize, Ordering::SeqCst};
 
 // Minimum number of elements to insert, to guarantee a tree with 2 levels,
 // i.e., a tree who's root is an internal node at height 1, with edges to leaf nodes.
diff --git a/library/alloc/src/collections/btree/mem.rs b/library/alloc/src/collections/btree/mem.rs
index e1363d1ae1f..d738c5c47b4 100644
--- a/library/alloc/src/collections/btree/mem.rs
+++ b/library/alloc/src/collections/btree/mem.rs
@@ -1,6 +1,4 @@
-use core::intrinsics;
-use core::mem;
-use core::ptr;
+use core::{intrinsics, mem, ptr};
 
 /// This replaces the value behind the `v` unique reference by calling the
 /// relevant function.
diff --git a/library/alloc/src/collections/btree/navigate.rs b/library/alloc/src/collections/btree/navigate.rs
index 5e6a26f65c4..f5c621e2c17 100644
--- a/library/alloc/src/collections/btree/navigate.rs
+++ b/library/alloc/src/collections/btree/navigate.rs
@@ -1,11 +1,10 @@
 use core::borrow::Borrow;
-use core::hint;
 use core::ops::RangeBounds;
-use core::ptr;
+use core::{hint, ptr};
 
-use super::node::{marker, ForceResult::*, Handle, NodeRef};
+use super::node::ForceResult::*;
+use super::node::{marker, Handle, NodeRef};
 use super::search::SearchBound;
-
 use crate::alloc::Allocator;
 // `front` and `back` are always both `None` or both `Some`.
 pub struct LeafRange<BorrowType, K, V> {
diff --git a/library/alloc/src/collections/btree/remove.rs b/library/alloc/src/collections/btree/remove.rs
index 0904299254f..c46422c2f1d 100644
--- a/library/alloc/src/collections/btree/remove.rs
+++ b/library/alloc/src/collections/btree/remove.rs
@@ -1,7 +1,10 @@
-use super::map::MIN_LEN;
-use super::node::{marker, ForceResult::*, Handle, LeftOrRight::*, NodeRef};
 use core::alloc::Allocator;
 
+use super::map::MIN_LEN;
+use super::node::ForceResult::*;
+use super::node::LeftOrRight::*;
+use super::node::{marker, Handle, NodeRef};
+
 impl<'a, K: 'a, V: 'a> Handle<NodeRef<marker::Mut<'a>, K, V, marker::LeafOrInternal>, marker::KV> {
     /// Removes a key-value pair from the tree, and returns that pair, as well as
     /// the leaf edge corresponding to that former pair. It's possible this empties
diff --git a/library/alloc/src/collections/btree/search.rs b/library/alloc/src/collections/btree/search.rs
index ad3522b4e04..1d5c927175e 100644
--- a/library/alloc/src/collections/btree/search.rs
+++ b/library/alloc/src/collections/btree/search.rs
@@ -2,11 +2,12 @@ use core::borrow::Borrow;
 use core::cmp::Ordering;
 use core::ops::{Bound, RangeBounds};
 
-use super::node::{marker, ForceResult::*, Handle, NodeRef};
-
 use SearchBound::*;
 use SearchResult::*;
 
+use super::node::ForceResult::*;
+use super::node::{marker, Handle, NodeRef};
+
 pub enum SearchBound<T> {
     /// An inclusive bound to look for, just like `Bound::Included(T)`.
     Included(T),
diff --git a/library/alloc/src/collections/btree/set.rs b/library/alloc/src/collections/btree/set.rs
index b0bd6ef2d3c..74b000fd1c4 100644
--- a/library/alloc/src/collections/btree/set.rs
+++ b/library/alloc/src/collections/btree/set.rs
@@ -1,4 +1,3 @@
-use crate::vec::Vec;
 use core::borrow::Borrow;
 use core::cmp::Ordering::{self, Equal, Greater, Less};
 use core::cmp::{max, min};
@@ -12,8 +11,8 @@ use super::map::{BTreeMap, Keys};
 use super::merge_iter::MergeIterInner;
 use super::set_val::SetValZST;
 use super::Recover;
-
 use crate::alloc::{Allocator, Global};
+use crate::vec::Vec;
 
 /// An ordered set based on a B-Tree.
 ///
diff --git a/library/alloc/src/collections/btree/set/tests.rs b/library/alloc/src/collections/btree/set/tests.rs
index 48bf7674138..f947b6108c9 100644
--- a/library/alloc/src/collections/btree/set/tests.rs
+++ b/library/alloc/src/collections/btree/set/tests.rs
@@ -1,8 +1,9 @@
+use std::ops::Bound::{Excluded, Included};
+use std::panic::{catch_unwind, AssertUnwindSafe};
+
 use super::*;
 use crate::testing::crash_test::{CrashTestDummy, Panic};
 use crate::testing::rng::DeterministicRng;
-use std::ops::Bound::{Excluded, Included};
-use std::panic::{catch_unwind, AssertUnwindSafe};
 
 #[test]
 fn test_clone_eq() {
diff --git a/library/alloc/src/collections/btree/split.rs b/library/alloc/src/collections/btree/split.rs
index 638dc98fc3e..c188ed1da61 100644
--- a/library/alloc/src/collections/btree/split.rs
+++ b/library/alloc/src/collections/btree/split.rs
@@ -1,8 +1,10 @@
-use super::node::{ForceResult::*, Root};
-use super::search::SearchResult::*;
 use core::alloc::Allocator;
 use core::borrow::Borrow;
 
+use super::node::ForceResult::*;
+use super::node::Root;
+use super::search::SearchResult::*;
+
 impl<K, V> Root<K, V> {
     /// Calculates the length of both trees that result from splitting up
     /// a given number of distinct key-value pairs.
diff --git a/library/alloc/src/collections/linked_list.rs b/library/alloc/src/collections/linked_list.rs
index 077483a174b..0cd410c0fb7 100644
--- a/library/alloc/src/collections/linked_list.rs
+++ b/library/alloc/src/collections/linked_list.rs
@@ -13,12 +13,11 @@
 #![stable(feature = "rust1", since = "1.0.0")]
 
 use core::cmp::Ordering;
-use core::fmt;
 use core::hash::{Hash, Hasher};
 use core::iter::FusedIterator;
 use core::marker::PhantomData;
-use core::mem;
 use core::ptr::NonNull;
+use core::{fmt, mem};
 
 use super::SpecExtend;
 use crate::alloc::{Allocator, Global};
diff --git a/library/alloc/src/collections/linked_list/tests.rs b/library/alloc/src/collections/linked_list/tests.rs
index d3744c5a9d0..9b3c9ac5ce5 100644
--- a/library/alloc/src/collections/linked_list/tests.rs
+++ b/library/alloc/src/collections/linked_list/tests.rs
@@ -1,12 +1,12 @@
-use super::*;
-use crate::testing::crash_test::{CrashTestDummy, Panic};
-use crate::vec::Vec;
-
 use std::panic::{catch_unwind, AssertUnwindSafe};
 use std::thread;
 
 use rand::RngCore;
 
+use super::*;
+use crate::testing::crash_test::{CrashTestDummy, Panic};
+use crate::vec::Vec;
+
 #[test]
 fn test_basic() {
     let mut m = LinkedList::<Box<_>>::new();
@@ -1167,9 +1167,7 @@ fn test_drop_panic() {
 
 #[test]
 fn test_allocator() {
-    use core::alloc::AllocError;
-    use core::alloc::Allocator;
-    use core::alloc::Layout;
+    use core::alloc::{AllocError, Allocator, Layout};
     use core::cell::Cell;
 
     struct A {
diff --git a/library/alloc/src/collections/mod.rs b/library/alloc/src/collections/mod.rs
index 705b81535c2..020cf4d7365 100644
--- a/library/alloc/src/collections/mod.rs
+++ b/library/alloc/src/collections/mod.rs
@@ -27,33 +27,30 @@ pub mod btree_set {
     pub use super::btree::set::*;
 }
 
+use core::fmt::Display;
+
 #[cfg(not(no_global_oom_handling))]
 #[stable(feature = "rust1", since = "1.0.0")]
 #[doc(no_inline)]
 pub use binary_heap::BinaryHeap;
-
 #[cfg(not(no_global_oom_handling))]
 #[stable(feature = "rust1", since = "1.0.0")]
 #[doc(no_inline)]
 pub use btree_map::BTreeMap;
-
 #[cfg(not(no_global_oom_handling))]
 #[stable(feature = "rust1", since = "1.0.0")]
 #[doc(no_inline)]
 pub use btree_set::BTreeSet;
-
 #[cfg(not(no_global_oom_handling))]
 #[stable(feature = "rust1", since = "1.0.0")]
 #[doc(no_inline)]
 pub use linked_list::LinkedList;
-
 #[cfg(not(no_global_oom_handling))]
 #[stable(feature = "rust1", since = "1.0.0")]
 #[doc(no_inline)]
 pub use vec_deque::VecDeque;
 
 use crate::alloc::{Layout, LayoutError};
-use core::fmt::Display;
 
 /// The error type for `try_reserve` methods.
 #[derive(Clone, PartialEq, Eq, Debug)]
diff --git a/library/alloc/src/collections/vec_deque/drain.rs b/library/alloc/src/collections/vec_deque/drain.rs
index 1373e601492..44fcef4ed7d 100644
--- a/library/alloc/src/collections/vec_deque/drain.rs
+++ b/library/alloc/src/collections/vec_deque/drain.rs
@@ -4,9 +4,8 @@ use core::mem::{self, SizedTypeProperties};
 use core::ptr::NonNull;
 use core::{fmt, ptr};
 
-use crate::alloc::{Allocator, Global};
-
 use super::VecDeque;
+use crate::alloc::{Allocator, Global};
 
 /// A draining iterator over the elements of a `VecDeque`.
 ///
diff --git a/library/alloc/src/collections/vec_deque/into_iter.rs b/library/alloc/src/collections/vec_deque/into_iter.rs
index 4747517393c..2d283dac9a9 100644
--- a/library/alloc/src/collections/vec_deque/into_iter.rs
+++ b/library/alloc/src/collections/vec_deque/into_iter.rs
@@ -1,10 +1,11 @@
 use core::iter::{FusedIterator, TrustedLen};
+use core::mem::MaybeUninit;
 use core::num::NonZero;
-use core::{array, fmt, mem::MaybeUninit, ops::Try, ptr};
-
-use crate::alloc::{Allocator, Global};
+use core::ops::Try;
+use core::{array, fmt, ptr};
 
 use super::VecDeque;
+use crate::alloc::{Allocator, Global};
 
 /// An owning iterator over the elements of a `VecDeque`.
 ///
diff --git a/library/alloc/src/collections/vec_deque/mod.rs b/library/alloc/src/collections/vec_deque/mod.rs
index a07f250d7d8..dc725ec0f56 100644
--- a/library/alloc/src/collections/vec_deque/mod.rs
+++ b/library/alloc/src/collections/vec_deque/mod.rs
@@ -8,23 +8,19 @@
 #![stable(feature = "rust1", since = "1.0.0")]
 
 use core::cmp::{self, Ordering};
-use core::fmt;
 use core::hash::{Hash, Hasher};
 use core::iter::{repeat_n, repeat_with, ByRefSized};
-use core::mem::{ManuallyDrop, SizedTypeProperties};
-use core::ops::{Index, IndexMut, Range, RangeBounds};
-use core::ptr;
-use core::slice;
-
 // This is used in a bunch of intra-doc links.
 // FIXME: For some reason, `#[cfg(doc)]` wasn't sufficient, resulting in
 // failures in linkchecker even though rustdoc built the docs just fine.
 #[allow(unused_imports)]
 use core::mem;
+use core::mem::{ManuallyDrop, SizedTypeProperties};
+use core::ops::{Index, IndexMut, Range, RangeBounds};
+use core::{fmt, ptr, slice};
 
 use crate::alloc::{Allocator, Global};
-use crate::collections::TryReserveError;
-use crate::collections::TryReserveErrorKind;
+use crate::collections::{TryReserveError, TryReserveErrorKind};
 use crate::raw_vec::RawVec;
 use crate::vec::Vec;
 
diff --git a/library/alloc/src/collections/vec_deque/spec_extend.rs b/library/alloc/src/collections/vec_deque/spec_extend.rs
index 6a89abc3ef9..a9b0fd073b5 100644
--- a/library/alloc/src/collections/vec_deque/spec_extend.rs
+++ b/library/alloc/src/collections/vec_deque/spec_extend.rs
@@ -1,9 +1,9 @@
-use crate::alloc::Allocator;
-use crate::vec;
 use core::iter::TrustedLen;
 use core::slice;
 
 use super::VecDeque;
+use crate::alloc::Allocator;
+use crate::vec;
 
 // Specialization trait used for VecDeque::extend
 pub(super) trait SpecExtend<T, I> {
diff --git a/library/alloc/src/ffi/c_str.rs b/library/alloc/src/ffi/c_str.rs
index f1eb195b884..e32676a6543 100644
--- a/library/alloc/src/ffi/c_str.rs
+++ b/library/alloc/src/ffi/c_str.rs
@@ -3,25 +3,21 @@
 #[cfg(test)]
 mod tests;
 
-use crate::borrow::{Cow, ToOwned};
-use crate::boxed::Box;
-use crate::rc::Rc;
-use crate::slice::hack::into_vec;
-use crate::string::String;
-use crate::vec::Vec;
 use core::borrow::Borrow;
 use core::ffi::{c_char, CStr};
-use core::fmt;
-use core::mem;
 use core::num::NonZero;
-use core::ops;
-use core::ptr;
-use core::slice;
 use core::slice::memchr;
 use core::str::{self, Utf8Error};
+use core::{fmt, mem, ops, ptr, slice};
 
+use crate::borrow::{Cow, ToOwned};
+use crate::boxed::Box;
+use crate::rc::Rc;
+use crate::slice::hack::into_vec;
+use crate::string::String;
 #[cfg(target_has_atomic = "ptr")]
 use crate::sync::Arc;
+use crate::vec::Vec;
 
 /// A type representing an owned, C-compatible, nul-terminated string with no nul bytes in the
 /// middle.
diff --git a/library/alloc/src/ffi/c_str/tests.rs b/library/alloc/src/ffi/c_str/tests.rs
index 9f51e17a427..8b7172b3f20 100644
--- a/library/alloc/src/ffi/c_str/tests.rs
+++ b/library/alloc/src/ffi/c_str/tests.rs
@@ -1,10 +1,10 @@
-use super::*;
 use core::assert_matches::assert_matches;
 use core::ffi::FromBytesUntilNulError;
-use core::hash::{Hash, Hasher};
-
 #[allow(deprecated)]
 use core::hash::SipHasher13 as DefaultHasher;
+use core::hash::{Hash, Hasher};
+
+use super::*;
 
 #[test]
 fn c_to_rust() {
diff --git a/library/alloc/src/ffi/mod.rs b/library/alloc/src/ffi/mod.rs
index 9fc1acc231b..4f9dc40a3cf 100644
--- a/library/alloc/src/ffi/mod.rs
+++ b/library/alloc/src/ffi/mod.rs
@@ -80,13 +80,12 @@
 
 #![stable(feature = "alloc_ffi", since = "1.64.0")]
 
-#[doc(no_inline)]
-#[stable(feature = "alloc_c_string", since = "1.64.0")]
-pub use self::c_str::{FromVecWithNulError, IntoStringError, NulError};
-
 #[doc(inline)]
 #[stable(feature = "alloc_c_string", since = "1.64.0")]
 pub use self::c_str::CString;
+#[doc(no_inline)]
+#[stable(feature = "alloc_c_string", since = "1.64.0")]
+pub use self::c_str::{FromVecWithNulError, IntoStringError, NulError};
 
 #[unstable(feature = "c_str_module", issue = "112134")]
 pub mod c_str;
diff --git a/library/alloc/src/raw_vec.rs b/library/alloc/src/raw_vec.rs
index 2860b88bd83..5b84df9ecef 100644
--- a/library/alloc/src/raw_vec.rs
+++ b/library/alloc/src/raw_vec.rs
@@ -1,10 +1,9 @@
 #![unstable(feature = "raw_vec_internals", reason = "unstable const warnings", issue = "none")]
 
 use core::alloc::LayoutError;
-use core::cmp;
-use core::hint;
 use core::mem::{self, ManuallyDrop, MaybeUninit, SizedTypeProperties};
 use core::ptr::{self, NonNull, Unique};
+use core::{cmp, hint};
 
 #[cfg(not(no_global_oom_handling))]
 use crate::alloc::handle_alloc_error;
diff --git a/library/alloc/src/raw_vec/tests.rs b/library/alloc/src/raw_vec/tests.rs
index 4194be53061..48c6e5f46f8 100644
--- a/library/alloc/src/raw_vec/tests.rs
+++ b/library/alloc/src/raw_vec/tests.rs
@@ -1,7 +1,8 @@
-use super::*;
 use core::mem::size_of;
 use std::cell::Cell;
 
+use super::*;
+
 #[test]
 fn allocator_param() {
     use crate::alloc::AllocError;
diff --git a/library/alloc/src/rc.rs b/library/alloc/src/rc.rs
index 64233d19c5a..bc0874fc13f 100644
--- a/library/alloc/src/rc.rs
+++ b/library/alloc/src/rc.rs
@@ -241,20 +241,12 @@
 
 #![stable(feature = "rust1", since = "1.0.0")]
 
-#[cfg(not(test))]
-use crate::boxed::Box;
-#[cfg(test)]
-use std::boxed::Box;
-
 use core::any::Any;
-use core::borrow;
 use core::cell::Cell;
 #[cfg(not(no_global_oom_handling))]
 use core::clone::CloneToUninit;
 use core::cmp::Ordering;
-use core::fmt;
 use core::hash::{Hash, Hasher};
-use core::hint;
 use core::intrinsics::abort;
 #[cfg(not(no_global_oom_handling))]
 use core::iter;
@@ -267,11 +259,16 @@ use core::pin::Pin;
 use core::ptr::{self, drop_in_place, NonNull};
 #[cfg(not(no_global_oom_handling))]
 use core::slice::from_raw_parts_mut;
+use core::{borrow, fmt, hint};
+#[cfg(test)]
+use std::boxed::Box;
 
 #[cfg(not(no_global_oom_handling))]
 use crate::alloc::handle_alloc_error;
 use crate::alloc::{AllocError, Allocator, Global, Layout};
 use crate::borrow::{Cow, ToOwned};
+#[cfg(not(test))]
+use crate::boxed::Box;
 #[cfg(not(no_global_oom_handling))]
 use crate::string::String;
 #[cfg(not(no_global_oom_handling))]
diff --git a/library/alloc/src/rc/tests.rs b/library/alloc/src/rc/tests.rs
index 5e2e4beb94a..84e8b325f71 100644
--- a/library/alloc/src/rc/tests.rs
+++ b/library/alloc/src/rc/tests.rs
@@ -1,8 +1,8 @@
-use super::*;
-
 use std::cell::RefCell;
 use std::clone::Clone;
 
+use super::*;
+
 #[test]
 fn test_clone() {
     let x = Rc::new(RefCell::new(5));
diff --git a/library/alloc/src/slice.rs b/library/alloc/src/slice.rs
index c7960b3fb49..7dcf344cdc5 100644
--- a/library/alloc/src/slice.rs
+++ b/library/alloc/src/slice.rs
@@ -78,7 +78,6 @@ pub use core::slice::{SplitInclusive, SplitInclusiveMut};
 // N.B., see the `hack` module in this file for more details.
 #[cfg(test)]
 pub use hack::into_vec;
-
 // HACK(japaric) needed for the implementation of `Vec::clone` during testing
 // N.B., see the `hack` module in this file for more details.
 #[cfg(test)]
diff --git a/library/alloc/src/slice/tests.rs b/library/alloc/src/slice/tests.rs
index 0b972a13898..786704caeb0 100644
--- a/library/alloc/src/slice/tests.rs
+++ b/library/alloc/src/slice/tests.rs
@@ -1,18 +1,21 @@
+use core::cell::Cell;
+use core::cmp::Ordering::{self, Equal, Greater, Less};
+use core::convert::identity;
+use core::sync::atomic::AtomicUsize;
+use core::sync::atomic::Ordering::Relaxed;
+use core::{fmt, mem};
+use std::panic;
+
+use rand::distributions::Standard;
+use rand::prelude::*;
+use rand::{Rng, RngCore};
+
 use crate::borrow::ToOwned;
 use crate::rc::Rc;
 use crate::string::ToString;
 use crate::test_helpers::test_rng;
 use crate::vec::Vec;
 
-use core::cell::Cell;
-use core::cmp::Ordering::{self, Equal, Greater, Less};
-use core::convert::identity;
-use core::fmt;
-use core::mem;
-use core::sync::atomic::{AtomicUsize, Ordering::Relaxed};
-use rand::{distributions::Standard, prelude::*, Rng, RngCore};
-use std::panic;
-
 macro_rules! do_test {
     ($input:ident, $func:ident) => {
         let len = $input.len();
diff --git a/library/alloc/src/str.rs b/library/alloc/src/str.rs
index 94053ef83a0..d7fba3ae159 100644
--- a/library/alloc/src/str.rs
+++ b/library/alloc/src/str.rs
@@ -9,19 +9,9 @@
 
 use core::borrow::{Borrow, BorrowMut};
 use core::iter::FusedIterator;
-use core::mem;
-use core::ptr;
-use core::str::pattern::{DoubleEndedSearcher, Pattern, ReverseSearcher, Searcher};
-use core::unicode::conversions;
-
-use crate::borrow::ToOwned;
-use crate::boxed::Box;
-use crate::slice::{Concat, Join, SliceIndex};
-use crate::string::String;
-use crate::vec::Vec;
-
 #[stable(feature = "rust1", since = "1.0.0")]
 pub use core::str::pattern;
+use core::str::pattern::{DoubleEndedSearcher, Pattern, ReverseSearcher, Searcher};
 #[stable(feature = "encode_utf16", since = "1.8.0")]
 pub use core::str::EncodeUtf16;
 #[stable(feature = "split_ascii_whitespace", since = "1.34.0")]
@@ -55,6 +45,14 @@ pub use core::str::{RSplitN, SplitN};
 pub use core::str::{RSplitTerminator, SplitTerminator};
 #[stable(feature = "utf8_chunks", since = "1.79.0")]
 pub use core::str::{Utf8Chunk, Utf8Chunks};
+use core::unicode::conversions;
+use core::{mem, ptr};
+
+use crate::borrow::ToOwned;
+use crate::boxed::Box;
+use crate::slice::{Concat, Join, SliceIndex};
+use crate::string::String;
+use crate::vec::Vec;
 
 /// Note: `str` in `Concat<str>` is not meaningful here.
 /// This type parameter of the trait only exists to enable another impl.
diff --git a/library/alloc/src/string.rs b/library/alloc/src/string.rs
index 0ff66167a46..01fe950cf3f 100644
--- a/library/alloc/src/string.rs
+++ b/library/alloc/src/string.rs
@@ -43,8 +43,6 @@
 #![stable(feature = "rust1", since = "1.0.0")]
 
 use core::error::Error;
-use core::fmt;
-use core::hash;
 #[cfg(not(no_global_oom_handling))]
 use core::iter::from_fn;
 use core::iter::FusedIterator;
@@ -55,9 +53,8 @@ use core::ops::AddAssign;
 #[cfg(not(no_global_oom_handling))]
 use core::ops::Bound::{Excluded, Included, Unbounded};
 use core::ops::{self, Range, RangeBounds};
-use core::ptr;
-use core::slice;
 use core::str::pattern::Pattern;
+use core::{fmt, hash, ptr, slice};
 
 #[cfg(not(no_global_oom_handling))]
 use crate::alloc::Allocator;
diff --git a/library/alloc/src/sync.rs b/library/alloc/src/sync.rs
index f73cd0396cd..3ad0dae77db 100644
--- a/library/alloc/src/sync.rs
+++ b/library/alloc/src/sync.rs
@@ -9,13 +9,10 @@
 //! `#[cfg(target_has_atomic = "ptr")]`.
 
 use core::any::Any;
-use core::borrow;
 #[cfg(not(no_global_oom_handling))]
 use core::clone::CloneToUninit;
 use core::cmp::Ordering;
-use core::fmt;
 use core::hash::{Hash, Hasher};
-use core::hint;
 use core::intrinsics::abort;
 #[cfg(not(no_global_oom_handling))]
 use core::iter;
@@ -29,6 +26,7 @@ use core::ptr::{self, NonNull};
 use core::slice::from_raw_parts_mut;
 use core::sync::atomic;
 use core::sync::atomic::Ordering::{Acquire, Relaxed, Release};
+use core::{borrow, fmt, hint};
 
 #[cfg(not(no_global_oom_handling))]
 use crate::alloc::handle_alloc_error;
diff --git a/library/alloc/src/sync/tests.rs b/library/alloc/src/sync/tests.rs
index 1b123aa58f2..d6b3de87577 100644
--- a/library/alloc/src/sync/tests.rs
+++ b/library/alloc/src/sync/tests.rs
@@ -1,5 +1,3 @@
-use super::*;
-
 use std::clone::Clone;
 use std::mem::MaybeUninit;
 use std::option::Option::None;
@@ -9,6 +7,8 @@ use std::sync::mpsc::channel;
 use std::sync::Mutex;
 use std::thread;
 
+use super::*;
+
 struct Canary(*mut AtomicUsize);
 
 impl Drop for Canary {
diff --git a/library/alloc/src/task.rs b/library/alloc/src/task.rs
index a3fa6585a37..27589aed2f9 100644
--- a/library/alloc/src/task.rs
+++ b/library/alloc/src/task.rs
@@ -7,14 +7,14 @@
 //! This may be detected at compile time using
 //! `#[cfg(target_has_atomic = "ptr")]`.
 
-use crate::rc::Rc;
 use core::mem::ManuallyDrop;
+#[cfg(target_has_atomic = "ptr")]
+use core::task::Waker;
 use core::task::{LocalWaker, RawWaker, RawWakerVTable};
 
+use crate::rc::Rc;
 #[cfg(target_has_atomic = "ptr")]
 use crate::sync::Arc;
-#[cfg(target_has_atomic = "ptr")]
-use core::task::Waker;
 
 /// The implementation of waking a task on an executor.
 ///
diff --git a/library/alloc/src/testing/crash_test.rs b/library/alloc/src/testing/crash_test.rs
index ff72f99b2cb..684bac60d9a 100644
--- a/library/alloc/src/testing/crash_test.rs
+++ b/library/alloc/src/testing/crash_test.rs
@@ -1,6 +1,8 @@
-use crate::fmt::Debug; // the `Debug` trait is the only thing we use from `crate::fmt`
 use std::cmp::Ordering;
-use std::sync::atomic::{AtomicUsize, Ordering::SeqCst};
+use std::sync::atomic::AtomicUsize;
+use std::sync::atomic::Ordering::SeqCst;
+
+use crate::fmt::Debug; // the `Debug` trait is the only thing we use from `crate::fmt`
 
 /// A blueprint for crash test dummy instances that monitor particular events.
 /// Some instances may be configured to panic at some point.
diff --git a/library/alloc/src/tests.rs b/library/alloc/src/tests.rs
index ab256ceaec3..b95d11cb07e 100644
--- a/library/alloc/src/tests.rs
+++ b/library/alloc/src/tests.rs
@@ -2,7 +2,6 @@
 
 use core::any::Any;
 use core::ops::Deref;
-
 use std::boxed::Box;
 
 #[test]
diff --git a/library/alloc/src/vec/cow.rs b/library/alloc/src/vec/cow.rs
index 3fe83242a30..c18091705a6 100644
--- a/library/alloc/src/vec/cow.rs
+++ b/library/alloc/src/vec/cow.rs
@@ -1,6 +1,5 @@
-use crate::borrow::Cow;
-
 use super::Vec;
+use crate::borrow::Cow;
 
 #[stable(feature = "cow_from_vec", since = "1.8.0")]
 impl<'a, T: Clone> From<&'a [T]> for Cow<'a, [T]> {
diff --git a/library/alloc/src/vec/drain.rs b/library/alloc/src/vec/drain.rs
index f0b63759ac7..9362cef2a1b 100644
--- a/library/alloc/src/vec/drain.rs
+++ b/library/alloc/src/vec/drain.rs
@@ -1,4 +1,3 @@
-use crate::alloc::{Allocator, Global};
 use core::fmt;
 use core::iter::{FusedIterator, TrustedLen};
 use core::mem::{self, ManuallyDrop, SizedTypeProperties};
@@ -6,6 +5,7 @@ use core::ptr::{self, NonNull};
 use core::slice::{self};
 
 use super::Vec;
+use crate::alloc::{Allocator, Global};
 
 /// A draining iterator for `Vec<T>`.
 ///
diff --git a/library/alloc/src/vec/extract_if.rs b/library/alloc/src/vec/extract_if.rs
index 118cfdb36b9..72d51e89044 100644
--- a/library/alloc/src/vec/extract_if.rs
+++ b/library/alloc/src/vec/extract_if.rs
@@ -1,8 +1,7 @@
-use crate::alloc::{Allocator, Global};
-use core::ptr;
-use core::slice;
+use core::{ptr, slice};
 
 use super::Vec;
+use crate::alloc::{Allocator, Global};
 
 /// An iterator which uses a closure to determine if an element should be removed.
 ///
diff --git a/library/alloc/src/vec/in_place_collect.rs b/library/alloc/src/vec/in_place_collect.rs
index 0dc193d82c5..d119e6ca397 100644
--- a/library/alloc/src/vec/in_place_collect.rs
+++ b/library/alloc/src/vec/in_place_collect.rs
@@ -155,9 +155,7 @@
 //! vec.truncate(write_idx);
 //! ```
 
-use crate::alloc::{handle_alloc_error, Global};
-use core::alloc::Allocator;
-use core::alloc::Layout;
+use core::alloc::{Allocator, Layout};
 use core::iter::{InPlaceIterable, SourceIter, TrustedRandomAccessNoCoerce};
 use core::marker::PhantomData;
 use core::mem::{self, ManuallyDrop, SizedTypeProperties};
@@ -165,6 +163,7 @@ use core::num::NonZero;
 use core::ptr;
 
 use super::{InPlaceDrop, InPlaceDstDataSrcBufDrop, SpecFromIter, SpecFromIterNested, Vec};
+use crate::alloc::{handle_alloc_error, Global};
 
 const fn in_place_collectible<DEST, SRC>(
     step_merge: Option<NonZero<usize>>,
diff --git a/library/alloc/src/vec/in_place_drop.rs b/library/alloc/src/vec/in_place_drop.rs
index 4050c250130..27f75979310 100644
--- a/library/alloc/src/vec/in_place_drop.rs
+++ b/library/alloc/src/vec/in_place_drop.rs
@@ -1,6 +1,5 @@
 use core::marker::PhantomData;
-use core::ptr::NonNull;
-use core::ptr::{self, drop_in_place};
+use core::ptr::{self, drop_in_place, NonNull};
 use core::slice::{self};
 
 use crate::alloc::Global;
diff --git a/library/alloc/src/vec/into_iter.rs b/library/alloc/src/vec/into_iter.rs
index c3a8660383d..fad8abad493 100644
--- a/library/alloc/src/vec/into_iter.rs
+++ b/library/alloc/src/vec/into_iter.rs
@@ -1,11 +1,3 @@
-#[cfg(not(no_global_oom_handling))]
-use super::AsVecIntoIter;
-use crate::alloc::{Allocator, Global};
-#[cfg(not(no_global_oom_handling))]
-use crate::collections::VecDeque;
-use crate::raw_vec::RawVec;
-use core::array;
-use core::fmt;
 use core::iter::{
     FusedIterator, InPlaceIterable, SourceIter, TrustedFused, TrustedLen,
     TrustedRandomAccessNoCoerce,
@@ -17,6 +9,14 @@ use core::num::NonZero;
 use core::ops::Deref;
 use core::ptr::{self, NonNull};
 use core::slice::{self};
+use core::{array, fmt};
+
+#[cfg(not(no_global_oom_handling))]
+use super::AsVecIntoIter;
+use crate::alloc::{Allocator, Global};
+#[cfg(not(no_global_oom_handling))]
+use crate::collections::VecDeque;
+use crate::raw_vec::RawVec;
 
 macro non_null {
     (mut $place:expr, $t:ident) => {{
diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs
index db81fc05c34..5306c507487 100644
--- a/library/alloc/src/vec/mod.rs
+++ b/library/alloc/src/vec/mod.rs
@@ -66,15 +66,14 @@ use core::ops::{self, Index, IndexMut, Range, RangeBounds};
 use core::ptr::{self, NonNull};
 use core::slice::{self, SliceIndex};
 
+#[unstable(feature = "extract_if", reason = "recently added", issue = "43244")]
+pub use self::extract_if::ExtractIf;
 use crate::alloc::{Allocator, Global};
 use crate::borrow::{Cow, ToOwned};
 use crate::boxed::Box;
 use crate::collections::TryReserveError;
 use crate::raw_vec::RawVec;
 
-#[unstable(feature = "extract_if", reason = "recently added", issue = "43244")]
-pub use self::extract_if::ExtractIf;
-
 mod extract_if;
 
 #[cfg(not(no_global_oom_handling))]
diff --git a/library/alloc/src/vec/partial_eq.rs b/library/alloc/src/vec/partial_eq.rs
index b0cf72577a1..5e620c4b2ef 100644
--- a/library/alloc/src/vec/partial_eq.rs
+++ b/library/alloc/src/vec/partial_eq.rs
@@ -1,9 +1,8 @@
+use super::Vec;
 use crate::alloc::Allocator;
 #[cfg(not(no_global_oom_handling))]
 use crate::borrow::Cow;
 
-use super::Vec;
-
 macro_rules! __impl_slice_eq1 {
     ([$($vars:tt)*] $lhs:ty, $rhs:ty $(where $ty:ty: $bound:ident)?, #[$stability:meta]) => {
         #[$stability]
diff --git a/library/alloc/src/vec/spec_extend.rs b/library/alloc/src/vec/spec_extend.rs
index e2f865d0f71..7085bceef5b 100644
--- a/library/alloc/src/vec/spec_extend.rs
+++ b/library/alloc/src/vec/spec_extend.rs
@@ -1,8 +1,8 @@
-use crate::alloc::Allocator;
 use core::iter::TrustedLen;
 use core::slice::{self};
 
 use super::{IntoIter, Vec};
+use crate::alloc::Allocator;
 
 // Specialization trait used for Vec::extend
 pub(super) trait SpecExtend<T, I> {
diff --git a/library/alloc/src/vec/spec_from_elem.rs b/library/alloc/src/vec/spec_from_elem.rs
index 01a6db14474..96d701e15d4 100644
--- a/library/alloc/src/vec/spec_from_elem.rs
+++ b/library/alloc/src/vec/spec_from_elem.rs
@@ -1,10 +1,9 @@
 use core::ptr;
 
+use super::{IsZero, Vec};
 use crate::alloc::Allocator;
 use crate::raw_vec::RawVec;
 
-use super::{IsZero, Vec};
-
 // Specialization trait used for Vec::from_elem
 pub(super) trait SpecFromElem: Sized {
     fn from_elem<A: Allocator>(elem: Self, n: usize, alloc: A) -> Vec<Self, A>;
diff --git a/library/alloc/src/vec/spec_from_iter_nested.rs b/library/alloc/src/vec/spec_from_iter_nested.rs
index f915ebb86e5..77f7761d22f 100644
--- a/library/alloc/src/vec/spec_from_iter_nested.rs
+++ b/library/alloc/src/vec/spec_from_iter_nested.rs
@@ -1,10 +1,8 @@
-use core::cmp;
 use core::iter::TrustedLen;
-use core::ptr;
-
-use crate::raw_vec::RawVec;
+use core::{cmp, ptr};
 
 use super::{SpecExtend, Vec};
+use crate::raw_vec::RawVec;
 
 /// Another specialization trait for Vec::from_iter
 /// necessary to manually prioritize overlapping specializations
diff --git a/library/alloc/src/vec/splice.rs b/library/alloc/src/vec/splice.rs
index 852fdcc3f5c..9e36377c148 100644
--- a/library/alloc/src/vec/splice.rs
+++ b/library/alloc/src/vec/splice.rs
@@ -1,8 +1,8 @@
-use crate::alloc::{Allocator, Global};
 use core::ptr::{self};
 use core::slice::{self};
 
 use super::{Drain, Vec};
+use crate::alloc::{Allocator, Global};
 
 /// A splicing iterator for `Vec`.
 ///
diff --git a/library/alloc/tests/btree_set_hash.rs b/library/alloc/tests/btree_set_hash.rs
index ab275ac4353..71a3a143209 100644
--- a/library/alloc/tests/btree_set_hash.rs
+++ b/library/alloc/tests/btree_set_hash.rs
@@ -1,6 +1,7 @@
-use crate::hash;
 use std::collections::BTreeSet;
 
+use crate::hash;
+
 #[test]
 fn test_hash() {
     let mut x = BTreeSet::new();
diff --git a/library/alloc/tests/slice.rs b/library/alloc/tests/slice.rs
index c0f7a11a93e..df5a8af16fd 100644
--- a/library/alloc/tests/slice.rs
+++ b/library/alloc/tests/slice.rs
@@ -1,9 +1,7 @@
 use std::cmp::Ordering::{Equal, Greater, Less};
 use std::convert::identity;
-use std::fmt;
-use std::mem;
-use std::panic;
 use std::rc::Rc;
+use std::{fmt, mem, panic};
 
 fn square(n: usize) -> usize {
     n * n
@@ -911,8 +909,7 @@ fn test_split_iterators_size_hint() {
             // become maximally long, so the size_hint upper bounds are tight
             ((|_| true) as fn(&_) -> _, Bounds::Upper),
         ] {
-            use assert_tight_size_hints as a;
-            use format_args as f;
+            use {assert_tight_size_hints as a, format_args as f};
 
             a(v.split(p), b, "split");
             a(v.split_mut(p), b, "split_mut");
diff --git a/library/alloc/tests/str.rs b/library/alloc/tests/str.rs
index de5d3991c91..a6b1fe5b979 100644
--- a/library/alloc/tests/str.rs
+++ b/library/alloc/tests/str.rs
@@ -165,7 +165,8 @@ fn test_join_for_different_lengths_with_long_separator() {
 
 #[test]
 fn test_join_issue_80335() {
-    use core::{borrow::Borrow, cell::Cell};
+    use core::borrow::Borrow;
+    use core::cell::Cell;
 
     struct WeirdBorrow {
         state: Cell<bool>,
diff --git a/library/alloc/tests/string.rs b/library/alloc/tests/string.rs
index e20ceae87b0..c5bc4185a36 100644
--- a/library/alloc/tests/string.rs
+++ b/library/alloc/tests/string.rs
@@ -2,11 +2,9 @@ use std::assert_matches::assert_matches;
 use std::borrow::Cow;
 use std::cell::Cell;
 use std::collections::TryReserveErrorKind::*;
-use std::ops::Bound;
 use std::ops::Bound::*;
-use std::ops::RangeBounds;
-use std::panic;
-use std::str;
+use std::ops::{Bound, RangeBounds};
+use std::{panic, str};
 
 pub trait IntoCow<'a, B: ?Sized>
 where
diff --git a/library/alloc/tests/vec.rs b/library/alloc/tests/vec.rs
index 71d79893e01..fd2ddbf59e4 100644
--- a/library/alloc/tests/vec.rs
+++ b/library/alloc/tests/vec.rs
@@ -8,15 +8,14 @@ use std::borrow::Cow;
 use std::cell::Cell;
 use std::collections::TryReserveErrorKind::*;
 use std::fmt::Debug;
-use std::hint;
 use std::iter::InPlaceIterable;
-use std::mem;
 use std::mem::{size_of, swap};
 use std::ops::Bound::*;
 use std::panic::{catch_unwind, AssertUnwindSafe};
 use std::rc::Rc;
 use std::sync::atomic::{AtomicU32, Ordering};
 use std::vec::{Drain, IntoIter};
+use std::{hint, mem};
 
 struct DropCounter<'a> {
     count: &'a mut u32,
@@ -2572,7 +2571,8 @@ fn test_into_flattened_size_overflow() {
 
 #[test]
 fn test_box_zero_allocator() {
-    use core::{alloc::AllocError, cell::RefCell};
+    use core::alloc::AllocError;
+    use core::cell::RefCell;
     use std::collections::HashSet;
 
     // Track ZST allocations and ensure that they all have a matching free.
diff --git a/library/alloc/tests/vec_deque.rs b/library/alloc/tests/vec_deque.rs
index cea5de4dd59..db972122fef 100644
--- a/library/alloc/tests/vec_deque.rs
+++ b/library/alloc/tests/vec_deque.rs
@@ -1,16 +1,17 @@
 use core::num::NonZero;
 use std::assert_matches::assert_matches;
+use std::collections::vec_deque::Drain;
 use std::collections::TryReserveErrorKind::*;
-use std::collections::{vec_deque::Drain, VecDeque};
+use std::collections::VecDeque;
 use std::fmt::Debug;
 use std::ops::Bound::*;
 use std::panic::{catch_unwind, AssertUnwindSafe};
 
-use crate::hash;
-
 use Taggy::*;
 use Taggypar::*;
 
+use crate::hash;
+
 #[test]
 fn test_simple() {
     let mut d = VecDeque::new();
diff --git a/library/alloc/tests/vec_deque_alloc_error.rs b/library/alloc/tests/vec_deque_alloc_error.rs
index 8b516ddbc5c..c41d8266eb4 100644
--- a/library/alloc/tests/vec_deque_alloc_error.rs
+++ b/library/alloc/tests/vec_deque_alloc_error.rs
@@ -1,11 +1,9 @@
 #![feature(alloc_error_hook, allocator_api)]
 
-use std::{
-    alloc::{set_alloc_error_hook, AllocError, Allocator, Layout, System},
-    collections::VecDeque,
-    panic::{catch_unwind, AssertUnwindSafe},
-    ptr::NonNull,
-};
+use std::alloc::{set_alloc_error_hook, AllocError, Allocator, Layout, System};
+use std::collections::VecDeque;
+use std::panic::{catch_unwind, AssertUnwindSafe};
+use std::ptr::NonNull;
 
 #[test]
 #[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
diff --git a/library/core/benches/any.rs b/library/core/benches/any.rs
index 53099b78266..f6be41bcdbf 100644
--- a/library/core/benches/any.rs
+++ b/library/core/benches/any.rs
@@ -1,4 +1,5 @@
 use core::any::*;
+
 use test::{black_box, Bencher};
 
 #[bench]
diff --git a/library/core/benches/array.rs b/library/core/benches/array.rs
index d8cc44d05c4..b1a41a088c4 100644
--- a/library/core/benches/array.rs
+++ b/library/core/benches/array.rs
@@ -1,5 +1,4 @@
-use test::black_box;
-use test::Bencher;
+use test::{black_box, Bencher};
 
 macro_rules! map_array {
     ($func_name:ident, $start_item: expr, $map_item: expr, $arr_size: expr) => {
diff --git a/library/core/benches/ascii.rs b/library/core/benches/ascii.rs
index 71ec9fed2fe..61bf8bbf411 100644
--- a/library/core/benches/ascii.rs
+++ b/library/core/benches/ascii.rs
@@ -64,8 +64,8 @@ macro_rules! benches {
 }
 
 use std::fmt::Write;
-use test::black_box;
-use test::Bencher;
+
+use test::{black_box, Bencher};
 
 const ASCII_CASE_MASK: u8 = 0b0010_0000;
 
diff --git a/library/core/benches/ascii/is_ascii.rs b/library/core/benches/ascii/is_ascii.rs
index a42a1dcfe39..05f60a46f8b 100644
--- a/library/core/benches/ascii/is_ascii.rs
+++ b/library/core/benches/ascii/is_ascii.rs
@@ -1,6 +1,6 @@
+use test::{black_box, Bencher};
+
 use super::{LONG, MEDIUM, SHORT};
-use test::black_box;
-use test::Bencher;
 
 macro_rules! benches {
     ($( fn $name: ident($arg: ident: &[u8]) $body: block )+) => {
diff --git a/library/core/benches/fmt.rs b/library/core/benches/fmt.rs
index d1cdb12e50f..906d7ac3eef 100644
--- a/library/core/benches/fmt.rs
+++ b/library/core/benches/fmt.rs
@@ -1,5 +1,6 @@
 use std::fmt::{self, Write as FmtWrite};
 use std::io::{self, Write as IoWrite};
+
 use test::{black_box, Bencher};
 
 #[bench]
diff --git a/library/core/benches/hash/sip.rs b/library/core/benches/hash/sip.rs
index 725c864dce9..8e8c07b6ee4 100644
--- a/library/core/benches/hash/sip.rs
+++ b/library/core/benches/hash/sip.rs
@@ -1,6 +1,7 @@
 #![allow(deprecated)]
 
 use core::hash::*;
+
 use test::{black_box, Bencher};
 
 fn hash_bytes<H: Hasher>(mut s: H, x: &[u8]) -> u64 {
diff --git a/library/core/benches/iter.rs b/library/core/benches/iter.rs
index c1cec5e6d3c..24469ba0c42 100644
--- a/library/core/benches/iter.rs
+++ b/library/core/benches/iter.rs
@@ -3,6 +3,7 @@ use core::iter::*;
 use core::mem;
 use core::num::Wrapping;
 use core::ops::Range;
+
 use test::{black_box, Bencher};
 
 #[bench]
diff --git a/library/core/benches/num/flt2dec/mod.rs b/library/core/benches/num/flt2dec/mod.rs
index b1a9fc56bae..6c7de5dcd22 100644
--- a/library/core/benches/num/flt2dec/mod.rs
+++ b/library/core/benches/num/flt2dec/mod.rs
@@ -3,9 +3,9 @@ mod strategy {
     mod grisu;
 }
 
-use core::num::flt2dec::MAX_SIG_DIGITS;
-use core::num::flt2dec::{decode, DecodableFloat, Decoded, FullDecoded};
+use core::num::flt2dec::{decode, DecodableFloat, Decoded, FullDecoded, MAX_SIG_DIGITS};
 use std::io::Write;
+
 use test::{black_box, Bencher};
 
 pub fn decode_finite<T: DecodableFloat>(v: T) -> Decoded {
diff --git a/library/core/benches/num/flt2dec/strategy/dragon.rs b/library/core/benches/num/flt2dec/strategy/dragon.rs
index babedc6c0ec..45266971403 100644
--- a/library/core/benches/num/flt2dec/strategy/dragon.rs
+++ b/library/core/benches/num/flt2dec/strategy/dragon.rs
@@ -1,7 +1,8 @@
-use super::super::*;
 use core::num::flt2dec::strategy::dragon::*;
 use std::mem::MaybeUninit;
 
+use super::super::*;
+
 #[bench]
 fn bench_small_shortest(b: &mut Bencher) {
     let decoded = decode_finite(3.141592f64);
diff --git a/library/core/benches/num/flt2dec/strategy/grisu.rs b/library/core/benches/num/flt2dec/strategy/grisu.rs
index b5bddb2c7c7..d20f9b02f7e 100644
--- a/library/core/benches/num/flt2dec/strategy/grisu.rs
+++ b/library/core/benches/num/flt2dec/strategy/grisu.rs
@@ -1,7 +1,8 @@
-use super::super::*;
 use core::num::flt2dec::strategy::grisu::*;
 use std::mem::MaybeUninit;
 
+use super::super::*;
+
 pub fn decode_finite<T: DecodableFloat>(v: T) -> Decoded {
     match decode(v).1 {
         FullDecoded::Finite(decoded) => decoded,
diff --git a/library/core/benches/num/mod.rs b/library/core/benches/num/mod.rs
index 4922ee150d9..c1dc3a30622 100644
--- a/library/core/benches/num/mod.rs
+++ b/library/core/benches/num/mod.rs
@@ -4,6 +4,7 @@ mod int_log;
 mod int_pow;
 
 use std::str::FromStr;
+
 use test::{black_box, Bencher};
 
 const ASCII_NUMBERS: [&str; 19] = [
diff --git a/library/core/benches/ops.rs b/library/core/benches/ops.rs
index 0a2be8a2881..3d0b3302957 100644
--- a/library/core/benches/ops.rs
+++ b/library/core/benches/ops.rs
@@ -1,4 +1,5 @@
 use core::ops::*;
+
 use test::Bencher;
 
 // Overhead of dtors
diff --git a/library/core/benches/pattern.rs b/library/core/benches/pattern.rs
index 480ac6f36d2..0d60b005feb 100644
--- a/library/core/benches/pattern.rs
+++ b/library/core/benches/pattern.rs
@@ -1,5 +1,4 @@
-use test::black_box;
-use test::Bencher;
+use test::{black_box, Bencher};
 
 #[bench]
 fn starts_with_char(b: &mut Bencher) {
diff --git a/library/core/benches/slice.rs b/library/core/benches/slice.rs
index 8f87a211449..2741dbd53f1 100644
--- a/library/core/benches/slice.rs
+++ b/library/core/benches/slice.rs
@@ -1,6 +1,6 @@
 use core::ptr::NonNull;
-use test::black_box;
-use test::Bencher;
+
+use test::{black_box, Bencher};
 
 enum Cache {
     L1,
diff --git a/library/core/benches/str.rs b/library/core/benches/str.rs
index 0f14809444b..a8178f9c187 100644
--- a/library/core/benches/str.rs
+++ b/library/core/benches/str.rs
@@ -1,4 +1,5 @@
 use std::str;
+
 use test::{black_box, Bencher};
 
 mod char_count;
diff --git a/library/core/benches/str/char_count.rs b/library/core/benches/str/char_count.rs
index 25d9b2e2992..b87ad0f6adf 100644
--- a/library/core/benches/str/char_count.rs
+++ b/library/core/benches/str/char_count.rs
@@ -1,6 +1,7 @@
-use super::corpora::*;
 use test::{black_box, Bencher};
 
+use super::corpora::*;
+
 macro_rules! define_benches {
     ($( fn $name: ident($arg: ident: &str) $body: block )+) => {
         define_benches!(mod en_tiny, en::TINY, $($name $arg $body)+);
diff --git a/library/core/benches/str/debug.rs b/library/core/benches/str/debug.rs
index cb91169eed8..6dbf4e92c08 100644
--- a/library/core/benches/str/debug.rs
+++ b/library/core/benches/str/debug.rs
@@ -4,6 +4,7 @@
 //! we should still try to minimize those calls over time rather than regress them.
 
 use std::fmt::{self, Write};
+
 use test::{black_box, Bencher};
 
 #[derive(Default)]
diff --git a/library/core/benches/str/iter.rs b/library/core/benches/str/iter.rs
index 58ae71fc10f..f6e73e48d8e 100644
--- a/library/core/benches/str/iter.rs
+++ b/library/core/benches/str/iter.rs
@@ -1,6 +1,7 @@
-use super::corpora;
 use test::{black_box, Bencher};
 
+use super::corpora;
+
 #[bench]
 fn chars_advance_by_1000(b: &mut Bencher) {
     b.iter(|| black_box(corpora::ru::LARGE).chars().advance_by(1000));
diff --git a/library/core/src/alloc/global.rs b/library/core/src/alloc/global.rs
index cf25deacb57..a6f799c4a7d 100644
--- a/library/core/src/alloc/global.rs
+++ b/library/core/src/alloc/global.rs
@@ -1,6 +1,5 @@
 use crate::alloc::Layout;
-use crate::cmp;
-use crate::ptr;
+use crate::{cmp, ptr};
 
 /// A memory allocator that can be registered as the standard library’s default
 /// through the `#[global_allocator]` attribute.
diff --git a/library/core/src/alloc/layout.rs b/library/core/src/alloc/layout.rs
index 431b07035c3..549a4bc6727 100644
--- a/library/core/src/alloc/layout.rs
+++ b/library/core/src/alloc/layout.rs
@@ -4,11 +4,9 @@
 // collections, resulting in having to optimize down excess IR multiple times.
 // Your performance intuition is useless. Run perf.
 
-use crate::cmp;
 use crate::error::Error;
-use crate::fmt;
-use crate::mem;
 use crate::ptr::{Alignment, NonNull};
+use crate::{cmp, fmt, mem};
 
 // While this function is used in one place and its implementation
 // could be inlined, the previous attempts to do so made rustc
diff --git a/library/core/src/alloc/mod.rs b/library/core/src/alloc/mod.rs
index 1c8e6676544..aa841db045c 100644
--- a/library/core/src/alloc/mod.rs
+++ b/library/core/src/alloc/mod.rs
@@ -17,10 +17,8 @@ pub use self::layout::Layout;
 )]
 #[allow(deprecated, deprecated_in_future)]
 pub use self::layout::LayoutErr;
-
 #[stable(feature = "alloc_layout_error", since = "1.50.0")]
 pub use self::layout::LayoutError;
-
 use crate::error::Error;
 use crate::fmt;
 use crate::ptr::{self, NonNull};
diff --git a/library/core/src/any.rs b/library/core/src/any.rs
index 59f3b6841d5..58107b1e7d0 100644
--- a/library/core/src/any.rs
+++ b/library/core/src/any.rs
@@ -86,9 +86,7 @@
 
 #![stable(feature = "rust1", since = "1.0.0")]
 
-use crate::fmt;
-use crate::hash;
-use crate::intrinsics;
+use crate::{fmt, hash, intrinsics};
 
 ///////////////////////////////////////////////////////////////////////////////
 // Any trait
diff --git a/library/core/src/array/iter.rs b/library/core/src/array/iter.rs
index 617fd627c92..2d19e4876f6 100644
--- a/library/core/src/array/iter.rs
+++ b/library/core/src/array/iter.rs
@@ -1,14 +1,11 @@
 //! Defines the `IntoIter` owned iterator for arrays.
 
+use crate::intrinsics::transmute_unchecked;
+use crate::iter::{self, FusedIterator, TrustedLen, TrustedRandomAccessNoCoerce};
+use crate::mem::MaybeUninit;
 use crate::num::NonZero;
-use crate::{
-    fmt,
-    intrinsics::transmute_unchecked,
-    iter::{self, FusedIterator, TrustedLen, TrustedRandomAccessNoCoerce},
-    mem::MaybeUninit,
-    ops::{IndexRange, Range},
-    ptr,
-};
+use crate::ops::{IndexRange, Range};
+use crate::{fmt, ptr};
 
 /// A by-value [array] iterator.
 #[stable(feature = "array_value_iter", since = "1.51.0")]
diff --git a/library/core/src/array/mod.rs b/library/core/src/array/mod.rs
index 8285c64ed29..5c826b9993f 100644
--- a/library/core/src/array/mod.rs
+++ b/library/core/src/array/mod.rs
@@ -23,7 +23,6 @@ mod equality;
 mod iter;
 
 pub(crate) use drain::drain_array_with;
-
 #[stable(feature = "array_value_iter", since = "1.51.0")]
 pub use iter::IntoIter;
 
diff --git a/library/core/src/ascii.rs b/library/core/src/ascii.rs
index e9f4d0f93ed..5b3711b4071 100644
--- a/library/core/src/ascii.rs
+++ b/library/core/src/ascii.rs
@@ -9,10 +9,9 @@
 
 #![stable(feature = "core_ascii", since = "1.26.0")]
 
-use crate::escape;
-use crate::fmt;
 use crate::iter::FusedIterator;
 use crate::num::NonZero;
+use crate::{escape, fmt};
 
 mod ascii_char;
 #[unstable(feature = "ascii_char", issue = "110998")]
diff --git a/library/core/src/asserting.rs b/library/core/src/asserting.rs
index 212b637d343..3015aa562e6 100644
--- a/library/core/src/asserting.rs
+++ b/library/core/src/asserting.rs
@@ -9,10 +9,8 @@
 #![doc(hidden)]
 #![unstable(feature = "generic_assert_internals", issue = "44838")]
 
-use crate::{
-    fmt::{Debug, Formatter},
-    marker::PhantomData,
-};
+use crate::fmt::{Debug, Formatter};
+use crate::marker::PhantomData;
 
 // ***** TryCapture - Generic *****
 
diff --git a/library/core/src/async_iter/from_iter.rs b/library/core/src/async_iter/from_iter.rs
index 3180187afc8..f4e10bdffea 100644
--- a/library/core/src/async_iter/from_iter.rs
+++ b/library/core/src/async_iter/from_iter.rs
@@ -1,6 +1,5 @@
-use crate::pin::Pin;
-
 use crate::async_iter::AsyncIterator;
+use crate::pin::Pin;
 use crate::task::{Context, Poll};
 
 /// An async iterator that was created from iterator.
diff --git a/library/core/src/cell/lazy.rs b/library/core/src/cell/lazy.rs
index 21452d40f9d..6ec1d2a33be 100644
--- a/library/core/src/cell/lazy.rs
+++ b/library/core/src/cell/lazy.rs
@@ -1,8 +1,7 @@
+use super::UnsafeCell;
 use crate::ops::Deref;
 use crate::{fmt, mem};
 
-use super::UnsafeCell;
-
 enum State<T, F> {
     Uninit(F),
     Init(T),
diff --git a/library/core/src/cell/once.rs b/library/core/src/cell/once.rs
index 872b4da4dbf..097fa86c938 100644
--- a/library/core/src/cell/once.rs
+++ b/library/core/src/cell/once.rs
@@ -1,6 +1,5 @@
 use crate::cell::UnsafeCell;
-use crate::fmt;
-use crate::mem;
+use crate::{fmt, mem};
 
 /// A cell which can nominally be written to only once.
 ///
diff --git a/library/core/src/char/methods.rs b/library/core/src/char/methods.rs
index 4186565c131..cece00c9c08 100644
--- a/library/core/src/char/methods.rs
+++ b/library/core/src/char/methods.rs
@@ -1,12 +1,11 @@
 //! impl char {}
 
+use super::*;
 use crate::slice;
 use crate::str::from_utf8_unchecked_mut;
 use crate::unicode::printable::is_printable;
 use crate::unicode::{self, conversions};
 
-use super::*;
-
 impl char {
     /// The lowest valid code point a `char` can have, `'\0'`.
     ///
diff --git a/library/core/src/char/mod.rs b/library/core/src/char/mod.rs
index 37c27ecb8c4..625ac5ae2b4 100644
--- a/library/core/src/char/mod.rs
+++ b/library/core/src/char/mod.rs
@@ -42,14 +42,13 @@ pub use self::methods::encode_utf8_raw; // perma-unstable
 
 #[rustfmt::skip]
 use crate::ascii;
+pub(crate) use self::methods::EscapeDebugExtArgs;
 use crate::error::Error;
 use crate::escape;
 use crate::fmt::{self, Write};
 use crate::iter::{FusedIterator, TrustedLen, TrustedRandomAccess, TrustedRandomAccessNoCoerce};
 use crate::num::NonZero;
 
-pub(crate) use self::methods::EscapeDebugExtArgs;
-
 // UTF-8 ranges and tags for encoding characters
 const TAG_CONT: u8 = 0b1000_0000;
 const TAG_TWO_B: u8 = 0b1100_0000;
diff --git a/library/core/src/ffi/c_str.rs b/library/core/src/ffi/c_str.rs
index ae42ae3baf4..b1f731c5fe0 100644
--- a/library/core/src/ffi/c_str.rs
+++ b/library/core/src/ffi/c_str.rs
@@ -3,16 +3,11 @@
 use crate::cmp::Ordering;
 use crate::error::Error;
 use crate::ffi::c_char;
-use crate::fmt;
-use crate::intrinsics;
 use crate::iter::FusedIterator;
 use crate::marker::PhantomData;
-use crate::ops;
-use crate::ptr::addr_of;
-use crate::ptr::NonNull;
-use crate::slice;
+use crate::ptr::{addr_of, NonNull};
 use crate::slice::memchr;
-use crate::str;
+use crate::{fmt, intrinsics, ops, slice, str};
 
 // FIXME: because this is doc(inline)d, we *have* to use intra-doc links because the actual link
 //   depends on where the item is being documented. however, since this is libcore, we can't
diff --git a/library/core/src/ffi/mod.rs b/library/core/src/ffi/mod.rs
index 93426b90c70..ec1f9052a15 100644
--- a/library/core/src/ffi/mod.rs
+++ b/library/core/src/ffi/mod.rs
@@ -9,19 +9,16 @@
 #![stable(feature = "core_ffi", since = "1.30.0")]
 #![allow(non_camel_case_types)]
 
-use crate::fmt;
-
-#[doc(no_inline)]
+#[doc(inline)]
 #[stable(feature = "core_c_str", since = "1.64.0")]
-pub use self::c_str::FromBytesWithNulError;
-
+pub use self::c_str::CStr;
 #[doc(no_inline)]
 #[stable(feature = "cstr_from_bytes_until_nul", since = "1.69.0")]
 pub use self::c_str::FromBytesUntilNulError;
-
-#[doc(inline)]
+#[doc(no_inline)]
 #[stable(feature = "core_c_str", since = "1.64.0")]
-pub use self::c_str::CStr;
+pub use self::c_str::FromBytesWithNulError;
+use crate::fmt;
 
 #[unstable(feature = "c_str_module", issue = "112134")]
 pub mod c_str;
diff --git a/library/core/src/ffi/va_list.rs b/library/core/src/ffi/va_list.rs
index dda9e30c24b..3a224e4d8fe 100644
--- a/library/core/src/ffi/va_list.rs
+++ b/library/core/src/ffi/va_list.rs
@@ -3,7 +3,6 @@
 //! Better known as "varargs".
 
 use crate::ffi::c_void;
-
 #[allow(unused_imports)]
 use crate::fmt;
 use crate::marker::PhantomData;
diff --git a/library/core/src/fmt/float.rs b/library/core/src/fmt/float.rs
index 80c45fce2f0..20ea0352c2d 100644
--- a/library/core/src/fmt/float.rs
+++ b/library/core/src/fmt/float.rs
@@ -1,7 +1,6 @@
 use crate::fmt::{Debug, Display, Formatter, LowerExp, Result, UpperExp};
 use crate::mem::MaybeUninit;
-use crate::num::flt2dec;
-use crate::num::fmt as numfmt;
+use crate::num::{flt2dec, fmt as numfmt};
 
 #[doc(hidden)]
 trait GeneralFormat: PartialOrd {
diff --git a/library/core/src/fmt/mod.rs b/library/core/src/fmt/mod.rs
index 594f26e978a..60c0dc76852 100644
--- a/library/core/src/fmt/mod.rs
+++ b/library/core/src/fmt/mod.rs
@@ -4,13 +4,10 @@
 
 use crate::cell::{Cell, Ref, RefCell, RefMut, SyncUnsafeCell, UnsafeCell};
 use crate::char::EscapeDebugExtArgs;
-use crate::iter;
 use crate::marker::PhantomData;
-use crate::mem;
 use crate::num::fmt as numfmt;
 use crate::ops::Deref;
-use crate::result;
-use crate::str;
+use crate::{iter, mem, result, str};
 
 mod builders;
 #[cfg(not(no_fp_fmt_parse))]
@@ -36,11 +33,10 @@ pub enum Alignment {
     Center,
 }
 
-#[stable(feature = "debug_builders", since = "1.2.0")]
-pub use self::builders::{DebugList, DebugMap, DebugSet, DebugStruct, DebugTuple};
-
 #[unstable(feature = "debug_closure_helpers", issue = "117729")]
 pub use self::builders::FormatterFn;
+#[stable(feature = "debug_builders", since = "1.2.0")]
+pub use self::builders::{DebugList, DebugMap, DebugSet, DebugStruct, DebugTuple};
 
 /// The type returned by formatter methods.
 ///
diff --git a/library/core/src/fmt/num.rs b/library/core/src/fmt/num.rs
index 3a5a5af8bf5..e7726da8d91 100644
--- a/library/core/src/fmt/num.rs
+++ b/library/core/src/fmt/num.rs
@@ -1,12 +1,9 @@
 //! Integer and floating-point number formatting
 
-use crate::fmt;
 use crate::mem::MaybeUninit;
 use crate::num::fmt as numfmt;
 use crate::ops::{Div, Rem, Sub};
-use crate::ptr;
-use crate::slice;
-use crate::str;
+use crate::{fmt, ptr, slice, str};
 
 #[doc(hidden)]
 trait DisplayInt:
diff --git a/library/core/src/future/mod.rs b/library/core/src/future/mod.rs
index 3a1451abfa4..d188f1c7130 100644
--- a/library/core/src/future/mod.rs
+++ b/library/core/src/future/mod.rs
@@ -20,25 +20,21 @@ mod pending;
 mod poll_fn;
 mod ready;
 
-#[stable(feature = "futures_api", since = "1.36.0")]
-pub use self::future::Future;
-
-#[unstable(feature = "future_join", issue = "91642")]
-pub use self::join::join;
-
+#[unstable(feature = "async_drop", issue = "126482")]
+pub use async_drop::{async_drop, async_drop_in_place, AsyncDrop, AsyncDropInPlace};
 #[stable(feature = "into_future", since = "1.64.0")]
 pub use into_future::IntoFuture;
-
 #[stable(feature = "future_readiness_fns", since = "1.48.0")]
 pub use pending::{pending, Pending};
-#[stable(feature = "future_readiness_fns", since = "1.48.0")]
-pub use ready::{ready, Ready};
-
 #[stable(feature = "future_poll_fn", since = "1.64.0")]
 pub use poll_fn::{poll_fn, PollFn};
+#[stable(feature = "future_readiness_fns", since = "1.48.0")]
+pub use ready::{ready, Ready};
 
-#[unstable(feature = "async_drop", issue = "126482")]
-pub use async_drop::{async_drop, async_drop_in_place, AsyncDrop, AsyncDropInPlace};
+#[stable(feature = "futures_api", since = "1.36.0")]
+pub use self::future::Future;
+#[unstable(feature = "future_join", issue = "91642")]
+pub use self::join::join;
 
 /// This type is needed because:
 ///
diff --git a/library/core/src/hash/mod.rs b/library/core/src/hash/mod.rs
index da734466263..061690e88dd 100644
--- a/library/core/src/hash/mod.rs
+++ b/library/core/src/hash/mod.rs
@@ -83,17 +83,14 @@
 
 #![stable(feature = "rust1", since = "1.0.0")]
 
-use crate::fmt;
-use crate::marker;
-
 #[stable(feature = "rust1", since = "1.0.0")]
 #[allow(deprecated)]
 pub use self::sip::SipHasher;
-
 #[unstable(feature = "hashmap_internals", issue = "none")]
 #[allow(deprecated)]
 #[doc(hidden)]
 pub use self::sip::SipHasher13;
+use crate::{fmt, marker};
 
 mod sip;
 
@@ -806,10 +803,8 @@ impl<H> PartialEq for BuildHasherDefault<H> {
 impl<H> Eq for BuildHasherDefault<H> {}
 
 mod impls {
-    use crate::mem;
-    use crate::slice;
-
     use super::*;
+    use crate::{mem, slice};
 
     macro_rules! impl_write {
         ($(($ty:ident, $meth:ident),)*) => {$(
diff --git a/library/core/src/hash/sip.rs b/library/core/src/hash/sip.rs
index 0d1ac64aa56..17f2caaa0c0 100644
--- a/library/core/src/hash/sip.rs
+++ b/library/core/src/hash/sip.rs
@@ -2,10 +2,8 @@
 
 #![allow(deprecated)] // the types in this module are deprecated
 
-use crate::cmp;
 use crate::marker::PhantomData;
-use crate::mem;
-use crate::ptr;
+use crate::{cmp, mem, ptr};
 
 /// An implementation of SipHash 1-3.
 ///
diff --git a/library/core/src/hint.rs b/library/core/src/hint.rs
index b3e36e6fbc4..bb969cf71c5 100644
--- a/library/core/src/hint.rs
+++ b/library/core/src/hint.rs
@@ -3,8 +3,7 @@
 //! Hints to compiler that affects how code should be emitted or optimized.
 //! Hints may be compile time or runtime.
 
-use crate::intrinsics;
-use crate::ub_checks;
+use crate::{intrinsics, ub_checks};
 
 /// Informs the compiler that the site which is calling this function is not
 /// reachable, possibly enabling further optimizations.
diff --git a/library/core/src/intrinsics.rs b/library/core/src/intrinsics.rs
index 878ab5ad27d..a455a15d9a9 100644
--- a/library/core/src/intrinsics.rs
+++ b/library/core/src/intrinsics.rs
@@ -63,10 +63,8 @@
 )]
 #![allow(missing_docs)]
 
-use crate::marker::DiscriminantKind;
-use crate::marker::Tuple;
-use crate::ptr;
-use crate::ub_checks;
+use crate::marker::{DiscriminantKind, Tuple};
+use crate::{ptr, ub_checks};
 
 pub mod mir;
 pub mod simd;
diff --git a/library/core/src/intrinsics/mir.rs b/library/core/src/intrinsics/mir.rs
index 1daf1d723fb..fd49a96eaa0 100644
--- a/library/core/src/intrinsics/mir.rs
+++ b/library/core/src/intrinsics/mir.rs
@@ -276,8 +276,7 @@ pub enum UnwindTerminateReason {
     InCleanup,
 }
 
-pub use UnwindTerminateReason::Abi as ReasonAbi;
-pub use UnwindTerminateReason::InCleanup as ReasonInCleanup;
+pub use UnwindTerminateReason::{Abi as ReasonAbi, InCleanup as ReasonInCleanup};
 
 macro_rules! define {
     ($name:literal, $( #[ $meta:meta ] )* fn $($sig:tt)*) => {
diff --git a/library/core/src/iter/adapters/cloned.rs b/library/core/src/iter/adapters/cloned.rs
index 1a106ef9794..aea6d64281a 100644
--- a/library/core/src/iter/adapters/cloned.rs
+++ b/library/core/src/iter/adapters/cloned.rs
@@ -1,9 +1,9 @@
-use crate::iter::adapters::{
-    zip::try_get_unchecked, SourceIter, TrustedRandomAccess, TrustedRandomAccessNoCoerce,
-};
+use core::num::NonZero;
+
+use crate::iter::adapters::zip::try_get_unchecked;
+use crate::iter::adapters::{SourceIter, TrustedRandomAccess, TrustedRandomAccessNoCoerce};
 use crate::iter::{FusedIterator, InPlaceIterable, TrustedLen, UncheckedIterator};
 use crate::ops::Try;
-use core::num::NonZero;
 
 /// An iterator that clones the elements of an underlying iterator.
 ///
diff --git a/library/core/src/iter/adapters/copied.rs b/library/core/src/iter/adapters/copied.rs
index d772e7b36e0..23e4e25ab53 100644
--- a/library/core/src/iter/adapters/copied.rs
+++ b/library/core/src/iter/adapters/copied.rs
@@ -1,9 +1,7 @@
-use crate::iter::adapters::{
-    zip::try_get_unchecked, SourceIter, TrustedRandomAccess, TrustedRandomAccessNoCoerce,
-};
+use crate::iter::adapters::zip::try_get_unchecked;
+use crate::iter::adapters::{SourceIter, TrustedRandomAccess, TrustedRandomAccessNoCoerce};
 use crate::iter::{FusedIterator, InPlaceIterable, TrustedLen};
-use crate::mem::MaybeUninit;
-use crate::mem::SizedTypeProperties;
+use crate::mem::{MaybeUninit, SizedTypeProperties};
 use crate::num::NonZero;
 use crate::ops::Try;
 use crate::{array, ptr};
diff --git a/library/core/src/iter/adapters/cycle.rs b/library/core/src/iter/adapters/cycle.rs
index b35ed844203..6cb1a3a4676 100644
--- a/library/core/src/iter/adapters/cycle.rs
+++ b/library/core/src/iter/adapters/cycle.rs
@@ -1,5 +1,6 @@
+use crate::iter::FusedIterator;
 use crate::num::NonZero;
-use crate::{iter::FusedIterator, ops::Try};
+use crate::ops::Try;
 
 /// An iterator that repeats endlessly.
 ///
diff --git a/library/core/src/iter/adapters/enumerate.rs b/library/core/src/iter/adapters/enumerate.rs
index 7adbabf69e4..ac15e3767fc 100644
--- a/library/core/src/iter/adapters/enumerate.rs
+++ b/library/core/src/iter/adapters/enumerate.rs
@@ -1,6 +1,5 @@
-use crate::iter::adapters::{
-    zip::try_get_unchecked, SourceIter, TrustedRandomAccess, TrustedRandomAccessNoCoerce,
-};
+use crate::iter::adapters::zip::try_get_unchecked;
+use crate::iter::adapters::{SourceIter, TrustedRandomAccess, TrustedRandomAccessNoCoerce};
 use crate::iter::{FusedIterator, InPlaceIterable, TrustedFused, TrustedLen};
 use crate::num::NonZero;
 use crate::ops::Try;
diff --git a/library/core/src/iter/adapters/filter.rs b/library/core/src/iter/adapters/filter.rs
index ba49070329c..dd08cd6f61c 100644
--- a/library/core/src/iter/adapters/filter.rs
+++ b/library/core/src/iter/adapters/filter.rs
@@ -1,11 +1,13 @@
-use crate::fmt;
-use crate::iter::{adapters::SourceIter, FusedIterator, InPlaceIterable, TrustedFused};
-use crate::num::NonZero;
-use crate::ops::Try;
 use core::array;
 use core::mem::MaybeUninit;
 use core::ops::ControlFlow;
 
+use crate::fmt;
+use crate::iter::adapters::SourceIter;
+use crate::iter::{FusedIterator, InPlaceIterable, TrustedFused};
+use crate::num::NonZero;
+use crate::ops::Try;
+
 /// An iterator that filters the elements of `iter` with `predicate`.
 ///
 /// This `struct` is created by the [`filter`] method on [`Iterator`]. See its
diff --git a/library/core/src/iter/adapters/filter_map.rs b/library/core/src/iter/adapters/filter_map.rs
index 2126619a58a..914ef613177 100644
--- a/library/core/src/iter/adapters/filter_map.rs
+++ b/library/core/src/iter/adapters/filter_map.rs
@@ -1,4 +1,5 @@
-use crate::iter::{adapters::SourceIter, FusedIterator, InPlaceIterable, TrustedFused};
+use crate::iter::adapters::SourceIter;
+use crate::iter::{FusedIterator, InPlaceIterable, TrustedFused};
 use crate::mem::{ManuallyDrop, MaybeUninit};
 use crate::num::NonZero;
 use crate::ops::{ControlFlow, Try};
diff --git a/library/core/src/iter/adapters/flatten.rs b/library/core/src/iter/adapters/flatten.rs
index 145c9d3dacc..0023b46031f 100644
--- a/library/core/src/iter/adapters/flatten.rs
+++ b/library/core/src/iter/adapters/flatten.rs
@@ -1,13 +1,11 @@
 use crate::iter::adapters::SourceIter;
 use crate::iter::{
-    Cloned, Copied, Filter, FilterMap, Fuse, FusedIterator, InPlaceIterable, Map, TrustedFused,
-    TrustedLen,
+    Cloned, Copied, Empty, Filter, FilterMap, Fuse, FusedIterator, InPlaceIterable, Map, Once,
+    OnceWith, TrustedFused, TrustedLen,
 };
-use crate::iter::{Empty, Once, OnceWith};
 use crate::num::NonZero;
 use crate::ops::{ControlFlow, Try};
-use crate::result;
-use crate::{array, fmt, option};
+use crate::{array, fmt, option, result};
 
 /// An iterator that maps each element to an iterator, and yields the elements
 /// of the produced iterators.
diff --git a/library/core/src/iter/adapters/inspect.rs b/library/core/src/iter/adapters/inspect.rs
index 1c4656a649a..0e2a68a503e 100644
--- a/library/core/src/iter/adapters/inspect.rs
+++ b/library/core/src/iter/adapters/inspect.rs
@@ -1,5 +1,6 @@
 use crate::fmt;
-use crate::iter::{adapters::SourceIter, FusedIterator, InPlaceIterable, TrustedFused};
+use crate::iter::adapters::SourceIter;
+use crate::iter::{FusedIterator, InPlaceIterable, TrustedFused};
 use crate::num::NonZero;
 use crate::ops::Try;
 
diff --git a/library/core/src/iter/adapters/map.rs b/library/core/src/iter/adapters/map.rs
index 6e163e20d8e..007c2d5acc2 100644
--- a/library/core/src/iter/adapters/map.rs
+++ b/library/core/src/iter/adapters/map.rs
@@ -1,7 +1,6 @@
 use crate::fmt;
-use crate::iter::adapters::{
-    zip::try_get_unchecked, SourceIter, TrustedRandomAccess, TrustedRandomAccessNoCoerce,
-};
+use crate::iter::adapters::zip::try_get_unchecked;
+use crate::iter::adapters::{SourceIter, TrustedRandomAccess, TrustedRandomAccessNoCoerce};
 use crate::iter::{FusedIterator, InPlaceIterable, TrustedFused, TrustedLen, UncheckedIterator};
 use crate::num::NonZero;
 use crate::ops::Try;
diff --git a/library/core/src/iter/adapters/map_while.rs b/library/core/src/iter/adapters/map_while.rs
index 9ad50048c25..4e7327938d7 100644
--- a/library/core/src/iter/adapters/map_while.rs
+++ b/library/core/src/iter/adapters/map_while.rs
@@ -1,5 +1,6 @@
 use crate::fmt;
-use crate::iter::{adapters::SourceIter, InPlaceIterable};
+use crate::iter::adapters::SourceIter;
+use crate::iter::InPlaceIterable;
 use crate::num::NonZero;
 use crate::ops::{ControlFlow, Try};
 
diff --git a/library/core/src/iter/adapters/map_windows.rs b/library/core/src/iter/adapters/map_windows.rs
index 18277512136..cb13023c85c 100644
--- a/library/core/src/iter/adapters/map_windows.rs
+++ b/library/core/src/iter/adapters/map_windows.rs
@@ -1,9 +1,6 @@
-use crate::{
-    fmt,
-    iter::FusedIterator,
-    mem::{self, MaybeUninit},
-    ptr,
-};
+use crate::iter::FusedIterator;
+use crate::mem::{self, MaybeUninit};
+use crate::{fmt, ptr};
 
 /// An iterator over the mapped windows of another iterator.
 ///
diff --git a/library/core/src/iter/adapters/mod.rs b/library/core/src/iter/adapters/mod.rs
index 1bde4488cc9..96158c43318 100644
--- a/library/core/src/iter/adapters/mod.rs
+++ b/library/core/src/iter/adapters/mod.rs
@@ -28,51 +28,38 @@ mod take;
 mod take_while;
 mod zip;
 
-#[stable(feature = "rust1", since = "1.0.0")]
-pub use self::{
-    chain::Chain, cycle::Cycle, enumerate::Enumerate, filter::Filter, filter_map::FilterMap,
-    flatten::FlatMap, fuse::Fuse, inspect::Inspect, map::Map, peekable::Peekable, rev::Rev,
-    scan::Scan, skip::Skip, skip_while::SkipWhile, take::Take, take_while::TakeWhile, zip::Zip,
-};
-
 #[unstable(feature = "iter_array_chunks", reason = "recently added", issue = "100450")]
 pub use self::array_chunks::ArrayChunks;
-
 #[unstable(feature = "std_internals", issue = "none")]
 pub use self::by_ref_sized::ByRefSized;
-
 #[unstable(feature = "iter_chain", reason = "recently added", issue = "125964")]
 pub use self::chain::chain;
-
 #[stable(feature = "iter_cloned", since = "1.1.0")]
 pub use self::cloned::Cloned;
-
-#[stable(feature = "iterator_step_by", since = "1.28.0")]
-pub use self::step_by::StepBy;
-
-#[stable(feature = "iterator_flatten", since = "1.29.0")]
-pub use self::flatten::Flatten;
-
 #[stable(feature = "iter_copied", since = "1.36.0")]
 pub use self::copied::Copied;
-
+#[stable(feature = "iterator_flatten", since = "1.29.0")]
+pub use self::flatten::Flatten;
 #[unstable(feature = "iter_intersperse", reason = "recently added", issue = "79524")]
 pub use self::intersperse::{Intersperse, IntersperseWith};
-
 #[stable(feature = "iter_map_while", since = "1.57.0")]
 pub use self::map_while::MapWhile;
-
 #[unstable(feature = "iter_map_windows", reason = "recently added", issue = "87155")]
 pub use self::map_windows::MapWindows;
-
+#[stable(feature = "iterator_step_by", since = "1.28.0")]
+pub use self::step_by::StepBy;
+#[stable(feature = "iter_zip", since = "1.59.0")]
+pub use self::zip::zip;
 #[unstable(feature = "trusted_random_access", issue = "none")]
 pub use self::zip::TrustedRandomAccess;
-
 #[unstable(feature = "trusted_random_access", issue = "none")]
 pub use self::zip::TrustedRandomAccessNoCoerce;
-
-#[stable(feature = "iter_zip", since = "1.59.0")]
-pub use self::zip::zip;
+#[stable(feature = "rust1", since = "1.0.0")]
+pub use self::{
+    chain::Chain, cycle::Cycle, enumerate::Enumerate, filter::Filter, filter_map::FilterMap,
+    flatten::FlatMap, fuse::Fuse, inspect::Inspect, map::Map, peekable::Peekable, rev::Rev,
+    scan::Scan, skip::Skip, skip_while::SkipWhile, take::Take, take_while::TakeWhile, zip::Zip,
+};
 
 /// This trait provides transitive access to source-stage in an iterator-adapter pipeline
 /// under the conditions that
diff --git a/library/core/src/iter/adapters/peekable.rs b/library/core/src/iter/adapters/peekable.rs
index 65ba42920c9..a11b73cbe8e 100644
--- a/library/core/src/iter/adapters/peekable.rs
+++ b/library/core/src/iter/adapters/peekable.rs
@@ -1,4 +1,5 @@
-use crate::iter::{adapters::SourceIter, FusedIterator, TrustedLen};
+use crate::iter::adapters::SourceIter;
+use crate::iter::{FusedIterator, TrustedLen};
 use crate::ops::{ControlFlow, Try};
 
 /// An iterator with a `peek()` that returns an optional reference to the next
diff --git a/library/core/src/iter/adapters/scan.rs b/library/core/src/iter/adapters/scan.rs
index d261a535b18..7ba7ed2fdd0 100644
--- a/library/core/src/iter/adapters/scan.rs
+++ b/library/core/src/iter/adapters/scan.rs
@@ -1,5 +1,6 @@
 use crate::fmt;
-use crate::iter::{adapters::SourceIter, InPlaceIterable};
+use crate::iter::adapters::SourceIter;
+use crate::iter::InPlaceIterable;
 use crate::num::NonZero;
 use crate::ops::{ControlFlow, Try};
 
diff --git a/library/core/src/iter/adapters/skip.rs b/library/core/src/iter/adapters/skip.rs
index f51a2c39b8e..8ba2e2a8f2d 100644
--- a/library/core/src/iter/adapters/skip.rs
+++ b/library/core/src/iter/adapters/skip.rs
@@ -1,8 +1,8 @@
 use crate::intrinsics::unlikely;
 use crate::iter::adapters::zip::try_get_unchecked;
-use crate::iter::TrustedFused;
+use crate::iter::adapters::SourceIter;
 use crate::iter::{
-    adapters::SourceIter, FusedIterator, InPlaceIterable, TrustedLen, TrustedRandomAccess,
+    FusedIterator, InPlaceIterable, TrustedFused, TrustedLen, TrustedRandomAccess,
     TrustedRandomAccessNoCoerce,
 };
 use crate::num::NonZero;
diff --git a/library/core/src/iter/adapters/skip_while.rs b/library/core/src/iter/adapters/skip_while.rs
index 8001e6e6471..8ae453e76fa 100644
--- a/library/core/src/iter/adapters/skip_while.rs
+++ b/library/core/src/iter/adapters/skip_while.rs
@@ -1,5 +1,6 @@
 use crate::fmt;
-use crate::iter::{adapters::SourceIter, FusedIterator, InPlaceIterable, TrustedFused};
+use crate::iter::adapters::SourceIter;
+use crate::iter::{FusedIterator, InPlaceIterable, TrustedFused};
 use crate::num::NonZero;
 use crate::ops::Try;
 
diff --git a/library/core/src/iter/adapters/step_by.rs b/library/core/src/iter/adapters/step_by.rs
index d3105e7d88c..72eb72a76c6 100644
--- a/library/core/src/iter/adapters/step_by.rs
+++ b/library/core/src/iter/adapters/step_by.rs
@@ -1,9 +1,7 @@
-use crate::{
-    intrinsics,
-    iter::{from_fn, TrustedLen, TrustedRandomAccess},
-    num::NonZero,
-    ops::{Range, Try},
-};
+use crate::intrinsics;
+use crate::iter::{from_fn, TrustedLen, TrustedRandomAccess};
+use crate::num::NonZero;
+use crate::ops::{Range, Try};
 
 /// An iterator for stepping iterators by a custom amount.
 ///
diff --git a/library/core/src/iter/adapters/take.rs b/library/core/src/iter/adapters/take.rs
index 6870c677b1e..297dd0acadd 100644
--- a/library/core/src/iter/adapters/take.rs
+++ b/library/core/src/iter/adapters/take.rs
@@ -1,8 +1,6 @@
 use crate::cmp;
-use crate::iter::{
-    adapters::SourceIter, FusedIterator, InPlaceIterable, TrustedFused, TrustedLen,
-    TrustedRandomAccess,
-};
+use crate::iter::adapters::SourceIter;
+use crate::iter::{FusedIterator, InPlaceIterable, TrustedFused, TrustedLen, TrustedRandomAccess};
 use crate::num::NonZero;
 use crate::ops::{ControlFlow, Try};
 
diff --git a/library/core/src/iter/adapters/take_while.rs b/library/core/src/iter/adapters/take_while.rs
index d3f09ab356a..06028ea98e7 100644
--- a/library/core/src/iter/adapters/take_while.rs
+++ b/library/core/src/iter/adapters/take_while.rs
@@ -1,5 +1,6 @@
 use crate::fmt;
-use crate::iter::{adapters::SourceIter, FusedIterator, InPlaceIterable, TrustedFused};
+use crate::iter::adapters::SourceIter;
+use crate::iter::{FusedIterator, InPlaceIterable, TrustedFused};
 use crate::num::NonZero;
 use crate::ops::{ControlFlow, Try};
 
diff --git a/library/core/src/iter/adapters/zip.rs b/library/core/src/iter/adapters/zip.rs
index 2e885f06b52..0c388115908 100644
--- a/library/core/src/iter/adapters/zip.rs
+++ b/library/core/src/iter/adapters/zip.rs
@@ -1,7 +1,8 @@
 use crate::cmp;
 use crate::fmt::{self, Debug};
-use crate::iter::{FusedIterator, TrustedFused};
-use crate::iter::{InPlaceIterable, SourceIter, TrustedLen, UncheckedIterator};
+use crate::iter::{
+    FusedIterator, InPlaceIterable, SourceIter, TrustedFused, TrustedLen, UncheckedIterator,
+};
 use crate::num::NonZero;
 
 /// An iterator that iterates two other iterators simultaneously.
diff --git a/library/core/src/iter/mod.rs b/library/core/src/iter/mod.rs
index 921c75c85f1..1f2bf49d2b7 100644
--- a/library/core/src/iter/mod.rs
+++ b/library/core/src/iter/mod.rs
@@ -380,16 +380,46 @@ macro_rules! impl_fold_via_try_fold {
     };
 }
 
+#[unstable(feature = "iter_chain", reason = "recently added", issue = "125964")]
+pub use self::adapters::chain;
+pub(crate) use self::adapters::try_process;
+#[stable(feature = "iter_zip", since = "1.59.0")]
+pub use self::adapters::zip;
+#[unstable(feature = "iter_array_chunks", reason = "recently added", issue = "100450")]
+pub use self::adapters::ArrayChunks;
+#[unstable(feature = "std_internals", issue = "none")]
+pub use self::adapters::ByRefSized;
+#[stable(feature = "iter_cloned", since = "1.1.0")]
+pub use self::adapters::Cloned;
+#[stable(feature = "iter_copied", since = "1.36.0")]
+pub use self::adapters::Copied;
+#[stable(feature = "iterator_flatten", since = "1.29.0")]
+pub use self::adapters::Flatten;
+#[stable(feature = "iter_map_while", since = "1.57.0")]
+pub use self::adapters::MapWhile;
+#[unstable(feature = "iter_map_windows", reason = "recently added", issue = "87155")]
+pub use self::adapters::MapWindows;
+#[unstable(feature = "inplace_iteration", issue = "none")]
+pub use self::adapters::SourceIter;
+#[stable(feature = "iterator_step_by", since = "1.28.0")]
+pub use self::adapters::StepBy;
+#[unstable(feature = "trusted_random_access", issue = "none")]
+pub use self::adapters::TrustedRandomAccess;
+#[unstable(feature = "trusted_random_access", issue = "none")]
+pub use self::adapters::TrustedRandomAccessNoCoerce;
 #[stable(feature = "rust1", since = "1.0.0")]
-pub use self::traits::Iterator;
-
+pub use self::adapters::{
+    Chain, Cycle, Enumerate, Filter, FilterMap, FlatMap, Fuse, Inspect, Map, Peekable, Rev, Scan,
+    Skip, SkipWhile, Take, TakeWhile, Zip,
+};
+#[unstable(feature = "iter_intersperse", reason = "recently added", issue = "79524")]
+pub use self::adapters::{Intersperse, IntersperseWith};
 #[unstable(
     feature = "step_trait",
     reason = "likely to be replaced by finer-grained traits",
     issue = "42168"
 )]
 pub use self::range::Step;
-
 #[unstable(
     feature = "iter_from_coroutine",
     issue = "43122",
@@ -412,59 +442,24 @@ pub use self::sources::{repeat_n, RepeatN};
 pub use self::sources::{repeat_with, RepeatWith};
 #[stable(feature = "iter_successors", since = "1.34.0")]
 pub use self::sources::{successors, Successors};
-
 #[stable(feature = "fused", since = "1.26.0")]
 pub use self::traits::FusedIterator;
 #[unstable(issue = "none", feature = "inplace_iteration")]
 pub use self::traits::InPlaceIterable;
+#[stable(feature = "rust1", since = "1.0.0")]
+pub use self::traits::Iterator;
 #[unstable(issue = "none", feature = "trusted_fused")]
 pub use self::traits::TrustedFused;
 #[unstable(feature = "trusted_len", issue = "37572")]
 pub use self::traits::TrustedLen;
 #[unstable(feature = "trusted_step", issue = "85731")]
 pub use self::traits::TrustedStep;
+pub(crate) use self::traits::UncheckedIterator;
 #[stable(feature = "rust1", since = "1.0.0")]
 pub use self::traits::{
     DoubleEndedIterator, ExactSizeIterator, Extend, FromIterator, IntoIterator, Product, Sum,
 };
 
-#[unstable(feature = "iter_chain", reason = "recently added", issue = "125964")]
-pub use self::adapters::chain;
-#[stable(feature = "iter_zip", since = "1.59.0")]
-pub use self::adapters::zip;
-#[unstable(feature = "iter_array_chunks", reason = "recently added", issue = "100450")]
-pub use self::adapters::ArrayChunks;
-#[unstable(feature = "std_internals", issue = "none")]
-pub use self::adapters::ByRefSized;
-#[stable(feature = "iter_cloned", since = "1.1.0")]
-pub use self::adapters::Cloned;
-#[stable(feature = "iter_copied", since = "1.36.0")]
-pub use self::adapters::Copied;
-#[stable(feature = "iterator_flatten", since = "1.29.0")]
-pub use self::adapters::Flatten;
-#[stable(feature = "iter_map_while", since = "1.57.0")]
-pub use self::adapters::MapWhile;
-#[unstable(feature = "iter_map_windows", reason = "recently added", issue = "87155")]
-pub use self::adapters::MapWindows;
-#[unstable(feature = "inplace_iteration", issue = "none")]
-pub use self::adapters::SourceIter;
-#[stable(feature = "iterator_step_by", since = "1.28.0")]
-pub use self::adapters::StepBy;
-#[unstable(feature = "trusted_random_access", issue = "none")]
-pub use self::adapters::TrustedRandomAccess;
-#[unstable(feature = "trusted_random_access", issue = "none")]
-pub use self::adapters::TrustedRandomAccessNoCoerce;
-#[stable(feature = "rust1", since = "1.0.0")]
-pub use self::adapters::{
-    Chain, Cycle, Enumerate, Filter, FilterMap, FlatMap, Fuse, Inspect, Map, Peekable, Rev, Scan,
-    Skip, SkipWhile, Take, TakeWhile, Zip,
-};
-#[unstable(feature = "iter_intersperse", reason = "recently added", issue = "79524")]
-pub use self::adapters::{Intersperse, IntersperseWith};
-
-pub(crate) use self::adapters::try_process;
-pub(crate) use self::traits::UncheckedIterator;
-
 mod adapters;
 mod range;
 mod sources;
diff --git a/library/core/src/iter/range.rs b/library/core/src/iter/range.rs
index 644a1692943..da4f68a0de4 100644
--- a/library/core/src/iter/range.rs
+++ b/library/core/src/iter/range.rs
@@ -1,13 +1,12 @@
+use super::{
+    FusedIterator, TrustedLen, TrustedRandomAccess, TrustedRandomAccessNoCoerce, TrustedStep,
+};
 use crate::ascii::Char as AsciiChar;
 use crate::mem;
 use crate::net::{Ipv4Addr, Ipv6Addr};
 use crate::num::NonZero;
 use crate::ops::{self, Try};
 
-use super::{
-    FusedIterator, TrustedLen, TrustedRandomAccess, TrustedRandomAccessNoCoerce, TrustedStep,
-};
-
 // Safety: All invariants are upheld.
 macro_rules! unsafe_impl_trusted_step {
     ($($type:ty)*) => {$(
diff --git a/library/core/src/iter/sources.rs b/library/core/src/iter/sources.rs
index 56c1f86079a..6a94051b7c7 100644
--- a/library/core/src/iter/sources.rs
+++ b/library/core/src/iter/sources.rs
@@ -8,33 +8,25 @@ mod repeat_n;
 mod repeat_with;
 mod successors;
 
-#[stable(feature = "rust1", since = "1.0.0")]
-pub use self::repeat::{repeat, Repeat};
-
 #[stable(feature = "iter_empty", since = "1.2.0")]
 pub use self::empty::{empty, Empty};
-
-#[stable(feature = "iter_once", since = "1.2.0")]
-pub use self::once::{once, Once};
-
-#[unstable(feature = "iter_repeat_n", issue = "104434")]
-pub use self::repeat_n::{repeat_n, RepeatN};
-
-#[stable(feature = "iterator_repeat_with", since = "1.28.0")]
-pub use self::repeat_with::{repeat_with, RepeatWith};
-
-#[stable(feature = "iter_from_fn", since = "1.34.0")]
-pub use self::from_fn::{from_fn, FromFn};
-
 #[unstable(
     feature = "iter_from_coroutine",
     issue = "43122",
     reason = "coroutines are unstable"
 )]
 pub use self::from_coroutine::from_coroutine;
-
-#[stable(feature = "iter_successors", since = "1.34.0")]
-pub use self::successors::{successors, Successors};
-
+#[stable(feature = "iter_from_fn", since = "1.34.0")]
+pub use self::from_fn::{from_fn, FromFn};
+#[stable(feature = "iter_once", since = "1.2.0")]
+pub use self::once::{once, Once};
 #[stable(feature = "iter_once_with", since = "1.43.0")]
 pub use self::once_with::{once_with, OnceWith};
+#[stable(feature = "rust1", since = "1.0.0")]
+pub use self::repeat::{repeat, Repeat};
+#[unstable(feature = "iter_repeat_n", issue = "104434")]
+pub use self::repeat_n::{repeat_n, RepeatN};
+#[stable(feature = "iterator_repeat_with", since = "1.28.0")]
+pub use self::repeat_with::{repeat_with, RepeatWith};
+#[stable(feature = "iter_successors", since = "1.34.0")]
+pub use self::successors::{successors, Successors};
diff --git a/library/core/src/iter/sources/empty.rs b/library/core/src/iter/sources/empty.rs
index 438e046a4df..3c3acceded8 100644
--- a/library/core/src/iter/sources/empty.rs
+++ b/library/core/src/iter/sources/empty.rs
@@ -1,6 +1,5 @@
-use crate::fmt;
 use crate::iter::{FusedIterator, TrustedLen};
-use crate::marker;
+use crate::{fmt, marker};
 
 /// Creates an iterator that yields nothing.
 ///
diff --git a/library/core/src/iter/sources/successors.rs b/library/core/src/iter/sources/successors.rs
index 7f7b2c77566..36bc4035039 100644
--- a/library/core/src/iter/sources/successors.rs
+++ b/library/core/src/iter/sources/successors.rs
@@ -1,4 +1,5 @@
-use crate::{fmt, iter::FusedIterator};
+use crate::fmt;
+use crate::iter::FusedIterator;
 
 /// Creates a new iterator where each successive item is computed based on the preceding one.
 ///
diff --git a/library/core/src/iter/traits/iterator.rs b/library/core/src/iter/traits/iterator.rs
index c85a61ada3d..50a2d952e5b 100644
--- a/library/core/src/iter/traits/iterator.rs
+++ b/library/core/src/iter/traits/iterator.rs
@@ -1,19 +1,14 @@
+use super::super::{
+    try_process, ArrayChunks, ByRefSized, Chain, Cloned, Copied, Cycle, Enumerate, Filter,
+    FilterMap, FlatMap, Flatten, Fuse, Inspect, Intersperse, IntersperseWith, Map, MapWhile,
+    MapWindows, Peekable, Product, Rev, Scan, Skip, SkipWhile, StepBy, Sum, Take, TakeWhile,
+    TrustedRandomAccessNoCoerce, Zip,
+};
 use crate::array;
 use crate::cmp::{self, Ordering};
 use crate::num::NonZero;
 use crate::ops::{ChangeOutputType, ControlFlow, FromResidual, Residual, Try};
 
-use super::super::try_process;
-use super::super::ByRefSized;
-use super::super::TrustedRandomAccessNoCoerce;
-use super::super::{ArrayChunks, Chain, Cloned, Copied, Cycle, Enumerate, Filter, FilterMap, Fuse};
-use super::super::{FlatMap, Flatten};
-use super::super::{
-    Inspect, Map, MapWhile, MapWindows, Peekable, Rev, Scan, Skip, SkipWhile, StepBy, Take,
-    TakeWhile,
-};
-use super::super::{Intersperse, IntersperseWith, Product, Sum, Zip};
-
 fn _assert_is_object_safe(_: &dyn Iterator<Item = ()>) {}
 
 /// A trait for dealing with iterators.
diff --git a/library/core/src/iter/traits/mod.rs b/library/core/src/iter/traits/mod.rs
index d4c9cc4b160..b330e9ffe21 100644
--- a/library/core/src/iter/traits/mod.rs
+++ b/library/core/src/iter/traits/mod.rs
@@ -6,6 +6,13 @@ mod iterator;
 mod marker;
 mod unchecked_iterator;
 
+#[unstable(issue = "none", feature = "inplace_iteration")]
+pub use self::marker::InPlaceIterable;
+#[unstable(issue = "none", feature = "trusted_fused")]
+pub use self::marker::TrustedFused;
+#[unstable(feature = "trusted_step", issue = "85731")]
+pub use self::marker::TrustedStep;
+pub(crate) use self::unchecked_iterator::UncheckedIterator;
 #[stable(feature = "rust1", since = "1.0.0")]
 pub use self::{
     accum::{Product, Sum},
@@ -15,12 +22,3 @@ pub use self::{
     iterator::Iterator,
     marker::{FusedIterator, TrustedLen},
 };
-
-#[unstable(issue = "none", feature = "inplace_iteration")]
-pub use self::marker::InPlaceIterable;
-#[unstable(issue = "none", feature = "trusted_fused")]
-pub use self::marker::TrustedFused;
-#[unstable(feature = "trusted_step", issue = "85731")]
-pub use self::marker::TrustedStep;
-
-pub(crate) use self::unchecked_iterator::UncheckedIterator;
diff --git a/library/core/src/marker.rs b/library/core/src/marker.rs
index ac630df805a..082768ea9f2 100644
--- a/library/core/src/marker.rs
+++ b/library/core/src/marker.rs
@@ -9,8 +9,7 @@
 use crate::cell::UnsafeCell;
 use crate::cmp;
 use crate::fmt::Debug;
-use crate::hash::Hash;
-use crate::hash::Hasher;
+use crate::hash::{Hash, Hasher};
 
 /// Implements a given marker trait for multiple types at the same time.
 ///
diff --git a/library/core/src/mem/maybe_uninit.rs b/library/core/src/mem/maybe_uninit.rs
index a3f433fd5ac..f920ab1792d 100644
--- a/library/core/src/mem/maybe_uninit.rs
+++ b/library/core/src/mem/maybe_uninit.rs
@@ -1,9 +1,6 @@
 use crate::any::type_name;
-use crate::fmt;
-use crate::intrinsics;
 use crate::mem::{self, ManuallyDrop};
-use crate::ptr;
-use crate::slice;
+use crate::{fmt, intrinsics, ptr, slice};
 
 /// A wrapper type to construct uninitialized instances of `T`.
 ///
diff --git a/library/core/src/mem/mod.rs b/library/core/src/mem/mod.rs
index 9bb4ba922cd..b8e9f606a9a 100644
--- a/library/core/src/mem/mod.rs
+++ b/library/core/src/mem/mod.rs
@@ -5,13 +5,8 @@
 
 #![stable(feature = "rust1", since = "1.0.0")]
 
-use crate::clone;
-use crate::cmp;
-use crate::fmt;
-use crate::hash;
-use crate::intrinsics;
 use crate::marker::DiscriminantKind;
-use crate::ptr;
+use crate::{clone, cmp, fmt, hash, intrinsics, ptr};
 
 mod manually_drop;
 #[stable(feature = "manually_drop", since = "1.20.0")]
diff --git a/library/core/src/net/display_buffer.rs b/library/core/src/net/display_buffer.rs
index 6619c85f483..bab84a97308 100644
--- a/library/core/src/net/display_buffer.rs
+++ b/library/core/src/net/display_buffer.rs
@@ -1,6 +1,5 @@
-use crate::fmt;
 use crate::mem::MaybeUninit;
-use crate::str;
+use crate::{fmt, str};
 
 /// Used for slow path in `Display` implementations when alignment is required.
 pub struct DisplayBuffer<const SIZE: usize> {
diff --git a/library/core/src/net/ip_addr.rs b/library/core/src/net/ip_addr.rs
index e9abd57b858..3e036b88128 100644
--- a/library/core/src/net/ip_addr.rs
+++ b/library/core/src/net/ip_addr.rs
@@ -1,11 +1,10 @@
+use super::display_buffer::DisplayBuffer;
 use crate::cmp::Ordering;
 use crate::fmt::{self, Write};
 use crate::iter;
 use crate::mem::transmute;
 use crate::ops::{BitAnd, BitAndAssign, BitOr, BitOrAssign, Not};
 
-use super::display_buffer::DisplayBuffer;
-
 /// An IP address, either IPv4 or IPv6.
 ///
 /// This enum can contain either an [`Ipv4Addr`] or an [`Ipv6Addr`], see their
diff --git a/library/core/src/net/socket_addr.rs b/library/core/src/net/socket_addr.rs
index c24d8f55195..4e339172b68 100644
--- a/library/core/src/net/socket_addr.rs
+++ b/library/core/src/net/socket_addr.rs
@@ -1,8 +1,7 @@
+use super::display_buffer::DisplayBuffer;
 use crate::fmt::{self, Write};
 use crate::net::{IpAddr, Ipv4Addr, Ipv6Addr};
 
-use super::display_buffer::DisplayBuffer;
-
 /// An internet socket address, either IPv4 or IPv6.
 ///
 /// Internet socket addresses consist of an [IP address], a 16-bit port number, as well
diff --git a/library/core/src/num/bignum.rs b/library/core/src/num/bignum.rs
index d2a21b6b382..2a47c89e2ae 100644
--- a/library/core/src/num/bignum.rs
+++ b/library/core/src/num/bignum.rs
@@ -145,8 +145,7 @@ macro_rules! define_bignum {
 
             /// Adds `other` to itself and returns its own mutable reference.
             pub fn add<'a>(&'a mut self, other: &$name) -> &'a mut $name {
-                use crate::cmp;
-                use crate::iter;
+                use crate::{cmp, iter};
 
                 let mut sz = cmp::max(self.size, other.size);
                 let mut carry = false;
@@ -181,8 +180,7 @@ macro_rules! define_bignum {
 
             /// Subtracts `other` from itself and returns its own mutable reference.
             pub fn sub<'a>(&'a mut self, other: &$name) -> &'a mut $name {
-                use crate::cmp;
-                use crate::iter;
+                use crate::{cmp, iter};
 
                 let sz = cmp::max(self.size, other.size);
                 let mut noborrow = true;
diff --git a/library/core/src/num/dec2flt/mod.rs b/library/core/src/num/dec2flt/mod.rs
index 9aac2332dce..87bfd0d2566 100644
--- a/library/core/src/num/dec2flt/mod.rs
+++ b/library/core/src/num/dec2flt/mod.rs
@@ -75,15 +75,14 @@
     issue = "none"
 )]
 
-use crate::error::Error;
-use crate::fmt;
-use crate::str::FromStr;
-
 use self::common::BiasedFp;
 use self::float::RawFloat;
 use self::lemire::compute_float;
 use self::parse::{parse_inf_nan, parse_number};
 use self::slow::parse_long_mantissa;
+use crate::error::Error;
+use crate::fmt;
+use crate::str::FromStr;
 
 mod common;
 mod decimal;
diff --git a/library/core/src/num/flt2dec/mod.rs b/library/core/src/num/flt2dec/mod.rs
index 1ff2e8c8228..7d923a2652f 100644
--- a/library/core/src/num/flt2dec/mod.rs
+++ b/library/core/src/num/flt2dec/mod.rs
@@ -123,7 +123,6 @@ functions.
 )]
 
 pub use self::decoder::{decode, DecodableFloat, Decoded, FullDecoded};
-
 use super::fmt::{Formatted, Part};
 use crate::mem::MaybeUninit;
 
diff --git a/library/core/src/num/flt2dec/strategy/dragon.rs b/library/core/src/num/flt2dec/strategy/dragon.rs
index 71b14d0ae3f..751edd3c793 100644
--- a/library/core/src/num/flt2dec/strategy/dragon.rs
+++ b/library/core/src/num/flt2dec/strategy/dragon.rs
@@ -6,9 +6,7 @@
 
 use crate::cmp::Ordering;
 use crate::mem::MaybeUninit;
-
-use crate::num::bignum::Big32x40 as Big;
-use crate::num::bignum::Digit32 as Digit;
+use crate::num::bignum::{Big32x40 as Big, Digit32 as Digit};
 use crate::num::flt2dec::estimator::estimate_scaling_factor;
 use crate::num::flt2dec::{round_up, Decoded, MAX_SIG_DIGITS};
 
diff --git a/library/core/src/num/mod.rs b/library/core/src/num/mod.rs
index e342a73d1ae..309e1ba958a 100644
--- a/library/core/src/num/mod.rs
+++ b/library/core/src/num/mod.rs
@@ -2,11 +2,9 @@
 
 #![stable(feature = "rust1", since = "1.0.0")]
 
-use crate::ascii;
-use crate::intrinsics;
-use crate::mem;
 use crate::str::FromStr;
 use crate::ub_checks::assert_unsafe_precondition;
+use crate::{ascii, intrinsics, mem};
 
 // Used because the `?` operator is not allowed in a const context.
 macro_rules! try_opt {
@@ -48,39 +46,31 @@ mod overflow_panic;
 mod saturating;
 mod wrapping;
 
-#[stable(feature = "saturating_int_impl", since = "1.74.0")]
-pub use saturating::Saturating;
-#[stable(feature = "rust1", since = "1.0.0")]
-pub use wrapping::Wrapping;
-
 #[stable(feature = "rust1", since = "1.0.0")]
 #[cfg(not(no_fp_fmt_parse))]
 pub use dec2flt::ParseFloatError;
-
+#[stable(feature = "int_error_matching", since = "1.55.0")]
+pub use error::IntErrorKind;
 #[stable(feature = "rust1", since = "1.0.0")]
 pub use error::ParseIntError;
-
+#[stable(feature = "try_from", since = "1.34.0")]
+pub use error::TryFromIntError;
+#[stable(feature = "generic_nonzero", since = "1.79.0")]
+pub use nonzero::NonZero;
 #[unstable(
     feature = "nonzero_internals",
     reason = "implementation detail which may disappear or be replaced at any time",
     issue = "none"
 )]
 pub use nonzero::ZeroablePrimitive;
-
-#[stable(feature = "generic_nonzero", since = "1.79.0")]
-pub use nonzero::NonZero;
-
 #[stable(feature = "signed_nonzero", since = "1.34.0")]
 pub use nonzero::{NonZeroI128, NonZeroI16, NonZeroI32, NonZeroI64, NonZeroI8, NonZeroIsize};
-
 #[stable(feature = "nonzero", since = "1.28.0")]
 pub use nonzero::{NonZeroU128, NonZeroU16, NonZeroU32, NonZeroU64, NonZeroU8, NonZeroUsize};
-
-#[stable(feature = "try_from", since = "1.34.0")]
-pub use error::TryFromIntError;
-
-#[stable(feature = "int_error_matching", since = "1.55.0")]
-pub use error::IntErrorKind;
+#[stable(feature = "saturating_int_impl", since = "1.74.0")]
+pub use saturating::Saturating;
+#[stable(feature = "rust1", since = "1.0.0")]
+pub use wrapping::Wrapping;
 
 macro_rules! usize_isize_to_xe_bytes_doc {
     () => {
diff --git a/library/core/src/num/nonzero.rs b/library/core/src/num/nonzero.rs
index 64985e216c4..c6e9c249048 100644
--- a/library/core/src/num/nonzero.rs
+++ b/library/core/src/num/nonzero.rs
@@ -1,18 +1,13 @@
 //! Definitions of integer that is known not to equal zero.
 
+use super::{IntErrorKind, ParseIntError};
 use crate::cmp::Ordering;
-use crate::fmt;
 use crate::hash::{Hash, Hasher};
-use crate::hint;
-use crate::intrinsics;
 use crate::marker::{Freeze, StructuralPartialEq};
 use crate::ops::{BitOr, BitOrAssign, Div, DivAssign, Neg, Rem, RemAssign};
 use crate::panic::{RefUnwindSafe, UnwindSafe};
-use crate::ptr;
 use crate::str::FromStr;
-use crate::ub_checks;
-
-use super::{IntErrorKind, ParseIntError};
+use crate::{fmt, hint, intrinsics, ptr, ub_checks};
 
 /// A marker trait for primitive types which can be zero.
 ///
diff --git a/library/core/src/num/saturating.rs b/library/core/src/num/saturating.rs
index d040539ebe5..3f4791e163e 100644
--- a/library/core/src/num/saturating.rs
+++ b/library/core/src/num/saturating.rs
@@ -1,10 +1,10 @@
 //! Definitions of `Saturating<T>`.
 
 use crate::fmt;
-use crate::ops::{Add, AddAssign, BitAnd, BitAndAssign, BitOr, BitOrAssign};
-use crate::ops::{BitXor, BitXorAssign, Div, DivAssign};
-use crate::ops::{Mul, MulAssign, Neg, Not, Rem, RemAssign};
-use crate::ops::{Sub, SubAssign};
+use crate::ops::{
+    Add, AddAssign, BitAnd, BitAndAssign, BitOr, BitOrAssign, BitXor, BitXorAssign, Div, DivAssign,
+    Mul, MulAssign, Neg, Not, Rem, RemAssign, Sub, SubAssign,
+};
 
 /// Provides intentionally-saturating arithmetic on `T`.
 ///
diff --git a/library/core/src/num/wrapping.rs b/library/core/src/num/wrapping.rs
index 16f0b6d913d..1ac6d3161c2 100644
--- a/library/core/src/num/wrapping.rs
+++ b/library/core/src/num/wrapping.rs
@@ -1,10 +1,10 @@
 //! Definitions of `Wrapping<T>`.
 
 use crate::fmt;
-use crate::ops::{Add, AddAssign, BitAnd, BitAndAssign, BitOr, BitOrAssign};
-use crate::ops::{BitXor, BitXorAssign, Div, DivAssign};
-use crate::ops::{Mul, MulAssign, Neg, Not, Rem, RemAssign};
-use crate::ops::{Shl, ShlAssign, Shr, ShrAssign, Sub, SubAssign};
+use crate::ops::{
+    Add, AddAssign, BitAnd, BitAndAssign, BitOr, BitOrAssign, BitXor, BitXorAssign, Div, DivAssign,
+    Mul, MulAssign, Neg, Not, Rem, RemAssign, Shl, ShlAssign, Shr, ShrAssign, Sub, SubAssign,
+};
 
 /// Provides intentionally-wrapped arithmetic on `T`.
 ///
diff --git a/library/core/src/ops/mod.rs b/library/core/src/ops/mod.rs
index 7bcfaadbe37..98d41b71e8e 100644
--- a/library/core/src/ops/mod.rs
+++ b/library/core/src/ops/mod.rs
@@ -156,65 +156,44 @@ mod unsize;
 pub use self::arith::{Add, Div, Mul, Neg, Rem, Sub};
 #[stable(feature = "op_assign_traits", since = "1.8.0")]
 pub use self::arith::{AddAssign, DivAssign, MulAssign, RemAssign, SubAssign};
-
+#[unstable(feature = "async_fn_traits", issue = "none")]
+pub use self::async_function::{AsyncFn, AsyncFnMut, AsyncFnOnce};
 #[stable(feature = "rust1", since = "1.0.0")]
 pub use self::bit::{BitAnd, BitOr, BitXor, Not, Shl, Shr};
 #[stable(feature = "op_assign_traits", since = "1.8.0")]
 pub use self::bit::{BitAndAssign, BitOrAssign, BitXorAssign, ShlAssign, ShrAssign};
-
-#[stable(feature = "rust1", since = "1.0.0")]
-pub use self::deref::{Deref, DerefMut};
-
+#[unstable(feature = "control_flow_enum", reason = "new API", issue = "75744")]
+pub use self::control_flow::ControlFlow;
+#[unstable(feature = "coroutine_trait", issue = "43122")]
+pub use self::coroutine::{Coroutine, CoroutineState};
 #[unstable(feature = "deref_pure_trait", issue = "87121")]
 pub use self::deref::DerefPure;
-
 #[unstable(feature = "receiver_trait", issue = "none")]
 pub use self::deref::Receiver;
-
 #[stable(feature = "rust1", since = "1.0.0")]
-pub use self::drop::Drop;
-
+pub use self::deref::{Deref, DerefMut};
 pub(crate) use self::drop::fallback_surface_drop;
-
+#[stable(feature = "rust1", since = "1.0.0")]
+pub use self::drop::Drop;
 #[stable(feature = "rust1", since = "1.0.0")]
 pub use self::function::{Fn, FnMut, FnOnce};
-
-#[unstable(feature = "async_fn_traits", issue = "none")]
-pub use self::async_function::{AsyncFn, AsyncFnMut, AsyncFnOnce};
-
 #[stable(feature = "rust1", since = "1.0.0")]
 pub use self::index::{Index, IndexMut};
-
-#[stable(feature = "rust1", since = "1.0.0")]
-pub use self::range::{Range, RangeFrom, RangeFull, RangeTo};
-
 pub(crate) use self::index_range::IndexRange;
-
-#[stable(feature = "inclusive_range", since = "1.26.0")]
-pub use self::range::{Bound, RangeBounds, RangeInclusive, RangeToInclusive};
-
 #[unstable(feature = "one_sided_range", issue = "69780")]
 pub use self::range::OneSidedRange;
-
-#[unstable(feature = "try_trait_v2", issue = "84277")]
-pub use self::try_trait::{FromResidual, Try};
-
-#[unstable(feature = "try_trait_v2_yeet", issue = "96374")]
-pub use self::try_trait::Yeet;
-
+#[stable(feature = "inclusive_range", since = "1.26.0")]
+pub use self::range::{Bound, RangeBounds, RangeInclusive, RangeToInclusive};
+#[stable(feature = "rust1", since = "1.0.0")]
+pub use self::range::{Range, RangeFrom, RangeFull, RangeTo};
 #[unstable(feature = "try_trait_v2_residual", issue = "91285")]
 pub use self::try_trait::Residual;
-
+#[unstable(feature = "try_trait_v2_yeet", issue = "96374")]
+pub use self::try_trait::Yeet;
 pub(crate) use self::try_trait::{ChangeOutputType, NeverShortCircuit};
-
-#[unstable(feature = "coroutine_trait", issue = "43122")]
-pub use self::coroutine::{Coroutine, CoroutineState};
-
+#[unstable(feature = "try_trait_v2", issue = "84277")]
+pub use self::try_trait::{FromResidual, Try};
 #[unstable(feature = "coerce_unsized", issue = "18598")]
 pub use self::unsize::CoerceUnsized;
-
 #[unstable(feature = "dispatch_from_dyn", issue = "none")]
 pub use self::unsize::DispatchFromDyn;
-
-#[unstable(feature = "control_flow_enum", reason = "new API", issue = "75744")]
-pub use self::control_flow::ControlFlow;
diff --git a/library/core/src/option.rs b/library/core/src/option.rs
index d93cb8d10e6..6c89c810180 100644
--- a/library/core/src/option.rs
+++ b/library/core/src/option.rs
@@ -557,13 +557,10 @@
 #![stable(feature = "rust1", since = "1.0.0")]
 
 use crate::iter::{self, FusedIterator, TrustedLen};
+use crate::ops::{self, ControlFlow, Deref, DerefMut};
 use crate::panicking::{panic, panic_display};
 use crate::pin::Pin;
-use crate::{
-    cmp, convert, hint, mem,
-    ops::{self, ControlFlow, Deref, DerefMut},
-    slice,
-};
+use crate::{cmp, convert, hint, mem, slice};
 
 /// The `Option` type. See [the module level documentation](self) for more.
 #[derive(Copy, Eq, Debug, Hash)]
diff --git a/library/core/src/panic.rs b/library/core/src/panic.rs
index 03123450f76..8e641e515fb 100644
--- a/library/core/src/panic.rs
+++ b/library/core/src/panic.rs
@@ -6,8 +6,6 @@ mod location;
 mod panic_info;
 mod unwind_safe;
 
-use crate::any::Any;
-
 #[stable(feature = "panic_hooks", since = "1.10.0")]
 pub use self::location::Location;
 #[stable(feature = "panic_hooks", since = "1.10.0")]
@@ -16,6 +14,7 @@ pub use self::panic_info::PanicInfo;
 pub use self::panic_info::PanicMessage;
 #[stable(feature = "catch_unwind", since = "1.9.0")]
 pub use self::unwind_safe::{AssertUnwindSafe, RefUnwindSafe, UnwindSafe};
+use crate::any::Any;
 
 #[doc(hidden)]
 #[unstable(feature = "edition_panic", issue = "none", reason = "use panic!() instead")]
diff --git a/library/core/src/pin.rs b/library/core/src/pin.rs
index 18e1f753def..d752151d10c 100644
--- a/library/core/src/pin.rs
+++ b/library/core/src/pin.rs
@@ -920,11 +920,8 @@
 
 #![stable(feature = "pin", since = "1.33.0")]
 
-use crate::cmp;
-use crate::fmt;
 use crate::hash::{Hash, Hasher};
 use crate::ops::{CoerceUnsized, Deref, DerefMut, DerefPure, DispatchFromDyn, Receiver};
-
 #[allow(unused_imports)]
 use crate::{
     cell::{RefCell, UnsafeCell},
@@ -932,6 +929,7 @@ use crate::{
     marker::PhantomPinned,
     mem, ptr,
 };
+use crate::{cmp, fmt};
 
 /// A pointer which pins its pointee in place.
 ///
diff --git a/library/core/src/ptr/metadata.rs b/library/core/src/ptr/metadata.rs
index 84accc3e466..ccc9f8754f0 100644
--- a/library/core/src/ptr/metadata.rs
+++ b/library/core/src/ptr/metadata.rs
@@ -2,8 +2,7 @@
 
 use crate::fmt;
 use crate::hash::{Hash, Hasher};
-use crate::intrinsics::aggregate_raw_ptr;
-use crate::intrinsics::ptr_metadata;
+use crate::intrinsics::{aggregate_raw_ptr, ptr_metadata};
 use crate::marker::Freeze;
 use crate::ptr::NonNull;
 
diff --git a/library/core/src/ptr/mod.rs b/library/core/src/ptr/mod.rs
index da6b541a987..9921f5d70c0 100644
--- a/library/core/src/ptr/mod.rs
+++ b/library/core/src/ptr/mod.rs
@@ -409,13 +409,9 @@
 #![allow(clippy::not_unsafe_ptr_arg_deref)]
 
 use crate::cmp::Ordering;
-use crate::fmt;
-use crate::hash;
-use crate::intrinsics;
 use crate::marker::FnPtr;
-use crate::ub_checks;
-
 use crate::mem::{self, MaybeUninit};
+use crate::{fmt, hash, intrinsics, ub_checks};
 
 mod alignment;
 #[unstable(feature = "ptr_alignment_type", issue = "102070")]
@@ -423,12 +419,10 @@ pub use alignment::Alignment;
 
 #[stable(feature = "rust1", since = "1.0.0")]
 #[doc(inline)]
-pub use crate::intrinsics::copy_nonoverlapping;
-
+pub use crate::intrinsics::copy;
 #[stable(feature = "rust1", since = "1.0.0")]
 #[doc(inline)]
-pub use crate::intrinsics::copy;
-
+pub use crate::intrinsics::copy_nonoverlapping;
 #[stable(feature = "rust1", since = "1.0.0")]
 #[doc(inline)]
 pub use crate::intrinsics::write_bytes;
diff --git a/library/core/src/ptr/non_null.rs b/library/core/src/ptr/non_null.rs
index 796c85d0cac..4a716a75039 100644
--- a/library/core/src/ptr/non_null.rs
+++ b/library/core/src/ptr/non_null.rs
@@ -1,15 +1,12 @@
 use crate::cmp::Ordering;
-use crate::fmt;
-use crate::hash;
-use crate::intrinsics;
 use crate::marker::Unsize;
 use crate::mem::{MaybeUninit, SizedTypeProperties};
 use crate::num::NonZero;
 use crate::ops::{CoerceUnsized, DispatchFromDyn};
-use crate::ptr;
 use crate::ptr::Unique;
 use crate::slice::{self, SliceIndex};
 use crate::ub_checks::assert_unsafe_precondition;
+use crate::{fmt, hash, intrinsics, ptr};
 
 /// `*mut T` but non-zero and [covariant].
 ///
diff --git a/library/core/src/range.rs b/library/core/src/range.rs
index 93400e9b9f0..408972c267f 100644
--- a/library/core/src/range.rs
+++ b/library/core/src/range.rs
@@ -25,15 +25,13 @@ mod iter;
 pub mod legacy;
 
 #[doc(inline)]
-pub use crate::ops::{Bound, OneSidedRange, RangeBounds, RangeFull, RangeTo, RangeToInclusive};
-
+pub use iter::{IterRange, IterRangeFrom, IterRangeInclusive};
 use Bound::{Excluded, Included, Unbounded};
 
 #[doc(inline)]
 pub use crate::iter::Step;
-
 #[doc(inline)]
-pub use iter::{IterRange, IterRangeFrom, IterRangeInclusive};
+pub use crate::ops::{Bound, OneSidedRange, RangeBounds, RangeFull, RangeTo, RangeToInclusive};
 
 /// A (half-open) range bounded inclusively below and exclusively above
 /// (`start..end` in a future edition).
diff --git a/library/core/src/range/iter.rs b/library/core/src/range/iter.rs
index 2b7db475ffb..4935280df60 100644
--- a/library/core/src/range/iter.rs
+++ b/library/core/src/range/iter.rs
@@ -1,9 +1,8 @@
-use crate::num::NonZero;
-use crate::range::{legacy, Range, RangeFrom, RangeInclusive};
-
 use crate::iter::{
     FusedIterator, Step, TrustedLen, TrustedRandomAccess, TrustedRandomAccessNoCoerce, TrustedStep,
 };
+use crate::num::NonZero;
+use crate::range::{legacy, Range, RangeFrom, RangeInclusive};
 
 /// By-value [`Range`] iterator.
 #[unstable(feature = "new_range_api", issue = "125687")]
diff --git a/library/core/src/slice/ascii.rs b/library/core/src/slice/ascii.rs
index bf444d2f68a..d1ea52fab6b 100644
--- a/library/core/src/slice/ascii.rs
+++ b/library/core/src/slice/ascii.rs
@@ -1,12 +1,10 @@
 //! Operations on ASCII `[u8]`.
 
-use crate::ascii;
-use crate::fmt::{self, Write};
-use crate::iter;
-use crate::mem;
-use crate::ops;
 use core::ascii::EscapeDefault;
 
+use crate::fmt::{self, Write};
+use crate::{ascii, iter, mem, ops};
+
 #[cfg(not(test))]
 impl [u8] {
     /// Checks if all bytes in this slice are within the ASCII range.
diff --git a/library/core/src/slice/cmp.rs b/library/core/src/slice/cmp.rs
index 5bee4d55135..d19d0eae166 100644
--- a/library/core/src/slice/cmp.rs
+++ b/library/core/src/slice/cmp.rs
@@ -1,12 +1,10 @@
 //! Comparison traits for `[T]`.
 
+use super::{from_raw_parts, memchr};
 use crate::cmp::{self, BytewiseEq, Ordering};
 use crate::intrinsics::compare_bytes;
 use crate::mem;
 
-use super::from_raw_parts;
-use super::memchr;
-
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<T, U> PartialEq<[U]> for [T]
 where
diff --git a/library/core/src/slice/index.rs b/library/core/src/slice/index.rs
index 1591aaf52e5..de1492e82ce 100644
--- a/library/core/src/slice/index.rs
+++ b/library/core/src/slice/index.rs
@@ -1,9 +1,8 @@
 //! Indexing implementations for `[T]`.
 
 use crate::intrinsics::const_eval_select;
-use crate::ops;
-use crate::range;
 use crate::ub_checks::assert_unsafe_precondition;
+use crate::{ops, range};
 
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<T, I> ops::Index<I> for [T]
diff --git a/library/core/src/slice/iter.rs b/library/core/src/slice/iter.rs
index 504676ce187..62b170a87d4 100644
--- a/library/core/src/slice/iter.rs
+++ b/library/core/src/slice/iter.rs
@@ -3,8 +3,7 @@
 #[macro_use] // import iterator! and forward_iterator!
 mod macros;
 
-use crate::cmp;
-use crate::fmt;
+use super::{from_raw_parts, from_raw_parts_mut};
 use crate::hint::assert_unchecked;
 use crate::iter::{
     FusedIterator, TrustedLen, TrustedRandomAccess, TrustedRandomAccessNoCoerce, UncheckedIterator,
@@ -13,8 +12,7 @@ use crate::marker::PhantomData;
 use crate::mem::{self, SizedTypeProperties};
 use crate::num::NonZero;
 use crate::ptr::{self, without_provenance, without_provenance_mut, NonNull};
-
-use super::{from_raw_parts, from_raw_parts_mut};
+use crate::{cmp, fmt};
 
 #[stable(feature = "boxed_slice_into_iter", since = "1.80.0")]
 impl<T> !Iterator for [T] {}
diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs
index 5f75e194412..64edaa2f034 100644
--- a/library/core/src/slice/mod.rs
+++ b/library/core/src/slice/mod.rs
@@ -7,16 +7,13 @@
 #![stable(feature = "rust1", since = "1.0.0")]
 
 use crate::cmp::Ordering::{self, Equal, Greater, Less};
-use crate::fmt;
-use crate::hint;
 use crate::intrinsics::{exact_div, unchecked_sub};
 use crate::mem::{self, SizedTypeProperties};
 use crate::num::NonZero;
 use crate::ops::{Bound, OneSidedRange, Range, RangeBounds};
-use crate::ptr;
 use crate::simd::{self, Simd};
-use crate::slice;
 use crate::ub_checks::assert_unsafe_precondition;
+use crate::{fmt, hint, ptr, slice};
 
 #[unstable(
     feature = "slice_internals",
@@ -44,52 +41,38 @@ mod specialize;
 #[unstable(feature = "str_internals", issue = "none")]
 #[doc(hidden)]
 pub use ascii::is_ascii_simple;
-
+#[stable(feature = "inherent_ascii_escape", since = "1.60.0")]
+pub use ascii::EscapeAscii;
+#[stable(feature = "slice_get_slice", since = "1.28.0")]
+pub use index::SliceIndex;
+#[unstable(feature = "slice_range", issue = "76393")]
+pub use index::{range, try_range};
+#[unstable(feature = "array_windows", issue = "75027")]
+pub use iter::ArrayWindows;
+#[unstable(feature = "array_chunks", issue = "74985")]
+pub use iter::{ArrayChunks, ArrayChunksMut};
+#[stable(feature = "slice_group_by", since = "1.77.0")]
+pub use iter::{ChunkBy, ChunkByMut};
 #[stable(feature = "rust1", since = "1.0.0")]
 pub use iter::{Chunks, ChunksMut, Windows};
-#[stable(feature = "rust1", since = "1.0.0")]
-pub use iter::{Iter, IterMut};
-#[stable(feature = "rust1", since = "1.0.0")]
-pub use iter::{RSplitN, RSplitNMut, Split, SplitMut, SplitN, SplitNMut};
-
-#[stable(feature = "slice_rsplit", since = "1.27.0")]
-pub use iter::{RSplit, RSplitMut};
-
 #[stable(feature = "chunks_exact", since = "1.31.0")]
 pub use iter::{ChunksExact, ChunksExactMut};
-
+#[stable(feature = "rust1", since = "1.0.0")]
+pub use iter::{Iter, IterMut};
 #[stable(feature = "rchunks", since = "1.31.0")]
 pub use iter::{RChunks, RChunksExact, RChunksExactMut, RChunksMut};
-
-#[unstable(feature = "array_chunks", issue = "74985")]
-pub use iter::{ArrayChunks, ArrayChunksMut};
-
-#[unstable(feature = "array_windows", issue = "75027")]
-pub use iter::ArrayWindows;
-
-#[stable(feature = "slice_group_by", since = "1.77.0")]
-pub use iter::{ChunkBy, ChunkByMut};
-
+#[stable(feature = "slice_rsplit", since = "1.27.0")]
+pub use iter::{RSplit, RSplitMut};
+#[stable(feature = "rust1", since = "1.0.0")]
+pub use iter::{RSplitN, RSplitNMut, Split, SplitMut, SplitN, SplitNMut};
 #[stable(feature = "split_inclusive", since = "1.51.0")]
 pub use iter::{SplitInclusive, SplitInclusiveMut};
-
-#[stable(feature = "rust1", since = "1.0.0")]
-pub use raw::{from_raw_parts, from_raw_parts_mut};
-
 #[stable(feature = "from_ref", since = "1.28.0")]
 pub use raw::{from_mut, from_ref};
-
 #[unstable(feature = "slice_from_ptr_range", issue = "89792")]
 pub use raw::{from_mut_ptr_range, from_ptr_range};
-
-#[stable(feature = "slice_get_slice", since = "1.28.0")]
-pub use index::SliceIndex;
-
-#[unstable(feature = "slice_range", issue = "76393")]
-pub use index::{range, try_range};
-
-#[stable(feature = "inherent_ascii_escape", since = "1.60.0")]
-pub use ascii::EscapeAscii;
+#[stable(feature = "rust1", since = "1.0.0")]
+pub use raw::{from_raw_parts, from_raw_parts_mut};
 
 /// Calculates the direction and split point of a one-sided range.
 ///
diff --git a/library/core/src/slice/raw.rs b/library/core/src/slice/raw.rs
index 280aead270e..85507eb8a73 100644
--- a/library/core/src/slice/raw.rs
+++ b/library/core/src/slice/raw.rs
@@ -1,9 +1,7 @@
 //! Free functions to create `&[T]` and `&mut [T]`.
 
-use crate::array;
 use crate::ops::Range;
-use crate::ptr;
-use crate::ub_checks;
+use crate::{array, ptr, ub_checks};
 
 /// Forms a slice from a pointer and a length.
 ///
diff --git a/library/core/src/slice/rotate.rs b/library/core/src/slice/rotate.rs
index 1d7b8633979..1e4865a7caa 100644
--- a/library/core/src/slice/rotate.rs
+++ b/library/core/src/slice/rotate.rs
@@ -1,6 +1,5 @@
-use crate::cmp;
 use crate::mem::{self, MaybeUninit, SizedTypeProperties};
-use crate::ptr;
+use crate::{cmp, ptr};
 
 /// Rotates the range `[mid-left, mid+right)` such that the element at `mid` becomes the first
 /// element. Equivalently, rotates the range `left` elements to the left or `right` elements to the
diff --git a/library/core/src/slice/sort/select.rs b/library/core/src/slice/sort/select.rs
index efda993a103..f6529f23bcb 100644
--- a/library/core/src/slice/sort/select.rs
+++ b/library/core/src/slice/sort/select.rs
@@ -7,7 +7,6 @@
 //! better performance than one would get using heapsort as fallback.
 
 use crate::mem::{self, SizedTypeProperties};
-
 use crate::slice::sort::shared::pivot::choose_pivot;
 use crate::slice::sort::shared::smallsort::insertion_sort_shift_left;
 use crate::slice::sort::unstable::quicksort::partition;
diff --git a/library/core/src/slice/sort/shared/smallsort.rs b/library/core/src/slice/sort/shared/smallsort.rs
index 5111ed8756b..5064c5a0ae5 100644
--- a/library/core/src/slice/sort/shared/smallsort.rs
+++ b/library/core/src/slice/sort/shared/smallsort.rs
@@ -1,11 +1,8 @@
 //! This module contains a variety of sort implementations that are optimized for small lengths.
 
-use crate::intrinsics;
 use crate::mem::{self, ManuallyDrop, MaybeUninit};
-use crate::ptr;
-use crate::slice;
-
 use crate::slice::sort::shared::FreezeMarker;
+use crate::{intrinsics, ptr, slice};
 
 // It's important to differentiate between SMALL_SORT_THRESHOLD performance for
 // small slices and small-sort performance sorting small sub-slices as part of
diff --git a/library/core/src/slice/sort/stable/drift.rs b/library/core/src/slice/sort/stable/drift.rs
index 73dc40cafcf..644e75a4581 100644
--- a/library/core/src/slice/sort/stable/drift.rs
+++ b/library/core/src/slice/sort/stable/drift.rs
@@ -1,14 +1,12 @@
 //! This module contains the hybrid top-level loop combining bottom-up Mergesort with top-down
 //! Quicksort.
 
-use crate::cmp;
-use crate::intrinsics;
 use crate::mem::MaybeUninit;
-
 use crate::slice::sort::shared::find_existing_run;
 use crate::slice::sort::shared::smallsort::StableSmallSortTypeImpl;
 use crate::slice::sort::stable::merge::merge;
 use crate::slice::sort::stable::quicksort::quicksort;
+use crate::{cmp, intrinsics};
 
 /// Sorts `v` based on comparison function `is_less`. If `eager_sort` is true,
 /// it will only do small-sorts and physical merges, ensuring O(N * log(N))
diff --git a/library/core/src/slice/sort/stable/merge.rs b/library/core/src/slice/sort/stable/merge.rs
index 6739e114b13..0cb21740795 100644
--- a/library/core/src/slice/sort/stable/merge.rs
+++ b/library/core/src/slice/sort/stable/merge.rs
@@ -1,8 +1,7 @@
 //! This module contains logic for performing a merge of two sorted sub-slices.
 
-use crate::cmp;
 use crate::mem::MaybeUninit;
-use crate::ptr;
+use crate::{cmp, ptr};
 
 /// Merges non-decreasing runs `v[..mid]` and `v[mid..]` using `scratch` as
 /// temporary storage, and stores the result into `v[..]`.
diff --git a/library/core/src/slice/sort/stable/mod.rs b/library/core/src/slice/sort/stable/mod.rs
index 18f7b2ac54a..a383b0f589c 100644
--- a/library/core/src/slice/sort/stable/mod.rs
+++ b/library/core/src/slice/sort/stable/mod.rs
@@ -1,12 +1,10 @@
 //! This module contains the entry points for `slice::sort`.
 
-use crate::cmp;
-use crate::intrinsics;
 use crate::mem::{self, MaybeUninit, SizedTypeProperties};
-
 use crate::slice::sort::shared::smallsort::{
     insertion_sort_shift_left, StableSmallSortTypeImpl, SMALL_SORT_GENERAL_SCRATCH_LEN,
 };
+use crate::{cmp, intrinsics};
 
 pub(crate) mod drift;
 pub(crate) mod merge;
diff --git a/library/core/src/slice/sort/stable/quicksort.rs b/library/core/src/slice/sort/stable/quicksort.rs
index 164314991d0..3319d67ab52 100644
--- a/library/core/src/slice/sort/stable/quicksort.rs
+++ b/library/core/src/slice/sort/stable/quicksort.rs
@@ -1,12 +1,10 @@
 //! This module contains a stable quicksort and partition implementation.
 
-use crate::intrinsics;
 use crate::mem::{self, ManuallyDrop, MaybeUninit};
-use crate::ptr;
-
 use crate::slice::sort::shared::pivot::choose_pivot;
 use crate::slice::sort::shared::smallsort::StableSmallSortTypeImpl;
 use crate::slice::sort::shared::FreezeMarker;
+use crate::{intrinsics, ptr};
 
 /// Sorts `v` recursively using quicksort.
 ///
diff --git a/library/core/src/slice/sort/unstable/heapsort.rs b/library/core/src/slice/sort/unstable/heapsort.rs
index 559605ef4b6..27e2ad588ea 100644
--- a/library/core/src/slice/sort/unstable/heapsort.rs
+++ b/library/core/src/slice/sort/unstable/heapsort.rs
@@ -1,7 +1,6 @@
 //! This module contains a branchless heapsort as fallback for unstable quicksort.
 
-use crate::intrinsics;
-use crate::ptr;
+use crate::{intrinsics, ptr};
 
 /// Sorts `v` using heapsort, which guarantees *O*(*n* \* log(*n*)) worst-case.
 ///
diff --git a/library/core/src/slice/sort/unstable/mod.rs b/library/core/src/slice/sort/unstable/mod.rs
index 692c2d8f7c7..ed735e1ebfb 100644
--- a/library/core/src/slice/sort/unstable/mod.rs
+++ b/library/core/src/slice/sort/unstable/mod.rs
@@ -2,7 +2,6 @@
 
 use crate::intrinsics;
 use crate::mem::SizedTypeProperties;
-
 use crate::slice::sort::shared::find_existing_run;
 use crate::slice::sort::shared::smallsort::insertion_sort_shift_left;
 
diff --git a/library/core/src/slice/sort/unstable/quicksort.rs b/library/core/src/slice/sort/unstable/quicksort.rs
index 533b5b0eec7..cd53656e9b4 100644
--- a/library/core/src/slice/sort/unstable/quicksort.rs
+++ b/library/core/src/slice/sort/unstable/quicksort.rs
@@ -1,11 +1,9 @@
 //! This module contains an unstable quicksort and two partition implementations.
 
-use crate::intrinsics;
 use crate::mem::{self, ManuallyDrop};
-use crate::ptr;
-
 use crate::slice::sort::shared::pivot::choose_pivot;
 use crate::slice::sort::shared::smallsort::UnstableSmallSortTypeImpl;
+use crate::{intrinsics, ptr};
 
 /// Sorts `v` recursively.
 ///
diff --git a/library/core/src/str/converts.rs b/library/core/src/str/converts.rs
index b35216eee7b..1956a04829d 100644
--- a/library/core/src/str/converts.rs
+++ b/library/core/src/str/converts.rs
@@ -1,9 +1,8 @@
 //! Ways to create a `str` from bytes slice.
 
-use crate::{mem, ptr};
-
 use super::validations::run_utf8_validation;
 use super::Utf8Error;
+use crate::{mem, ptr};
 
 /// Converts a slice of bytes to a string slice.
 ///
diff --git a/library/core/src/str/iter.rs b/library/core/src/str/iter.rs
index 5845e3b5481..06f796f9f3a 100644
--- a/library/core/src/str/iter.rs
+++ b/library/core/src/str/iter.rs
@@ -1,23 +1,20 @@
 //! Iterators for `str` methods.
 
-use crate::char as char_mod;
+use super::pattern::{DoubleEndedSearcher, Pattern, ReverseSearcher, Searcher};
+use super::validations::{next_code_point, next_code_point_reverse};
+use super::{
+    from_utf8_unchecked, BytesIsNotEmpty, CharEscapeDebugContinue, CharEscapeDefault,
+    CharEscapeUnicode, IsAsciiWhitespace, IsNotEmpty, IsWhitespace, LinesMap, UnsafeBytesToStr,
+};
 use crate::fmt::{self, Write};
-use crate::iter::{Chain, FlatMap, Flatten};
-use crate::iter::{Copied, Filter, FusedIterator, Map, TrustedLen};
-use crate::iter::{TrustedRandomAccess, TrustedRandomAccessNoCoerce};
+use crate::iter::{
+    Chain, Copied, Filter, FlatMap, Flatten, FusedIterator, Map, TrustedLen, TrustedRandomAccess,
+    TrustedRandomAccessNoCoerce,
+};
 use crate::num::NonZero;
 use crate::ops::Try;
-use crate::option;
 use crate::slice::{self, Split as SliceSplit};
-
-use super::from_utf8_unchecked;
-use super::pattern::Pattern;
-use super::pattern::{DoubleEndedSearcher, ReverseSearcher, Searcher};
-use super::validations::{next_code_point, next_code_point_reverse};
-use super::LinesMap;
-use super::{BytesIsNotEmpty, UnsafeBytesToStr};
-use super::{CharEscapeDebugContinue, CharEscapeDefault, CharEscapeUnicode};
-use super::{IsAsciiWhitespace, IsNotEmpty, IsWhitespace};
+use crate::{char as char_mod, option};
 
 /// An iterator over the [`char`]s of a string slice.
 ///
diff --git a/library/core/src/str/lossy.rs b/library/core/src/str/lossy.rs
index 51a0777c2d6..3f31107acf0 100644
--- a/library/core/src/str/lossy.rs
+++ b/library/core/src/str/lossy.rs
@@ -1,10 +1,8 @@
-use crate::fmt;
-use crate::fmt::Formatter;
-use crate::fmt::Write;
-use crate::iter::FusedIterator;
-
 use super::from_utf8_unchecked;
 use super::validations::utf8_char_width;
+use crate::fmt;
+use crate::fmt::{Formatter, Write};
+use crate::iter::FusedIterator;
 
 impl [u8] {
     /// Creates an iterator over the contiguous valid UTF-8 ranges of this
diff --git a/library/core/src/str/mod.rs b/library/core/src/str/mod.rs
index d861fb2075f..56517348dc7 100644
--- a/library/core/src/str/mod.rs
+++ b/library/core/src/str/mod.rs
@@ -13,74 +13,52 @@ mod iter;
 mod traits;
 mod validations;
 
-use self::pattern::Pattern;
-use self::pattern::{DoubleEndedSearcher, ReverseSearcher, Searcher};
-
-use crate::ascii;
+use self::pattern::{DoubleEndedSearcher, Pattern, ReverseSearcher, Searcher};
 use crate::char::{self, EscapeDebugExtArgs};
-use crate::mem;
 use crate::ops::Range;
 use crate::slice::{self, SliceIndex};
+use crate::{ascii, mem};
 
 pub mod pattern;
 
 mod lossy;
-#[stable(feature = "utf8_chunks", since = "1.79.0")]
-pub use lossy::{Utf8Chunk, Utf8Chunks};
-
+#[unstable(feature = "str_from_raw_parts", issue = "119206")]
+pub use converts::{from_raw_parts, from_raw_parts_mut};
 #[stable(feature = "rust1", since = "1.0.0")]
 pub use converts::{from_utf8, from_utf8_unchecked};
-
 #[stable(feature = "str_mut_extras", since = "1.20.0")]
 pub use converts::{from_utf8_mut, from_utf8_unchecked_mut};
-
-#[unstable(feature = "str_from_raw_parts", issue = "119206")]
-pub use converts::{from_raw_parts, from_raw_parts_mut};
-
 #[stable(feature = "rust1", since = "1.0.0")]
 pub use error::{ParseBoolError, Utf8Error};
-
-#[stable(feature = "rust1", since = "1.0.0")]
-pub use traits::FromStr;
-
-#[stable(feature = "rust1", since = "1.0.0")]
-pub use iter::{Bytes, CharIndices, Chars, Lines, SplitWhitespace};
-
+#[stable(feature = "encode_utf16", since = "1.8.0")]
+pub use iter::EncodeUtf16;
 #[stable(feature = "rust1", since = "1.0.0")]
 #[allow(deprecated)]
 pub use iter::LinesAny;
-
-#[stable(feature = "rust1", since = "1.0.0")]
-pub use iter::{RSplit, RSplitTerminator, Split, SplitTerminator};
-
-#[stable(feature = "rust1", since = "1.0.0")]
-pub use iter::{RSplitN, SplitN};
-
-#[stable(feature = "str_matches", since = "1.2.0")]
-pub use iter::{Matches, RMatches};
-
-#[stable(feature = "str_match_indices", since = "1.5.0")]
-pub use iter::{MatchIndices, RMatchIndices};
-
-#[stable(feature = "encode_utf16", since = "1.8.0")]
-pub use iter::EncodeUtf16;
-
-#[stable(feature = "str_escape", since = "1.34.0")]
-pub use iter::{EscapeDebug, EscapeDefault, EscapeUnicode};
-
 #[stable(feature = "split_ascii_whitespace", since = "1.34.0")]
 pub use iter::SplitAsciiWhitespace;
-
 #[stable(feature = "split_inclusive", since = "1.51.0")]
 pub use iter::SplitInclusive;
-
+#[stable(feature = "rust1", since = "1.0.0")]
+pub use iter::{Bytes, CharIndices, Chars, Lines, SplitWhitespace};
+#[stable(feature = "str_escape", since = "1.34.0")]
+pub use iter::{EscapeDebug, EscapeDefault, EscapeUnicode};
+#[stable(feature = "str_match_indices", since = "1.5.0")]
+pub use iter::{MatchIndices, RMatchIndices};
+use iter::{MatchIndicesInternal, MatchesInternal, SplitInternal, SplitNInternal};
+#[stable(feature = "str_matches", since = "1.2.0")]
+pub use iter::{Matches, RMatches};
+#[stable(feature = "rust1", since = "1.0.0")]
+pub use iter::{RSplit, RSplitTerminator, Split, SplitTerminator};
+#[stable(feature = "rust1", since = "1.0.0")]
+pub use iter::{RSplitN, SplitN};
+#[stable(feature = "utf8_chunks", since = "1.79.0")]
+pub use lossy::{Utf8Chunk, Utf8Chunks};
+#[stable(feature = "rust1", since = "1.0.0")]
+pub use traits::FromStr;
 #[unstable(feature = "str_internals", issue = "none")]
 pub use validations::{next_code_point, utf8_char_width};
 
-use iter::MatchIndicesInternal;
-use iter::SplitInternal;
-use iter::{MatchesInternal, SplitNInternal};
-
 #[inline(never)]
 #[cold]
 #[track_caller]
diff --git a/library/core/src/str/pattern.rs b/library/core/src/str/pattern.rs
index 33a5d45e445..2f1096db8f0 100644
--- a/library/core/src/str/pattern.rs
+++ b/library/core/src/str/pattern.rs
@@ -38,11 +38,10 @@
     issue = "27721"
 )]
 
-use crate::cmp;
 use crate::cmp::Ordering;
 use crate::convert::TryInto as _;
-use crate::fmt;
 use crate::slice::memchr;
+use crate::{cmp, fmt};
 
 // Pattern
 
@@ -1759,8 +1758,7 @@ fn simd_contains(needle: &str, haystack: &str) -> Option<bool> {
 
     use crate::ops::BitAnd;
     use crate::simd::cmp::SimdPartialEq;
-    use crate::simd::mask8x16 as Mask;
-    use crate::simd::u8x16 as Block;
+    use crate::simd::{mask8x16 as Mask, u8x16 as Block};
 
     let first_probe = needle[0];
     let last_byte_offset = needle.len() - 1;
diff --git a/library/core/src/str/traits.rs b/library/core/src/str/traits.rs
index 3de5546c4d4..b69c476ae5e 100644
--- a/library/core/src/str/traits.rs
+++ b/library/core/src/str/traits.rs
@@ -1,14 +1,11 @@
 //! Trait implementations for `str`.
 
+use super::ParseBoolError;
 use crate::cmp::Ordering;
 use crate::intrinsics::unchecked_sub;
-use crate::ops;
-use crate::ptr;
-use crate::range;
 use crate::slice::SliceIndex;
 use crate::ub_checks::assert_unsafe_precondition;
-
-use super::ParseBoolError;
+use crate::{ops, ptr, range};
 
 /// Implements ordering of strings.
 ///
diff --git a/library/core/src/str/validations.rs b/library/core/src/str/validations.rs
index a11d7fee8af..cca8ff74dda 100644
--- a/library/core/src/str/validations.rs
+++ b/library/core/src/str/validations.rs
@@ -1,8 +1,7 @@
 //! Operations related to UTF-8 validation.
 
-use crate::mem;
-
 use super::Utf8Error;
+use crate::mem;
 
 /// Returns the initial codepoint accumulator for the first byte.
 /// The first byte is special, only want bottom 5 bits for width 2, 4 bits
diff --git a/library/core/src/sync/atomic.rs b/library/core/src/sync/atomic.rs
index 1769a6dc101..912f164bcbd 100644
--- a/library/core/src/sync/atomic.rs
+++ b/library/core/src/sync/atomic.rs
@@ -223,12 +223,9 @@
 #![allow(clippy::not_unsafe_ptr_arg_deref)]
 
 use self::Ordering::*;
-
 use crate::cell::UnsafeCell;
-use crate::fmt;
-use crate::intrinsics;
-
 use crate::hint::spin_loop;
+use crate::{fmt, intrinsics};
 
 // Some architectures don't have byte-sized atomics, which results in LLVM
 // emulating them using a LL/SC loop. However for AtomicBool we can take
diff --git a/library/core/src/task/wake.rs b/library/core/src/task/wake.rs
index 3342fedd926..8ce3eb2ea39 100644
--- a/library/core/src/task/wake.rs
+++ b/library/core/src/task/wake.rs
@@ -1,11 +1,10 @@
 #![stable(feature = "futures_api", since = "1.36.0")]
 
 use crate::any::Any;
-use crate::fmt;
 use crate::marker::PhantomData;
 use crate::mem::{transmute, ManuallyDrop};
 use crate::panic::AssertUnwindSafe;
-use crate::ptr;
+use crate::{fmt, ptr};
 
 /// A `RawWaker` allows the implementor of a task executor to create a [`Waker`]
 /// or a [`LocalWaker`] which provides customized wakeup behavior.
diff --git a/library/core/src/tuple.rs b/library/core/src/tuple.rs
index bc376b13f64..65d4d5cf2ce 100644
--- a/library/core/src/tuple.rs
+++ b/library/core/src/tuple.rs
@@ -1,9 +1,7 @@
 // See core/src/primitive_docs.rs for documentation.
 
 use crate::cmp::Ordering::{self, *};
-use crate::marker::ConstParamTy_;
-use crate::marker::StructuralPartialEq;
-use crate::marker::UnsizedConstParamTy;
+use crate::marker::{ConstParamTy_, StructuralPartialEq, UnsizedConstParamTy};
 
 // Recursive macro for implementing n-ary tuple functions and operations
 //
diff --git a/library/core/src/ub_checks.rs b/library/core/src/ub_checks.rs
index cce0665b37d..b65b48c162d 100644
--- a/library/core/src/ub_checks.rs
+++ b/library/core/src/ub_checks.rs
@@ -81,7 +81,6 @@ macro_rules! assert_unsafe_precondition {
 }
 #[unstable(feature = "ub_checks", issue = "none")]
 pub use assert_unsafe_precondition;
-
 /// Checking library UB is always enabled when UB-checking is done
 /// (and we use a reexport so that there is no unnecessary wrapper function).
 #[unstable(feature = "ub_checks", issue = "none")]
diff --git a/library/core/tests/array.rs b/library/core/tests/array.rs
index e7773d138c2..b6d18f1ec38 100644
--- a/library/core/tests/array.rs
+++ b/library/core/tests/array.rs
@@ -259,7 +259,8 @@ fn iterator_drops() {
 #[test]
 #[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
 fn array_default_impl_avoids_leaks_on_panic() {
-    use core::sync::atomic::{AtomicUsize, Ordering::Relaxed};
+    use core::sync::atomic::AtomicUsize;
+    use core::sync::atomic::Ordering::Relaxed;
     static COUNTER: AtomicUsize = AtomicUsize::new(0);
     #[derive(Debug)]
     struct Bomb(#[allow(dead_code)] usize);
diff --git a/library/core/tests/clone.rs b/library/core/tests/clone.rs
index 23efab2f1b5..b7130f16f87 100644
--- a/library/core/tests/clone.rs
+++ b/library/core/tests/clone.rs
@@ -36,7 +36,8 @@ fn test_clone_to_uninit_slice_success() {
 #[test]
 #[cfg(panic = "unwind")]
 fn test_clone_to_uninit_slice_drops_on_panic() {
-    use core::sync::atomic::{AtomicUsize, Ordering::Relaxed};
+    use core::sync::atomic::AtomicUsize;
+    use core::sync::atomic::Ordering::Relaxed;
 
     /// A static counter is OK to use as long as _this one test_ isn't run several times in
     /// multiple threads.
diff --git a/library/core/tests/cmp.rs b/library/core/tests/cmp.rs
index 72fdd490da1..6c4e2146f91 100644
--- a/library/core/tests/cmp.rs
+++ b/library/core/tests/cmp.rs
@@ -1,7 +1,5 @@
-use core::cmp::{
-    self,
-    Ordering::{self, *},
-};
+use core::cmp::Ordering::{self, *};
+use core::cmp::{self};
 
 #[test]
 fn test_int_totalord() {
diff --git a/library/core/tests/hash/sip.rs b/library/core/tests/hash/sip.rs
index 0a67c485c98..f79954f916b 100644
--- a/library/core/tests/hash/sip.rs
+++ b/library/core/tests/hash/sip.rs
@@ -1,7 +1,6 @@
 #![allow(deprecated)]
 
-use core::hash::{Hash, Hasher};
-use core::hash::{SipHasher, SipHasher13};
+use core::hash::{Hash, Hasher, SipHasher, SipHasher13};
 use core::{mem, slice};
 
 // Hash just the bytes of the slice, without length prefix
diff --git a/library/core/tests/iter/adapters/chain.rs b/library/core/tests/iter/adapters/chain.rs
index c93510df524..1b2c026ee1e 100644
--- a/library/core/tests/iter/adapters/chain.rs
+++ b/library/core/tests/iter/adapters/chain.rs
@@ -1,7 +1,8 @@
-use super::*;
 use core::iter::*;
 use core::num::NonZero;
 
+use super::*;
+
 #[test]
 fn test_chain() {
     let xs = [0, 1, 2, 3, 4, 5];
diff --git a/library/core/tests/iter/adapters/flatten.rs b/library/core/tests/iter/adapters/flatten.rs
index 1f953f2aa01..66b7b6cb563 100644
--- a/library/core/tests/iter/adapters/flatten.rs
+++ b/library/core/tests/iter/adapters/flatten.rs
@@ -1,8 +1,9 @@
-use super::*;
 use core::assert_eq;
 use core::iter::*;
 use core::num::NonZero;
 
+use super::*;
+
 #[test]
 fn test_iterator_flatten() {
     let xs = [0, 3, 6];
diff --git a/library/core/tests/iter/adapters/map_windows.rs b/library/core/tests/iter/adapters/map_windows.rs
index 6744eff3fa2..01cebc9b27f 100644
--- a/library/core/tests/iter/adapters/map_windows.rs
+++ b/library/core/tests/iter/adapters/map_windows.rs
@@ -1,10 +1,12 @@
-use std::sync::atomic::{AtomicUsize, Ordering::SeqCst};
+use std::sync::atomic::AtomicUsize;
+use std::sync::atomic::Ordering::SeqCst;
 
 #[cfg(not(panic = "abort"))]
 mod drop_checks {
     //! These tests mainly make sure the elements are correctly dropped.
 
-    use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering::SeqCst};
+    use std::sync::atomic::Ordering::SeqCst;
+    use std::sync::atomic::{AtomicBool, AtomicUsize};
 
     #[derive(Debug)]
     struct DropInfo {
diff --git a/library/core/tests/iter/adapters/peekable.rs b/library/core/tests/iter/adapters/peekable.rs
index c1a1c29b609..7f4341b8902 100644
--- a/library/core/tests/iter/adapters/peekable.rs
+++ b/library/core/tests/iter/adapters/peekable.rs
@@ -1,6 +1,7 @@
-use super::*;
 use core::iter::*;
 
+use super::*;
+
 #[test]
 fn test_iterator_peekable() {
     let xs = vec![0, 1, 2, 3, 4, 5];
diff --git a/library/core/tests/iter/adapters/zip.rs b/library/core/tests/iter/adapters/zip.rs
index ba54de5822b..94b49bac453 100644
--- a/library/core/tests/iter/adapters/zip.rs
+++ b/library/core/tests/iter/adapters/zip.rs
@@ -1,6 +1,7 @@
-use super::*;
 use core::iter::*;
 
+use super::*;
+
 #[test]
 fn test_zip_nth() {
     let xs = [0, 1, 2, 4, 5];
@@ -239,8 +240,7 @@ fn test_zip_trusted_random_access_composition() {
 #[test]
 #[cfg(panic = "unwind")]
 fn test_zip_trusted_random_access_next_back_drop() {
-    use std::panic::catch_unwind;
-    use std::panic::AssertUnwindSafe;
+    use std::panic::{catch_unwind, AssertUnwindSafe};
 
     let mut counter = 0;
 
diff --git a/library/core/tests/iter/range.rs b/library/core/tests/iter/range.rs
index e31db0732e0..d5d2b8bf2b0 100644
--- a/library/core/tests/iter/range.rs
+++ b/library/core/tests/iter/range.rs
@@ -1,7 +1,8 @@
-use super::*;
 use core::ascii::Char as AsciiChar;
 use core::num::NonZero;
 
+use super::*;
+
 #[test]
 fn test_range() {
     assert_eq!((0..5).collect::<Vec<_>>(), [0, 1, 2, 3, 4]);
diff --git a/library/core/tests/iter/sources.rs b/library/core/tests/iter/sources.rs
index a15f3a5148f..eb8c80dd087 100644
--- a/library/core/tests/iter/sources.rs
+++ b/library/core/tests/iter/sources.rs
@@ -1,6 +1,7 @@
-use super::*;
 use core::iter::*;
 
+use super::*;
+
 #[test]
 fn test_repeat() {
     let mut it = repeat(42);
diff --git a/library/core/tests/lazy.rs b/library/core/tests/lazy.rs
index 7f7f1f00588..a3b89f15b3f 100644
--- a/library/core/tests/lazy.rs
+++ b/library/core/tests/lazy.rs
@@ -1,7 +1,6 @@
-use core::{
-    cell::{Cell, LazyCell, OnceCell},
-    sync::atomic::{AtomicUsize, Ordering::SeqCst},
-};
+use core::cell::{Cell, LazyCell, OnceCell};
+use core::sync::atomic::AtomicUsize;
+use core::sync::atomic::Ordering::SeqCst;
 
 #[test]
 fn once_cell() {
diff --git a/library/core/tests/mem.rs b/library/core/tests/mem.rs
index cc733916307..b7eee10ec3f 100644
--- a/library/core/tests/mem.rs
+++ b/library/core/tests/mem.rs
@@ -1,6 +1,5 @@
 use core::mem::*;
 use core::ptr;
-
 #[cfg(panic = "unwind")]
 use std::rc::Rc;
 
diff --git a/library/core/tests/net/ip_addr.rs b/library/core/tests/net/ip_addr.rs
index f9b351ef198..a10b51c550d 100644
--- a/library/core/tests/net/ip_addr.rs
+++ b/library/core/tests/net/ip_addr.rs
@@ -1,9 +1,10 @@
-use super::{sa4, sa6};
 use core::net::{
     IpAddr, Ipv4Addr, Ipv6Addr, Ipv6MulticastScope, SocketAddr, SocketAddrV4, SocketAddrV6,
 };
 use core::str::FromStr;
 
+use super::{sa4, sa6};
+
 #[test]
 fn test_from_str_ipv4() {
     assert_eq!(Ok(Ipv4Addr::new(127, 0, 0, 1)), "127.0.0.1".parse());
diff --git a/library/core/tests/num/flt2dec/mod.rs b/library/core/tests/num/flt2dec/mod.rs
index 83e2707b57e..070a53edc2e 100644
--- a/library/core/tests/num/flt2dec/mod.rs
+++ b/library/core/tests/num/flt2dec/mod.rs
@@ -1,12 +1,10 @@
-use std::mem::MaybeUninit;
-use std::{fmt, str};
-
-use core::num::flt2dec::{decode, DecodableFloat, Decoded, FullDecoded};
-use core::num::flt2dec::{round_up, Sign, MAX_SIG_DIGITS};
 use core::num::flt2dec::{
-    to_exact_exp_str, to_exact_fixed_str, to_shortest_exp_str, to_shortest_str,
+    decode, round_up, to_exact_exp_str, to_exact_fixed_str, to_shortest_exp_str, to_shortest_str,
+    DecodableFloat, Decoded, FullDecoded, Sign, MAX_SIG_DIGITS,
 };
 use core::num::fmt::{Formatted, Part};
+use std::mem::MaybeUninit;
+use std::{fmt, str};
 
 mod estimator;
 mod strategy {
diff --git a/library/core/tests/num/flt2dec/random.rs b/library/core/tests/num/flt2dec/random.rs
index 0084c1c814e..4817a666383 100644
--- a/library/core/tests/num/flt2dec/random.rs
+++ b/library/core/tests/num/flt2dec/random.rs
@@ -1,13 +1,10 @@
 #![cfg(not(target_arch = "wasm32"))]
 
+use core::num::flt2dec::strategy::grisu::{format_exact_opt, format_shortest_opt};
+use core::num::flt2dec::{decode, DecodableFloat, Decoded, FullDecoded, MAX_SIG_DIGITS};
 use std::mem::MaybeUninit;
 use std::str;
 
-use core::num::flt2dec::strategy::grisu::format_exact_opt;
-use core::num::flt2dec::strategy::grisu::format_shortest_opt;
-use core::num::flt2dec::MAX_SIG_DIGITS;
-use core::num::flt2dec::{decode, DecodableFloat, Decoded, FullDecoded};
-
 use rand::distributions::{Distribution, Uniform};
 
 pub fn decode_finite<T: DecodableFloat>(v: T) -> Decoded {
diff --git a/library/core/tests/num/flt2dec/strategy/dragon.rs b/library/core/tests/num/flt2dec/strategy/dragon.rs
index fc2e724a20c..be25fee3f6c 100644
--- a/library/core/tests/num/flt2dec/strategy/dragon.rs
+++ b/library/core/tests/num/flt2dec/strategy/dragon.rs
@@ -1,7 +1,8 @@
-use super::super::*;
 use core::num::bignum::Big32x40 as Big;
 use core::num::flt2dec::strategy::dragon::*;
 
+use super::super::*;
+
 #[test]
 fn test_mul_pow10() {
     let mut prevpow10 = Big::from_small(1);
diff --git a/library/core/tests/num/flt2dec/strategy/grisu.rs b/library/core/tests/num/flt2dec/strategy/grisu.rs
index b59a3b9b72d..9b2f0453de7 100644
--- a/library/core/tests/num/flt2dec/strategy/grisu.rs
+++ b/library/core/tests/num/flt2dec/strategy/grisu.rs
@@ -1,6 +1,7 @@
-use super::super::*;
 use core::num::flt2dec::strategy::grisu::*;
 
+use super::super::*;
+
 #[test]
 #[cfg_attr(miri, ignore)] // Miri is too slow
 fn test_cached_power() {
diff --git a/library/core/tests/ops.rs b/library/core/tests/ops.rs
index 0c81cba35b3..2ee0abd399b 100644
--- a/library/core/tests/ops.rs
+++ b/library/core/tests/ops.rs
@@ -1,7 +1,8 @@
 mod control_flow;
 
-use core::ops::{Bound, Range, RangeFrom, RangeFull, RangeInclusive, RangeTo, RangeToInclusive};
-use core::ops::{Deref, DerefMut};
+use core::ops::{
+    Bound, Deref, DerefMut, Range, RangeFrom, RangeFull, RangeInclusive, RangeTo, RangeToInclusive,
+};
 
 // Test the Range structs and syntax.
 
diff --git a/library/core/tests/pin_macro.rs b/library/core/tests/pin_macro.rs
index 57485ef3974..36c6972515a 100644
--- a/library/core/tests/pin_macro.rs
+++ b/library/core/tests/pin_macro.rs
@@ -1,10 +1,8 @@
 // edition:2021
 
-use core::{
-    marker::PhantomPinned,
-    mem::{drop as stuff, transmute},
-    pin::{pin, Pin},
-};
+use core::marker::PhantomPinned;
+use core::mem::{drop as stuff, transmute};
+use core::pin::{pin, Pin};
 
 #[test]
 fn basic() {
diff --git a/library/core/tests/result.rs b/library/core/tests/result.rs
index 00a6fd75b4f..90ec844bc57 100644
--- a/library/core/tests/result.rs
+++ b/library/core/tests/result.rs
@@ -410,7 +410,8 @@ fn result_opt_conversions() {
 #[test]
 fn result_try_trait_v2_branch() {
     use core::num::NonZero;
-    use core::ops::{ControlFlow::*, Try};
+    use core::ops::ControlFlow::*;
+    use core::ops::Try;
 
     assert_eq!(Ok::<i32, i32>(4).branch(), Continue(4));
     assert_eq!(Err::<i32, i32>(4).branch(), Break(Err(4)));
diff --git a/library/core/tests/slice.rs b/library/core/tests/slice.rs
index 4cbbabb672b..acabedcdc26 100644
--- a/library/core/tests/slice.rs
+++ b/library/core/tests/slice.rs
@@ -1856,6 +1856,7 @@ fn sort_unstable() {
 #[cfg_attr(miri, ignore)] // Miri is too slow
 fn select_nth_unstable() {
     use core::cmp::Ordering::{Equal, Greater, Less};
+
     use rand::seq::SliceRandom;
     use rand::Rng;
 
diff --git a/library/core/tests/waker.rs b/library/core/tests/waker.rs
index f8c91a72593..361e900e695 100644
--- a/library/core/tests/waker.rs
+++ b/library/core/tests/waker.rs
@@ -23,11 +23,9 @@ static WAKER_VTABLE: RawWakerVTable = RawWakerVTable::new(
 
 // https://github.com/rust-lang/rust/issues/102012#issuecomment-1915282956
 mod nop_waker {
-    use core::{
-        future::{ready, Future},
-        pin::Pin,
-        task::{Context, Poll, RawWaker, RawWakerVTable, Waker},
-    };
+    use core::future::{ready, Future};
+    use core::pin::Pin;
+    use core::task::{Context, Poll, RawWaker, RawWakerVTable, Waker};
 
     const NOP_RAWWAKER: RawWaker = {
         fn nop(_: *const ()) {}
diff --git a/library/panic_unwind/src/emcc.rs b/library/panic_unwind/src/emcc.rs
index fed4c52e83c..86a43184fb5 100644
--- a/library/panic_unwind/src/emcc.rs
+++ b/library/panic_unwind/src/emcc.rs
@@ -8,10 +8,9 @@
 
 use alloc::boxed::Box;
 use core::any::Any;
-use core::intrinsics;
-use core::mem;
-use core::ptr;
 use core::sync::atomic::{AtomicBool, Ordering};
+use core::{intrinsics, mem, ptr};
+
 use unwind as uw;
 
 // This matches the layout of std::type_info in C++
diff --git a/library/proc_macro/src/bridge/arena.rs b/library/proc_macro/src/bridge/arena.rs
index f81f2152cd0..1d5986093c8 100644
--- a/library/proc_macro/src/bridge/arena.rs
+++ b/library/proc_macro/src/bridge/arena.rs
@@ -5,12 +5,9 @@
 //! being built at the same time as `std`.
 
 use std::cell::{Cell, RefCell};
-use std::cmp;
 use std::mem::MaybeUninit;
 use std::ops::Range;
-use std::ptr;
-use std::slice;
-use std::str;
+use std::{cmp, ptr, slice, str};
 
 // The arenas start with PAGE-sized chunks, and then each new chunk is twice as
 // big as its predecessor, up until we reach HUGE_PAGE-sized chunks, whereupon
diff --git a/library/proc_macro/src/bridge/client.rs b/library/proc_macro/src/bridge/client.rs
index 9658fc4840f..5a1086527a1 100644
--- a/library/proc_macro/src/bridge/client.rs
+++ b/library/proc_macro/src/bridge/client.rs
@@ -1,11 +1,11 @@
 //! Client-side types.
 
-use super::*;
-
 use std::cell::RefCell;
 use std::marker::PhantomData;
 use std::sync::atomic::AtomicU32;
 
+use super::*;
+
 macro_rules! define_client_handles {
     (
         'owned: $($oty:ident,)*
@@ -190,10 +190,11 @@ impl<'a> !Sync for Bridge<'a> {}
 
 #[allow(unsafe_code)]
 mod state {
-    use super::Bridge;
     use std::cell::{Cell, RefCell};
     use std::ptr;
 
+    use super::Bridge;
+
     thread_local! {
         static BRIDGE_STATE: Cell<*const ()> = const { Cell::new(ptr::null()) };
     }
diff --git a/library/proc_macro/src/bridge/fxhash.rs b/library/proc_macro/src/bridge/fxhash.rs
index 9fb79eabd05..74a41451825 100644
--- a/library/proc_macro/src/bridge/fxhash.rs
+++ b/library/proc_macro/src/bridge/fxhash.rs
@@ -5,8 +5,7 @@
 //! on the `rustc_hash` crate.
 
 use std::collections::HashMap;
-use std::hash::BuildHasherDefault;
-use std::hash::Hasher;
+use std::hash::{BuildHasherDefault, Hasher};
 use std::ops::BitXor;
 
 /// Type alias for a hashmap using the `fx` hash algorithm.
diff --git a/library/proc_macro/src/bridge/mod.rs b/library/proc_macro/src/bridge/mod.rs
index 8553e8d5e4f..03c3e697cfe 100644
--- a/library/proc_macro/src/bridge/mod.rs
+++ b/library/proc_macro/src/bridge/mod.rs
@@ -8,16 +8,12 @@
 
 #![deny(unsafe_code)]
 
-use crate::{Delimiter, Level, Spacing};
-use std::fmt;
 use std::hash::Hash;
-use std::marker;
-use std::mem;
-use std::ops::Bound;
-use std::ops::Range;
-use std::panic;
+use std::ops::{Bound, Range};
 use std::sync::Once;
-use std::thread;
+use std::{fmt, marker, mem, panic, thread};
+
+use crate::{Delimiter, Level, Spacing};
 
 /// Higher-order macro describing the server RPC API, allowing automatic
 /// generation of type-safe Rust APIs, both client-side and server-side.
diff --git a/library/proc_macro/src/bridge/server.rs b/library/proc_macro/src/bridge/server.rs
index 140519bcb23..692b6038a38 100644
--- a/library/proc_macro/src/bridge/server.rs
+++ b/library/proc_macro/src/bridge/server.rs
@@ -1,10 +1,10 @@
 //! Server-side traits.
 
-use super::*;
-
 use std::cell::Cell;
 use std::marker::PhantomData;
 
+use super::*;
+
 macro_rules! define_server_handles {
     (
         'owned: $($oty:ident,)*
diff --git a/library/proc_macro/src/lib.rs b/library/proc_macro/src/lib.rs
index 57247359fbf..06db4837adf 100644
--- a/library/proc_macro/src/lib.rs
+++ b/library/proc_macro/src/lib.rs
@@ -45,16 +45,17 @@ pub mod bridge;
 mod diagnostic;
 mod escape;
 
-#[unstable(feature = "proc_macro_diagnostic", issue = "54140")]
-pub use diagnostic::{Diagnostic, Level, MultiSpan};
-
-use crate::escape::{escape_bytes, EscapeOptions};
 use std::ffi::CStr;
 use std::ops::{Range, RangeBounds};
 use std::path::PathBuf;
 use std::str::FromStr;
 use std::{error, fmt};
 
+#[unstable(feature = "proc_macro_diagnostic", issue = "54140")]
+pub use diagnostic::{Diagnostic, Level, MultiSpan};
+
+use crate::escape::{escape_bytes, EscapeOptions};
+
 /// Determines whether proc_macro has been made accessible to the currently
 /// running program.
 ///
diff --git a/library/std/benches/hash/map.rs b/library/std/benches/hash/map.rs
index bf646cbae47..d6023c8212b 100644
--- a/library/std/benches/hash/map.rs
+++ b/library/std/benches/hash/map.rs
@@ -1,6 +1,7 @@
 #![cfg(test)]
 
 use std::collections::HashMap;
+
 use test::Bencher;
 
 #[bench]
diff --git a/library/std/benches/hash/set_ops.rs b/library/std/benches/hash/set_ops.rs
index 1a4c4a66ee9..b97e3b45085 100644
--- a/library/std/benches/hash/set_ops.rs
+++ b/library/std/benches/hash/set_ops.rs
@@ -1,4 +1,5 @@
 use std::collections::HashSet;
+
 use test::Bencher;
 
 #[bench]
diff --git a/library/std/src/alloc.rs b/library/std/src/alloc.rs
index dc4924cdf58..5d51d6a0c78 100644
--- a/library/std/src/alloc.rs
+++ b/library/std/src/alloc.rs
@@ -56,10 +56,9 @@
 #![deny(unsafe_op_in_unsafe_fn)]
 #![stable(feature = "alloc_module", since = "1.28.0")]
 
-use core::hint;
 use core::ptr::NonNull;
 use core::sync::atomic::{AtomicPtr, Ordering};
-use core::{mem, ptr};
+use core::{hint, mem, ptr};
 
 #[stable(feature = "alloc_module", since = "1.28.0")]
 #[doc(inline)]
diff --git a/library/std/src/ascii.rs b/library/std/src/ascii.rs
index b18ab50de12..3a2880fd509 100644
--- a/library/std/src/ascii.rs
+++ b/library/std/src/ascii.rs
@@ -13,11 +13,10 @@
 
 #![stable(feature = "rust1", since = "1.0.0")]
 
-#[stable(feature = "rust1", since = "1.0.0")]
-pub use core::ascii::{escape_default, EscapeDefault};
-
 #[unstable(feature = "ascii_char", issue = "110998")]
 pub use core::ascii::Char;
+#[stable(feature = "rust1", since = "1.0.0")]
+pub use core::ascii::{escape_default, EscapeDefault};
 
 /// Extension methods for ASCII-subset only operations.
 ///
diff --git a/library/std/src/backtrace.rs b/library/std/src/backtrace.rs
index 4266da04f99..7df9a8a14b0 100644
--- a/library/std/src/backtrace.rs
+++ b/library/std/src/backtrace.rs
@@ -89,13 +89,13 @@ mod tests;
 // a backtrace or actually symbolizing it.
 
 use crate::backtrace_rs::{self, BytesOrWideString};
-use crate::env;
 use crate::ffi::c_void;
-use crate::fmt;
 use crate::panic::UnwindSafe;
-use crate::sync::atomic::{AtomicU8, Ordering::Relaxed};
+use crate::sync::atomic::AtomicU8;
+use crate::sync::atomic::Ordering::Relaxed;
 use crate::sync::LazyLock;
 use crate::sys::backtrace::{lock, output_filename, set_image_base};
+use crate::{env, fmt};
 
 /// A captured OS thread stack backtrace.
 ///
diff --git a/library/std/src/collections/hash/map.rs b/library/std/src/collections/hash/map.rs
index 1f6a3e90479..822fa5791e3 100644
--- a/library/std/src/collections/hash/map.rs
+++ b/library/std/src/collections/hash/map.rs
@@ -1,13 +1,11 @@
 #[cfg(test)]
 mod tests;
 
-use self::Entry::*;
-
 use hashbrown::hash_map as base;
 
+use self::Entry::*;
 use crate::borrow::Borrow;
-use crate::collections::TryReserveError;
-use crate::collections::TryReserveErrorKind;
+use crate::collections::{TryReserveError, TryReserveErrorKind};
 use crate::error::Error;
 use crate::fmt::{self, Debug};
 use crate::hash::{BuildHasher, Hash, RandomState};
diff --git a/library/std/src/collections/hash/map/tests.rs b/library/std/src/collections/hash/map/tests.rs
index 8585376abc1..6641197c372 100644
--- a/library/std/src/collections/hash/map/tests.rs
+++ b/library/std/src/collections/hash/map/tests.rs
@@ -1,11 +1,12 @@
+use rand::Rng;
+use realstd::collections::TryReserveErrorKind::*;
+
 use super::Entry::{Occupied, Vacant};
 use super::HashMap;
 use crate::assert_matches::assert_matches;
 use crate::cell::RefCell;
 use crate::hash::RandomState;
 use crate::test_helpers::test_rng;
-use rand::Rng;
-use realstd::collections::TryReserveErrorKind::*;
 
 // https://github.com/rust-lang/rust/issues/62301
 fn _assert_hashmap_is_unwind_safe() {
@@ -946,7 +947,6 @@ fn test_raw_entry() {
 
 mod test_extract_if {
     use super::*;
-
     use crate::panic::{catch_unwind, AssertUnwindSafe};
     use crate::sync::atomic::{AtomicUsize, Ordering};
 
diff --git a/library/std/src/collections/hash/set.rs b/library/std/src/collections/hash/set.rs
index f0a498fc7bb..d611353b0d3 100644
--- a/library/std/src/collections/hash/set.rs
+++ b/library/std/src/collections/hash/set.rs
@@ -3,6 +3,7 @@ mod tests;
 
 use hashbrown::hash_set as base;
 
+use super::map::map_try_reserve_error;
 use crate::borrow::Borrow;
 use crate::collections::TryReserveError;
 use crate::fmt;
@@ -10,8 +11,6 @@ use crate::hash::{BuildHasher, Hash, RandomState};
 use crate::iter::{Chain, FusedIterator};
 use crate::ops::{BitAnd, BitOr, BitXor, Sub};
 
-use super::map::map_try_reserve_error;
-
 /// A [hash set] implemented as a `HashMap` where the value is `()`.
 ///
 /// As with the [`HashMap`] type, a `HashSet` requires that the elements
diff --git a/library/std/src/collections/hash/set/tests.rs b/library/std/src/collections/hash/set/tests.rs
index a1884090043..4e635165272 100644
--- a/library/std/src/collections/hash/set/tests.rs
+++ b/library/std/src/collections/hash/set/tests.rs
@@ -1,5 +1,4 @@
 use super::HashSet;
-
 use crate::hash::RandomState;
 use crate::panic::{catch_unwind, AssertUnwindSafe};
 use crate::sync::atomic::{AtomicU32, Ordering};
diff --git a/library/std/src/collections/mod.rs b/library/std/src/collections/mod.rs
index 1389d24a8c5..3b04412e766 100644
--- a/library/std/src/collections/mod.rs
+++ b/library/std/src/collections/mod.rs
@@ -401,12 +401,14 @@
 
 #![stable(feature = "rust1", since = "1.0.0")]
 
-#[stable(feature = "rust1", since = "1.0.0")]
-// FIXME(#82080) The deprecation here is only theoretical, and does not actually produce a warning.
-#[deprecated(note = "moved to `std::ops::Bound`", since = "1.26.0")]
-#[doc(hidden)]
-pub use crate::ops::Bound;
-
+#[stable(feature = "try_reserve", since = "1.57.0")]
+pub use alloc_crate::collections::TryReserveError;
+#[unstable(
+    feature = "try_reserve_kind",
+    reason = "Uncertain how much info should be exposed",
+    issue = "48043"
+)]
+pub use alloc_crate::collections::TryReserveErrorKind;
 #[stable(feature = "rust1", since = "1.0.0")]
 pub use alloc_crate::collections::{binary_heap, btree_map, btree_set};
 #[stable(feature = "rust1", since = "1.0.0")]
@@ -422,15 +424,11 @@ pub use self::hash_map::HashMap;
 #[stable(feature = "rust1", since = "1.0.0")]
 #[doc(inline)]
 pub use self::hash_set::HashSet;
-
-#[stable(feature = "try_reserve", since = "1.57.0")]
-pub use alloc_crate::collections::TryReserveError;
-#[unstable(
-    feature = "try_reserve_kind",
-    reason = "Uncertain how much info should be exposed",
-    issue = "48043"
-)]
-pub use alloc_crate::collections::TryReserveErrorKind;
+#[stable(feature = "rust1", since = "1.0.0")]
+// FIXME(#82080) The deprecation here is only theoretical, and does not actually produce a warning.
+#[deprecated(note = "moved to `std::ops::Bound`", since = "1.26.0")]
+#[doc(hidden)]
+pub use crate::ops::Bound;
 
 mod hash;
 
@@ -439,7 +437,6 @@ pub mod hash_map {
     //! A hash map implemented with quadratic probing and SIMD lookup.
     #[stable(feature = "rust1", since = "1.0.0")]
     pub use super::hash::map::*;
-
     #[stable(feature = "hashmap_build_hasher", since = "1.7.0")]
     pub use crate::hash::random::DefaultHasher;
     #[stable(feature = "hashmap_build_hasher", since = "1.7.0")]
diff --git a/library/std/src/env.rs b/library/std/src/env.rs
index fc9b8cfd46d..50ae83090c7 100644
--- a/library/std/src/env.rs
+++ b/library/std/src/env.rs
@@ -15,11 +15,9 @@ mod tests;
 
 use crate::error::Error;
 use crate::ffi::{OsStr, OsString};
-use crate::fmt;
-use crate::io;
 use crate::path::{Path, PathBuf};
-use crate::sys;
 use crate::sys::os as os_imp;
+use crate::{fmt, io, sys};
 
 /// Returns the current working directory as a [`PathBuf`].
 ///
diff --git a/library/std/src/error.rs b/library/std/src/error.rs
index 7d10cbec26d..f5905605e78 100644
--- a/library/std/src/error.rs
+++ b/library/std/src/error.rs
@@ -4,14 +4,14 @@
 #[cfg(test)]
 mod tests;
 
-use crate::backtrace::Backtrace;
-use crate::fmt::{self, Write};
-
 #[stable(feature = "rust1", since = "1.0.0")]
 pub use core::error::Error;
 #[unstable(feature = "error_generic_member_access", issue = "99301")]
 pub use core::error::{request_ref, request_value, Request};
 
+use crate::backtrace::Backtrace;
+use crate::fmt::{self, Write};
+
 /// An error reporter that prints an error and its sources.
 ///
 /// Report also exposes configuration options for formatting the error sources, either entirely on a
diff --git a/library/std/src/error/tests.rs b/library/std/src/error/tests.rs
index ed070a26b0c..88a9f33c079 100644
--- a/library/std/src/error/tests.rs
+++ b/library/std/src/error/tests.rs
@@ -1,6 +1,7 @@
+use core::error::Request;
+
 use super::Error;
 use crate::fmt;
-use core::error::Request;
 
 #[derive(Debug, PartialEq)]
 struct A;
diff --git a/library/std/src/f128.rs b/library/std/src/f128.rs
index 0591c6f517b..34817fe6ae5 100644
--- a/library/std/src/f128.rs
+++ b/library/std/src/f128.rs
@@ -7,13 +7,13 @@
 #[cfg(test)]
 mod tests;
 
-#[cfg(not(test))]
-use crate::intrinsics;
-
 #[unstable(feature = "f128", issue = "116909")]
 pub use core::f128::consts;
 
 #[cfg(not(test))]
+use crate::intrinsics;
+
+#[cfg(not(test))]
 impl f128 {
     /// Raises a number to an integer power.
     ///
diff --git a/library/std/src/f128/tests.rs b/library/std/src/f128/tests.rs
index 0b3e485b0e7..dd42da8db30 100644
--- a/library/std/src/f128/tests.rs
+++ b/library/std/src/f128/tests.rs
@@ -3,8 +3,7 @@
 #![cfg(reliable_f128)]
 
 use crate::f128::consts;
-use crate::num::FpCategory as Fp;
-use crate::num::*;
+use crate::num::{FpCategory as Fp, *};
 
 /// Smallest number
 const TINY_BITS: u128 = 0x1;
diff --git a/library/std/src/f16.rs b/library/std/src/f16.rs
index d4851862299..bd5328d3356 100644
--- a/library/std/src/f16.rs
+++ b/library/std/src/f16.rs
@@ -7,13 +7,13 @@
 #[cfg(test)]
 mod tests;
 
-#[cfg(not(test))]
-use crate::intrinsics;
-
 #[unstable(feature = "f16", issue = "116909")]
 pub use core::f16::consts;
 
 #[cfg(not(test))]
+use crate::intrinsics;
+
+#[cfg(not(test))]
 impl f16 {
     /// Raises a number to an integer power.
     ///
diff --git a/library/std/src/f16/tests.rs b/library/std/src/f16/tests.rs
index 26658a0be87..d9b9d99bf04 100644
--- a/library/std/src/f16/tests.rs
+++ b/library/std/src/f16/tests.rs
@@ -3,8 +3,7 @@
 #![cfg(reliable_f16)]
 
 use crate::f16::consts;
-use crate::num::FpCategory as Fp;
-use crate::num::*;
+use crate::num::{FpCategory as Fp, *};
 
 // We run out of precision pretty quickly with f16
 // const F16_APPROX_L1: f16 = 0.001;
diff --git a/library/std/src/f32.rs b/library/std/src/f32.rs
index 4fc82fec0ad..b3afeca1ed8 100644
--- a/library/std/src/f32.rs
+++ b/library/std/src/f32.rs
@@ -15,11 +15,6 @@
 #[cfg(test)]
 mod tests;
 
-#[cfg(not(test))]
-use crate::intrinsics;
-#[cfg(not(test))]
-use crate::sys::cmath;
-
 #[stable(feature = "rust1", since = "1.0.0")]
 #[allow(deprecated, deprecated_in_future)]
 pub use core::f32::{
@@ -28,6 +23,11 @@ pub use core::f32::{
 };
 
 #[cfg(not(test))]
+use crate::intrinsics;
+#[cfg(not(test))]
+use crate::sys::cmath;
+
+#[cfg(not(test))]
 impl f32 {
     /// Returns the largest integer less than or equal to `self`.
     ///
diff --git a/library/std/src/f32/tests.rs b/library/std/src/f32/tests.rs
index 63e65698374..3a4c1c120a4 100644
--- a/library/std/src/f32/tests.rs
+++ b/library/std/src/f32/tests.rs
@@ -1,6 +1,5 @@
 use crate::f32::consts;
-use crate::num::FpCategory as Fp;
-use crate::num::*;
+use crate::num::{FpCategory as Fp, *};
 
 /// Smallest number
 #[allow(dead_code)] // unused on x86
diff --git a/library/std/src/f64.rs b/library/std/src/f64.rs
index 1ca2b32e241..c8a709c7768 100644
--- a/library/std/src/f64.rs
+++ b/library/std/src/f64.rs
@@ -15,11 +15,6 @@
 #[cfg(test)]
 mod tests;
 
-#[cfg(not(test))]
-use crate::intrinsics;
-#[cfg(not(test))]
-use crate::sys::cmath;
-
 #[stable(feature = "rust1", since = "1.0.0")]
 #[allow(deprecated, deprecated_in_future)]
 pub use core::f64::{
@@ -28,6 +23,11 @@ pub use core::f64::{
 };
 
 #[cfg(not(test))]
+use crate::intrinsics;
+#[cfg(not(test))]
+use crate::sys::cmath;
+
+#[cfg(not(test))]
 impl f64 {
     /// Returns the largest integer less than or equal to `self`.
     ///
diff --git a/library/std/src/f64/tests.rs b/library/std/src/f64/tests.rs
index d9e17fd601d..bac8405f973 100644
--- a/library/std/src/f64/tests.rs
+++ b/library/std/src/f64/tests.rs
@@ -1,6 +1,5 @@
 use crate::f64::consts;
-use crate::num::FpCategory as Fp;
-use crate::num::*;
+use crate::num::{FpCategory as Fp, *};
 
 /// Smallest number
 #[allow(dead_code)] // unused on x86
diff --git a/library/std/src/ffi/c_str.rs b/library/std/src/ffi/c_str.rs
index b59b0c5bba6..cb0ca5d1376 100644
--- a/library/std/src/ffi/c_str.rs
+++ b/library/std/src/ffi/c_str.rs
@@ -1,19 +1,14 @@
 //! [`CStr`], [`CString`], and related types.
 
-#[stable(feature = "rust1", since = "1.0.0")]
-pub use core::ffi::c_str::CStr;
-
-#[stable(feature = "cstr_from_bytes", since = "1.10.0")]
-pub use core::ffi::c_str::FromBytesWithNulError;
-
-#[stable(feature = "cstr_from_bytes_until_nul", since = "1.69.0")]
-pub use core::ffi::c_str::FromBytesUntilNulError;
-
-#[stable(feature = "rust1", since = "1.0.0")]
-pub use alloc::ffi::c_str::{CString, NulError};
-
 #[stable(feature = "cstring_from_vec_with_nul", since = "1.58.0")]
 pub use alloc::ffi::c_str::FromVecWithNulError;
-
 #[stable(feature = "cstring_into", since = "1.7.0")]
 pub use alloc::ffi::c_str::IntoStringError;
+#[stable(feature = "rust1", since = "1.0.0")]
+pub use alloc::ffi::c_str::{CString, NulError};
+#[stable(feature = "rust1", since = "1.0.0")]
+pub use core::ffi::c_str::CStr;
+#[stable(feature = "cstr_from_bytes_until_nul", since = "1.69.0")]
+pub use core::ffi::c_str::FromBytesUntilNulError;
+#[stable(feature = "cstr_from_bytes", since = "1.10.0")]
+pub use core::ffi::c_str::FromBytesWithNulError;
diff --git a/library/std/src/ffi/mod.rs b/library/std/src/ffi/mod.rs
index f45fd77e8b1..2b67750c2f0 100644
--- a/library/std/src/ffi/mod.rs
+++ b/library/std/src/ffi/mod.rs
@@ -164,50 +164,42 @@
 #[unstable(feature = "c_str_module", issue = "112134")]
 pub mod c_str;
 
-#[doc(inline)]
-#[stable(feature = "rust1", since = "1.0.0")]
-pub use self::c_str::{CStr, CString};
-
-#[doc(no_inline)]
-#[stable(feature = "cstr_from_bytes", since = "1.10.0")]
-pub use self::c_str::FromBytesWithNulError;
+#[stable(feature = "core_c_void", since = "1.30.0")]
+pub use core::ffi::c_void;
+#[stable(feature = "core_ffi_c", since = "1.64.0")]
+pub use core::ffi::{
+    c_char, c_double, c_float, c_int, c_long, c_longlong, c_schar, c_short, c_uchar, c_uint,
+    c_ulong, c_ulonglong, c_ushort,
+};
+#[unstable(
+    feature = "c_variadic",
+    reason = "the `c_variadic` feature has not been properly tested on \
+              all supported platforms",
+    issue = "44930"
+)]
+pub use core::ffi::{VaList, VaListImpl};
 
 #[doc(no_inline)]
 #[stable(feature = "cstr_from_bytes_until_nul", since = "1.69.0")]
 pub use self::c_str::FromBytesUntilNulError;
-
 #[doc(no_inline)]
-#[stable(feature = "rust1", since = "1.0.0")]
-pub use self::c_str::NulError;
-
+#[stable(feature = "cstr_from_bytes", since = "1.10.0")]
+pub use self::c_str::FromBytesWithNulError;
 #[doc(no_inline)]
 #[stable(feature = "cstring_from_vec_with_nul", since = "1.58.0")]
 pub use self::c_str::FromVecWithNulError;
-
 #[doc(no_inline)]
 #[stable(feature = "cstring_into", since = "1.7.0")]
 pub use self::c_str::IntoStringError;
-
+#[doc(no_inline)]
+#[stable(feature = "rust1", since = "1.0.0")]
+pub use self::c_str::NulError;
+#[doc(inline)]
+#[stable(feature = "rust1", since = "1.0.0")]
+pub use self::c_str::{CStr, CString};
 #[stable(feature = "rust1", since = "1.0.0")]
 #[doc(inline)]
 pub use self::os_str::{OsStr, OsString};
 
-#[stable(feature = "core_ffi_c", since = "1.64.0")]
-pub use core::ffi::{
-    c_char, c_double, c_float, c_int, c_long, c_longlong, c_schar, c_short, c_uchar, c_uint,
-    c_ulong, c_ulonglong, c_ushort,
-};
-
-#[stable(feature = "core_c_void", since = "1.30.0")]
-pub use core::ffi::c_void;
-
-#[unstable(
-    feature = "c_variadic",
-    reason = "the `c_variadic` feature has not been properly tested on \
-              all supported platforms",
-    issue = "44930"
-)]
-pub use core::ffi::{VaList, VaListImpl};
-
 #[unstable(feature = "os_str_display", issue = "120048")]
 pub mod os_str;
diff --git a/library/std/src/ffi/os_str.rs b/library/std/src/ffi/os_str.rs
index 0fb3964c9a9..a501bcc98cf 100644
--- a/library/std/src/ffi/os_str.rs
+++ b/library/std/src/ffi/os_str.rs
@@ -4,18 +4,15 @@
 mod tests;
 
 use crate::borrow::{Borrow, Cow};
-use crate::cmp;
 use crate::collections::TryReserveError;
-use crate::fmt;
 use crate::hash::{Hash, Hasher};
 use crate::ops::{self, Range};
 use crate::rc::Rc;
-use crate::slice;
 use crate::str::FromStr;
 use crate::sync::Arc;
-
 use crate::sys::os_str::{Buf, Slice};
 use crate::sys_common::{AsInner, FromInner, IntoInner};
+use crate::{cmp, fmt, slice};
 
 /// A type that can represent owned, mutable platform-native strings, but is
 /// cheaply inter-convertible with Rust strings.
diff --git a/library/std/src/fs/tests.rs b/library/std/src/fs/tests.rs
index c1fc2e5488d..13028c4c3b5 100644
--- a/library/std/src/fs/tests.rs
+++ b/library/std/src/fs/tests.rs
@@ -1,20 +1,11 @@
-use crate::io::prelude::*;
-
-use crate::env;
-use crate::fs::{self, File, FileTimes, OpenOptions};
-use crate::io::{BorrowedBuf, ErrorKind, SeekFrom};
-use crate::mem::MaybeUninit;
-use crate::path::Path;
-use crate::str;
-use crate::sync::Arc;
-use crate::sys_common::io::test::{tmpdir, TempDir};
-use crate::thread;
-use crate::time::{Duration, Instant, SystemTime};
-
 use rand::RngCore;
 
 #[cfg(target_os = "macos")]
 use crate::ffi::{c_char, c_int};
+use crate::fs::{self, File, FileTimes, OpenOptions};
+use crate::io::prelude::*;
+use crate::io::{BorrowedBuf, ErrorKind, SeekFrom};
+use crate::mem::MaybeUninit;
 #[cfg(unix)]
 use crate::os::unix::fs::symlink as symlink_dir;
 #[cfg(unix)]
@@ -23,8 +14,13 @@ use crate::os::unix::fs::symlink as symlink_file;
 use crate::os::unix::fs::symlink as junction_point;
 #[cfg(windows)]
 use crate::os::windows::fs::{junction_point, symlink_dir, symlink_file, OpenOptionsExt};
+use crate::path::Path;
+use crate::sync::Arc;
 #[cfg(target_os = "macos")]
 use crate::sys::weak::weak;
+use crate::sys_common::io::test::{tmpdir, TempDir};
+use crate::time::{Duration, Instant, SystemTime};
+use crate::{env, str, thread};
 
 macro_rules! check {
     ($e:expr) => {
@@ -1514,7 +1510,9 @@ fn symlink_hard_link() {
 #[test]
 #[cfg(windows)]
 fn create_dir_long_paths() {
-    use crate::{ffi::OsStr, iter, os::windows::ffi::OsStrExt};
+    use crate::ffi::OsStr;
+    use crate::iter;
+    use crate::os::windows::ffi::OsStrExt;
     const PATH_LEN: usize = 247;
 
     let tmpdir = tmpdir();
diff --git a/library/std/src/hash/random.rs b/library/std/src/hash/random.rs
index 0adf91e14ac..8ef45172eac 100644
--- a/library/std/src/hash/random.rs
+++ b/library/std/src/hash/random.rs
@@ -10,8 +10,7 @@
 #[allow(deprecated)]
 use super::{BuildHasher, Hasher, SipHasher13};
 use crate::cell::Cell;
-use crate::fmt;
-use crate::sys;
+use crate::{fmt, sys};
 
 /// `RandomState` is the default state for [`HashMap`] types.
 ///
diff --git a/library/std/src/io/buffered/bufreader.rs b/library/std/src/io/buffered/bufreader.rs
index 0cdc49c87d8..f11dd50c5e2 100644
--- a/library/std/src/io/buffered/bufreader.rs
+++ b/library/std/src/io/buffered/bufreader.rs
@@ -1,11 +1,12 @@
 mod buffer;
 
+use buffer::Buffer;
+
 use crate::fmt;
 use crate::io::{
     self, uninlined_slow_read_byte, BorrowedCursor, BufRead, IoSliceMut, Read, Seek, SeekFrom,
     SizeHint, SpecReadByte, DEFAULT_BUF_SIZE,
 };
-use buffer::Buffer;
 
 /// The `BufReader<R>` struct adds buffering to any reader.
 ///
diff --git a/library/std/src/io/buffered/bufwriter.rs b/library/std/src/io/buffered/bufwriter.rs
index a8680e9b6ea..21650d46744 100644
--- a/library/std/src/io/buffered/bufwriter.rs
+++ b/library/std/src/io/buffered/bufwriter.rs
@@ -1,10 +1,8 @@
-use crate::error;
-use crate::fmt;
 use crate::io::{
     self, ErrorKind, IntoInnerError, IoSlice, Seek, SeekFrom, Write, DEFAULT_BUF_SIZE,
 };
 use crate::mem::{self, ManuallyDrop};
-use crate::ptr;
+use crate::{error, fmt, ptr};
 
 /// Wraps a writer and buffers its output.
 ///
diff --git a/library/std/src/io/buffered/linewriter.rs b/library/std/src/io/buffered/linewriter.rs
index 3d4ae704193..cc6921b86dd 100644
--- a/library/std/src/io/buffered/linewriter.rs
+++ b/library/std/src/io/buffered/linewriter.rs
@@ -1,5 +1,6 @@
 use crate::fmt;
-use crate::io::{self, buffered::LineWriterShim, BufWriter, IntoInnerError, IoSlice, Write};
+use crate::io::buffered::LineWriterShim;
+use crate::io::{self, BufWriter, IntoInnerError, IoSlice, Write};
 
 /// Wraps a writer and buffers output to it, flushing whenever a newline
 /// (`0x0a`, `'\n'`) is detected.
diff --git a/library/std/src/io/buffered/linewritershim.rs b/library/std/src/io/buffered/linewritershim.rs
index a1f3317bdd8..3d04ccd1c7d 100644
--- a/library/std/src/io/buffered/linewritershim.rs
+++ b/library/std/src/io/buffered/linewritershim.rs
@@ -1,6 +1,7 @@
-use crate::io::{self, BufWriter, IoSlice, Write};
 use core::slice::memchr;
 
+use crate::io::{self, BufWriter, IoSlice, Write};
+
 /// Private helper struct for implementing the line-buffered writing logic.
 ///
 /// This shim temporarily wraps a BufWriter, and uses its internals to
diff --git a/library/std/src/io/buffered/mod.rs b/library/std/src/io/buffered/mod.rs
index d4dc8291131..475d877528f 100644
--- a/library/std/src/io/buffered/mod.rs
+++ b/library/std/src/io/buffered/mod.rs
@@ -8,16 +8,14 @@ mod linewritershim;
 #[cfg(test)]
 mod tests;
 
-use crate::error;
-use crate::fmt;
-use crate::io::Error;
+#[stable(feature = "bufwriter_into_parts", since = "1.56.0")]
+pub use bufwriter::WriterPanicked;
+use linewritershim::LineWriterShim;
 
 #[stable(feature = "rust1", since = "1.0.0")]
 pub use self::{bufreader::BufReader, bufwriter::BufWriter, linewriter::LineWriter};
-use linewritershim::LineWriterShim;
-
-#[stable(feature = "bufwriter_into_parts", since = "1.56.0")]
-pub use bufwriter::WriterPanicked;
+use crate::io::Error;
+use crate::{error, fmt};
 
 /// An error returned by [`BufWriter::into_inner`] which combines an error that
 /// happened while writing out the buffer, and the buffered writer object
diff --git a/library/std/src/io/buffered/tests.rs b/library/std/src/io/buffered/tests.rs
index ab66deaf31d..d89ecd317d6 100644
--- a/library/std/src/io/buffered/tests.rs
+++ b/library/std/src/io/buffered/tests.rs
@@ -3,9 +3,8 @@ use crate::io::{
     self, BorrowedBuf, BufReader, BufWriter, ErrorKind, IoSlice, LineWriter, SeekFrom,
 };
 use crate::mem::MaybeUninit;
-use crate::panic;
 use crate::sync::atomic::{AtomicUsize, Ordering};
-use crate::thread;
+use crate::{panic, thread};
 
 /// A dummy reader intended at testing short-reads propagation.
 pub struct ShortReader {
diff --git a/library/std/src/io/copy/tests.rs b/library/std/src/io/copy/tests.rs
index a1f909a3c53..7e08826a7e1 100644
--- a/library/std/src/io/copy/tests.rs
+++ b/library/std/src/io/copy/tests.rs
@@ -119,13 +119,12 @@ fn copy_specializes_from_slice() {
 
 #[cfg(unix)]
 mod io_benches {
-    use crate::fs::File;
-    use crate::fs::OpenOptions;
+    use test::Bencher;
+
+    use crate::fs::{File, OpenOptions};
     use crate::io::prelude::*;
     use crate::io::BufReader;
 
-    use test::Bencher;
-
     #[bench]
     fn bench_copy_buf_reader(b: &mut Bencher) {
         let mut file_in = File::open("/dev/zero").expect("opening /dev/zero failed");
diff --git a/library/std/src/io/cursor.rs b/library/std/src/io/cursor.rs
index 2ed64a40495..dd32d77934a 100644
--- a/library/std/src/io/cursor.rs
+++ b/library/std/src/io/cursor.rs
@@ -1,10 +1,9 @@
 #[cfg(test)]
 mod tests;
 
-use crate::io::prelude::*;
-
 use crate::alloc::Allocator;
 use crate::cmp;
+use crate::io::prelude::*;
 use crate::io::{self, BorrowedCursor, ErrorKind, IoSlice, IoSliceMut, SeekFrom};
 
 /// A `Cursor` wraps an in-memory buffer and provides it with a
diff --git a/library/std/src/io/error.rs b/library/std/src/io/error.rs
index 32c0ec53ff2..e8ae1d99fbf 100644
--- a/library/std/src/io/error.rs
+++ b/library/std/src/io/error.rs
@@ -11,10 +11,7 @@ mod repr_unpacked;
 #[cfg(any(not(target_pointer_width = "64"), target_os = "uefi"))]
 use repr_unpacked::Repr;
 
-use crate::error;
-use crate::fmt;
-use crate::result;
-use crate::sys;
+use crate::{error, fmt, result, sys};
 
 /// A specialized [`Result`] type for I/O operations.
 ///
diff --git a/library/std/src/io/error/repr_bitpacked.rs b/library/std/src/io/error/repr_bitpacked.rs
index fbb74967df3..9d3ade46bd9 100644
--- a/library/std/src/io/error/repr_bitpacked.rs
+++ b/library/std/src/io/error/repr_bitpacked.rs
@@ -102,10 +102,11 @@
 //! to use a pointer type to store something that may hold an integer, some of
 //! the time.
 
-use super::{Custom, ErrorData, ErrorKind, RawOsError, SimpleMessage};
 use core::marker::PhantomData;
 use core::ptr::{self, NonNull};
 
+use super::{Custom, ErrorData, ErrorKind, RawOsError, SimpleMessage};
+
 // The 2 least-significant bits are used as tag.
 const TAG_MASK: usize = 0b11;
 const TAG_SIMPLE_MESSAGE: usize = 0b00;
diff --git a/library/std/src/io/error/tests.rs b/library/std/src/io/error/tests.rs
index fc6db2825e8..064e2e36b7a 100644
--- a/library/std/src/io/error/tests.rs
+++ b/library/std/src/io/error/tests.rs
@@ -1,10 +1,9 @@
 use super::{const_io_error, Custom, Error, ErrorData, ErrorKind, Repr, SimpleMessage};
 use crate::assert_matches::assert_matches;
-use crate::error;
-use crate::fmt;
 use crate::mem::size_of;
 use crate::sys::decode_error_kind;
 use crate::sys::os::error_string;
+use crate::{error, fmt};
 
 #[test]
 fn test_size() {
@@ -95,7 +94,8 @@ fn test_errorkind_packing() {
 
 #[test]
 fn test_simple_message_packing() {
-    use super::{ErrorKind::*, SimpleMessage};
+    use super::ErrorKind::*;
+    use super::SimpleMessage;
     macro_rules! check_simple_msg {
         ($err:expr, $kind:ident, $msg:literal) => {{
             let e = &$err;
diff --git a/library/std/src/io/impls.rs b/library/std/src/io/impls.rs
index a8a2e9413e1..85023540a81 100644
--- a/library/std/src/io/impls.rs
+++ b/library/std/src/io/impls.rs
@@ -2,12 +2,9 @@
 mod tests;
 
 use crate::alloc::Allocator;
-use crate::cmp;
 use crate::collections::VecDeque;
-use crate::fmt;
 use crate::io::{self, BorrowedCursor, BufRead, IoSlice, IoSliceMut, Read, Seek, SeekFrom, Write};
-use crate::mem;
-use crate::str;
+use crate::{cmp, fmt, mem, str};
 
 // =============================================================================
 // Forwarding implementations
diff --git a/library/std/src/io/mod.rs b/library/std/src/io/mod.rs
index beb88106f1c..63338c934b5 100644
--- a/library/std/src/io/mod.rs
+++ b/library/std/src/io/mod.rs
@@ -297,15 +297,12 @@
 #[cfg(test)]
 mod tests;
 
-use crate::cmp;
-use crate::fmt;
-use crate::mem::take;
-use crate::ops::{Deref, DerefMut};
-use crate::slice;
-use crate::str;
-use crate::sys;
+#[unstable(feature = "read_buf", issue = "78485")]
+pub use core::io::{BorrowedBuf, BorrowedCursor};
 use core::slice::memchr;
 
+pub(crate) use error::const_io_error;
+
 #[stable(feature = "bufwriter_into_parts", since = "1.56.0")]
 pub use self::buffered::WriterPanicked;
 #[unstable(feature = "raw_os_error_ty", issue = "107792")]
@@ -328,10 +325,9 @@ pub use self::{
     stdio::{stderr, stdin, stdout, Stderr, StderrLock, Stdin, StdinLock, Stdout, StdoutLock},
     util::{empty, repeat, sink, Empty, Repeat, Sink},
 };
-
-#[unstable(feature = "read_buf", issue = "78485")]
-pub use core::io::{BorrowedBuf, BorrowedCursor};
-pub(crate) use error::const_io_error;
+use crate::mem::take;
+use crate::ops::{Deref, DerefMut};
+use crate::{cmp, fmt, slice, str, sys};
 
 mod buffered;
 pub(crate) mod copy;
diff --git a/library/std/src/io/stdio.rs b/library/std/src/io/stdio.rs
index 10eb8dae48e..6de069a518e 100644
--- a/library/std/src/io/stdio.rs
+++ b/library/std/src/io/stdio.rs
@@ -3,11 +3,10 @@
 #[cfg(test)]
 mod tests;
 
-use crate::io::prelude::*;
-
 use crate::cell::{Cell, RefCell};
 use crate::fmt;
 use crate::fs::File;
+use crate::io::prelude::*;
 use crate::io::{
     self, BorrowedCursor, BufReader, IoSlice, IoSliceMut, LineWriter, Lines, SpecReadByte,
 };
diff --git a/library/std/src/io/tests.rs b/library/std/src/io/tests.rs
index f613626bca8..9a1cbb2627f 100644
--- a/library/std/src/io/tests.rs
+++ b/library/std/src/io/tests.rs
@@ -1,7 +1,8 @@
 use super::{repeat, BorrowedBuf, Cursor, SeekFrom};
 use crate::cmp::{self, min};
-use crate::io::{self, IoSlice, IoSliceMut, DEFAULT_BUF_SIZE};
-use crate::io::{BufRead, BufReader, Read, Seek, Write};
+use crate::io::{
+    self, BufRead, BufReader, IoSlice, IoSliceMut, Read, Seek, Write, DEFAULT_BUF_SIZE,
+};
 use crate::mem::MaybeUninit;
 use crate::ops::Deref;
 
diff --git a/library/std/src/io/util/tests.rs b/library/std/src/io/util/tests.rs
index 6de91e29c77..1dff3f3832b 100644
--- a/library/std/src/io/util/tests.rs
+++ b/library/std/src/io/util/tests.rs
@@ -1,6 +1,5 @@
 use crate::io::prelude::*;
 use crate::io::{empty, repeat, sink, BorrowedBuf, Empty, Repeat, SeekFrom, Sink};
-
 use crate::mem::MaybeUninit;
 
 #[test]
diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs
index 353fd8d2de8..6dc74728dfd 100644
--- a/library/std/src/lib.rs
+++ b/library/std/src/lib.rs
@@ -471,24 +471,6 @@ pub mod rt;
 pub mod prelude;
 
 #[stable(feature = "rust1", since = "1.0.0")]
-pub use alloc_crate::borrow;
-#[stable(feature = "rust1", since = "1.0.0")]
-pub use alloc_crate::boxed;
-#[stable(feature = "rust1", since = "1.0.0")]
-pub use alloc_crate::fmt;
-#[stable(feature = "rust1", since = "1.0.0")]
-pub use alloc_crate::format;
-#[stable(feature = "rust1", since = "1.0.0")]
-pub use alloc_crate::rc;
-#[stable(feature = "rust1", since = "1.0.0")]
-pub use alloc_crate::slice;
-#[stable(feature = "rust1", since = "1.0.0")]
-pub use alloc_crate::str;
-#[stable(feature = "rust1", since = "1.0.0")]
-pub use alloc_crate::string;
-#[stable(feature = "rust1", since = "1.0.0")]
-pub use alloc_crate::vec;
-#[stable(feature = "rust1", since = "1.0.0")]
 pub use core::any;
 #[stable(feature = "core_array", since = "1.36.0")]
 pub use core::array;
@@ -565,6 +547,25 @@ pub use core::u8;
 #[allow(deprecated, deprecated_in_future)]
 pub use core::usize;
 
+#[stable(feature = "rust1", since = "1.0.0")]
+pub use alloc_crate::borrow;
+#[stable(feature = "rust1", since = "1.0.0")]
+pub use alloc_crate::boxed;
+#[stable(feature = "rust1", since = "1.0.0")]
+pub use alloc_crate::fmt;
+#[stable(feature = "rust1", since = "1.0.0")]
+pub use alloc_crate::format;
+#[stable(feature = "rust1", since = "1.0.0")]
+pub use alloc_crate::rc;
+#[stable(feature = "rust1", since = "1.0.0")]
+pub use alloc_crate::slice;
+#[stable(feature = "rust1", since = "1.0.0")]
+pub use alloc_crate::str;
+#[stable(feature = "rust1", since = "1.0.0")]
+pub use alloc_crate::string;
+#[stable(feature = "rust1", since = "1.0.0")]
+pub use alloc_crate::vec;
+
 #[unstable(feature = "f128", issue = "116909")]
 pub mod f128;
 #[unstable(feature = "f16", issue = "116909")]
@@ -609,9 +610,10 @@ pub mod simd {
     #![doc = include_str!("../../portable-simd/crates/core_simd/src/core_simd_docs.md")]
 
     #[doc(inline)]
-    pub use crate::std_float::StdFloat;
-    #[doc(inline)]
     pub use core::simd::*;
+
+    #[doc(inline)]
+    pub use crate::std_float::StdFloat;
 }
 
 #[stable(feature = "futures_api", since = "1.36.0")]
@@ -619,12 +621,11 @@ pub mod task {
     //! Types and Traits for working with asynchronous tasks.
 
     #[doc(inline)]
-    #[stable(feature = "futures_api", since = "1.36.0")]
-    pub use core::task::*;
-
-    #[doc(inline)]
     #[stable(feature = "wake_trait", since = "1.51.0")]
     pub use alloc::task::*;
+    #[doc(inline)]
+    #[stable(feature = "futures_api", since = "1.36.0")]
+    pub use core::task::*;
 }
 
 #[doc = include_str!("../../stdarch/crates/core_arch/src/core_arch_docs.md")]
@@ -670,34 +671,30 @@ mod panicking;
 mod backtrace_rs;
 
 // Re-export macros defined in core.
-#[stable(feature = "rust1", since = "1.0.0")]
-#[allow(deprecated, deprecated_in_future)]
-pub use core::{
-    assert_eq, assert_ne, debug_assert, debug_assert_eq, debug_assert_ne, matches, todo, r#try,
-    unimplemented, unreachable, write, writeln,
-};
-
-// Re-export built-in macros defined through core.
-#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
-#[allow(deprecated)]
-pub use core::{
-    assert, assert_matches, cfg, column, compile_error, concat, concat_idents, const_format_args,
-    env, file, format_args, format_args_nl, include, include_bytes, include_str, line, log_syntax,
-    module_path, option_env, stringify, trace_macros,
-};
-
+#[unstable(feature = "cfg_match", issue = "115585")]
+pub use core::cfg_match;
 #[unstable(
     feature = "concat_bytes",
     issue = "87555",
     reason = "`concat_bytes` is not stable enough for use and is subject to change"
 )]
 pub use core::concat_bytes;
-
-#[unstable(feature = "cfg_match", issue = "115585")]
-pub use core::cfg_match;
-
 #[stable(feature = "core_primitive", since = "1.43.0")]
 pub use core::primitive;
+// Re-export built-in macros defined through core.
+#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
+#[allow(deprecated)]
+pub use core::{
+    assert, assert_matches, cfg, column, compile_error, concat, concat_idents, const_format_args,
+    env, file, format_args, format_args_nl, include, include_bytes, include_str, line, log_syntax,
+    module_path, option_env, stringify, trace_macros,
+};
+#[stable(feature = "rust1", since = "1.0.0")]
+#[allow(deprecated, deprecated_in_future)]
+pub use core::{
+    assert_eq, assert_ne, debug_assert, debug_assert_eq, debug_assert_ne, matches, todo, r#try,
+    unimplemented, unreachable, write, writeln,
+};
 
 // Include a number of private modules that exist solely to provide
 // the rustdoc documentation for primitive types. Using `include!`
diff --git a/library/std/src/net/ip_addr.rs b/library/std/src/net/ip_addr.rs
index e167fbd1b9c..8a9426b61f9 100644
--- a/library/std/src/net/ip_addr.rs
+++ b/library/std/src/net/ip_addr.rs
@@ -2,17 +2,15 @@
 #[cfg(all(test, not(target_os = "emscripten")))]
 mod tests;
 
-use crate::sys::net::netc as c;
-use crate::sys_common::{FromInner, IntoInner};
-
 #[stable(feature = "ip_addr", since = "1.7.0")]
 pub use core::net::IpAddr;
-
+#[unstable(feature = "ip", issue = "27709")]
+pub use core::net::Ipv6MulticastScope;
 #[stable(feature = "rust1", since = "1.0.0")]
 pub use core::net::{Ipv4Addr, Ipv6Addr};
 
-#[unstable(feature = "ip", issue = "27709")]
-pub use core::net::Ipv6MulticastScope;
+use crate::sys::net::netc as c;
+use crate::sys_common::{FromInner, IntoInner};
 
 impl IntoInner<c::in_addr> for Ipv4Addr {
     #[inline]
diff --git a/library/std/src/net/mod.rs b/library/std/src/net/mod.rs
index 858776f1446..3b19c743b1e 100644
--- a/library/std/src/net/mod.rs
+++ b/library/std/src/net/mod.rs
@@ -21,7 +21,8 @@
 
 #![stable(feature = "rust1", since = "1.0.0")]
 
-use crate::io::{self, ErrorKind};
+#[stable(feature = "rust1", since = "1.0.0")]
+pub use core::net::AddrParseError;
 
 #[stable(feature = "rust1", since = "1.0.0")]
 pub use self::ip_addr::{IpAddr, Ipv4Addr, Ipv6Addr, Ipv6MulticastScope};
@@ -33,8 +34,7 @@ pub use self::tcp::IntoIncoming;
 pub use self::tcp::{Incoming, TcpListener, TcpStream};
 #[stable(feature = "rust1", since = "1.0.0")]
 pub use self::udp::UdpSocket;
-#[stable(feature = "rust1", since = "1.0.0")]
-pub use core::net::AddrParseError;
+use crate::io::{self, ErrorKind};
 
 mod ip_addr;
 mod socket_addr;
diff --git a/library/std/src/net/socket_addr.rs b/library/std/src/net/socket_addr.rs
index 421fed9077c..84922aabdb5 100644
--- a/library/std/src/net/socket_addr.rs
+++ b/library/std/src/net/socket_addr.rs
@@ -2,19 +2,14 @@
 #[cfg(all(test, not(target_os = "emscripten")))]
 mod tests;
 
-use crate::io;
-use crate::iter;
-use crate::mem;
+#[stable(feature = "rust1", since = "1.0.0")]
+pub use core::net::{SocketAddr, SocketAddrV4, SocketAddrV6};
+
 use crate::net::{IpAddr, Ipv4Addr, Ipv6Addr};
-use crate::option;
-use crate::slice;
 use crate::sys::net::netc as c;
 use crate::sys_common::net::LookupHost;
 use crate::sys_common::{FromInner, IntoInner};
-use crate::vec;
-
-#[stable(feature = "rust1", since = "1.0.0")]
-pub use core::net::{SocketAddr, SocketAddrV4, SocketAddrV6};
+use crate::{io, iter, mem, option, slice, vec};
 
 impl FromInner<c::sockaddr_in> for SocketAddrV4 {
     fn from_inner(addr: c::sockaddr_in) -> SocketAddrV4 {
diff --git a/library/std/src/net/tcp.rs b/library/std/src/net/tcp.rs
index 6336354239b..22d2dfe65a2 100644
--- a/library/std/src/net/tcp.rs
+++ b/library/std/src/net/tcp.rs
@@ -3,14 +3,12 @@
 #[cfg(all(test, not(any(target_os = "emscripten", target_os = "xous"))))]
 mod tests;
 
-use crate::io::prelude::*;
-
 use crate::fmt;
+use crate::io::prelude::*;
 use crate::io::{self, BorrowedCursor, IoSlice, IoSliceMut};
 use crate::iter::FusedIterator;
 use crate::net::{Shutdown, SocketAddr, ToSocketAddrs};
-use crate::sys_common::net as net_imp;
-use crate::sys_common::{AsInner, FromInner, IntoInner};
+use crate::sys_common::{net as net_imp, AsInner, FromInner, IntoInner};
 use crate::time::Duration;
 
 /// A TCP stream between a local and a remote socket.
diff --git a/library/std/src/net/tcp/tests.rs b/library/std/src/net/tcp/tests.rs
index 3ad046733a6..d26517d74e4 100644
--- a/library/std/src/net/tcp/tests.rs
+++ b/library/std/src/net/tcp/tests.rs
@@ -1,12 +1,11 @@
-use crate::fmt;
 use crate::io::prelude::*;
 use crate::io::{BorrowedBuf, IoSlice, IoSliceMut};
 use crate::mem::MaybeUninit;
 use crate::net::test::{next_test_ip4, next_test_ip6};
 use crate::net::*;
 use crate::sync::mpsc::channel;
-use crate::thread;
 use crate::time::{Duration, Instant};
+use crate::{fmt, thread};
 
 fn each_ip(f: &mut dyn FnMut(SocketAddr)) {
     f(next_test_ip4());
diff --git a/library/std/src/net/udp.rs b/library/std/src/net/udp.rs
index 60347a11da9..32e9086003d 100644
--- a/library/std/src/net/udp.rs
+++ b/library/std/src/net/udp.rs
@@ -4,8 +4,7 @@ mod tests;
 use crate::fmt;
 use crate::io::{self, ErrorKind};
 use crate::net::{Ipv4Addr, Ipv6Addr, SocketAddr, ToSocketAddrs};
-use crate::sys_common::net as net_imp;
-use crate::sys_common::{AsInner, FromInner, IntoInner};
+use crate::sys_common::{net as net_imp, AsInner, FromInner, IntoInner};
 use crate::time::Duration;
 
 /// A UDP socket.
diff --git a/library/std/src/num.rs b/library/std/src/num.rs
index 8910cdea7c0..c1e6e7e628c 100644
--- a/library/std/src/num.rs
+++ b/library/std/src/num.rs
@@ -9,32 +9,27 @@
 #[cfg(test)]
 mod tests;
 
+#[stable(feature = "int_error_matching", since = "1.55.0")]
+pub use core::num::IntErrorKind;
+#[stable(feature = "generic_nonzero", since = "1.79.0")]
+pub use core::num::NonZero;
 #[stable(feature = "saturating_int_impl", since = "1.74.0")]
 pub use core::num::Saturating;
 #[stable(feature = "rust1", since = "1.0.0")]
 pub use core::num::Wrapping;
-#[stable(feature = "rust1", since = "1.0.0")]
-pub use core::num::{FpCategory, ParseFloatError, ParseIntError, TryFromIntError};
-
 #[unstable(
     feature = "nonzero_internals",
     reason = "implementation detail which may disappear or be replaced at any time",
     issue = "none"
 )]
 pub use core::num::ZeroablePrimitive;
-
-#[stable(feature = "generic_nonzero", since = "1.79.0")]
-pub use core::num::NonZero;
-
+#[stable(feature = "rust1", since = "1.0.0")]
+pub use core::num::{FpCategory, ParseFloatError, ParseIntError, TryFromIntError};
 #[stable(feature = "signed_nonzero", since = "1.34.0")]
 pub use core::num::{NonZeroI128, NonZeroI16, NonZeroI32, NonZeroI64, NonZeroI8, NonZeroIsize};
-
 #[stable(feature = "nonzero", since = "1.28.0")]
 pub use core::num::{NonZeroU128, NonZeroU16, NonZeroU32, NonZeroU64, NonZeroU8, NonZeroUsize};
 
-#[stable(feature = "int_error_matching", since = "1.55.0")]
-pub use core::num::IntErrorKind;
-
 #[cfg(test)]
 use crate::fmt;
 #[cfg(test)]
diff --git a/library/std/src/os/aix/raw.rs b/library/std/src/os/aix/raw.rs
index b4c8dc72cfe..13f61fc9722 100644
--- a/library/std/src/os/aix/raw.rs
+++ b/library/std/src/os/aix/raw.rs
@@ -4,6 +4,5 @@
 
 #[stable(feature = "pthread_t", since = "1.8.0")]
 pub use libc::pthread_t;
-
 #[stable(feature = "raw_ext", since = "1.1.0")]
 pub use libc::{blkcnt_t, blksize_t, dev_t, ino_t, mode_t, nlink_t, off_t, stat, time_t};
diff --git a/library/std/src/os/android/fs.rs b/library/std/src/os/android/fs.rs
index 1beb3cf6e84..6b931e38169 100644
--- a/library/std/src/os/android/fs.rs
+++ b/library/std/src/os/android/fs.rs
@@ -1,10 +1,9 @@
 #![stable(feature = "metadata_ext", since = "1.1.0")]
 
 use crate::fs::Metadata;
-use crate::sys_common::AsInner;
-
 #[allow(deprecated)]
 use crate::os::android::raw;
+use crate::sys_common::AsInner;
 
 /// OS-specific extensions to [`fs::Metadata`].
 ///
diff --git a/library/std/src/os/android/net.rs b/library/std/src/os/android/net.rs
index 349e73eaabd..960a304fd0c 100644
--- a/library/std/src/os/android/net.rs
+++ b/library/std/src/os/android/net.rs
@@ -4,9 +4,7 @@
 
 #[stable(feature = "unix_socket_abstract", since = "1.70.0")]
 pub use crate::os::net::linux_ext::addr::SocketAddrExt;
-
 #[unstable(feature = "unix_socket_ancillary_data", issue = "76915")]
 pub use crate::os::net::linux_ext::socket::UnixSocketExt;
-
 #[unstable(feature = "tcp_quickack", issue = "96256")]
 pub use crate::os::net::linux_ext::tcp::TcpStreamExt;
diff --git a/library/std/src/os/darwin/fs.rs b/library/std/src/os/darwin/fs.rs
index 2032cca311a..2d154b214b5 100644
--- a/library/std/src/os/darwin/fs.rs
+++ b/library/std/src/os/darwin/fs.rs
@@ -1,13 +1,12 @@
 #![allow(dead_code)]
 
+#[allow(deprecated)]
+use super::raw;
 use crate::fs::{self, Metadata};
 use crate::sealed::Sealed;
 use crate::sys_common::{AsInner, AsInnerMut, IntoInner};
 use crate::time::SystemTime;
 
-#[allow(deprecated)]
-use super::raw;
-
 /// OS-specific extensions to [`fs::Metadata`].
 ///
 /// [`fs::Metadata`]: crate::fs::Metadata
diff --git a/library/std/src/os/dragonfly/fs.rs b/library/std/src/os/dragonfly/fs.rs
index 1424fc4c698..0cd543b2ab9 100644
--- a/library/std/src/os/dragonfly/fs.rs
+++ b/library/std/src/os/dragonfly/fs.rs
@@ -1,10 +1,9 @@
 #![stable(feature = "metadata_ext", since = "1.1.0")]
 
 use crate::fs::Metadata;
-use crate::sys_common::AsInner;
-
 #[allow(deprecated)]
 use crate::os::dragonfly::raw;
+use crate::sys_common::AsInner;
 
 /// OS-specific extensions to [`fs::Metadata`].
 ///
diff --git a/library/std/src/os/emscripten/fs.rs b/library/std/src/os/emscripten/fs.rs
index d5ec8e03c00..3282b79ac1c 100644
--- a/library/std/src/os/emscripten/fs.rs
+++ b/library/std/src/os/emscripten/fs.rs
@@ -1,10 +1,9 @@
 #![stable(feature = "metadata_ext", since = "1.1.0")]
 
 use crate::fs::Metadata;
-use crate::sys_common::AsInner;
-
 #[allow(deprecated)]
 use crate::os::emscripten::raw;
+use crate::sys_common::AsInner;
 
 /// OS-specific extensions to [`fs::Metadata`].
 ///
diff --git a/library/std/src/os/espidf/fs.rs b/library/std/src/os/espidf/fs.rs
index 88701dafe20..ffff584cda0 100644
--- a/library/std/src/os/espidf/fs.rs
+++ b/library/std/src/os/espidf/fs.rs
@@ -1,10 +1,9 @@
 #![stable(feature = "metadata_ext", since = "1.1.0")]
 
 use crate::fs::Metadata;
-use crate::sys_common::AsInner;
-
 #[allow(deprecated)]
 use crate::os::espidf::raw;
+use crate::sys_common::AsInner;
 
 /// OS-specific extensions to [`fs::Metadata`].
 ///
diff --git a/library/std/src/os/fd/owned.rs b/library/std/src/os/fd/owned.rs
index 3baba14f75e..2d087c03b04 100644
--- a/library/std/src/os/fd/owned.rs
+++ b/library/std/src/os/fd/owned.rs
@@ -4,14 +4,12 @@
 #![deny(unsafe_op_in_unsafe_fn)]
 
 use super::raw::{AsRawFd, FromRawFd, IntoRawFd, RawFd};
-use crate::fmt;
-use crate::fs;
-use crate::io;
 use crate::marker::PhantomData;
 use crate::mem::ManuallyDrop;
 #[cfg(not(any(target_arch = "wasm32", target_env = "sgx", target_os = "hermit")))]
 use crate::sys::cvt;
 use crate::sys_common::{AsInner, FromInner, IntoInner};
+use crate::{fmt, fs, io};
 
 /// A borrowed file descriptor.
 ///
diff --git a/library/std/src/os/fd/raw.rs b/library/std/src/os/fd/raw.rs
index ef896ea95c9..1e6ecd7d7a6 100644
--- a/library/std/src/os/fd/raw.rs
+++ b/library/std/src/os/fd/raw.rs
@@ -2,8 +2,9 @@
 
 #![stable(feature = "rust1", since = "1.0.0")]
 
-use crate::fs;
-use crate::io;
+#[cfg(target_os = "hermit")]
+use hermit_abi as libc;
+
 #[cfg(target_os = "hermit")]
 use crate::os::hermit::io::OwnedFd;
 #[cfg(not(target_os = "hermit"))]
@@ -15,8 +16,7 @@ use crate::os::unix::io::OwnedFd;
 #[cfg(target_os = "wasi")]
 use crate::os::wasi::io::OwnedFd;
 use crate::sys_common::{AsInner, IntoInner};
-#[cfg(target_os = "hermit")]
-use hermit_abi as libc;
+use crate::{fs, io};
 
 /// Raw file descriptors.
 #[rustc_allowed_through_unstable_modules]
diff --git a/library/std/src/os/fortanix_sgx/arch.rs b/library/std/src/os/fortanix_sgx/arch.rs
index 8358cb9e81b..4c8048e7152 100644
--- a/library/std/src/os/fortanix_sgx/arch.rs
+++ b/library/std/src/os/fortanix_sgx/arch.rs
@@ -4,9 +4,10 @@
 //! Software Developer's Manual, Volume 3, Chapter 40.
 #![unstable(feature = "sgx_platform", issue = "56975")]
 
-use crate::mem::MaybeUninit;
 use core::arch::asm;
 
+use crate::mem::MaybeUninit;
+
 /// Wrapper struct to force 16-byte alignment.
 #[repr(align(16))]
 #[unstable(feature = "sgx_platform", issue = "56975")]
diff --git a/library/std/src/os/fortanix_sgx/mod.rs b/library/std/src/os/fortanix_sgx/mod.rs
index b31dc06f8df..64f4d97ca95 100644
--- a/library/std/src/os/fortanix_sgx/mod.rs
+++ b/library/std/src/os/fortanix_sgx/mod.rs
@@ -22,20 +22,12 @@ pub mod usercalls {
     /// Lowest-level interfaces to usercalls and usercall ABI type definitions.
     pub mod raw {
         pub use crate::sys::abi::usercalls::raw::{
-            accept_stream, alloc, async_queues, bind_stream, close, connect_stream, exit, flush,
-            free, insecure_time, launch_thread, read, read_alloc, send, wait, write,
-        };
-        pub use crate::sys::abi::usercalls::raw::{do_usercall, Usercalls as UsercallNrs};
-        pub use crate::sys::abi::usercalls::raw::{Register, RegisterArgument, ReturnValue};
-
-        pub use crate::sys::abi::usercalls::raw::Error;
-        pub use crate::sys::abi::usercalls::raw::{
-            ByteBuffer, Cancel, FifoDescriptor, Return, Usercall,
-        };
-        pub use crate::sys::abi::usercalls::raw::{Fd, Result, Tcs};
-        pub use crate::sys::abi::usercalls::raw::{
-            EV_RETURNQ_NOT_EMPTY, EV_UNPARK, EV_USERCALLQ_NOT_FULL, FD_STDERR, FD_STDIN, FD_STDOUT,
-            RESULT_SUCCESS, USERCALL_USER_DEFINED, WAIT_INDEFINITE, WAIT_NO,
+            accept_stream, alloc, async_queues, bind_stream, close, connect_stream, do_usercall,
+            exit, flush, free, insecure_time, launch_thread, read, read_alloc, send, wait, write,
+            ByteBuffer, Cancel, Error, Fd, FifoDescriptor, Register, RegisterArgument, Result,
+            Return, ReturnValue, Tcs, Usercall, Usercalls as UsercallNrs, EV_RETURNQ_NOT_EMPTY,
+            EV_UNPARK, EV_USERCALLQ_NOT_FULL, FD_STDERR, FD_STDIN, FD_STDOUT, RESULT_SUCCESS,
+            USERCALL_USER_DEFINED, WAIT_INDEFINITE, WAIT_NO,
         };
     }
 }
diff --git a/library/std/src/os/freebsd/fs.rs b/library/std/src/os/freebsd/fs.rs
index 5689a82e00a..34384a4bcb5 100644
--- a/library/std/src/os/freebsd/fs.rs
+++ b/library/std/src/os/freebsd/fs.rs
@@ -1,10 +1,9 @@
 #![stable(feature = "metadata_ext", since = "1.1.0")]
 
 use crate::fs::Metadata;
-use crate::sys_common::AsInner;
-
 #[allow(deprecated)]
 use crate::os::freebsd::raw;
+use crate::sys_common::AsInner;
 
 /// OS-specific extensions to [`fs::Metadata`].
 ///
diff --git a/library/std/src/os/haiku/fs.rs b/library/std/src/os/haiku/fs.rs
index a23a2af8f6e..23f6493180b 100644
--- a/library/std/src/os/haiku/fs.rs
+++ b/library/std/src/os/haiku/fs.rs
@@ -1,10 +1,9 @@
 #![stable(feature = "metadata_ext", since = "1.1.0")]
 
 use crate::fs::Metadata;
-use crate::sys_common::AsInner;
-
 #[allow(deprecated)]
 use crate::os::haiku::raw;
+use crate::sys_common::AsInner;
 
 /// OS-specific extensions to [`fs::Metadata`].
 ///
diff --git a/library/std/src/os/hermit/io/net.rs b/library/std/src/os/hermit/io/net.rs
index 8f3802d7873..7a774345b23 100644
--- a/library/std/src/os/hermit/io/net.rs
+++ b/library/std/src/os/hermit/io/net.rs
@@ -1,5 +1,4 @@
-use crate::os::hermit::io::OwnedFd;
-use crate::os::hermit::io::{AsRawFd, FromRawFd, IntoRawFd, RawFd};
+use crate::os::hermit::io::{AsRawFd, FromRawFd, IntoRawFd, OwnedFd, RawFd};
 use crate::sys_common::{self, AsInner, FromInner, IntoInner};
 use crate::{net, sys};
 
diff --git a/library/std/src/os/illumos/fs.rs b/library/std/src/os/illumos/fs.rs
index 63be48b8131..75dbe167785 100644
--- a/library/std/src/os/illumos/fs.rs
+++ b/library/std/src/os/illumos/fs.rs
@@ -1,10 +1,9 @@
 #![stable(feature = "metadata_ext", since = "1.1.0")]
 
 use crate::fs::Metadata;
-use crate::sys_common::AsInner;
-
 #[allow(deprecated)]
 use crate::os::illumos::raw;
+use crate::sys_common::AsInner;
 
 /// OS-specific extensions to [`fs::Metadata`].
 ///
diff --git a/library/std/src/os/ios/mod.rs b/library/std/src/os/ios/mod.rs
index 5e130d77b7b..52d592ed95a 100644
--- a/library/std/src/os/ios/mod.rs
+++ b/library/std/src/os/ios/mod.rs
@@ -7,7 +7,6 @@ pub mod fs {
     #[doc(inline)]
     #[stable(feature = "file_set_times", since = "1.75.0")]
     pub use crate::os::darwin::fs::FileTimesExt;
-
     #[doc(inline)]
     #[stable(feature = "metadata_ext", since = "1.1.0")]
     pub use crate::os::darwin::fs::MetadataExt;
diff --git a/library/std/src/os/l4re/fs.rs b/library/std/src/os/l4re/fs.rs
index 6d6a535b1e8..0511ddcf19a 100644
--- a/library/std/src/os/l4re/fs.rs
+++ b/library/std/src/os/l4re/fs.rs
@@ -5,10 +5,9 @@
 #![stable(feature = "metadata_ext", since = "1.1.0")]
 
 use crate::fs::Metadata;
-use crate::sys_common::AsInner;
-
 #[allow(deprecated)]
 use crate::os::l4re::raw;
+use crate::sys_common::AsInner;
 
 /// OS-specific extensions to [`fs::Metadata`].
 ///
diff --git a/library/std/src/os/linux/fs.rs b/library/std/src/os/linux/fs.rs
index ab0b2a3eda3..20a7a161a26 100644
--- a/library/std/src/os/linux/fs.rs
+++ b/library/std/src/os/linux/fs.rs
@@ -5,10 +5,9 @@
 #![stable(feature = "metadata_ext", since = "1.1.0")]
 
 use crate::fs::Metadata;
-use crate::sys_common::AsInner;
-
 #[allow(deprecated)]
 use crate::os::linux::raw;
+use crate::sys_common::AsInner;
 
 /// OS-specific extensions to [`fs::Metadata`].
 ///
diff --git a/library/std/src/os/linux/net.rs b/library/std/src/os/linux/net.rs
index f898e705487..1de120c8fd3 100644
--- a/library/std/src/os/linux/net.rs
+++ b/library/std/src/os/linux/net.rs
@@ -4,9 +4,7 @@
 
 #[stable(feature = "unix_socket_abstract", since = "1.70.0")]
 pub use crate::os::net::linux_ext::addr::SocketAddrExt;
-
 #[unstable(feature = "unix_socket_ancillary_data", issue = "76915")]
 pub use crate::os::net::linux_ext::socket::UnixSocketExt;
-
 #[unstable(feature = "tcp_quickack", issue = "96256")]
 pub use crate::os::net::linux_ext::tcp::TcpStreamExt;
diff --git a/library/std/src/os/macos/mod.rs b/library/std/src/os/macos/mod.rs
index 3638406b180..59fe90834c2 100644
--- a/library/std/src/os/macos/mod.rs
+++ b/library/std/src/os/macos/mod.rs
@@ -7,7 +7,6 @@ pub mod fs {
     #[doc(inline)]
     #[stable(feature = "file_set_times", since = "1.75.0")]
     pub use crate::os::darwin::fs::FileTimesExt;
-
     #[doc(inline)]
     #[stable(feature = "metadata_ext", since = "1.1.0")]
     pub use crate::os::darwin::fs::MetadataExt;
diff --git a/library/std/src/os/net/linux_ext/tcp.rs b/library/std/src/os/net/linux_ext/tcp.rs
index ff29afe7ed3..c8d012962d4 100644
--- a/library/std/src/os/net/linux_ext/tcp.rs
+++ b/library/std/src/os/net/linux_ext/tcp.rs
@@ -2,10 +2,9 @@
 //!
 //! [`std::net`]: crate::net
 
-use crate::io;
-use crate::net;
 use crate::sealed::Sealed;
 use crate::sys_common::AsInner;
+use crate::{io, net};
 
 /// Os-specific extensions for [`TcpStream`]
 ///
diff --git a/library/std/src/os/net/linux_ext/tests.rs b/library/std/src/os/net/linux_ext/tests.rs
index f8dbbfc18e2..12f35696abc 100644
--- a/library/std/src/os/net/linux_ext/tests.rs
+++ b/library/std/src/os/net/linux_ext/tests.rs
@@ -1,9 +1,8 @@
 #[test]
 fn quickack() {
-    use crate::{
-        net::{test::next_test_ip4, TcpListener, TcpStream},
-        os::net::linux_ext::tcp::TcpStreamExt,
-    };
+    use crate::net::test::next_test_ip4;
+    use crate::net::{TcpListener, TcpStream};
+    use crate::os::net::linux_ext::tcp::TcpStreamExt;
 
     macro_rules! t {
         ($e:expr) => {
@@ -30,10 +29,9 @@ fn quickack() {
 #[test]
 #[cfg(target_os = "linux")]
 fn deferaccept() {
-    use crate::{
-        net::{test::next_test_ip4, TcpListener, TcpStream},
-        os::net::linux_ext::tcp::TcpStreamExt,
-    };
+    use crate::net::test::next_test_ip4;
+    use crate::net::{TcpListener, TcpStream};
+    use crate::os::net::linux_ext::tcp::TcpStreamExt;
 
     macro_rules! t {
         ($e:expr) => {
diff --git a/library/std/src/os/netbsd/fs.rs b/library/std/src/os/netbsd/fs.rs
index fe0be069e5e..74fbbabb17a 100644
--- a/library/std/src/os/netbsd/fs.rs
+++ b/library/std/src/os/netbsd/fs.rs
@@ -1,10 +1,9 @@
 #![stable(feature = "metadata_ext", since = "1.1.0")]
 
 use crate::fs::Metadata;
-use crate::sys_common::AsInner;
-
 #[allow(deprecated)]
 use crate::os::netbsd::raw;
+use crate::sys_common::AsInner;
 
 /// OS-specific extensions to [`fs::Metadata`].
 ///
diff --git a/library/std/src/os/openbsd/fs.rs b/library/std/src/os/openbsd/fs.rs
index b8d8d31c5b8..e584098476a 100644
--- a/library/std/src/os/openbsd/fs.rs
+++ b/library/std/src/os/openbsd/fs.rs
@@ -1,10 +1,9 @@
 #![stable(feature = "metadata_ext", since = "1.1.0")]
 
 use crate::fs::Metadata;
-use crate::sys_common::AsInner;
-
 #[allow(deprecated)]
 use crate::os::openbsd::raw;
+use crate::sys_common::AsInner;
 
 /// OS-specific extensions to [`fs::Metadata`].
 ///
diff --git a/library/std/src/os/redox/fs.rs b/library/std/src/os/redox/fs.rs
index 682ca6a2c03..c6b813f0cc6 100644
--- a/library/std/src/os/redox/fs.rs
+++ b/library/std/src/os/redox/fs.rs
@@ -1,10 +1,9 @@
 #![stable(feature = "metadata_ext", since = "1.1.0")]
 
 use crate::fs::Metadata;
-use crate::sys_common::AsInner;
-
 #[allow(deprecated)]
 use crate::os::redox::raw;
+use crate::sys_common::AsInner;
 
 /// OS-specific extensions to [`fs::Metadata`].
 ///
diff --git a/library/std/src/os/solaris/fs.rs b/library/std/src/os/solaris/fs.rs
index 09314373704..9b0527d7138 100644
--- a/library/std/src/os/solaris/fs.rs
+++ b/library/std/src/os/solaris/fs.rs
@@ -1,10 +1,9 @@
 #![stable(feature = "metadata_ext", since = "1.1.0")]
 
 use crate::fs::Metadata;
-use crate::sys_common::AsInner;
-
 #[allow(deprecated)]
 use crate::os::solaris::raw;
+use crate::sys_common::AsInner;
 
 /// OS-specific extensions to [`fs::Metadata`].
 ///
diff --git a/library/std/src/os/solid/io.rs b/library/std/src/os/solid/io.rs
index 9834ff60735..9e89d9fbc1b 100644
--- a/library/std/src/os/solid/io.rs
+++ b/library/std/src/os/solid/io.rs
@@ -46,12 +46,10 @@
 
 #![unstable(feature = "solid_ext", issue = "none")]
 
-use crate::fmt;
 use crate::marker::PhantomData;
 use crate::mem::ManuallyDrop;
-use crate::net;
-use crate::sys;
 use crate::sys_common::{self, AsInner, FromInner, IntoInner};
+use crate::{fmt, net, sys};
 
 /// Raw file descriptors.
 pub type RawFd = i32;
diff --git a/library/std/src/os/uefi/env.rs b/library/std/src/os/uefi/env.rs
index 3248ff98ff2..cf8ae697e38 100644
--- a/library/std/src/os/uefi/env.rs
+++ b/library/std/src/os/uefi/env.rs
@@ -2,8 +2,9 @@
 
 #![unstable(feature = "uefi_std", issue = "100499")]
 
+use crate::ffi::c_void;
+use crate::ptr::NonNull;
 use crate::sync::atomic::{AtomicBool, AtomicPtr, Ordering};
-use crate::{ffi::c_void, ptr::NonNull};
 
 static SYSTEM_TABLE: AtomicPtr<c_void> = AtomicPtr::new(crate::ptr::null_mut());
 static IMAGE_HANDLE: AtomicPtr<c_void> = AtomicPtr::new(crate::ptr::null_mut());
diff --git a/library/std/src/os/unix/fs.rs b/library/std/src/os/unix/fs.rs
index 20c472040fa..caf6980afd9 100644
--- a/library/std/src/os/unix/fs.rs
+++ b/library/std/src/os/unix/fs.rs
@@ -4,18 +4,18 @@
 
 #![stable(feature = "rust1", since = "1.0.0")]
 
+#[allow(unused_imports)]
+use io::{Read, Write};
+
 use super::platform::fs::MetadataExt as _;
+// Used for `File::read` on intra-doc links
+use crate::ffi::OsStr;
 use crate::fs::{self, OpenOptions, Permissions};
-use crate::io;
 use crate::os::unix::io::{AsFd, AsRawFd};
 use crate::path::Path;
-use crate::sys;
-use crate::sys_common::{AsInner, AsInnerMut, FromInner};
-// Used for `File::read` on intra-doc links
-use crate::ffi::OsStr;
 use crate::sealed::Sealed;
-#[allow(unused_imports)]
-use io::{Read, Write};
+use crate::sys_common::{AsInner, AsInnerMut, FromInner};
+use crate::{io, sys};
 
 // Tests for this module
 #[cfg(test)]
diff --git a/library/std/src/os/unix/net/datagram.rs b/library/std/src/os/unix/net/datagram.rs
index f58f9b4d9ab..a605c3d4a26 100644
--- a/library/std/src/os/unix/net/datagram.rs
+++ b/library/std/src/os/unix/net/datagram.rs
@@ -1,3 +1,17 @@
+#[cfg(any(
+    target_os = "linux",
+    target_os = "android",
+    target_os = "dragonfly",
+    target_os = "freebsd",
+    target_os = "openbsd",
+    target_os = "netbsd",
+    target_os = "solaris",
+    target_os = "illumos",
+    target_os = "haiku",
+    target_os = "nto",
+))]
+use libc::MSG_NOSIGNAL;
+
 #[cfg(any(doc, target_os = "android", target_os = "linux"))]
 use super::{recv_vectored_with_ancillary_from, send_vectored_with_ancillary_to, SocketAncillary};
 use super::{sockaddr_un, SocketAddr};
@@ -12,20 +26,6 @@ use crate::sys::net::Socket;
 use crate::sys_common::{AsInner, FromInner, IntoInner};
 use crate::time::Duration;
 use crate::{fmt, io};
-
-#[cfg(any(
-    target_os = "linux",
-    target_os = "android",
-    target_os = "dragonfly",
-    target_os = "freebsd",
-    target_os = "openbsd",
-    target_os = "netbsd",
-    target_os = "solaris",
-    target_os = "illumos",
-    target_os = "haiku",
-    target_os = "nto",
-))]
-use libc::MSG_NOSIGNAL;
 #[cfg(not(any(
     target_os = "linux",
     target_os = "android",
diff --git a/library/std/src/os/unix/net/tests.rs b/library/std/src/os/unix/net/tests.rs
index e456e41b21c..21e2176185d 100644
--- a/library/std/src/os/unix/net/tests.rs
+++ b/library/std/src/os/unix/net/tests.rs
@@ -1,18 +1,16 @@
 use super::*;
 use crate::io::prelude::*;
 use crate::io::{self, ErrorKind, IoSlice, IoSliceMut};
+#[cfg(target_os = "android")]
+use crate::os::android::net::{SocketAddrExt, UnixSocketExt};
+#[cfg(target_os = "linux")]
+use crate::os::linux::net::{SocketAddrExt, UnixSocketExt};
 #[cfg(any(target_os = "android", target_os = "linux"))]
 use crate::os::unix::io::AsRawFd;
 use crate::sys_common::io::test::tmpdir;
 use crate::thread;
 use crate::time::Duration;
 
-#[cfg(target_os = "android")]
-use crate::os::android::net::{SocketAddrExt, UnixSocketExt};
-
-#[cfg(target_os = "linux")]
-use crate::os::linux::net::{SocketAddrExt, UnixSocketExt};
-
 macro_rules! or_panic {
     ($e:expr) => {
         match $e {
diff --git a/library/std/src/os/unix/net/ucred.rs b/library/std/src/os/unix/net/ucred.rs
index 1497e730bbf..b96e373ad0a 100644
--- a/library/std/src/os/unix/net/ucred.rs
+++ b/library/std/src/os/unix/net/ucred.rs
@@ -23,9 +23,8 @@ pub struct UCred {
     pub pid: Option<pid_t>,
 }
 
-#[cfg(any(target_os = "android", target_os = "linux"))]
-pub(super) use self::impl_linux::peer_cred;
-
+#[cfg(target_vendor = "apple")]
+pub(super) use self::impl_apple::peer_cred;
 #[cfg(any(
     target_os = "dragonfly",
     target_os = "freebsd",
@@ -34,17 +33,17 @@ pub(super) use self::impl_linux::peer_cred;
     target_os = "nto"
 ))]
 pub(super) use self::impl_bsd::peer_cred;
-
-#[cfg(target_vendor = "apple")]
-pub(super) use self::impl_apple::peer_cred;
+#[cfg(any(target_os = "android", target_os = "linux"))]
+pub(super) use self::impl_linux::peer_cred;
 
 #[cfg(any(target_os = "linux", target_os = "android"))]
 mod impl_linux {
+    use libc::{c_void, getsockopt, socklen_t, ucred, SOL_SOCKET, SO_PEERCRED};
+
     use super::UCred;
     use crate::os::unix::io::AsRawFd;
     use crate::os::unix::net::UnixStream;
     use crate::{io, mem};
-    use libc::{c_void, getsockopt, socklen_t, ucred, SOL_SOCKET, SO_PEERCRED};
 
     pub fn peer_cred(socket: &UnixStream) -> io::Result<UCred> {
         let ucred_size = mem::size_of::<ucred>();
@@ -99,11 +98,12 @@ mod impl_bsd {
 
 #[cfg(target_vendor = "apple")]
 mod impl_apple {
+    use libc::{c_void, getpeereid, getsockopt, pid_t, socklen_t, LOCAL_PEERPID, SOL_LOCAL};
+
     use super::UCred;
     use crate::os::unix::io::AsRawFd;
     use crate::os::unix::net::UnixStream;
     use crate::{io, mem};
-    use libc::{c_void, getpeereid, getsockopt, pid_t, socklen_t, LOCAL_PEERPID, SOL_LOCAL};
 
     pub fn peer_cred(socket: &UnixStream) -> io::Result<UCred> {
         let mut cred = UCred { uid: 1, gid: 1, pid: None };
diff --git a/library/std/src/os/unix/net/ucred/tests.rs b/library/std/src/os/unix/net/ucred/tests.rs
index a6cc81318fc..59414f4dcae 100644
--- a/library/std/src/os/unix/net/ucred/tests.rs
+++ b/library/std/src/os/unix/net/ucred/tests.rs
@@ -1,6 +1,7 @@
-use crate::os::unix::net::UnixStream;
 use libc::{getegid, geteuid, getpid};
 
+use crate::os::unix::net::UnixStream;
+
 #[test]
 #[cfg(any(
     target_os = "android",
diff --git a/library/std/src/os/unix/process.rs b/library/std/src/os/unix/process.rs
index d4a35ad3f86..c53423675bd 100644
--- a/library/std/src/os/unix/process.rs
+++ b/library/std/src/os/unix/process.rs
@@ -4,15 +4,13 @@
 
 #![stable(feature = "rust1", since = "1.0.0")]
 
+use cfg_if::cfg_if;
+
 use crate::ffi::OsStr;
-use crate::io;
 use crate::os::unix::io::{AsFd, AsRawFd, BorrowedFd, FromRawFd, IntoRawFd, OwnedFd, RawFd};
-use crate::process;
 use crate::sealed::Sealed;
-use crate::sys;
 use crate::sys_common::{AsInner, AsInnerMut, FromInner, IntoInner};
-
-use cfg_if::cfg_if;
+use crate::{io, process, sys};
 
 cfg_if! {
     if #[cfg(any(target_os = "vxworks", target_os = "espidf", target_os = "horizon", target_os = "vita"))] {
diff --git a/library/std/src/os/wasi/fs.rs b/library/std/src/os/wasi/fs.rs
index a0920a28199..a58ca543d67 100644
--- a/library/std/src/os/wasi/fs.rs
+++ b/library/std/src/os/wasi/fs.rs
@@ -5,14 +5,15 @@
 #![deny(unsafe_op_in_unsafe_fn)]
 #![unstable(feature = "wasi_ext", issue = "71213")]
 
+// Used for `File::read` on intra-doc links
+#[allow(unused_imports)]
+use io::{Read, Write};
+
 use crate::ffi::OsStr;
 use crate::fs::{self, File, Metadata, OpenOptions};
 use crate::io::{self, IoSlice, IoSliceMut};
 use crate::path::{Path, PathBuf};
 use crate::sys_common::{AsInner, AsInnerMut, FromInner};
-// Used for `File::read` on intra-doc links
-#[allow(unused_imports)]
-use io::{Read, Write};
 
 /// WASI-specific extensions to [`File`].
 pub trait FileExt {
diff --git a/library/std/src/os/wasi/net/mod.rs b/library/std/src/os/wasi/net/mod.rs
index 73c097d4a50..4704dd57451 100644
--- a/library/std/src/os/wasi/net/mod.rs
+++ b/library/std/src/os/wasi/net/mod.rs
@@ -2,9 +2,8 @@
 
 #![unstable(feature = "wasi_ext", issue = "71213")]
 
-use crate::io;
-use crate::net;
 use crate::sys_common::AsInner;
+use crate::{io, net};
 
 /// WASI-specific extensions to [`std::net::TcpListener`].
 ///
diff --git a/library/std/src/os/windows/ffi.rs b/library/std/src/os/windows/ffi.rs
index 96bab59d3f8..496443dbbc3 100644
--- a/library/std/src/os/windows/ffi.rs
+++ b/library/std/src/os/windows/ffi.rs
@@ -56,11 +56,10 @@
 use crate::ffi::{OsStr, OsString};
 use crate::sealed::Sealed;
 use crate::sys::os_str::Buf;
-use crate::sys_common::wtf8::Wtf8Buf;
-use crate::sys_common::{AsInner, FromInner};
-
 #[stable(feature = "rust1", since = "1.0.0")]
 pub use crate::sys_common::wtf8::EncodeWide;
+use crate::sys_common::wtf8::Wtf8Buf;
+use crate::sys_common::{AsInner, FromInner};
 
 /// Windows-specific extensions to [`OsString`].
 ///
diff --git a/library/std/src/os/windows/fs.rs b/library/std/src/os/windows/fs.rs
index 8bddeb7310a..3dcde43cfec 100644
--- a/library/std/src/os/windows/fs.rs
+++ b/library/std/src/os/windows/fs.rs
@@ -5,12 +5,11 @@
 #![stable(feature = "rust1", since = "1.0.0")]
 
 use crate::fs::{self, Metadata, OpenOptions};
-use crate::io;
 use crate::path::Path;
 use crate::sealed::Sealed;
-use crate::sys;
 use crate::sys_common::{AsInner, AsInnerMut, IntoInner};
 use crate::time::SystemTime;
+use crate::{io, sys};
 
 /// Windows-specific extensions to [`fs::File`].
 #[stable(feature = "file_offset", since = "1.15.0")]
diff --git a/library/std/src/os/windows/io/handle.rs b/library/std/src/os/windows/io/handle.rs
index 21c0f27c5bb..a4fa94e2b96 100644
--- a/library/std/src/os/windows/io/handle.rs
+++ b/library/std/src/os/windows/io/handle.rs
@@ -3,15 +3,11 @@
 #![stable(feature = "io_safety", since = "1.63.0")]
 
 use super::raw::{AsRawHandle, FromRawHandle, IntoRawHandle, RawHandle};
-use crate::fmt;
-use crate::fs;
-use crate::io;
 use crate::marker::PhantomData;
 use crate::mem::ManuallyDrop;
-use crate::ptr;
-use crate::sys;
 use crate::sys::cvt;
 use crate::sys_common::{AsInner, FromInner, IntoInner};
+use crate::{fmt, fs, io, ptr, sys};
 
 /// A borrowed handle.
 ///
diff --git a/library/std/src/os/windows/io/raw.rs b/library/std/src/os/windows/io/raw.rs
index a1888be5f1d..4ba07e3d2af 100644
--- a/library/std/src/os/windows/io/raw.rs
+++ b/library/std/src/os/windows/io/raw.rs
@@ -2,16 +2,12 @@
 
 #![stable(feature = "rust1", since = "1.0.0")]
 
-use crate::fs;
-use crate::io;
-use crate::net;
 #[cfg(doc)]
 use crate::os::windows::io::{AsHandle, AsSocket};
 use crate::os::windows::io::{OwnedHandle, OwnedSocket};
 use crate::os::windows::raw;
-use crate::ptr;
-use crate::sys;
 use crate::sys_common::{self, AsInner, FromInner, IntoInner};
+use crate::{fs, io, net, ptr, sys};
 
 /// Raw HANDLEs.
 #[stable(feature = "rust1", since = "1.0.0")]
diff --git a/library/std/src/os/windows/io/socket.rs b/library/std/src/os/windows/io/socket.rs
index 5a62177e901..1fcfb6e73ad 100644
--- a/library/std/src/os/windows/io/socket.rs
+++ b/library/std/src/os/windows/io/socket.rs
@@ -3,13 +3,11 @@
 #![stable(feature = "io_safety", since = "1.63.0")]
 
 use super::raw::{AsRawSocket, FromRawSocket, IntoRawSocket, RawSocket};
-use crate::fmt;
-use crate::io;
 use crate::marker::PhantomData;
 use crate::mem::{self, ManuallyDrop};
-use crate::sys;
 #[cfg(not(target_vendor = "uwp"))]
 use crate::sys::cvt;
+use crate::{fmt, io, sys};
 
 /// A borrowed socket.
 ///
diff --git a/library/std/src/os/windows/process.rs b/library/std/src/os/windows/process.rs
index af5c13b99e7..c2830d2eb61 100644
--- a/library/std/src/os/windows/process.rs
+++ b/library/std/src/os/windows/process.rs
@@ -8,10 +8,9 @@ use crate::ffi::OsStr;
 use crate::os::windows::io::{
     AsHandle, AsRawHandle, BorrowedHandle, FromRawHandle, IntoRawHandle, OwnedHandle, RawHandle,
 };
-use crate::process;
 use crate::sealed::Sealed;
-use crate::sys;
 use crate::sys_common::{AsInner, AsInnerMut, FromInner, IntoInner};
+use crate::{process, sys};
 
 #[stable(feature = "process_extensions", since = "1.2.0")]
 impl FromRawHandle for process::Stdio {
diff --git a/library/std/src/os/xous/services.rs b/library/std/src/os/xous/services.rs
index bc4558d9981..ddf0236f5ad 100644
--- a/library/std/src/os/xous/services.rs
+++ b/library/std/src/os/xous/services.rs
@@ -1,6 +1,7 @@
-use crate::os::xous::ffi::Connection;
 use core::sync::atomic::{AtomicU32, Ordering};
 
+use crate::os::xous::ffi::Connection;
+
 mod dns;
 pub(crate) use dns::*;
 
diff --git a/library/std/src/os/xous/services/dns.rs b/library/std/src/os/xous/services/dns.rs
index 6ea453e0636..02881648393 100644
--- a/library/std/src/os/xous/services/dns.rs
+++ b/library/std/src/os/xous/services/dns.rs
@@ -1,6 +1,7 @@
+use core::sync::atomic::{AtomicU32, Ordering};
+
 use crate::os::xous::ffi::Connection;
 use crate::os::xous::services::connect;
-use core::sync::atomic::{AtomicU32, Ordering};
 
 #[repr(usize)]
 pub(crate) enum DnsLendMut {
diff --git a/library/std/src/os/xous/services/log.rs b/library/std/src/os/xous/services/log.rs
index 0ecc4bcfd14..1661011ca64 100644
--- a/library/std/src/os/xous/services/log.rs
+++ b/library/std/src/os/xous/services/log.rs
@@ -1,6 +1,7 @@
-use crate::os::xous::ffi::Connection;
 use core::sync::atomic::{AtomicU32, Ordering};
 
+use crate::os::xous::ffi::Connection;
+
 /// Group a `usize` worth of bytes into a `usize` and return it, beginning from
 /// `offset` * sizeof(usize) bytes from the start. For example,
 /// `group_or_null([1,2,3,4,5,6,7,8], 1)` on a 32-bit system will return a
diff --git a/library/std/src/os/xous/services/net.rs b/library/std/src/os/xous/services/net.rs
index c7b9ac9f5d5..83acc7961b3 100644
--- a/library/std/src/os/xous/services/net.rs
+++ b/library/std/src/os/xous/services/net.rs
@@ -1,6 +1,7 @@
+use core::sync::atomic::{AtomicU32, Ordering};
+
 use crate::os::xous::ffi::Connection;
 use crate::os::xous::services::connect;
-use core::sync::atomic::{AtomicU32, Ordering};
 
 pub(crate) enum NetBlockingScalar {
     StdGetTtlUdp(u16 /* fd */),                /* 36 */
diff --git a/library/std/src/os/xous/services/systime.rs b/library/std/src/os/xous/services/systime.rs
index 40f70b4db81..079ede7aa86 100644
--- a/library/std/src/os/xous/services/systime.rs
+++ b/library/std/src/os/xous/services/systime.rs
@@ -1,6 +1,7 @@
-use crate::os::xous::ffi::{connect, Connection};
 use core::sync::atomic::{AtomicU32, Ordering};
 
+use crate::os::xous::ffi::{connect, Connection};
+
 pub(crate) enum SystimeScalar {
     GetUtcTimeMs,
 }
diff --git a/library/std/src/os/xous/services/ticktimer.rs b/library/std/src/os/xous/services/ticktimer.rs
index c94e7710fab..66ade6da65c 100644
--- a/library/std/src/os/xous/services/ticktimer.rs
+++ b/library/std/src/os/xous/services/ticktimer.rs
@@ -1,6 +1,7 @@
-use crate::os::xous::ffi::Connection;
 use core::sync::atomic::{AtomicU32, Ordering};
 
+use crate::os::xous::ffi::Connection;
+
 pub(crate) enum TicktimerScalar {
     ElapsedMs,
     SleepMs(usize),
diff --git a/library/std/src/panic.rs b/library/std/src/panic.rs
index b0c7804fd2b..57ba7c6d407 100644
--- a/library/std/src/panic.rs
+++ b/library/std/src/panic.rs
@@ -3,12 +3,10 @@
 #![stable(feature = "std_panic", since = "1.9.0")]
 
 use crate::any::Any;
-use crate::collections;
-use crate::fmt;
-use crate::panicking;
 use crate::sync::atomic::{AtomicU8, Ordering};
 use crate::sync::{Condvar, Mutex, RwLock};
 use crate::thread::Result;
+use crate::{collections, fmt, panicking};
 
 #[stable(feature = "panic_hooks", since = "1.10.0")]
 #[deprecated(
@@ -236,18 +234,15 @@ pub macro panic_2015 {
 #[doc(hidden)]
 #[unstable(feature = "edition_panic", issue = "none", reason = "use panic!() instead")]
 pub use core::panic::panic_2021;
-
 #[stable(feature = "panic_hooks", since = "1.10.0")]
-pub use crate::panicking::{set_hook, take_hook};
+pub use core::panic::Location;
+#[stable(feature = "catch_unwind", since = "1.9.0")]
+pub use core::panic::{AssertUnwindSafe, RefUnwindSafe, UnwindSafe};
 
 #[unstable(feature = "panic_update_hook", issue = "92649")]
 pub use crate::panicking::update_hook;
-
 #[stable(feature = "panic_hooks", since = "1.10.0")]
-pub use core::panic::Location;
-
-#[stable(feature = "catch_unwind", since = "1.9.0")]
-pub use core::panic::{AssertUnwindSafe, RefUnwindSafe, UnwindSafe};
+pub use crate::panicking::{set_hook, take_hook};
 
 /// Panics the current thread with the given message as the panic payload.
 ///
diff --git a/library/std/src/panicking.rs b/library/std/src/panicking.rs
index 418a855fb72..e818b448270 100644
--- a/library/std/src/panicking.rs
+++ b/library/std/src/panicking.rs
@@ -9,26 +9,23 @@
 
 #![deny(unsafe_op_in_unsafe_fn)]
 
-use crate::panic::{BacktraceStyle, PanicHookInfo};
 use core::panic::{Location, PanicPayload};
 
+// make sure to use the stderr output configured
+// by libtest in the real copy of std
+#[cfg(test)]
+use realstd::io::try_set_output_capture;
+
 use crate::any::Any;
-use crate::fmt;
-use crate::intrinsics;
+#[cfg(not(test))]
+use crate::io::try_set_output_capture;
 use crate::mem::{self, ManuallyDrop};
-use crate::process;
+use crate::panic::{BacktraceStyle, PanicHookInfo};
 use crate::sync::atomic::{AtomicBool, Ordering};
 use crate::sync::{PoisonError, RwLock};
 use crate::sys::backtrace;
 use crate::sys::stdio::panic_output;
-use crate::thread;
-
-#[cfg(not(test))]
-use crate::io::try_set_output_capture;
-// make sure to use the stderr output configured
-// by libtest in the real copy of std
-#[cfg(test)]
-use realstd::io::try_set_output_capture;
+use crate::{fmt, intrinsics, process, thread};
 
 // Binary interface to the panic runtime that the standard library depends on.
 //
diff --git a/library/std/src/path.rs b/library/std/src/path.rs
index 46a1953743f..80163667636 100644
--- a/library/std/src/path.rs
+++ b/library/std/src/path.rs
@@ -71,22 +71,17 @@
 mod tests;
 
 use crate::borrow::{Borrow, Cow};
-use crate::cmp;
 use crate::collections::TryReserveError;
 use crate::error::Error;
-use crate::fmt;
-use crate::fs;
+use crate::ffi::{os_str, OsStr, OsString};
 use crate::hash::{Hash, Hasher};
-use crate::io;
 use crate::iter::FusedIterator;
 use crate::ops::{self, Deref};
 use crate::rc::Rc;
 use crate::str::FromStr;
 use crate::sync::Arc;
-
-use crate::ffi::{os_str, OsStr, OsString};
-use crate::sys;
 use crate::sys::path::{is_sep_byte, is_verbatim_sep, parse_prefix, MAIN_SEP_STR};
+use crate::{cmp, fmt, fs, io, sys};
 
 ////////////////////////////////////////////////////////////////////////////////
 // GENERAL NOTES
diff --git a/library/std/src/path/tests.rs b/library/std/src/path/tests.rs
index 3ade4fb892f..a12e42cba0c 100644
--- a/library/std/src/path/tests.rs
+++ b/library/std/src/path/tests.rs
@@ -1,8 +1,8 @@
-use super::*;
+use core::hint::black_box;
 
+use super::*;
 use crate::collections::{BTreeSet, HashSet};
 use crate::hash::DefaultHasher;
-use core::hint::black_box;
 
 #[allow(unknown_lints, unused_macro_rules)]
 macro_rules! t (
diff --git a/library/std/src/pipe.rs b/library/std/src/pipe.rs
index f251b57a7cc..aa4c7014fe9 100644
--- a/library/std/src/pipe.rs
+++ b/library/std/src/pipe.rs
@@ -11,10 +11,8 @@
 //! # }
 //! ```
 
-use crate::{
-    io,
-    sys::anonymous_pipe::{pipe as pipe_inner, AnonPipe},
-};
+use crate::io;
+use crate::sys::anonymous_pipe::{pipe as pipe_inner, AnonPipe};
 
 /// Create anonymous pipe that is close-on-exec and blocking.
 #[unstable(feature = "anonymous_pipe", issue = "127154")]
diff --git a/library/std/src/process.rs b/library/std/src/process.rs
index a2222bd11b1..9ffdebe1b6f 100644
--- a/library/std/src/process.rs
+++ b/library/std/src/process.rs
@@ -151,21 +151,18 @@
 #[cfg(all(test, not(any(target_os = "emscripten", target_env = "sgx", target_os = "xous"))))]
 mod tests;
 
-use crate::io::prelude::*;
-
 use crate::convert::Infallible;
 use crate::ffi::OsStr;
-use crate::fmt;
-use crate::fs;
+use crate::io::prelude::*;
 use crate::io::{self, BorrowedCursor, IoSlice, IoSliceMut};
 use crate::num::NonZero;
 use crate::path::Path;
-use crate::str;
 use crate::sys::pipe::{read2, AnonPipe};
 use crate::sys::process as imp;
 #[stable(feature = "command_access", since = "1.57.0")]
 pub use crate::sys_common::process::CommandEnvs;
 use crate::sys_common::{AsInner, AsInnerMut, FromInner, IntoInner};
+use crate::{fmt, fs, str};
 
 /// Representation of a running or exited child process.
 ///
diff --git a/library/std/src/process/tests.rs b/library/std/src/process/tests.rs
index 055601d0307..f8e8e0dea55 100644
--- a/library/std/src/process/tests.rs
+++ b/library/std/src/process/tests.rs
@@ -1,6 +1,5 @@
-use crate::io::prelude::*;
-
 use super::{Command, Output, Stdio};
+use crate::io::prelude::*;
 use crate::io::{BorrowedBuf, ErrorKind};
 use crate::mem::MaybeUninit;
 use crate::str;
diff --git a/library/std/src/sync/lazy_lock.rs b/library/std/src/sync/lazy_lock.rs
index 9fe9ccab4a9..953aef40e7b 100644
--- a/library/std/src/sync/lazy_lock.rs
+++ b/library/std/src/sync/lazy_lock.rs
@@ -1,3 +1,4 @@
+use super::once::ExclusiveState;
 use crate::cell::UnsafeCell;
 use crate::mem::ManuallyDrop;
 use crate::ops::Deref;
@@ -5,8 +6,6 @@ use crate::panic::{RefUnwindSafe, UnwindSafe};
 use crate::sync::Once;
 use crate::{fmt, ptr};
 
-use super::once::ExclusiveState;
-
 // We use the state of a Once as discriminant value. Upon creation, the state is
 // "incomplete" and `f` contains the initialization closure. In the first call to
 // `call_once`, `f` is taken and run. If it succeeds, `value` is set and the state
diff --git a/library/std/src/sync/lazy_lock/tests.rs b/library/std/src/sync/lazy_lock/tests.rs
index a5d4e25c596..8a6ab4ac4fd 100644
--- a/library/std/src/sync/lazy_lock/tests.rs
+++ b/library/std/src/sync/lazy_lock/tests.rs
@@ -1,13 +1,8 @@
-use crate::{
-    cell::LazyCell,
-    panic,
-    sync::{
-        atomic::{AtomicUsize, Ordering::SeqCst},
-        Mutex,
-    },
-    sync::{LazyLock, OnceLock},
-    thread,
-};
+use crate::cell::LazyCell;
+use crate::sync::atomic::AtomicUsize;
+use crate::sync::atomic::Ordering::SeqCst;
+use crate::sync::{LazyLock, Mutex, OnceLock};
+use crate::{panic, thread};
 
 fn spawn_and_wait<R: Send + 'static>(f: impl FnOnce() -> R + Send + 'static) -> R {
     thread::spawn(f).join().unwrap()
diff --git a/library/std/src/sync/mod.rs b/library/std/src/sync/mod.rs
index 9a38c42f43a..d0ba8cc3b47 100644
--- a/library/std/src/sync/mod.rs
+++ b/library/std/src/sync/mod.rs
@@ -159,16 +159,19 @@
 #![stable(feature = "rust1", since = "1.0.0")]
 
 #[stable(feature = "rust1", since = "1.0.0")]
-pub use alloc_crate::sync::{Arc, Weak};
-#[stable(feature = "rust1", since = "1.0.0")]
 pub use core::sync::atomic;
 #[unstable(feature = "exclusive_wrapper", issue = "98407")]
 pub use core::sync::Exclusive;
 
 #[stable(feature = "rust1", since = "1.0.0")]
+pub use alloc_crate::sync::{Arc, Weak};
+
+#[stable(feature = "rust1", since = "1.0.0")]
 pub use self::barrier::{Barrier, BarrierWaitResult};
 #[stable(feature = "rust1", since = "1.0.0")]
 pub use self::condvar::{Condvar, WaitTimeoutResult};
+#[stable(feature = "lazy_cell", since = "1.80.0")]
+pub use self::lazy_lock::LazyLock;
 #[unstable(feature = "mapped_lock_guards", issue = "117108")]
 pub use self::mutex::MappedMutexGuard;
 #[stable(feature = "rust1", since = "1.0.0")]
@@ -176,21 +179,17 @@ pub use self::mutex::{Mutex, MutexGuard};
 #[stable(feature = "rust1", since = "1.0.0")]
 #[allow(deprecated)]
 pub use self::once::{Once, OnceState, ONCE_INIT};
+#[stable(feature = "once_cell", since = "1.70.0")]
+pub use self::once_lock::OnceLock;
 #[stable(feature = "rust1", since = "1.0.0")]
 pub use self::poison::{LockResult, PoisonError, TryLockError, TryLockResult};
+#[unstable(feature = "reentrant_lock", issue = "121440")]
+pub use self::reentrant_lock::{ReentrantLock, ReentrantLockGuard};
 #[unstable(feature = "mapped_lock_guards", issue = "117108")]
 pub use self::rwlock::{MappedRwLockReadGuard, MappedRwLockWriteGuard};
 #[stable(feature = "rust1", since = "1.0.0")]
 pub use self::rwlock::{RwLock, RwLockReadGuard, RwLockWriteGuard};
 
-#[stable(feature = "lazy_cell", since = "1.80.0")]
-pub use self::lazy_lock::LazyLock;
-#[stable(feature = "once_cell", since = "1.70.0")]
-pub use self::once_lock::OnceLock;
-
-#[unstable(feature = "reentrant_lock", issue = "121440")]
-pub use self::reentrant_lock::{ReentrantLock, ReentrantLockGuard};
-
 pub mod mpsc;
 
 mod barrier;
diff --git a/library/std/src/sync/mpmc/array.rs b/library/std/src/sync/mpmc/array.rs
index 185319add74..34acd9c9a94 100644
--- a/library/std/src/sync/mpmc/array.rs
+++ b/library/std/src/sync/mpmc/array.rs
@@ -13,7 +13,6 @@ use super::error::*;
 use super::select::{Operation, Selected, Token};
 use super::utils::{Backoff, CachePadded};
 use super::waker::SyncWaker;
-
 use crate::cell::UnsafeCell;
 use crate::mem::MaybeUninit;
 use crate::ptr;
diff --git a/library/std/src/sync/mpmc/context.rs b/library/std/src/sync/mpmc/context.rs
index bbfc6ce00ff..8db3c9896eb 100644
--- a/library/std/src/sync/mpmc/context.rs
+++ b/library/std/src/sync/mpmc/context.rs
@@ -2,7 +2,6 @@
 
 use super::select::Selected;
 use super::waker::current_thread_id;
-
 use crate::cell::Cell;
 use crate::ptr;
 use crate::sync::atomic::{AtomicPtr, AtomicUsize, Ordering};
diff --git a/library/std/src/sync/mpmc/counter.rs b/library/std/src/sync/mpmc/counter.rs
index 3478cf41dc9..d1bfe612f53 100644
--- a/library/std/src/sync/mpmc/counter.rs
+++ b/library/std/src/sync/mpmc/counter.rs
@@ -1,6 +1,5 @@
-use crate::ops;
-use crate::process;
 use crate::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
+use crate::{ops, process};
 
 /// Reference counter internals.
 struct Counter<C> {
diff --git a/library/std/src/sync/mpmc/error.rs b/library/std/src/sync/mpmc/error.rs
index 33b2bff8534..e3aec7e7623 100644
--- a/library/std/src/sync/mpmc/error.rs
+++ b/library/std/src/sync/mpmc/error.rs
@@ -1,7 +1,5 @@
-use crate::error;
-use crate::fmt;
-
 pub use crate::sync::mpsc::{RecvError, RecvTimeoutError, SendError, TryRecvError, TrySendError};
+use crate::{error, fmt};
 
 /// An error returned from the [`send_timeout`] method.
 ///
diff --git a/library/std/src/sync/mpmc/list.rs b/library/std/src/sync/mpmc/list.rs
index edac7a0cb18..bbe205cad04 100644
--- a/library/std/src/sync/mpmc/list.rs
+++ b/library/std/src/sync/mpmc/list.rs
@@ -5,7 +5,6 @@ use super::error::*;
 use super::select::{Operation, Selected, Token};
 use super::utils::{Backoff, CachePadded};
 use super::waker::SyncWaker;
-
 use crate::cell::UnsafeCell;
 use crate::marker::PhantomData;
 use crate::mem::MaybeUninit;
diff --git a/library/std/src/sync/mpmc/mod.rs b/library/std/src/sync/mpmc/mod.rs
index 2068dda393a..c640e07348e 100644
--- a/library/std/src/sync/mpmc/mod.rs
+++ b/library/std/src/sync/mpmc/mod.rs
@@ -40,10 +40,11 @@ mod utils;
 mod waker;
 mod zero;
 
+pub use error::*;
+
 use crate::fmt;
 use crate::panic::{RefUnwindSafe, UnwindSafe};
 use crate::time::{Duration, Instant};
-pub use error::*;
 
 /// Creates a channel of unbounded capacity.
 ///
diff --git a/library/std/src/sync/mpmc/waker.rs b/library/std/src/sync/mpmc/waker.rs
index 9aab1b9417e..fb877887f9c 100644
--- a/library/std/src/sync/mpmc/waker.rs
+++ b/library/std/src/sync/mpmc/waker.rs
@@ -2,7 +2,6 @@
 
 use super::context::Context;
 use super::select::{Operation, Selected};
-
 use crate::ptr;
 use crate::sync::atomic::{AtomicBool, Ordering};
 use crate::sync::Mutex;
diff --git a/library/std/src/sync/mpmc/zero.rs b/library/std/src/sync/mpmc/zero.rs
index 6d1c9d64e7a..2b82eeda3d5 100644
--- a/library/std/src/sync/mpmc/zero.rs
+++ b/library/std/src/sync/mpmc/zero.rs
@@ -7,7 +7,6 @@ use super::error::*;
 use super::select::{Operation, Selected, Token};
 use super::utils::Backoff;
 use super::waker::Waker;
-
 use crate::cell::UnsafeCell;
 use crate::marker::PhantomData;
 use crate::sync::atomic::{AtomicBool, Ordering};
diff --git a/library/std/src/sync/mpsc/mod.rs b/library/std/src/sync/mpsc/mod.rs
index feee6948db4..26d5b9515a2 100644
--- a/library/std/src/sync/mpsc/mod.rs
+++ b/library/std/src/sync/mpsc/mod.rs
@@ -148,10 +148,9 @@ mod sync_tests;
 // not exposed publicly, but if you are curious about the implementation,
 // that's where everything is.
 
-use crate::error;
-use crate::fmt;
 use crate::sync::mpmc;
 use crate::time::{Duration, Instant};
+use crate::{error, fmt};
 
 /// The receiving half of Rust's [`channel`] (or [`sync_channel`]) type.
 /// This half can only be owned by one thread.
diff --git a/library/std/src/sync/mpsc/sync_tests.rs b/library/std/src/sync/mpsc/sync_tests.rs
index 945de280f40..49b65c8efe6 100644
--- a/library/std/src/sync/mpsc/sync_tests.rs
+++ b/library/std/src/sync/mpsc/sync_tests.rs
@@ -1,8 +1,7 @@
 use super::*;
-use crate::env;
 use crate::rc::Rc;
 use crate::sync::mpmc::SendTimeoutError;
-use crate::thread;
+use crate::{env, thread};
 
 pub fn stress_factor() -> usize {
     match env::var("RUST_TEST_STRESS") {
diff --git a/library/std/src/sync/mpsc/tests.rs b/library/std/src/sync/mpsc/tests.rs
index ac1a804cf9c..13892fa0d18 100644
--- a/library/std/src/sync/mpsc/tests.rs
+++ b/library/std/src/sync/mpsc/tests.rs
@@ -1,6 +1,5 @@
 use super::*;
-use crate::env;
-use crate::thread;
+use crate::{env, thread};
 
 pub fn stress_factor() -> usize {
     match env::var("RUST_TEST_STRESS") {
diff --git a/library/std/src/sync/once/tests.rs b/library/std/src/sync/once/tests.rs
index 0c35597e11c..d43dabc1cf1 100644
--- a/library/std/src/sync/once/tests.rs
+++ b/library/std/src/sync/once/tests.rs
@@ -1,7 +1,6 @@
 use super::Once;
-use crate::panic;
 use crate::sync::mpsc::channel;
-use crate::thread;
+use crate::{panic, thread};
 
 #[test]
 fn smoke_once() {
diff --git a/library/std/src/sync/once_lock/tests.rs b/library/std/src/sync/once_lock/tests.rs
index d5d32e73d88..176830c6748 100644
--- a/library/std/src/sync/once_lock/tests.rs
+++ b/library/std/src/sync/once_lock/tests.rs
@@ -1,12 +1,8 @@
-use crate::{
-    panic,
-    sync::OnceLock,
-    sync::{
-        atomic::{AtomicUsize, Ordering::SeqCst},
-        mpsc::channel,
-    },
-    thread,
-};
+use crate::sync::atomic::AtomicUsize;
+use crate::sync::atomic::Ordering::SeqCst;
+use crate::sync::mpsc::channel;
+use crate::sync::OnceLock;
+use crate::{panic, thread};
 
 fn spawn_and_wait<R: Send + 'static>(f: impl FnOnce() -> R + Send + 'static) -> R {
     thread::spawn(f).join().unwrap()
diff --git a/library/std/src/sync/poison.rs b/library/std/src/sync/poison.rs
index d71643b5000..da66a088e51 100644
--- a/library/std/src/sync/poison.rs
+++ b/library/std/src/sync/poison.rs
@@ -1,6 +1,5 @@
 use crate::error::Error;
 use crate::fmt;
-
 #[cfg(panic = "unwind")]
 use crate::sync::atomic::{AtomicBool, Ordering};
 #[cfg(panic = "unwind")]
diff --git a/library/std/src/sync/rwlock/tests.rs b/library/std/src/sync/rwlock/tests.rs
index 9cc5e7a3a60..12bb0fbf050 100644
--- a/library/std/src/sync/rwlock/tests.rs
+++ b/library/std/src/sync/rwlock/tests.rs
@@ -1,3 +1,5 @@
+use rand::Rng;
+
 use crate::sync::atomic::{AtomicUsize, Ordering};
 use crate::sync::mpsc::channel;
 use crate::sync::{
@@ -5,7 +7,6 @@ use crate::sync::{
     TryLockError,
 };
 use crate::thread;
-use rand::Rng;
 
 #[derive(Eq, PartialEq, Debug)]
 struct NonCopy(i32);
diff --git a/library/std/src/sys/anonymous_pipe/tests.rs b/library/std/src/sys/anonymous_pipe/tests.rs
index f5ea583eefe..865d24ec855 100644
--- a/library/std/src/sys/anonymous_pipe/tests.rs
+++ b/library/std/src/sys/anonymous_pipe/tests.rs
@@ -1,7 +1,5 @@
-use crate::{
-    io::{Read, Write},
-    pipe::pipe,
-};
+use crate::io::{Read, Write};
+use crate::pipe::pipe;
 
 #[test]
 fn pipe_creation_clone_and_rw() {
diff --git a/library/std/src/sys/anonymous_pipe/unix.rs b/library/std/src/sys/anonymous_pipe/unix.rs
index ddbf1d7334f..7c0e75208c4 100644
--- a/library/std/src/sys/anonymous_pipe/unix.rs
+++ b/library/std/src/sys/anonymous_pipe/unix.rs
@@ -1,11 +1,10 @@
-use crate::{
-    io,
-    os::fd::{AsFd, AsRawFd, BorrowedFd, FromRawFd, IntoRawFd, OwnedFd, RawFd},
-    pipe::{PipeReader, PipeWriter},
-    process::Stdio,
-    sys::{fd::FileDesc, pipe::anon_pipe},
-    sys_common::{FromInner, IntoInner},
-};
+use crate::io;
+use crate::os::fd::{AsFd, AsRawFd, BorrowedFd, FromRawFd, IntoRawFd, OwnedFd, RawFd};
+use crate::pipe::{PipeReader, PipeWriter};
+use crate::process::Stdio;
+use crate::sys::fd::FileDesc;
+use crate::sys::pipe::anon_pipe;
+use crate::sys_common::{FromInner, IntoInner};
 
 pub(crate) type AnonPipe = FileDesc;
 
diff --git a/library/std/src/sys/anonymous_pipe/unsupported.rs b/library/std/src/sys/anonymous_pipe/unsupported.rs
index 5962b69203e..f3c826d2f8d 100644
--- a/library/std/src/sys/anonymous_pipe/unsupported.rs
+++ b/library/std/src/sys/anonymous_pipe/unsupported.rs
@@ -1,9 +1,6 @@
-use crate::{
-    io,
-    pipe::{PipeReader, PipeWriter},
-    process::Stdio,
-};
-
+use crate::io;
+use crate::pipe::{PipeReader, PipeWriter};
+use crate::process::Stdio;
 pub(crate) use crate::sys::pipe::AnonPipe;
 
 #[inline]
diff --git a/library/std/src/sys/anonymous_pipe/windows.rs b/library/std/src/sys/anonymous_pipe/windows.rs
index 81f95aa286a..0f746b1082b 100644
--- a/library/std/src/sys/anonymous_pipe/windows.rs
+++ b/library/std/src/sys/anonymous_pipe/windows.rs
@@ -1,13 +1,12 @@
-use crate::{
-    io,
-    os::windows::io::{
-        AsHandle, AsRawHandle, BorrowedHandle, FromRawHandle, IntoRawHandle, OwnedHandle, RawHandle,
-    },
-    pipe::{PipeReader, PipeWriter},
-    process::Stdio,
-    sys::{handle::Handle, pipe::unnamed_anon_pipe},
-    sys_common::{FromInner, IntoInner},
+use crate::io;
+use crate::os::windows::io::{
+    AsHandle, AsRawHandle, BorrowedHandle, FromRawHandle, IntoRawHandle, OwnedHandle, RawHandle,
 };
+use crate::pipe::{PipeReader, PipeWriter};
+use crate::process::Stdio;
+use crate::sys::handle::Handle;
+use crate::sys::pipe::unnamed_anon_pipe;
+use crate::sys_common::{FromInner, IntoInner};
 
 pub(crate) type AnonPipe = Handle;
 
diff --git a/library/std/src/sys/backtrace.rs b/library/std/src/sys/backtrace.rs
index 133ea520e30..4d939e175cf 100644
--- a/library/std/src/sys/backtrace.rs
+++ b/library/std/src/sys/backtrace.rs
@@ -3,12 +3,10 @@
 
 use crate::backtrace_rs::{self, BacktraceFmt, BytesOrWideString, PrintFmt};
 use crate::borrow::Cow;
-use crate::env;
-use crate::fmt;
-use crate::io;
 use crate::io::prelude::*;
 use crate::path::{self, Path, PathBuf};
 use crate::sync::{Mutex, MutexGuard, PoisonError};
+use crate::{env, fmt, io};
 
 /// Max number of frames to print.
 const MAX_NB_FRAMES: usize = 100;
diff --git a/library/std/src/sys/os_str/bytes.rs b/library/std/src/sys/os_str/bytes.rs
index 2a7477e3afc..0f8bd645352 100644
--- a/library/std/src/sys/os_str/bytes.rs
+++ b/library/std/src/sys/os_str/bytes.rs
@@ -3,13 +3,11 @@
 
 use crate::borrow::Cow;
 use crate::collections::TryReserveError;
-use crate::fmt;
 use crate::fmt::Write;
-use crate::mem;
 use crate::rc::Rc;
-use crate::str;
 use crate::sync::Arc;
 use crate::sys_common::{AsInner, IntoInner};
+use crate::{fmt, mem, str};
 
 #[cfg(test)]
 mod tests;
diff --git a/library/std/src/sys/os_str/wtf8.rs b/library/std/src/sys/os_str/wtf8.rs
index 806bf033dbc..ed975ba58b5 100644
--- a/library/std/src/sys/os_str/wtf8.rs
+++ b/library/std/src/sys/os_str/wtf8.rs
@@ -2,12 +2,11 @@
 //! wrapper around the "WTF-8" encoding; see the `wtf8` module for more.
 use crate::borrow::Cow;
 use crate::collections::TryReserveError;
-use crate::fmt;
-use crate::mem;
 use crate::rc::Rc;
 use crate::sync::Arc;
 use crate::sys_common::wtf8::{check_utf8_boundary, Wtf8, Wtf8Buf};
 use crate::sys_common::{AsInner, FromInner, IntoInner};
+use crate::{fmt, mem};
 
 #[derive(Clone, Hash)]
 pub struct Buf {
diff --git a/library/std/src/sys/pal/common/alloc.rs b/library/std/src/sys/pal/common/alloc.rs
index 54506c32296..1b465f95d1b 100644
--- a/library/std/src/sys/pal/common/alloc.rs
+++ b/library/std/src/sys/pal/common/alloc.rs
@@ -1,7 +1,6 @@
 #![forbid(unsafe_op_in_unsafe_fn)]
 use crate::alloc::{GlobalAlloc, Layout, System};
-use crate::cmp;
-use crate::ptr;
+use crate::{cmp, ptr};
 
 // The minimum alignment guaranteed by the architecture. This value is used to
 // add fast paths for low alignment values.
diff --git a/library/std/src/sys/pal/common/small_c_string.rs b/library/std/src/sys/pal/common/small_c_string.rs
index 37812fc0659..3c96714b5c5 100644
--- a/library/std/src/sys/pal/common/small_c_string.rs
+++ b/library/std/src/sys/pal/common/small_c_string.rs
@@ -1,8 +1,7 @@
 use crate::ffi::{CStr, CString};
 use crate::mem::MaybeUninit;
 use crate::path::Path;
-use crate::slice;
-use crate::{io, ptr};
+use crate::{io, ptr, slice};
 
 // Make sure to stay under 4096 so the compiler doesn't insert a probe frame:
 // https://docs.rs/compiler_builtins/latest/compiler_builtins/probestack/index.html
diff --git a/library/std/src/sys/pal/common/tests.rs b/library/std/src/sys/pal/common/tests.rs
index e72d02203da..b7698907070 100644
--- a/library/std/src/sys/pal/common/tests.rs
+++ b/library/std/src/sys/pal/common/tests.rs
@@ -1,8 +1,9 @@
+use core::iter::repeat;
+
 use crate::ffi::CString;
 use crate::hint::black_box;
 use crate::path::Path;
 use crate::sys::common::small_c_string::run_path_with_cstr;
-use core::iter::repeat;
 
 #[test]
 fn stack_allocation_works() {
diff --git a/library/std/src/sys/pal/hermit/args.rs b/library/std/src/sys/pal/hermit/args.rs
index 220a76e4b12..51afe3434ae 100644
--- a/library/std/src/sys/pal/hermit/args.rs
+++ b/library/std/src/sys/pal/hermit/args.rs
@@ -1,12 +1,8 @@
 use crate::ffi::{c_char, CStr, OsString};
-use crate::fmt;
 use crate::os::hermit::ffi::OsStringExt;
-use crate::ptr;
-use crate::sync::atomic::{
-    AtomicIsize, AtomicPtr,
-    Ordering::{Acquire, Relaxed, Release},
-};
-use crate::vec;
+use crate::sync::atomic::Ordering::{Acquire, Relaxed, Release};
+use crate::sync::atomic::{AtomicIsize, AtomicPtr};
+use crate::{fmt, ptr, vec};
 
 static ARGC: AtomicIsize = AtomicIsize::new(0);
 static ARGV: AtomicPtr<*const u8> = AtomicPtr::new(ptr::null_mut());
diff --git a/library/std/src/sys/pal/hermit/fd.rs b/library/std/src/sys/pal/hermit/fd.rs
index 3c52b85de23..bdcf880484d 100644
--- a/library/std/src/sys/pal/hermit/fd.rs
+++ b/library/std/src/sys/pal/hermit/fd.rs
@@ -3,13 +3,10 @@
 use super::hermit_abi;
 use crate::cmp;
 use crate::io::{self, IoSlice, IoSliceMut, Read};
-use crate::os::hermit::io::{FromRawFd, OwnedFd, RawFd};
-use crate::sys::cvt;
-use crate::sys::unsupported;
+use crate::os::hermit::io::{FromRawFd, OwnedFd, RawFd, *};
+use crate::sys::{cvt, unsupported};
 use crate::sys_common::{AsInner, FromInner, IntoInner};
 
-use crate::os::hermit::io::*;
-
 const fn max_iov() -> usize {
     hermit_abi::IOV_MAX
 }
diff --git a/library/std/src/sys/pal/hermit/fs.rs b/library/std/src/sys/pal/hermit/fs.rs
index e4e9eee044e..cbdb942ac58 100644
--- a/library/std/src/sys/pal/hermit/fs.rs
+++ b/library/std/src/sys/pal/hermit/fs.rs
@@ -4,21 +4,17 @@ use super::hermit_abi::{
     O_DIRECTORY, O_EXCL, O_RDONLY, O_RDWR, O_TRUNC, O_WRONLY, S_IFDIR, S_IFLNK, S_IFMT, S_IFREG,
 };
 use crate::ffi::{CStr, OsStr, OsString};
-use crate::fmt;
-use crate::io::{self, Error, ErrorKind};
-use crate::io::{BorrowedCursor, IoSlice, IoSliceMut, SeekFrom};
-use crate::mem;
+use crate::io::{self, BorrowedCursor, Error, ErrorKind, IoSlice, IoSliceMut, SeekFrom};
 use crate::os::hermit::ffi::OsStringExt;
 use crate::os::hermit::io::{AsFd, AsRawFd, BorrowedFd, FromRawFd, IntoRawFd, RawFd};
 use crate::path::{Path, PathBuf};
 use crate::sync::Arc;
 use crate::sys::common::small_c_string::run_path_with_cstr;
-use crate::sys::cvt;
 use crate::sys::time::SystemTime;
-use crate::sys::unsupported;
-use crate::sys_common::{AsInner, AsInnerMut, FromInner, IntoInner};
-
+use crate::sys::{cvt, unsupported};
 pub use crate::sys_common::fs::{copy, exists};
+use crate::sys_common::{AsInner, AsInnerMut, FromInner, IntoInner};
+use crate::{fmt, mem};
 
 #[derive(Debug)]
 pub struct File(FileDesc);
diff --git a/library/std/src/sys/pal/hermit/io.rs b/library/std/src/sys/pal/hermit/io.rs
index 9de7b53e53c..aad1eef71e9 100644
--- a/library/std/src/sys/pal/hermit/io.rs
+++ b/library/std/src/sys/pal/hermit/io.rs
@@ -1,9 +1,9 @@
+use hermit_abi::{c_void, iovec};
+
 use crate::marker::PhantomData;
 use crate::os::hermit::io::{AsFd, AsRawFd};
 use crate::slice;
 
-use hermit_abi::{c_void, iovec};
-
 #[derive(Copy, Clone)]
 #[repr(transparent)]
 pub struct IoSlice<'a> {
diff --git a/library/std/src/sys/pal/hermit/net.rs b/library/std/src/sys/pal/hermit/net.rs
index 6016d50eba0..416469c0037 100644
--- a/library/std/src/sys/pal/hermit/net.rs
+++ b/library/std/src/sys/pal/hermit/net.rs
@@ -1,17 +1,16 @@
 #![allow(dead_code)]
 
+use core::ffi::c_int;
+
 use super::fd::FileDesc;
-use crate::cmp;
 use crate::io::{self, BorrowedBuf, BorrowedCursor, IoSlice, IoSliceMut};
-use crate::mem;
 use crate::net::{Shutdown, SocketAddr};
 use crate::os::hermit::io::{AsFd, AsRawFd, BorrowedFd, FromRawFd, RawFd};
 use crate::sys::time::Instant;
 use crate::sys_common::net::{getsockopt, setsockopt, sockaddr_to_addr};
 use crate::sys_common::{AsInner, FromInner, IntoInner};
 use crate::time::Duration;
-
-use core::ffi::c_int;
+use crate::{cmp, mem};
 
 #[allow(unused_extern_crates)]
 pub extern crate hermit_abi as netc;
diff --git a/library/std/src/sys/pal/hermit/os.rs b/library/std/src/sys/pal/hermit/os.rs
index a7a73c756f2..9631dac658c 100644
--- a/library/std/src/sys/pal/hermit/os.rs
+++ b/library/std/src/sys/pal/hermit/os.rs
@@ -1,17 +1,15 @@
+use core::slice::memchr;
+
 use super::hermit_abi;
 use crate::collections::HashMap;
 use crate::error::Error as StdError;
 use crate::ffi::{CStr, OsStr, OsString};
-use crate::fmt;
-use crate::io;
 use crate::marker::PhantomData;
 use crate::os::hermit::ffi::OsStringExt;
 use crate::path::{self, PathBuf};
-use crate::str;
 use crate::sync::Mutex;
 use crate::sys::unsupported;
-use crate::vec;
-use core::slice::memchr;
+use crate::{fmt, io, str, vec};
 
 pub fn errno() -> i32 {
     unsafe { hermit_abi::get_errno() }
diff --git a/library/std/src/sys/pal/hermit/thread.rs b/library/std/src/sys/pal/hermit/thread.rs
index 3723f03081c..95c13e53b47 100644
--- a/library/std/src/sys/pal/hermit/thread.rs
+++ b/library/std/src/sys/pal/hermit/thread.rs
@@ -2,11 +2,10 @@
 
 use super::hermit_abi;
 use crate::ffi::CStr;
-use crate::io;
 use crate::mem::ManuallyDrop;
 use crate::num::NonZero;
-use crate::ptr;
 use crate::time::Duration;
+use crate::{io, ptr};
 
 pub type Tid = hermit_abi::Tid;
 
diff --git a/library/std/src/sys/pal/hermit/time.rs b/library/std/src/sys/pal/hermit/time.rs
index e0cb7c2aa98..2c87c4860a2 100644
--- a/library/std/src/sys/pal/hermit/time.rs
+++ b/library/std/src/sys/pal/hermit/time.rs
@@ -1,10 +1,11 @@
 #![allow(dead_code)]
 
+use core::hash::{Hash, Hasher};
+
 use super::hermit_abi::{self, timespec, CLOCK_MONOTONIC, CLOCK_REALTIME};
 use crate::cmp::Ordering;
 use crate::ops::{Add, AddAssign, Sub, SubAssign};
 use crate::time::Duration;
-use core::hash::{Hash, Hasher};
 
 const NSEC_PER_SEC: i32 = 1_000_000_000;
 
diff --git a/library/std/src/sys/pal/itron/error.rs b/library/std/src/sys/pal/itron/error.rs
index dab0aa7b92d..8ff3017c614 100644
--- a/library/std/src/sys/pal/itron/error.rs
+++ b/library/std/src/sys/pal/itron/error.rs
@@ -1,6 +1,6 @@
-use crate::{fmt, io::ErrorKind};
-
 use super::abi;
+use crate::fmt;
+use crate::io::ErrorKind;
 
 /// Wraps a μITRON error code.
 #[derive(Debug, Copy, Clone)]
diff --git a/library/std/src/sys/pal/itron/spin.rs b/library/std/src/sys/pal/itron/spin.rs
index 44d409444bc..6a9a7c72deb 100644
--- a/library/std/src/sys/pal/itron/spin.rs
+++ b/library/std/src/sys/pal/itron/spin.rs
@@ -1,9 +1,7 @@
 use super::abi;
-use crate::{
-    cell::UnsafeCell,
-    mem::MaybeUninit,
-    sync::atomic::{AtomicBool, AtomicUsize, Ordering},
-};
+use crate::cell::UnsafeCell;
+use crate::mem::MaybeUninit;
+use crate::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
 
 /// A mutex implemented by `dis_dsp` (for intra-core synchronization) and a
 /// spinlock (for inter-core synchronization).
diff --git a/library/std/src/sys/pal/itron/task.rs b/library/std/src/sys/pal/itron/task.rs
index 82b9b9bfd3a..5da0c591788 100644
--- a/library/std/src/sys/pal/itron/task.rs
+++ b/library/std/src/sys/pal/itron/task.rs
@@ -1,8 +1,5 @@
-use super::{
-    abi,
-    error::{fail, fail_aborting, ItronError},
-};
-
+use super::abi;
+use super::error::{fail, fail_aborting, ItronError};
 use crate::mem::MaybeUninit;
 
 /// Gets the ID of the task in Running state. Panics on failure.
diff --git a/library/std/src/sys/pal/itron/thread.rs b/library/std/src/sys/pal/itron/thread.rs
index 83581037706..01e69afa99e 100644
--- a/library/std/src/sys/pal/itron/thread.rs
+++ b/library/std/src/sys/pal/itron/thread.rs
@@ -1,22 +1,17 @@
 //! Thread implementation backed by μITRON tasks. Assumes `acre_tsk` and
 //! `exd_tsk` are available.
 
-use super::{
-    abi,
-    error::{expect_success, expect_success_aborting, ItronError},
-    task,
-    time::dur2reltims,
-};
-use crate::{
-    cell::UnsafeCell,
-    ffi::CStr,
-    hint, io,
-    mem::ManuallyDrop,
-    num::NonZero,
-    ptr::NonNull,
-    sync::atomic::{AtomicUsize, Ordering},
-    time::Duration,
-};
+use super::error::{expect_success, expect_success_aborting, ItronError};
+use super::time::dur2reltims;
+use super::{abi, task};
+use crate::cell::UnsafeCell;
+use crate::ffi::CStr;
+use crate::mem::ManuallyDrop;
+use crate::num::NonZero;
+use crate::ptr::NonNull;
+use crate::sync::atomic::{AtomicUsize, Ordering};
+use crate::time::Duration;
+use crate::{hint, io};
 
 pub struct Thread {
     p_inner: NonNull<ThreadInner>,
diff --git a/library/std/src/sys/pal/itron/time.rs b/library/std/src/sys/pal/itron/time.rs
index 427ea0d80e1..7976c27f495 100644
--- a/library/std/src/sys/pal/itron/time.rs
+++ b/library/std/src/sys/pal/itron/time.rs
@@ -1,5 +1,7 @@
-use super::{abi, error::expect_success};
-use crate::{mem::MaybeUninit, time::Duration};
+use super::abi;
+use super::error::expect_success;
+use crate::mem::MaybeUninit;
+use crate::time::Duration;
 
 #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)]
 pub struct Instant(abi::SYSTIM);
diff --git a/library/std/src/sys/pal/sgx/abi/mod.rs b/library/std/src/sys/pal/sgx/abi/mod.rs
index 9508c387415..d8836452e75 100644
--- a/library/std/src/sys/pal/sgx/abi/mod.rs
+++ b/library/std/src/sys/pal/sgx/abi/mod.rs
@@ -1,9 +1,10 @@
 #![cfg_attr(test, allow(unused))] // RT initialization logic is not compiled for test
 
-use crate::io::Write;
 use core::arch::global_asm;
 use core::sync::atomic::{AtomicUsize, Ordering};
 
+use crate::io::Write;
+
 // runtime features
 pub(super) mod panic;
 mod reloc;
diff --git a/library/std/src/sys/pal/sgx/abi/panic.rs b/library/std/src/sys/pal/sgx/abi/panic.rs
index 229b3b3291f..c06b97ee367 100644
--- a/library/std/src/sys/pal/sgx/abi/panic.rs
+++ b/library/std/src/sys/pal/sgx/abi/panic.rs
@@ -1,7 +1,6 @@
 use super::usercalls::alloc::UserRef;
-use crate::cmp;
 use crate::io::{self, Write};
-use crate::mem;
+use crate::{cmp, mem};
 
 extern "C" {
     fn take_debug_panic_buf_ptr() -> *mut u8;
diff --git a/library/std/src/sys/pal/sgx/abi/tls/mod.rs b/library/std/src/sys/pal/sgx/abi/tls/mod.rs
index bab59a3422d..34fc2f20d22 100644
--- a/library/std/src/sys/pal/sgx/abi/tls/mod.rs
+++ b/library/std/src/sys/pal/sgx/abi/tls/mod.rs
@@ -2,10 +2,9 @@ mod sync_bitset;
 
 use self::sync_bitset::*;
 use crate::cell::Cell;
-use crate::mem;
 use crate::num::NonZero;
-use crate::ptr;
 use crate::sync::atomic::{AtomicUsize, Ordering};
+use crate::{mem, ptr};
 
 #[cfg(target_pointer_width = "64")]
 const USIZE_BITS: usize = 64;
diff --git a/library/std/src/sys/pal/sgx/abi/usercalls/alloc.rs b/library/std/src/sys/pal/sgx/abi/usercalls/alloc.rs
index cf3ce60dc3d..29809525739 100644
--- a/library/std/src/sys/pal/sgx/abi/usercalls/alloc.rs
+++ b/library/std/src/sys/pal/sgx/abi/usercalls/alloc.rs
@@ -1,18 +1,16 @@
 #![allow(unused)]
 
+use fortanix_sgx_abi::*;
+
+use super::super::mem::{is_enclave_range, is_user_range};
 use crate::arch::asm;
 use crate::cell::UnsafeCell;
-use crate::cmp;
 use crate::convert::TryInto;
-use crate::intrinsics;
 use crate::mem::{self, ManuallyDrop};
 use crate::ops::{CoerceUnsized, Deref, DerefMut, Index, IndexMut};
 use crate::ptr::{self, NonNull};
-use crate::slice;
 use crate::slice::SliceIndex;
-
-use super::super::mem::{is_enclave_range, is_user_range};
-use fortanix_sgx_abi::*;
+use crate::{cmp, intrinsics, slice};
 
 /// A type that can be safely read from or written to userspace.
 ///
diff --git a/library/std/src/sys/pal/sgx/abi/usercalls/tests.rs b/library/std/src/sys/pal/sgx/abi/usercalls/tests.rs
index 58b8eb215d7..ef824d35f4a 100644
--- a/library/std/src/sys/pal/sgx/abi/usercalls/tests.rs
+++ b/library/std/src/sys/pal/sgx/abi/usercalls/tests.rs
@@ -1,5 +1,4 @@
-use super::alloc::User;
-use super::alloc::{copy_from_userspace, copy_to_userspace};
+use super::alloc::{copy_from_userspace, copy_to_userspace, User};
 
 #[test]
 fn test_copy_to_userspace_function() {
diff --git a/library/std/src/sys/pal/sgx/alloc.rs b/library/std/src/sys/pal/sgx/alloc.rs
index 0c7bf9a9201..f68ede9fcf0 100644
--- a/library/std/src/sys/pal/sgx/alloc.rs
+++ b/library/std/src/sys/pal/sgx/alloc.rs
@@ -1,9 +1,9 @@
-use crate::alloc::{GlobalAlloc, Layout, System};
-use crate::ptr;
 use core::sync::atomic::{AtomicBool, Ordering};
 
 use super::abi::mem as sgx_mem;
 use super::waitqueue::SpinMutex;
+use crate::alloc::{GlobalAlloc, Layout, System};
+use crate::ptr;
 
 // Using a SpinMutex because we never want to exit the enclave waiting for the
 // allocator.
diff --git a/library/std/src/sys/pal/sgx/args.rs b/library/std/src/sys/pal/sgx/args.rs
index ef4176c4ac0..a72a041da6c 100644
--- a/library/std/src/sys/pal/sgx/args.rs
+++ b/library/std/src/sys/pal/sgx/args.rs
@@ -1,10 +1,10 @@
-use super::abi::usercalls::{alloc, raw::ByteBuffer};
+use super::abi::usercalls::alloc;
+use super::abi::usercalls::raw::ByteBuffer;
 use crate::ffi::OsString;
-use crate::fmt;
-use crate::slice;
 use crate::sync::atomic::{AtomicUsize, Ordering};
 use crate::sys::os_str::Buf;
 use crate::sys_common::FromInner;
+use crate::{fmt, slice};
 
 #[cfg_attr(test, linkage = "available_externally")]
 #[export_name = "_ZN16__rust_internals3std3sys3sgx4args4ARGSE"]
diff --git a/library/std/src/sys/pal/sgx/net.rs b/library/std/src/sys/pal/sgx/net.rs
index 68a2d5eded2..f2e751c5119 100644
--- a/library/std/src/sys/pal/sgx/net.rs
+++ b/library/std/src/sys/pal/sgx/net.rs
@@ -1,13 +1,11 @@
-use crate::error;
-use crate::fmt;
+use super::abi::usercalls;
 use crate::io::{self, BorrowedCursor, IoSlice, IoSliceMut};
 use crate::net::{Ipv4Addr, Ipv6Addr, Shutdown, SocketAddr, ToSocketAddrs};
 use crate::sync::Arc;
 use crate::sys::fd::FileDesc;
 use crate::sys::{sgx_ineffective, unsupported, AsInner, FromInner, IntoInner, TryIntoInner};
 use crate::time::Duration;
-
-use super::abi::usercalls;
+use crate::{error, fmt};
 
 const DEFAULT_FAKE_TTL: u32 = 64;
 
diff --git a/library/std/src/sys/pal/sgx/os.rs b/library/std/src/sys/pal/sgx/os.rs
index c021300d4ae..46af710aa39 100644
--- a/library/std/src/sys/pal/sgx/os.rs
+++ b/library/std/src/sys/pal/sgx/os.rs
@@ -3,16 +3,12 @@ use fortanix_sgx_abi::{Error, RESULT_SUCCESS};
 use crate::collections::HashMap;
 use crate::error::Error as StdError;
 use crate::ffi::{OsStr, OsString};
-use crate::fmt;
-use crate::io;
 use crate::marker::PhantomData;
 use crate::path::{self, PathBuf};
-use crate::str;
 use crate::sync::atomic::{AtomicUsize, Ordering};
-use crate::sync::Mutex;
-use crate::sync::Once;
+use crate::sync::{Mutex, Once};
 use crate::sys::{decode_error_kind, sgx_ineffective, unsupported};
-use crate::vec;
+use crate::{fmt, io, str, vec};
 
 pub fn errno() -> i32 {
     RESULT_SUCCESS
diff --git a/library/std/src/sys/pal/sgx/thread.rs b/library/std/src/sys/pal/sgx/thread.rs
index 446cdd18b7e..df65d1cc8fc 100644
--- a/library/std/src/sys/pal/sgx/thread.rs
+++ b/library/std/src/sys/pal/sgx/thread.rs
@@ -1,12 +1,11 @@
 #![cfg_attr(test, allow(dead_code))] // why is this necessary?
+use super::abi::usercalls;
 use super::unsupported;
 use crate::ffi::CStr;
 use crate::io;
 use crate::num::NonZero;
 use crate::time::Duration;
 
-use super::abi::usercalls;
-
 pub struct Thread(task_queue::JoinHandle);
 
 pub const DEFAULT_MIN_STACK_SIZE: usize = 4096;
diff --git a/library/std/src/sys/pal/sgx/thread_parking.rs b/library/std/src/sys/pal/sgx/thread_parking.rs
index 0006cd4f1be..660624ea9c3 100644
--- a/library/std/src/sys/pal/sgx/thread_parking.rs
+++ b/library/std/src/sys/pal/sgx/thread_parking.rs
@@ -1,7 +1,8 @@
+use fortanix_sgx_abi::{EV_UNPARK, WAIT_INDEFINITE};
+
 use super::abi::usercalls;
 use crate::io::ErrorKind;
 use crate::time::Duration;
-use fortanix_sgx_abi::{EV_UNPARK, WAIT_INDEFINITE};
 
 pub type ThreadId = fortanix_sgx_abi::Tcs;
 
diff --git a/library/std/src/sys/pal/sgx/waitqueue/mod.rs b/library/std/src/sys/pal/sgx/waitqueue/mod.rs
index f5668a9493f..bd114523fe8 100644
--- a/library/std/src/sys/pal/sgx/waitqueue/mod.rs
+++ b/library/std/src/sys/pal/sgx/waitqueue/mod.rs
@@ -16,17 +16,15 @@ mod tests;
 mod spin_mutex;
 mod unsafe_list;
 
-use crate::num::NonZero;
-use crate::ops::{Deref, DerefMut};
-use crate::panic::{self, AssertUnwindSafe};
-use crate::time::Duration;
-
-use super::abi::thread;
-use super::abi::usercalls;
 use fortanix_sgx_abi::{Tcs, EV_UNPARK, WAIT_INDEFINITE};
 
 pub use self::spin_mutex::{try_lock_or_false, SpinMutex, SpinMutexGuard};
 use self::unsafe_list::{UnsafeList, UnsafeListEntry};
+use super::abi::{thread, usercalls};
+use crate::num::NonZero;
+use crate::ops::{Deref, DerefMut};
+use crate::panic::{self, AssertUnwindSafe};
+use crate::time::Duration;
 
 /// An queue entry in a `WaitQueue`.
 struct WaitEntry {
diff --git a/library/std/src/sys/pal/solid/abi/fs.rs b/library/std/src/sys/pal/solid/abi/fs.rs
index 75efaaac2a9..394be15b006 100644
--- a/library/std/src/sys/pal/solid/abi/fs.rs
+++ b/library/std/src/sys/pal/solid/abi/fs.rs
@@ -1,11 +1,12 @@
 //! `solid_fs.h`
 
-use crate::os::raw::{c_char, c_int, c_uchar};
 pub use libc::{
     ino_t, off_t, stat, time_t, O_APPEND, O_CREAT, O_EXCL, O_RDONLY, O_RDWR, O_TRUNC, O_WRONLY,
     SEEK_CUR, SEEK_END, SEEK_SET, S_IFBLK, S_IFCHR, S_IFDIR, S_IFIFO, S_IFMT, S_IFREG, S_IWRITE,
 };
 
+use crate::os::raw::{c_char, c_int, c_uchar};
+
 pub const O_ACCMODE: c_int = 0x3;
 
 pub const SOLID_MAX_PATH: usize = 256;
diff --git a/library/std/src/sys/pal/solid/abi/mod.rs b/library/std/src/sys/pal/solid/abi/mod.rs
index 8440d572cfb..62cd86236bb 100644
--- a/library/std/src/sys/pal/solid/abi/mod.rs
+++ b/library/std/src/sys/pal/solid/abi/mod.rs
@@ -3,7 +3,6 @@ use crate::os::raw::c_int;
 mod fs;
 pub mod sockets;
 pub use self::fs::*;
-
 // `solid_types.h`
 pub use super::itron::abi::{ER, ER_ID, E_TMOUT, ID};
 
diff --git a/library/std/src/sys/pal/solid/abi/sockets.rs b/library/std/src/sys/pal/solid/abi/sockets.rs
index 11c430360ce..3c9e3f9ffb9 100644
--- a/library/std/src/sys/pal/solid/abi/sockets.rs
+++ b/library/std/src/sys/pal/solid/abi/sockets.rs
@@ -1,6 +1,7 @@
-use crate::os::raw::{c_char, c_uint, c_void};
 pub use libc::{c_int, c_long, size_t, ssize_t, timeval};
 
+use crate::os::raw::{c_char, c_uint, c_void};
+
 pub const SOLID_NET_ERR_BASE: c_int = -2000;
 pub const EINPROGRESS: c_int = SOLID_NET_ERR_BASE - libc::EINPROGRESS;
 
diff --git a/library/std/src/sys/pal/solid/alloc.rs b/library/std/src/sys/pal/solid/alloc.rs
index d013bd87610..4cf60ac9b2e 100644
--- a/library/std/src/sys/pal/solid/alloc.rs
+++ b/library/std/src/sys/pal/solid/alloc.rs
@@ -1,7 +1,5 @@
-use crate::{
-    alloc::{GlobalAlloc, Layout, System},
-    sys::common::alloc::{realloc_fallback, MIN_ALIGN},
-};
+use crate::alloc::{GlobalAlloc, Layout, System};
+use crate::sys::common::alloc::{realloc_fallback, MIN_ALIGN};
 
 #[stable(feature = "alloc_system_type", since = "1.28.0")]
 unsafe impl GlobalAlloc for System {
diff --git a/library/std/src/sys/pal/solid/error.rs b/library/std/src/sys/pal/solid/error.rs
index 547b4f3a984..66c4d8a0ea2 100644
--- a/library/std/src/sys/pal/solid/error.rs
+++ b/library/std/src/sys/pal/solid/error.rs
@@ -1,8 +1,7 @@
+pub use self::itron::error::{expect_success, ItronError as SolidError};
 use super::{abi, itron, net};
 use crate::io::ErrorKind;
 
-pub use self::itron::error::{expect_success, ItronError as SolidError};
-
 /// Describe the specified SOLID error code. Returns `None` if it's an
 /// undefined error code.
 ///
diff --git a/library/std/src/sys/pal/solid/fs.rs b/library/std/src/sys/pal/solid/fs.rs
index dc83e4f4b49..8179ec8821a 100644
--- a/library/std/src/sys/pal/solid/fs.rs
+++ b/library/std/src/sys/pal/solid/fs.rs
@@ -1,17 +1,14 @@
 use super::{abi, error};
-use crate::{
-    ffi::{CStr, CString, OsStr, OsString},
-    fmt,
-    io::{self, BorrowedCursor, IoSlice, IoSliceMut, SeekFrom},
-    mem::MaybeUninit,
-    os::raw::{c_int, c_short},
-    os::solid::ffi::OsStrExt,
-    path::{Path, PathBuf},
-    sync::Arc,
-    sys::time::SystemTime,
-    sys::unsupported,
-};
-
+use crate::ffi::{CStr, CString, OsStr, OsString};
+use crate::fmt;
+use crate::io::{self, BorrowedCursor, IoSlice, IoSliceMut, SeekFrom};
+use crate::mem::MaybeUninit;
+use crate::os::raw::{c_int, c_short};
+use crate::os::solid::ffi::OsStrExt;
+use crate::path::{Path, PathBuf};
+use crate::sync::Arc;
+use crate::sys::time::SystemTime;
+use crate::sys::unsupported;
 pub use crate::sys_common::fs::exists;
 
 /// A file descriptor.
diff --git a/library/std/src/sys/pal/solid/io.rs b/library/std/src/sys/pal/solid/io.rs
index a862bb78702..4b1f788a492 100644
--- a/library/std/src/sys/pal/solid/io.rs
+++ b/library/std/src/sys/pal/solid/io.rs
@@ -1,8 +1,8 @@
-use crate::marker::PhantomData;
-use crate::slice;
+use libc::c_void;
 
 use super::abi::sockets::iovec;
-use libc::c_void;
+use crate::marker::PhantomData;
+use crate::slice;
 
 #[derive(Copy, Clone)]
 #[repr(transparent)]
diff --git a/library/std/src/sys/pal/solid/mod.rs b/library/std/src/sys/pal/solid/mod.rs
index 0b158fb63df..cbf34286878 100644
--- a/library/std/src/sys/pal/solid/mod.rs
+++ b/library/std/src/sys/pal/solid/mod.rs
@@ -32,8 +32,7 @@ pub mod pipe;
 #[path = "../unsupported/process.rs"]
 pub mod process;
 pub mod stdio;
-pub use self::itron::thread;
-pub use self::itron::thread_parking;
+pub use self::itron::{thread, thread_parking};
 pub mod time;
 
 // SAFETY: must be called only once during runtime initialization.
diff --git a/library/std/src/sys/pal/solid/net.rs b/library/std/src/sys/pal/solid/net.rs
index 5bd339849e9..b6a31395095 100644
--- a/library/std/src/sys/pal/solid/net.rs
+++ b/library/std/src/sys/pal/solid/net.rs
@@ -1,19 +1,15 @@
-use super::abi;
-use crate::{
-    cmp,
-    ffi::CStr,
-    io::{self, BorrowedBuf, BorrowedCursor, ErrorKind, IoSlice, IoSliceMut},
-    mem,
-    net::{Shutdown, SocketAddr},
-    os::solid::io::{AsFd, AsRawFd, BorrowedFd, FromRawFd, IntoRawFd, OwnedFd},
-    ptr, str,
-    sys_common::net::{getsockopt, setsockopt, sockaddr_to_addr},
-    sys_common::{FromInner, IntoInner},
-    time::Duration,
-};
+use libc::{c_int, c_void, size_t};
 
 use self::netc::{sockaddr, socklen_t, MSG_PEEK};
-use libc::{c_int, c_void, size_t};
+use super::abi;
+use crate::ffi::CStr;
+use crate::io::{self, BorrowedBuf, BorrowedCursor, ErrorKind, IoSlice, IoSliceMut};
+use crate::net::{Shutdown, SocketAddr};
+use crate::os::solid::io::{AsFd, AsRawFd, BorrowedFd, FromRawFd, IntoRawFd, OwnedFd};
+use crate::sys_common::net::{getsockopt, setsockopt, sockaddr_to_addr};
+use crate::sys_common::{FromInner, IntoInner};
+use crate::time::Duration;
+use crate::{cmp, mem, ptr, str};
 
 pub mod netc {
     pub use super::super::abi::sockets::*;
diff --git a/library/std/src/sys/pal/solid/os.rs b/library/std/src/sys/pal/solid/os.rs
index ac90aae4ebe..d8afcb91f67 100644
--- a/library/std/src/sys/pal/solid/os.rs
+++ b/library/std/src/sys/pal/solid/os.rs
@@ -1,20 +1,14 @@
-use super::unsupported;
+use core::slice::memchr;
+
+use super::{error, itron, unsupported};
 use crate::error::Error as StdError;
 use crate::ffi::{CStr, OsStr, OsString};
-use crate::fmt;
-use crate::io;
-use crate::os::{
-    raw::{c_char, c_int},
-    solid::ffi::{OsStrExt, OsStringExt},
-};
+use crate::os::raw::{c_char, c_int};
+use crate::os::solid::ffi::{OsStrExt, OsStringExt};
 use crate::path::{self, PathBuf};
 use crate::sync::{PoisonError, RwLock};
 use crate::sys::common::small_c_string::run_with_cstr;
-use crate::vec;
-
-use super::{error, itron};
-
-use core::slice::memchr;
+use crate::{fmt, io, vec};
 
 // `solid` directly maps `errno`s to μITRON error codes.
 impl itron::error::ItronError {
diff --git a/library/std/src/sys/pal/solid/time.rs b/library/std/src/sys/pal/solid/time.rs
index f83f1644fe8..3f9bbb0b63c 100644
--- a/library/std/src/sys/pal/solid/time.rs
+++ b/library/std/src/sys/pal/solid/time.rs
@@ -1,7 +1,8 @@
-use super::{abi, error::expect_success};
-use crate::{mem::MaybeUninit, time::Duration};
-
+use super::abi;
+use super::error::expect_success;
 pub use super::itron::time::Instant;
+use crate::mem::MaybeUninit;
+use crate::time::Duration;
 
 #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)]
 pub struct SystemTime(abi::time_t);
diff --git a/library/std/src/sys/pal/teeos/os.rs b/library/std/src/sys/pal/teeos/os.rs
index 3be0846a6dd..82cade771b5 100644
--- a/library/std/src/sys/pal/teeos/os.rs
+++ b/library/std/src/sys/pal/teeos/os.rs
@@ -2,14 +2,11 @@
 
 use core::marker::PhantomData;
 
+use super::unsupported;
 use crate::error::Error as StdError;
 use crate::ffi::{OsStr, OsString};
-use crate::fmt;
-use crate::io;
-use crate::path;
 use crate::path::PathBuf;
-
-use super::unsupported;
+use crate::{fmt, io, path};
 
 pub fn errno() -> i32 {
     unsafe { (*libc::__errno_location()) as i32 }
diff --git a/library/std/src/sys/pal/teeos/stdio.rs b/library/std/src/sys/pal/teeos/stdio.rs
index 9ca04f29273..67e251812da 100644
--- a/library/std/src/sys/pal/teeos/stdio.rs
+++ b/library/std/src/sys/pal/teeos/stdio.rs
@@ -1,8 +1,9 @@
 #![deny(unsafe_op_in_unsafe_fn)]
 
-use crate::io;
 use core::arch::asm;
 
+use crate::io;
+
 pub struct Stdin;
 pub struct Stdout;
 pub struct Stderr;
diff --git a/library/std/src/sys/pal/teeos/thread.rs b/library/std/src/sys/pal/teeos/thread.rs
index b821e98f9cb..15c65240ddd 100644
--- a/library/std/src/sys/pal/teeos/thread.rs
+++ b/library/std/src/sys/pal/teeos/thread.rs
@@ -1,11 +1,9 @@
-use crate::cmp;
 use crate::ffi::CStr;
-use crate::io;
 use crate::mem::{self, ManuallyDrop};
 use crate::num::NonZero;
-use crate::ptr;
 use crate::sys::os;
 use crate::time::Duration;
+use crate::{cmp, io, ptr};
 
 pub const DEFAULT_MIN_STACK_SIZE: usize = 8 * 1024;
 
diff --git a/library/std/src/sys/pal/uefi/args.rs b/library/std/src/sys/pal/uefi/args.rs
index ca6bdfc55eb..bdf6f5a0c1c 100644
--- a/library/std/src/sys/pal/uefi/args.rs
+++ b/library/std/src/sys/pal/uefi/args.rs
@@ -3,10 +3,9 @@ use r_efi::protocols::loaded_image;
 use super::helpers;
 use crate::env::current_exe;
 use crate::ffi::OsString;
-use crate::fmt;
 use crate::iter::Iterator;
 use crate::mem::size_of;
-use crate::vec;
+use crate::{fmt, vec};
 
 pub struct Args {
     parsed_args_list: vec::IntoIter<OsString>,
diff --git a/library/std/src/sys/pal/uefi/helpers.rs b/library/std/src/sys/pal/uefi/helpers.rs
index 586dbd84af2..4031d33ba80 100644
--- a/library/std/src/sys/pal/uefi/helpers.rs
+++ b/library/std/src/sys/pal/uefi/helpers.rs
@@ -15,7 +15,9 @@ use r_efi::protocols::{device_path, device_path_to_text};
 use crate::ffi::{OsStr, OsString};
 use crate::io::{self, const_io_error};
 use crate::mem::{size_of, MaybeUninit};
-use crate::os::uefi::{self, env::boot_services, ffi::OsStrExt, ffi::OsStringExt};
+use crate::os::uefi::env::boot_services;
+use crate::os::uefi::ffi::{OsStrExt, OsStringExt};
+use crate::os::uefi::{self};
 use crate::ptr::NonNull;
 use crate::slice;
 use crate::sync::atomic::{AtomicPtr, Ordering};
diff --git a/library/std/src/sys/pal/uefi/mod.rs b/library/std/src/sys/pal/uefi/mod.rs
index c54e9477bfc..851bcea4c1e 100644
--- a/library/std/src/sys/pal/uefi/mod.rs
+++ b/library/std/src/sys/pal/uefi/mod.rs
@@ -101,9 +101,10 @@ pub const fn unsupported_err() -> std_io::Error {
 }
 
 pub fn decode_error_kind(code: RawOsError) -> crate::io::ErrorKind {
-    use crate::io::ErrorKind;
     use r_efi::efi::Status;
 
+    use crate::io::ErrorKind;
+
     match r_efi::efi::Status::from_usize(code) {
         Status::ALREADY_STARTED
         | Status::COMPROMISED_DATA
diff --git a/library/std/src/sys/pal/uefi/os.rs b/library/std/src/sys/pal/uefi/os.rs
index 0b27977df2f..4d2d7264704 100644
--- a/library/std/src/sys/pal/uefi/os.rs
+++ b/library/std/src/sys/pal/uefi/os.rs
@@ -1,14 +1,14 @@
+use r_efi::efi::protocols::{device_path, loaded_image_device_path};
+use r_efi::efi::Status;
+
 use super::{helpers, unsupported, RawOsError};
 use crate::error::Error as StdError;
 use crate::ffi::{OsStr, OsString};
-use crate::fmt;
-use crate::io;
 use crate::marker::PhantomData;
 use crate::os::uefi;
 use crate::path::{self, PathBuf};
 use crate::ptr::NonNull;
-use r_efi::efi::protocols::{device_path, loaded_image_device_path};
-use r_efi::efi::Status;
+use crate::{fmt, io};
 
 pub fn errno() -> RawOsError {
     0
diff --git a/library/std/src/sys/pal/uefi/process.rs b/library/std/src/sys/pal/uefi/process.rs
index 5c7c8415ee2..fdc5f5d7e4f 100644
--- a/library/std/src/sys/pal/uefi/process.rs
+++ b/library/std/src/sys/pal/uefi/process.rs
@@ -1,20 +1,15 @@
 use r_efi::protocols::simple_text_output;
 
-use crate::ffi::OsStr;
-use crate::ffi::OsString;
-use crate::fmt;
-use crate::io;
-use crate::num::NonZero;
-use crate::num::NonZeroI32;
+use super::helpers;
+pub use crate::ffi::OsString as EnvKey;
+use crate::ffi::{OsStr, OsString};
+use crate::num::{NonZero, NonZeroI32};
 use crate::path::Path;
 use crate::sys::fs::File;
 use crate::sys::pipe::AnonPipe;
 use crate::sys::unsupported;
 use crate::sys_common::process::{CommandEnv, CommandEnvs};
-
-pub use crate::ffi::OsString as EnvKey;
-
-use super::helpers;
+use crate::{fmt, io};
 
 ////////////////////////////////////////////////////////////////////////////////
 // Command
diff --git a/library/std/src/sys/pal/uefi/time.rs b/library/std/src/sys/pal/uefi/time.rs
index 76562cf9f51..a97d69f997b 100644
--- a/library/std/src/sys/pal/uefi/time.rs
+++ b/library/std/src/sys/pal/uefi/time.rs
@@ -59,11 +59,12 @@ impl SystemTime {
 }
 
 pub(crate) mod system_time_internal {
+    use r_efi::efi::{RuntimeServices, Time};
+
     use super::super::helpers;
     use super::*;
     use crate::mem::MaybeUninit;
     use crate::ptr::NonNull;
-    use r_efi::efi::{RuntimeServices, Time};
 
     pub fn now() -> Option<SystemTime> {
         let runtime_services: NonNull<RuntimeServices> = helpers::runtime_services()?;
@@ -114,13 +115,14 @@ pub(crate) mod system_time_internal {
 }
 
 pub(crate) mod instant_internal {
+    use r_efi::protocols::timestamp;
+
     use super::super::helpers;
     use super::*;
     use crate::mem::MaybeUninit;
     use crate::ptr::NonNull;
     use crate::sync::atomic::{AtomicPtr, Ordering};
     use crate::sys_common::mul_div_u64;
-    use r_efi::protocols::timestamp;
 
     const NS_PER_SEC: u64 = 1_000_000_000;
 
diff --git a/library/std/src/sys/pal/unix/args.rs b/library/std/src/sys/pal/unix/args.rs
index e2ec838b740..9a37e1a0346 100644
--- a/library/std/src/sys/pal/unix/args.rs
+++ b/library/std/src/sys/pal/unix/args.rs
@@ -6,9 +6,8 @@
 #![allow(dead_code)] // runtime init functions not used during testing
 
 use crate::ffi::{CStr, OsString};
-use crate::fmt;
 use crate::os::unix::ffi::OsStringExt;
-use crate::vec;
+use crate::{fmt, vec};
 
 /// One-time global initialization.
 pub unsafe fn init(argc: isize, argv: *const *const u8) {
diff --git a/library/std/src/sys/pal/unix/fd.rs b/library/std/src/sys/pal/unix/fd.rs
index f705bd61442..d8e239ee23e 100644
--- a/library/std/src/sys/pal/unix/fd.rs
+++ b/library/std/src/sys/pal/unix/fd.rs
@@ -3,12 +3,6 @@
 #[cfg(test)]
 mod tests;
 
-use crate::cmp;
-use crate::io::{self, BorrowedCursor, IoSlice, IoSliceMut, Read};
-use crate::os::unix::io::{AsFd, AsRawFd, BorrowedFd, FromRawFd, IntoRawFd, OwnedFd, RawFd};
-use crate::sys::cvt;
-use crate::sys_common::{AsInner, FromInner, IntoInner};
-
 #[cfg(any(
     target_os = "android",
     target_os = "linux",
@@ -26,6 +20,12 @@ use libc::off64_t;
 )))]
 use libc::off_t as off64_t;
 
+use crate::cmp;
+use crate::io::{self, BorrowedCursor, IoSlice, IoSliceMut, Read};
+use crate::os::unix::io::{AsFd, AsRawFd, BorrowedFd, FromRawFd, IntoRawFd, OwnedFd, RawFd};
+use crate::sys::cvt;
+use crate::sys_common::{AsInner, FromInner, IntoInner};
+
 #[derive(Debug)]
 pub struct FileDesc(OwnedFd);
 
diff --git a/library/std/src/sys/pal/unix/fd/tests.rs b/library/std/src/sys/pal/unix/fd/tests.rs
index 5d17e46786c..c5301ce6557 100644
--- a/library/std/src/sys/pal/unix/fd/tests.rs
+++ b/library/std/src/sys/pal/unix/fd/tests.rs
@@ -1,6 +1,7 @@
+use core::mem::ManuallyDrop;
+
 use super::{FileDesc, IoSlice};
 use crate::os::unix::io::FromRawFd;
-use core::mem::ManuallyDrop;
 
 #[test]
 fn limit_vector_count() {
diff --git a/library/std/src/sys/pal/unix/fs.rs b/library/std/src/sys/pal/unix/fs.rs
index c7915e26e3f..bdb83f07857 100644
--- a/library/std/src/sys/pal/unix/fs.rs
+++ b/library/std/src/sys/pal/unix/fs.rs
@@ -4,29 +4,6 @@
 #[cfg(test)]
 mod tests;
 
-use crate::os::unix::prelude::*;
-
-use crate::ffi::{CStr, OsStr, OsString};
-use crate::fmt::{self, Write as _};
-use crate::io::{self, BorrowedCursor, Error, IoSlice, IoSliceMut, SeekFrom};
-use crate::mem;
-use crate::os::unix::io::{AsFd, AsRawFd, BorrowedFd, FromRawFd, IntoRawFd};
-use crate::path::{Path, PathBuf};
-use crate::ptr;
-use crate::sync::Arc;
-use crate::sys::common::small_c_string::run_path_with_cstr;
-use crate::sys::fd::FileDesc;
-use crate::sys::time::SystemTime;
-use crate::sys::{cvt, cvt_r};
-use crate::sys_common::{AsInner, AsInnerMut, FromInner, IntoInner};
-
-#[cfg(all(target_os = "linux", target_env = "gnu"))]
-use crate::sys::weak::syscall;
-#[cfg(target_os = "android")]
-use crate::sys::weak::weak;
-
-use libc::{c_int, mode_t};
-
 #[cfg(all(target_os = "linux", target_env = "gnu"))]
 use libc::c_char;
 #[cfg(any(
@@ -73,6 +50,7 @@ use libc::readdir64_r;
     target_os = "hurd",
 )))]
 use libc::readdir_r as readdir64_r;
+use libc::{c_int, mode_t};
 #[cfg(target_os = "android")]
 use libc::{
     dirent as dirent64, fstat as fstat64, fstatat as fstatat64, ftruncate64, lseek64,
@@ -97,7 +75,24 @@ use libc::{
 ))]
 use libc::{dirent64, fstat64, ftruncate64, lseek64, lstat64, off64_t, open64, stat64};
 
+use crate::ffi::{CStr, OsStr, OsString};
+use crate::fmt::{self, Write as _};
+use crate::io::{self, BorrowedCursor, Error, IoSlice, IoSliceMut, SeekFrom};
+use crate::os::unix::io::{AsFd, AsRawFd, BorrowedFd, FromRawFd, IntoRawFd};
+use crate::os::unix::prelude::*;
+use crate::path::{Path, PathBuf};
+use crate::sync::Arc;
+use crate::sys::common::small_c_string::run_path_with_cstr;
+use crate::sys::fd::FileDesc;
+use crate::sys::time::SystemTime;
+#[cfg(all(target_os = "linux", target_env = "gnu"))]
+use crate::sys::weak::syscall;
+#[cfg(target_os = "android")]
+use crate::sys::weak::weak;
+use crate::sys::{cvt, cvt_r};
 pub use crate::sys_common::fs::exists;
+use crate::sys_common::{AsInner, AsInnerMut, FromInner, IntoInner};
+use crate::{mem, ptr};
 
 pub struct File(FileDesc);
 
@@ -2021,6 +2016,11 @@ mod remove_dir_impl {
     miri
 )))]
 mod remove_dir_impl {
+    #[cfg(not(all(target_os = "linux", target_env = "gnu")))]
+    use libc::{fdopendir, openat, unlinkat};
+    #[cfg(all(target_os = "linux", target_env = "gnu"))]
+    use libc::{fdopendir, openat64 as openat, unlinkat};
+
     use super::{lstat, Dir, DirEntry, InnerReadDir, ReadDir};
     use crate::ffi::CStr;
     use crate::io;
@@ -2030,11 +2030,6 @@ mod remove_dir_impl {
     use crate::sys::common::small_c_string::run_path_with_cstr;
     use crate::sys::{cvt, cvt_r};
 
-    #[cfg(not(all(target_os = "linux", target_env = "gnu")))]
-    use libc::{fdopendir, openat, unlinkat};
-    #[cfg(all(target_os = "linux", target_env = "gnu"))]
-    use libc::{fdopendir, openat64 as openat, unlinkat};
-
     pub fn openat_nofollow_dironly(parent_fd: Option<RawFd>, p: &CStr) -> io::Result<OwnedFd> {
         let fd = cvt_r(|| unsafe {
             openat(
diff --git a/library/std/src/sys/pal/unix/io.rs b/library/std/src/sys/pal/unix/io.rs
index 29c340dd349..181c35a971e 100644
--- a/library/std/src/sys/pal/unix/io.rs
+++ b/library/std/src/sys/pal/unix/io.rs
@@ -1,9 +1,9 @@
+use libc::{c_void, iovec};
+
 use crate::marker::PhantomData;
 use crate::os::fd::{AsFd, AsRawFd};
 use crate::slice;
 
-use libc::{c_void, iovec};
-
 #[derive(Copy, Clone)]
 #[repr(transparent)]
 pub struct IoSlice<'a> {
diff --git a/library/std/src/sys/pal/unix/kernel_copy.rs b/library/std/src/sys/pal/unix/kernel_copy.rs
index cd38b7c07e2..652b2e1feb7 100644
--- a/library/std/src/sys/pal/unix/kernel_copy.rs
+++ b/library/std/src/sys/pal/unix/kernel_copy.rs
@@ -42,6 +42,12 @@
 //!   progress, they can hit a performance cliff.
 //! * complexity
 
+#[cfg(not(any(all(target_os = "linux", target_env = "gnu"), target_os = "hurd")))]
+use libc::sendfile as sendfile64;
+#[cfg(any(all(target_os = "linux", target_env = "gnu"), target_os = "hurd"))]
+use libc::sendfile64;
+use libc::{EBADF, EINVAL, ENOSYS, EOPNOTSUPP, EOVERFLOW, EPERM, EXDEV};
+
 use crate::cmp::min;
 use crate::fs::{File, Metadata};
 use crate::io::copy::generic_copy;
@@ -59,11 +65,6 @@ use crate::ptr;
 use crate::sync::atomic::{AtomicBool, AtomicU8, Ordering};
 use crate::sys::cvt;
 use crate::sys::weak::syscall;
-#[cfg(not(any(all(target_os = "linux", target_env = "gnu"), target_os = "hurd")))]
-use libc::sendfile as sendfile64;
-#[cfg(any(all(target_os = "linux", target_env = "gnu"), target_os = "hurd"))]
-use libc::sendfile64;
-use libc::{EBADF, EINVAL, ENOSYS, EOPNOTSUPP, EOVERFLOW, EPERM, EXDEV};
 
 #[cfg(test)]
 mod tests;
diff --git a/library/std/src/sys/pal/unix/kernel_copy/tests.rs b/library/std/src/sys/pal/unix/kernel_copy/tests.rs
index a524270e3fb..1350d743ff6 100644
--- a/library/std/src/sys/pal/unix/kernel_copy/tests.rs
+++ b/library/std/src/sys/pal/unix/kernel_copy/tests.rs
@@ -1,8 +1,6 @@
 use crate::fs::OpenOptions;
 use crate::io;
-use crate::io::Result;
-use crate::io::SeekFrom;
-use crate::io::{BufRead, Read, Seek, Write};
+use crate::io::{BufRead, Read, Result, Seek, SeekFrom, Write};
 use crate::os::unix::io::AsRawFd;
 use crate::sys_common::io::test::tmpdir;
 
diff --git a/library/std/src/sys/pal/unix/mod.rs b/library/std/src/sys/pal/unix/mod.rs
index 7f5a8d0ce85..4898bdd2fa3 100644
--- a/library/std/src/sys/pal/unix/mod.rs
+++ b/library/std/src/sys/pal/unix/mod.rs
@@ -1,8 +1,7 @@
 #![allow(missing_docs, nonstandard_style)]
 
-use crate::io::ErrorKind;
-
 pub use self::rand::hashmap_random_keys;
+use crate::io::ErrorKind;
 
 #[cfg(not(target_os = "espidf"))]
 #[macro_use]
@@ -86,11 +85,12 @@ pub unsafe fn init(argc: isize, argv: *const *const u8, sigpipe: u8) {
             target_vendor = "apple",
         )))]
         'poll: {
-            use crate::sys::os::errno;
             #[cfg(not(all(target_os = "linux", target_env = "gnu")))]
             use libc::open as open64;
             #[cfg(all(target_os = "linux", target_env = "gnu"))]
             use libc::open64;
+
+            use crate::sys::os::errno;
             let pfds: &mut [_] = &mut [
                 libc::pollfd { fd: 0, events: 0, revents: 0 },
                 libc::pollfd { fd: 1, events: 0, revents: 0 },
@@ -140,11 +140,12 @@ pub unsafe fn init(argc: isize, argv: *const *const u8, sigpipe: u8) {
             target_os = "vita",
         )))]
         {
-            use crate::sys::os::errno;
             #[cfg(not(all(target_os = "linux", target_env = "gnu")))]
             use libc::open as open64;
             #[cfg(all(target_os = "linux", target_env = "gnu"))]
             use libc::open64;
+
+            use crate::sys::os::errno;
             for fd in 0..3 {
                 if libc::fcntl(fd, libc::F_GETFD) == -1 && errno() == libc::EBADF {
                     if open64(c"/dev/null".as_ptr().cast(), libc::O_RDWR, 0) == -1 {
@@ -232,12 +233,13 @@ pub unsafe fn cleanup() {
     stack_overflow::cleanup();
 }
 
-#[cfg(target_os = "android")]
-pub use crate::sys::android::signal;
 #[allow(unused_imports)]
 #[cfg(not(target_os = "android"))]
 pub use libc::signal;
 
+#[cfg(target_os = "android")]
+pub use crate::sys::android::signal;
+
 #[inline]
 pub(crate) fn is_interrupted(errno: i32) -> bool {
     errno == libc::EINTR
diff --git a/library/std/src/sys/pal/unix/net.rs b/library/std/src/sys/pal/unix/net.rs
index eafde51c608..bc0e3f4eeea 100644
--- a/library/std/src/sys/pal/unix/net.rs
+++ b/library/std/src/sys/pal/unix/net.rs
@@ -1,7 +1,7 @@
-use crate::cmp;
+use libc::{c_int, c_void, size_t, sockaddr, socklen_t, MSG_PEEK};
+
 use crate::ffi::CStr;
 use crate::io::{self, BorrowedBuf, BorrowedCursor, IoSlice, IoSliceMut};
-use crate::mem;
 use crate::net::{Shutdown, SocketAddr};
 use crate::os::unix::io::{AsFd, AsRawFd, BorrowedFd, FromRawFd, IntoRawFd, RawFd};
 use crate::sys::fd::FileDesc;
@@ -9,8 +9,7 @@ use crate::sys::pal::unix::IsMinusOne;
 use crate::sys_common::net::{getsockopt, setsockopt, sockaddr_to_addr};
 use crate::sys_common::{AsInner, FromInner, IntoInner};
 use crate::time::{Duration, Instant};
-
-use libc::{c_int, c_void, size_t, sockaddr, socklen_t, MSG_PEEK};
+use crate::{cmp, mem};
 
 cfg_if::cfg_if! {
     if #[cfg(target_vendor = "apple")] {
diff --git a/library/std/src/sys/pal/unix/os.rs b/library/std/src/sys/pal/unix/os.rs
index 9adc2b94e59..a785b97ac8d 100644
--- a/library/std/src/sys/pal/unix/os.rs
+++ b/library/std/src/sys/pal/unix/os.rs
@@ -5,29 +5,20 @@
 #[cfg(test)]
 mod tests;
 
-use crate::os::unix::prelude::*;
+use core::slice::memchr;
+
+use libc::{c_char, c_int, c_void};
 
 use crate::error::Error as StdError;
 use crate::ffi::{CStr, CString, OsStr, OsString};
-use crate::fmt;
-use crate::io;
-use crate::iter;
-use crate::mem;
+use crate::os::unix::prelude::*;
 use crate::path::{self, PathBuf};
-use crate::ptr;
-use crate::slice;
-use crate::str;
 use crate::sync::{PoisonError, RwLock};
 use crate::sys::common::small_c_string::{run_path_with_cstr, run_with_cstr};
-use crate::sys::cvt;
-use crate::sys::fd;
-use crate::vec;
-use core::slice::memchr;
-
 #[cfg(all(target_env = "gnu", not(target_os = "vxworks")))]
 use crate::sys::weak::weak;
-
-use libc::{c_char, c_int, c_void};
+use crate::sys::{cvt, fd};
+use crate::{fmt, io, iter, mem, ptr, slice, str, vec};
 
 const TMPBUF_SZ: usize = 128;
 
@@ -248,13 +239,12 @@ impl StdError for JoinPathsError {
 
 #[cfg(target_os = "aix")]
 pub fn current_exe() -> io::Result<PathBuf> {
-    use crate::io::ErrorKind;
-
     #[cfg(test)]
     use realstd::env;
 
     #[cfg(not(test))]
     use crate::env;
+    use crate::io::ErrorKind;
 
     let exe_path = env::args().next().ok_or(io::const_io_error!(
         ErrorKind::NotFound,
@@ -513,13 +503,12 @@ pub fn current_exe() -> io::Result<PathBuf> {
 
 #[cfg(target_os = "fuchsia")]
 pub fn current_exe() -> io::Result<PathBuf> {
-    use crate::io::ErrorKind;
-
     #[cfg(test)]
     use realstd::env;
 
     #[cfg(not(test))]
     use crate::env;
+    use crate::io::ErrorKind;
 
     let exe_path = env::args().next().ok_or(io::const_io_error!(
         ErrorKind::Uncategorized,
diff --git a/library/std/src/sys/pal/unix/process/process_common.rs b/library/std/src/sys/pal/unix/process/process_common.rs
index f615e8086dc..ecb5ca58db6 100644
--- a/library/std/src/sys/pal/unix/process/process_common.rs
+++ b/library/std/src/sys/pal/unix/process/process_common.rs
@@ -1,24 +1,20 @@
 #[cfg(all(test, not(target_os = "emscripten")))]
 mod tests;
 
-use crate::os::unix::prelude::*;
+use libc::{c_char, c_int, gid_t, pid_t, uid_t, EXIT_FAILURE, EXIT_SUCCESS};
 
 use crate::collections::BTreeMap;
 use crate::ffi::{CStr, CString, OsStr, OsString};
-use crate::fmt;
-use crate::io;
+use crate::os::unix::prelude::*;
 use crate::path::Path;
-use crate::ptr;
 use crate::sys::fd::FileDesc;
 use crate::sys::fs::File;
+#[cfg(not(target_os = "fuchsia"))]
+use crate::sys::fs::OpenOptions;
 use crate::sys::pipe::{self, AnonPipe};
 use crate::sys_common::process::{CommandEnv, CommandEnvs};
 use crate::sys_common::{FromInner, IntoInner};
-
-#[cfg(not(target_os = "fuchsia"))]
-use crate::sys::fs::OpenOptions;
-
-use libc::{c_char, c_int, gid_t, pid_t, uid_t, EXIT_FAILURE, EXIT_SUCCESS};
+use crate::{fmt, io, ptr};
 
 cfg_if::cfg_if! {
     if #[cfg(target_os = "fuchsia")] {
diff --git a/library/std/src/sys/pal/unix/process/process_common/tests.rs b/library/std/src/sys/pal/unix/process/process_common/tests.rs
index 823b4a56336..e5c8dd6e341 100644
--- a/library/std/src/sys/pal/unix/process/process_common/tests.rs
+++ b/library/std/src/sys/pal/unix/process/process_common/tests.rs
@@ -1,9 +1,7 @@
 use super::*;
-
 use crate::ffi::OsStr;
-use crate::mem;
-use crate::ptr;
 use crate::sys::{cvt, cvt_nz};
+use crate::{mem, ptr};
 
 macro_rules! t {
     ($e:expr) => {
diff --git a/library/std/src/sys/pal/unix/process/process_fuchsia.rs b/library/std/src/sys/pal/unix/process/process_fuchsia.rs
index 23c2be6adf9..f3d5fdec4c2 100644
--- a/library/std/src/sys/pal/unix/process/process_fuchsia.rs
+++ b/library/std/src/sys/pal/unix/process/process_fuchsia.rs
@@ -1,13 +1,9 @@
-use crate::fmt;
-use crate::io;
-use crate::mem;
-use crate::num::NonZero;
-use crate::ptr;
+use libc::{c_int, size_t};
 
+use crate::num::NonZero;
 use crate::sys::process::process_common::*;
 use crate::sys::process::zircon::{zx_handle_t, Handle};
-
-use libc::{c_int, size_t};
+use crate::{fmt, io, mem, ptr};
 
 ////////////////////////////////////////////////////////////////////////////////
 // Command
diff --git a/library/std/src/sys/pal/unix/process/process_unix.rs b/library/std/src/sys/pal/unix/process/process_unix.rs
index 4e4dd3040fe..5552e9ac977 100644
--- a/library/std/src/sys/pal/unix/process/process_unix.rs
+++ b/library/std/src/sys/pal/unix/process/process_unix.rs
@@ -1,20 +1,7 @@
-use crate::fmt;
-use crate::io::{self, Error, ErrorKind};
-use crate::mem;
-use crate::num::NonZero;
-use crate::sys;
-use crate::sys::cvt;
-use crate::sys::process::process_common::*;
-
-#[cfg(target_os = "linux")]
-use crate::sys::pal::unix::linux::pidfd::PidFd;
-
 #[cfg(target_os = "vxworks")]
 use libc::RTP_ID as pid_t;
-
 #[cfg(not(target_os = "vxworks"))]
 use libc::{c_int, pid_t};
-
 #[cfg(not(any(
     target_os = "vxworks",
     target_os = "l4re",
@@ -23,6 +10,14 @@ use libc::{c_int, pid_t};
 )))]
 use libc::{gid_t, uid_t};
 
+use crate::io::{self, Error, ErrorKind};
+use crate::num::NonZero;
+use crate::sys::cvt;
+#[cfg(target_os = "linux")]
+use crate::sys::pal::unix::linux::pidfd::PidFd;
+use crate::sys::process::process_common::*;
+use crate::{fmt, mem, sys};
+
 cfg_if::cfg_if! {
     if #[cfg(all(target_os = "nto", target_env = "nto71"))] {
         use crate::thread;
@@ -446,11 +441,12 @@ impl Command {
         stdio: &ChildPipes,
         envp: Option<&CStringArray>,
     ) -> io::Result<Option<Process>> {
+        #[cfg(target_os = "linux")]
+        use core::sync::atomic::{AtomicU8, Ordering};
+
         use crate::mem::MaybeUninit;
         use crate::sys::weak::weak;
         use crate::sys::{self, cvt_nz, on_broken_pipe_flag_used};
-        #[cfg(target_os = "linux")]
-        use core::sync::atomic::{AtomicU8, Ordering};
 
         if self.get_gid().is_some()
             || self.get_uid().is_some()
@@ -762,10 +758,11 @@ impl Command {
 
     #[cfg(target_os = "linux")]
     fn send_pidfd(&self, sock: &crate::sys::net::Socket) {
+        use libc::{CMSG_DATA, CMSG_FIRSTHDR, CMSG_LEN, CMSG_SPACE, SCM_RIGHTS, SOL_SOCKET};
+
         use crate::io::IoSlice;
         use crate::os::fd::RawFd;
         use crate::sys::cvt_r;
-        use libc::{CMSG_DATA, CMSG_FIRSTHDR, CMSG_LEN, CMSG_SPACE, SCM_RIGHTS, SOL_SOCKET};
 
         unsafe {
             let child_pid = libc::getpid();
@@ -819,11 +816,11 @@ impl Command {
 
     #[cfg(target_os = "linux")]
     fn recv_pidfd(&self, sock: &crate::sys::net::Socket) -> pid_t {
+        use libc::{CMSG_DATA, CMSG_FIRSTHDR, CMSG_LEN, CMSG_SPACE, SCM_RIGHTS, SOL_SOCKET};
+
         use crate::io::IoSliceMut;
         use crate::sys::cvt_r;
 
-        use libc::{CMSG_DATA, CMSG_FIRSTHDR, CMSG_LEN, CMSG_SPACE, SCM_RIGHTS, SOL_SOCKET};
-
         unsafe {
             const SCM_MSG_LEN: usize = mem::size_of::<[c_int; 1]>();
 
@@ -1189,12 +1186,11 @@ impl ExitStatusError {
 #[cfg(target_os = "linux")]
 mod linux_child_ext {
 
-    use crate::io;
-    use crate::mem;
     use crate::os::linux::process as os;
     use crate::sys::pal::unix::linux::pidfd as imp;
     use crate::sys::pal::unix::ErrorKind;
     use crate::sys_common::FromInner;
+    use crate::{io, mem};
 
     #[unstable(feature = "linux_pidfd", issue = "82971")]
     impl crate::os::linux::process::ChildExt for crate::process::Child {
diff --git a/library/std/src/sys/pal/unix/process/process_unsupported.rs b/library/std/src/sys/pal/unix/process/process_unsupported.rs
index 90d53464c83..c58548835ff 100644
--- a/library/std/src/sys/pal/unix/process/process_unsupported.rs
+++ b/library/std/src/sys/pal/unix/process/process_unsupported.rs
@@ -1,10 +1,10 @@
+use libc::{c_int, pid_t};
+
 use crate::io;
 use crate::num::NonZero;
 use crate::sys::pal::unix::unsupported::*;
 use crate::sys::process::process_common::*;
 
-use libc::{c_int, pid_t};
-
 ////////////////////////////////////////////////////////////////////////////////
 // Command
 ////////////////////////////////////////////////////////////////////////////////
diff --git a/library/std/src/sys/pal/unix/process/process_unsupported/wait_status.rs b/library/std/src/sys/pal/unix/process/process_unsupported/wait_status.rs
index 973188b1f2b..f04036bde49 100644
--- a/library/std/src/sys/pal/unix/process/process_unsupported/wait_status.rs
+++ b/library/std/src/sys/pal/unix/process/process_unsupported/wait_status.rs
@@ -2,12 +2,11 @@
 //!
 //! Separate module to facilitate testing against a real Unix implementation.
 
+use super::ExitStatusError;
 use crate::ffi::c_int;
 use crate::fmt;
 use crate::num::NonZero;
 
-use super::ExitStatusError;
-
 /// Emulated wait status for use by `process_unsupported.rs`
 ///
 /// Uses the "traditional unix" encoding.  For use on platfors which are `#[cfg(unix)]`
diff --git a/library/std/src/sys/pal/unix/process/process_vxworks.rs b/library/std/src/sys/pal/unix/process/process_vxworks.rs
index 26b8a0a39dc..6a9d8fab1d4 100644
--- a/library/std/src/sys/pal/unix/process/process_vxworks.rs
+++ b/library/std/src/sys/pal/unix/process/process_vxworks.rs
@@ -1,12 +1,11 @@
-use crate::fmt;
+use libc::{self, c_char, c_int, RTP_ID};
+
 use crate::io::{self, ErrorKind};
 use crate::num::NonZero;
-use crate::sys;
 use crate::sys::cvt;
 use crate::sys::pal::unix::thread;
 use crate::sys::process::process_common::*;
-use libc::RTP_ID;
-use libc::{self, c_char, c_int};
+use crate::{fmt, sys};
 
 ////////////////////////////////////////////////////////////////////////////////
 // Command
diff --git a/library/std/src/sys/pal/unix/process/zircon.rs b/library/std/src/sys/pal/unix/process/zircon.rs
index 2e596486f9c..4035e2370a3 100644
--- a/library/std/src/sys/pal/unix/process/zircon.rs
+++ b/library/std/src/sys/pal/unix/process/zircon.rs
@@ -1,11 +1,11 @@
 #![allow(non_camel_case_types, unused)]
 
+use libc::{c_int, c_void, size_t};
+
 use crate::io;
 use crate::mem::MaybeUninit;
 use crate::os::raw::c_char;
 
-use libc::{c_int, c_void, size_t};
-
 pub type zx_handle_t = u32;
 pub type zx_vaddr_t = usize;
 pub type zx_rights_t = u32;
diff --git a/library/std/src/sys/pal/unix/rand.rs b/library/std/src/sys/pal/unix/rand.rs
index e6df109a6b8..8a78ea8e7cc 100644
--- a/library/std/src/sys/pal/unix/rand.rs
+++ b/library/std/src/sys/pal/unix/rand.rs
@@ -24,7 +24,6 @@ pub fn hashmap_random_keys() -> (u64, u64) {
 mod imp {
     use crate::fs::File;
     use crate::io::Read;
-
     #[cfg(any(target_os = "linux", target_os = "android"))]
     use crate::sys::weak::syscall;
 
@@ -178,9 +177,10 @@ mod imp {
 
 #[cfg(target_vendor = "apple")]
 mod imp {
-    use crate::io;
     use libc::{c_int, c_void, size_t};
 
+    use crate::io;
+
     #[inline(always)]
     fn random_failure() -> ! {
         panic!("unexpected random generation error: {}", io::Error::last_os_error());
@@ -311,8 +311,10 @@ mod imp {
 
 #[cfg(target_os = "vxworks")]
 mod imp {
+    use core::sync::atomic::AtomicBool;
+    use core::sync::atomic::Ordering::Relaxed;
+
     use crate::io;
-    use core::sync::atomic::{AtomicBool, Ordering::Relaxed};
 
     pub fn fill_bytes(v: &mut [u8]) {
         static RNG_INIT: AtomicBool = AtomicBool::new(false);
diff --git a/library/std/src/sys/pal/unix/stack_overflow.rs b/library/std/src/sys/pal/unix/stack_overflow.rs
index 6eeec48bf5e..9ff44b54c41 100644
--- a/library/std/src/sys/pal/unix/stack_overflow.rs
+++ b/library/std/src/sys/pal/unix/stack_overflow.rs
@@ -1,10 +1,8 @@
 #![cfg_attr(test, allow(dead_code))]
 
+pub use self::imp::{cleanup, init};
 use self::imp::{drop_handler, make_handler};
 
-pub use self::imp::cleanup;
-pub use self::imp::init;
-
 pub struct Handler {
     data: *mut libc::c_void,
 }
@@ -37,24 +35,23 @@ impl Drop for Handler {
     target_os = "solaris"
 ))]
 mod imp {
+    #[cfg(not(all(target_os = "linux", target_env = "gnu")))]
+    use libc::{mmap as mmap64, mprotect, munmap};
+    #[cfg(all(target_os = "linux", target_env = "gnu"))]
+    use libc::{mmap64, mprotect, munmap};
+    use libc::{
+        sigaction, sigaltstack, sighandler_t, MAP_ANON, MAP_FAILED, MAP_FIXED, MAP_PRIVATE,
+        PROT_NONE, PROT_READ, PROT_WRITE, SA_ONSTACK, SA_SIGINFO, SIGBUS, SIGSEGV, SIG_DFL,
+        SS_DISABLE,
+    };
+
     use super::Handler;
     use crate::cell::Cell;
-    use crate::io;
-    use crate::mem;
     use crate::ops::Range;
-    use crate::ptr;
     use crate::sync::atomic::{AtomicBool, AtomicPtr, AtomicUsize, Ordering};
     use crate::sync::OnceLock;
     use crate::sys::pal::unix::os;
-    use crate::thread;
-
-    #[cfg(not(all(target_os = "linux", target_env = "gnu")))]
-    use libc::{mmap as mmap64, mprotect, munmap};
-    #[cfg(all(target_os = "linux", target_env = "gnu"))]
-    use libc::{mmap64, mprotect, munmap};
-    use libc::{sigaction, sighandler_t, SA_ONSTACK, SA_SIGINFO, SIGBUS, SIGSEGV, SIG_DFL};
-    use libc::{sigaltstack, SS_DISABLE};
-    use libc::{MAP_ANON, MAP_FAILED, MAP_FIXED, MAP_PRIVATE, PROT_NONE, PROT_READ, PROT_WRITE};
+    use crate::{io, mem, ptr, thread};
 
     // We use a TLS variable to store the address of the guard page. While TLS
     // variables are not guaranteed to be signal-safe, this works out in practice
diff --git a/library/std/src/sys/pal/unix/thread.rs b/library/std/src/sys/pal/unix/thread.rs
index 483697b8597..83034761f3d 100644
--- a/library/std/src/sys/pal/unix/thread.rs
+++ b/library/std/src/sys/pal/unix/thread.rs
@@ -1,16 +1,13 @@
-use crate::cmp;
 use crate::ffi::CStr;
-use crate::io;
 use crate::mem::{self, ManuallyDrop};
 use crate::num::NonZero;
-use crate::ptr;
-use crate::sys::{os, stack_overflow};
-use crate::time::Duration;
-
 #[cfg(all(target_os = "linux", target_env = "gnu"))]
 use crate::sys::weak::dlsym;
 #[cfg(any(target_os = "solaris", target_os = "illumos", target_os = "nto"))]
 use crate::sys::weak::weak;
+use crate::sys::{os, stack_overflow};
+use crate::time::Duration;
+use crate::{cmp, io, ptr};
 #[cfg(not(any(target_os = "l4re", target_os = "vxworks", target_os = "espidf")))]
 pub const DEFAULT_MIN_STACK_SIZE: usize = 2 * 1024 * 1024;
 #[cfg(target_os = "l4re")]
@@ -475,11 +472,9 @@ mod cgroups {
     use crate::borrow::Cow;
     use crate::ffi::OsString;
     use crate::fs::{exists, File};
-    use crate::io::Read;
-    use crate::io::{BufRead, BufReader};
+    use crate::io::{BufRead, BufReader, Read};
     use crate::os::unix::ffi::OsStringExt;
-    use crate::path::Path;
-    use crate::path::PathBuf;
+    use crate::path::{Path, PathBuf};
     use crate::str::from_utf8;
 
     #[derive(PartialEq)]
diff --git a/library/std/src/sys/pal/unix/thread_parking.rs b/library/std/src/sys/pal/unix/thread_parking.rs
index 1366410b71e..1da5fce3cd3 100644
--- a/library/std/src/sys/pal/unix/thread_parking.rs
+++ b/library/std/src/sys/pal/unix/thread_parking.rs
@@ -2,10 +2,11 @@
 // separate modules for each platform.
 #![cfg(target_os = "netbsd")]
 
+use libc::{_lwp_self, c_long, clockid_t, lwpid_t, time_t, timespec, CLOCK_MONOTONIC};
+
 use crate::ffi::{c_int, c_void};
 use crate::ptr;
 use crate::time::Duration;
-use libc::{_lwp_self, c_long, clockid_t, lwpid_t, time_t, timespec, CLOCK_MONOTONIC};
 
 extern "C" {
     fn ___lwp_park60(
diff --git a/library/std/src/sys/pal/unix/weak.rs b/library/std/src/sys/pal/unix/weak.rs
index 4765a286e6b..b1b6aae757c 100644
--- a/library/std/src/sys/pal/unix/weak.rs
+++ b/library/std/src/sys/pal/unix/weak.rs
@@ -23,9 +23,8 @@
 
 use crate::ffi::CStr;
 use crate::marker::PhantomData;
-use crate::mem;
-use crate::ptr;
 use crate::sync::atomic::{self, AtomicPtr, Ordering};
+use crate::{mem, ptr};
 
 // We can use true weak linkage on ELF targets.
 #[cfg(all(unix, not(target_vendor = "apple")))]
diff --git a/library/std/src/sys/pal/unsupported/os.rs b/library/std/src/sys/pal/unsupported/os.rs
index 3be98898bbe..481fd62c04f 100644
--- a/library/std/src/sys/pal/unsupported/os.rs
+++ b/library/std/src/sys/pal/unsupported/os.rs
@@ -1,10 +1,9 @@
 use super::unsupported;
 use crate::error::Error as StdError;
 use crate::ffi::{OsStr, OsString};
-use crate::fmt;
-use crate::io;
 use crate::marker::PhantomData;
 use crate::path::{self, PathBuf};
+use crate::{fmt, io};
 
 pub fn errno() -> i32 {
     0
diff --git a/library/std/src/sys/pal/unsupported/pipe.rs b/library/std/src/sys/pal/unsupported/pipe.rs
index 781eafe2f1a..6799d21a1ff 100644
--- a/library/std/src/sys/pal/unsupported/pipe.rs
+++ b/library/std/src/sys/pal/unsupported/pipe.rs
@@ -1,7 +1,5 @@
-use crate::{
-    fmt,
-    io::{self, BorrowedCursor, IoSlice, IoSliceMut},
-};
+use crate::fmt;
+use crate::io::{self, BorrowedCursor, IoSlice, IoSliceMut};
 
 pub struct AnonPipe(!);
 
diff --git a/library/std/src/sys/pal/unsupported/process.rs b/library/std/src/sys/pal/unsupported/process.rs
index 2445d9073db..40231bfc90b 100644
--- a/library/std/src/sys/pal/unsupported/process.rs
+++ b/library/std/src/sys/pal/unsupported/process.rs
@@ -1,14 +1,12 @@
+pub use crate::ffi::OsString as EnvKey;
 use crate::ffi::{OsStr, OsString};
-use crate::fmt;
-use crate::io;
 use crate::num::NonZero;
 use crate::path::Path;
 use crate::sys::fs::File;
 use crate::sys::pipe::AnonPipe;
 use crate::sys::unsupported;
 use crate::sys_common::process::{CommandEnv, CommandEnvs};
-
-pub use crate::ffi::OsString as EnvKey;
+use crate::{fmt, io};
 
 ////////////////////////////////////////////////////////////////////////////////
 // Command
diff --git a/library/std/src/sys/pal/wasi/args.rs b/library/std/src/sys/pal/wasi/args.rs
index c42c310e3a2..6b6d1b8ff4e 100644
--- a/library/std/src/sys/pal/wasi/args.rs
+++ b/library/std/src/sys/pal/wasi/args.rs
@@ -1,9 +1,8 @@
 #![deny(unsafe_op_in_unsafe_fn)]
 
 use crate::ffi::{CStr, OsStr, OsString};
-use crate::fmt;
 use crate::os::wasi::ffi::OsStrExt;
-use crate::vec;
+use crate::{fmt, vec};
 
 pub struct Args {
     iter: vec::IntoIter<OsString>,
diff --git a/library/std/src/sys/pal/wasi/fs.rs b/library/std/src/sys/pal/wasi/fs.rs
index c58e6a08b37..11900886f0b 100644
--- a/library/std/src/sys/pal/wasi/fs.rs
+++ b/library/std/src/sys/pal/wasi/fs.rs
@@ -2,22 +2,19 @@
 
 use super::fd::WasiFd;
 use crate::ffi::{CStr, OsStr, OsString};
-use crate::fmt;
 use crate::io::{self, BorrowedCursor, IoSlice, IoSliceMut, SeekFrom};
-use crate::iter;
 use crate::mem::{self, ManuallyDrop};
 use crate::os::raw::c_int;
 use crate::os::wasi::ffi::{OsStrExt, OsStringExt};
 use crate::os::wasi::io::{AsFd, AsRawFd, BorrowedFd, FromRawFd, IntoRawFd, RawFd};
 use crate::path::{Path, PathBuf};
-use crate::ptr;
 use crate::sync::Arc;
 use crate::sys::common::small_c_string::run_path_with_cstr;
 use crate::sys::time::SystemTime;
 use crate::sys::unsupported;
-use crate::sys_common::{AsInner, FromInner, IntoInner};
-
 pub use crate::sys_common::fs::exists;
+use crate::sys_common::{AsInner, FromInner, IntoInner};
+use crate::{fmt, iter, ptr};
 
 pub struct File {
     fd: WasiFd,
diff --git a/library/std/src/sys/pal/wasi/helpers.rs b/library/std/src/sys/pal/wasi/helpers.rs
index 82149cef8fa..4b770ee23bc 100644
--- a/library/std/src/sys/pal/wasi/helpers.rs
+++ b/library/std/src/sys/pal/wasi/helpers.rs
@@ -1,5 +1,4 @@
-use crate::io as std_io;
-use crate::mem;
+use crate::{io as std_io, mem};
 
 #[inline]
 pub fn is_interrupted(errno: i32) -> bool {
diff --git a/library/std/src/sys/pal/wasi/mod.rs b/library/std/src/sys/pal/wasi/mod.rs
index d8fe06d1973..f4dc3ebd414 100644
--- a/library/std/src/sys/pal/wasi/mod.rs
+++ b/library/std/src/sys/pal/wasi/mod.rs
@@ -48,8 +48,5 @@ mod helpers;
 // import conflict rules. If we glob export `helpers` and `common` together,
 // then the compiler complains about conflicts.
 
-pub use helpers::abort_internal;
-pub use helpers::decode_error_kind;
 use helpers::err2io;
-pub use helpers::hashmap_random_keys;
-pub use helpers::is_interrupted;
+pub use helpers::{abort_internal, decode_error_kind, hashmap_random_keys, is_interrupted};
diff --git a/library/std/src/sys/pal/wasi/os.rs b/library/std/src/sys/pal/wasi/os.rs
index e96296997e6..f5b17d9df94 100644
--- a/library/std/src/sys/pal/wasi/os.rs
+++ b/library/std/src/sys/pal/wasi/os.rs
@@ -1,18 +1,16 @@
 #![deny(unsafe_op_in_unsafe_fn)]
 
+use core::slice::memchr;
+
 use crate::error::Error as StdError;
 use crate::ffi::{CStr, OsStr, OsString};
-use crate::fmt;
-use crate::io;
 use crate::marker::PhantomData;
 use crate::ops::Drop;
 use crate::os::wasi::prelude::*;
 use crate::path::{self, PathBuf};
-use crate::str;
 use crate::sys::common::small_c_string::{run_path_with_cstr, run_with_cstr};
 use crate::sys::unsupported;
-use crate::vec;
-use core::slice::memchr;
+use crate::{fmt, io, str, vec};
 
 // Add a few symbols not in upstream `libc` just yet.
 mod libc {
diff --git a/library/std/src/sys/pal/wasi/thread.rs b/library/std/src/sys/pal/wasi/thread.rs
index 2a3a39aafa7..c37acd8dfee 100644
--- a/library/std/src/sys/pal/wasi/thread.rs
+++ b/library/std/src/sys/pal/wasi/thread.rs
@@ -1,9 +1,8 @@
 use crate::ffi::CStr;
-use crate::io;
-use crate::mem;
 use crate::num::NonZero;
 use crate::sys::unsupported;
 use crate::time::Duration;
+use crate::{io, mem};
 
 cfg_if::cfg_if! {
     if #[cfg(target_feature = "atomics")] {
diff --git a/library/std/src/sys/pal/wasip2/mod.rs b/library/std/src/sys/pal/wasip2/mod.rs
index 0930d2e22fa..f20630e10cf 100644
--- a/library/std/src/sys/pal/wasip2/mod.rs
+++ b/library/std/src/sys/pal/wasip2/mod.rs
@@ -51,10 +51,7 @@ mod helpers;
 // import conflict rules. If we glob export `helpers` and `common` together,
 // then the compiler complains about conflicts.
 
-pub use helpers::abort_internal;
-pub use helpers::decode_error_kind;
 use helpers::err2io;
-pub use helpers::hashmap_random_keys;
-pub use helpers::is_interrupted;
+pub use helpers::{abort_internal, decode_error_kind, hashmap_random_keys, is_interrupted};
 
 mod cabi_realloc;
diff --git a/library/std/src/sys/pal/wasm/alloc.rs b/library/std/src/sys/pal/wasm/alloc.rs
index b74ce0d4742..ef9d753d7f8 100644
--- a/library/std/src/sys/pal/wasm/alloc.rs
+++ b/library/std/src/sys/pal/wasm/alloc.rs
@@ -57,10 +57,8 @@ unsafe impl GlobalAlloc for System {
 
 #[cfg(target_feature = "atomics")]
 mod lock {
-    use crate::sync::atomic::{
-        AtomicI32,
-        Ordering::{Acquire, Release},
-    };
+    use crate::sync::atomic::AtomicI32;
+    use crate::sync::atomic::Ordering::{Acquire, Release};
 
     static LOCKED: AtomicI32 = AtomicI32::new(0);
 
diff --git a/library/std/src/sys/pal/windows/alloc.rs b/library/std/src/sys/pal/windows/alloc.rs
index 020a2a4f3a2..92b68b26032 100644
--- a/library/std/src/sys/pal/windows/alloc.rs
+++ b/library/std/src/sys/pal/windows/alloc.rs
@@ -1,10 +1,11 @@
+use core::mem::MaybeUninit;
+
 use crate::alloc::{GlobalAlloc, Layout, System};
 use crate::ffi::c_void;
 use crate::ptr;
 use crate::sync::atomic::{AtomicPtr, Ordering};
 use crate::sys::c::{self, windows_targets};
 use crate::sys::common::alloc::{realloc_fallback, MIN_ALIGN};
-use core::mem::MaybeUninit;
 
 #[cfg(test)]
 mod tests;
diff --git a/library/std/src/sys/pal/windows/args.rs b/library/std/src/sys/pal/windows/args.rs
index 5098c05196e..66e75a83571 100644
--- a/library/std/src/sys/pal/windows/args.rs
+++ b/library/std/src/sys/pal/windows/args.rs
@@ -8,8 +8,6 @@ mod tests;
 
 use super::os::current_exe;
 use crate::ffi::{OsStr, OsString};
-use crate::fmt;
-use crate::io;
 use crate::num::NonZero;
 use crate::os::windows::prelude::*;
 use crate::path::{Path, PathBuf};
@@ -18,9 +16,7 @@ use crate::sys::process::ensure_no_nuls;
 use crate::sys::{c, to_u16s};
 use crate::sys_common::wstr::WStrUnits;
 use crate::sys_common::AsInner;
-use crate::vec;
-
-use crate::iter;
+use crate::{fmt, io, iter, vec};
 
 /// This is the const equivalent to `NonZero::new(n).unwrap()`
 ///
diff --git a/library/std/src/sys/pal/windows/c.rs b/library/std/src/sys/pal/windows/c.rs
index f7ec17fde22..08b75186aef 100644
--- a/library/std/src/sys/pal/windows/c.rs
+++ b/library/std/src/sys/pal/windows/c.rs
@@ -6,8 +6,7 @@
 #![allow(clippy::style)]
 
 use core::ffi::{c_uint, c_ulong, c_ushort, c_void, CStr};
-use core::mem;
-use core::ptr;
+use core::{mem, ptr};
 
 pub(super) mod windows_targets;
 
diff --git a/library/std/src/sys/pal/windows/fs.rs b/library/std/src/sys/pal/windows/fs.rs
index a0a48fe7590..d99d4931de4 100644
--- a/library/std/src/sys/pal/windows/fs.rs
+++ b/library/std/src/sys/pal/windows/fs.rs
@@ -1,26 +1,21 @@
 use core::ptr::addr_of;
 
-use crate::os::windows::prelude::*;
-
+use super::api::{self, WinError};
+use super::{to_u16s, IoResult};
 use crate::borrow::Cow;
 use crate::ffi::{c_void, OsStr, OsString};
-use crate::fmt;
 use crate::io::{self, BorrowedCursor, Error, IoSlice, IoSliceMut, SeekFrom};
 use crate::mem::{self, MaybeUninit};
 use crate::os::windows::io::{AsHandle, BorrowedHandle};
+use crate::os::windows::prelude::*;
 use crate::path::{Path, PathBuf};
-use crate::ptr;
-use crate::slice;
 use crate::sync::Arc;
 use crate::sys::handle::Handle;
+use crate::sys::path::maybe_verbatim;
 use crate::sys::time::SystemTime;
 use crate::sys::{c, cvt, Align8};
 use crate::sys_common::{AsInner, FromInner, IntoInner};
-use crate::thread;
-
-use super::api::{self, WinError};
-use super::{to_u16s, IoResult};
-use crate::sys::path::maybe_verbatim;
+use crate::{fmt, ptr, slice, thread};
 
 pub struct File {
     handle: Handle,
diff --git a/library/std/src/sys/pal/windows/futex.rs b/library/std/src/sys/pal/windows/futex.rs
index c54810e06cd..8c5081a607a 100644
--- a/library/std/src/sys/pal/windows/futex.rs
+++ b/library/std/src/sys/pal/windows/futex.rs
@@ -1,14 +1,13 @@
-use super::api::{self, WinError};
-use crate::sys::c;
-use crate::sys::dur2timeout;
 use core::ffi::c_void;
-use core::mem;
-use core::ptr;
 use core::sync::atomic::{
     AtomicBool, AtomicI16, AtomicI32, AtomicI64, AtomicI8, AtomicIsize, AtomicPtr, AtomicU16,
     AtomicU32, AtomicU64, AtomicU8, AtomicUsize,
 };
 use core::time::Duration;
+use core::{mem, ptr};
+
+use super::api::{self, WinError};
+use crate::sys::{c, dur2timeout};
 
 /// An atomic for use as a futex that is at least 8-bits but may be larger.
 pub type SmallAtomic = AtomicU8;
diff --git a/library/std/src/sys/pal/windows/handle.rs b/library/std/src/sys/pal/windows/handle.rs
index e5b2da69782..82a880faf5f 100644
--- a/library/std/src/sys/pal/windows/handle.rs
+++ b/library/std/src/sys/pal/windows/handle.rs
@@ -3,17 +3,15 @@
 #[cfg(test)]
 mod tests;
 
+use core::ffi::c_void;
+use core::{cmp, mem, ptr};
+
 use crate::io::{self, BorrowedCursor, ErrorKind, IoSlice, IoSliceMut, Read};
 use crate::os::windows::io::{
     AsHandle, AsRawHandle, BorrowedHandle, FromRawHandle, IntoRawHandle, OwnedHandle, RawHandle,
 };
-use crate::sys::c;
-use crate::sys::cvt;
+use crate::sys::{c, cvt};
 use crate::sys_common::{AsInner, FromInner, IntoInner};
-use core::cmp;
-use core::ffi::c_void;
-use core::mem;
-use core::ptr;
 
 /// An owned container for `HANDLE` object, closing them on Drop.
 ///
diff --git a/library/std/src/sys/pal/windows/io.rs b/library/std/src/sys/pal/windows/io.rs
index bf3dfdfdd3e..785a3f6768b 100644
--- a/library/std/src/sys/pal/windows/io.rs
+++ b/library/std/src/sys/pal/windows/io.rs
@@ -1,9 +1,10 @@
+use core::ffi::c_void;
+
 use crate::marker::PhantomData;
 use crate::mem::size_of;
 use crate::os::windows::io::{AsHandle, AsRawHandle, BorrowedHandle};
 use crate::slice;
 use crate::sys::c;
-use core::ffi::c_void;
 
 #[derive(Copy, Clone)]
 #[repr(transparent)]
diff --git a/library/std/src/sys/pal/windows/mod.rs b/library/std/src/sys/pal/windows/mod.rs
index 881ca17936d..6ed77fbc3d4 100644
--- a/library/std/src/sys/pal/windows/mod.rs
+++ b/library/std/src/sys/pal/windows/mod.rs
@@ -1,6 +1,7 @@
 #![allow(missing_docs, nonstandard_style)]
 #![forbid(unsafe_op_in_unsafe_fn)]
 
+pub use self::rand::hashmap_random_keys;
 use crate::ffi::{OsStr, OsString};
 use crate::io::ErrorKind;
 use crate::mem::MaybeUninit;
@@ -9,8 +10,6 @@ use crate::path::PathBuf;
 use crate::sys::pal::windows::api::wide_str;
 use crate::time::Duration;
 
-pub use self::rand::hashmap_random_keys;
-
 #[macro_use]
 pub mod compat;
 
diff --git a/library/std/src/sys/pal/windows/net.rs b/library/std/src/sys/pal/windows/net.rs
index b7ecff032e4..e27fdb72256 100644
--- a/library/std/src/sys/pal/windows/net.rs
+++ b/library/std/src/sys/pal/windows/net.rs
@@ -1,21 +1,17 @@
 #![unstable(issue = "none", feature = "windows_net")]
 
-use crate::cmp;
+use core::ffi::{c_int, c_long, c_ulong, c_ushort};
+
 use crate::io::{self, BorrowedBuf, BorrowedCursor, IoSlice, IoSliceMut, Read};
-use crate::mem;
 use crate::net::{Shutdown, SocketAddr};
 use crate::os::windows::io::{
     AsRawSocket, AsSocket, BorrowedSocket, FromRawSocket, IntoRawSocket, OwnedSocket, RawSocket,
 };
-use crate::ptr;
 use crate::sync::OnceLock;
-use crate::sys;
 use crate::sys::c;
-use crate::sys_common::net;
-use crate::sys_common::{AsInner, FromInner, IntoInner};
+use crate::sys_common::{net, AsInner, FromInner, IntoInner};
 use crate::time::Duration;
-
-use core::ffi::{c_int, c_long, c_ulong, c_ushort};
+use crate::{cmp, mem, ptr, sys};
 
 #[allow(non_camel_case_types)]
 pub type wrlen_t = i32;
@@ -25,9 +21,9 @@ pub mod netc {
     //!
     //! Some Windows API types are not quite what's expected by our cross-platform
     //! net code. E.g. naming differences or different pointer types.
-    use crate::sys::c::{self, ADDRESS_FAMILY, ADDRINFOA, SOCKADDR, SOCKET};
     use core::ffi::{c_char, c_int, c_uint, c_ulong, c_ushort, c_void};
 
+    use crate::sys::c::{self, ADDRESS_FAMILY, ADDRINFOA, SOCKADDR, SOCKET};
     // re-exports from Windows API bindings.
     pub use crate::sys::c::{
         bind, connect, freeaddrinfo, getpeername, getsockname, getsockopt, listen, setsockopt,
diff --git a/library/std/src/sys/pal/windows/os.rs b/library/std/src/sys/pal/windows/os.rs
index f1f4d3a5d26..5242bc9da31 100644
--- a/library/std/src/sys/pal/windows/os.rs
+++ b/library/std/src/sys/pal/windows/os.rs
@@ -5,20 +5,15 @@
 #[cfg(test)]
 mod tests;
 
-use crate::os::windows::prelude::*;
-
+use super::api::{self, WinError};
+use super::to_u16s;
 use crate::error::Error as StdError;
 use crate::ffi::{OsStr, OsString};
-use crate::fmt;
-use crate::io;
 use crate::os::windows::ffi::EncodeWide;
+use crate::os::windows::prelude::*;
 use crate::path::{self, PathBuf};
-use crate::ptr;
-use crate::slice;
 use crate::sys::{c, cvt};
-
-use super::api::{self, WinError};
-use super::to_u16s;
+use crate::{fmt, io, ptr, slice};
 
 pub fn errno() -> i32 {
     api::get_last_error().code as i32
diff --git a/library/std/src/sys/pal/windows/pipe.rs b/library/std/src/sys/pal/windows/pipe.rs
index 01433d68b69..9eb19fcf2d7 100644
--- a/library/std/src/sys/pal/windows/pipe.rs
+++ b/library/std/src/sys/pal/windows/pipe.rs
@@ -1,18 +1,15 @@
-use crate::os::windows::prelude::*;
-
 use crate::ffi::OsStr;
 use crate::io::{self, BorrowedCursor, IoSlice, IoSliceMut};
-use crate::mem;
+use crate::os::windows::prelude::*;
 use crate::path::Path;
-use crate::ptr;
 use crate::sync::atomic::AtomicUsize;
 use crate::sync::atomic::Ordering::Relaxed;
-use crate::sys::c;
 use crate::sys::fs::{File, OpenOptions};
 use crate::sys::handle::Handle;
-use crate::sys::hashmap_random_keys;
 use crate::sys::pal::windows::api::{self, WinError};
+use crate::sys::{c, hashmap_random_keys};
 use crate::sys_common::{FromInner, IntoInner};
+use crate::{mem, ptr};
 
 ////////////////////////////////////////////////////////////////////////////////
 // Anonymous pipes
diff --git a/library/std/src/sys/pal/windows/process.rs b/library/std/src/sys/pal/windows/process.rs
index 288ddb3e801..c285e1530a5 100644
--- a/library/std/src/sys/pal/windows/process.rs
+++ b/library/std/src/sys/pal/windows/process.rs
@@ -3,35 +3,28 @@
 #[cfg(test)]
 mod tests;
 
-use crate::cmp;
+use core::ffi::c_void;
+
+use super::api::{self, WinError};
 use crate::collections::BTreeMap;
-use crate::env;
 use crate::env::consts::{EXE_EXTENSION, EXE_SUFFIX};
 use crate::ffi::{OsStr, OsString};
-use crate::fmt;
 use crate::io::{self, Error, ErrorKind};
-use crate::mem;
 use crate::mem::MaybeUninit;
 use crate::num::NonZero;
 use crate::os::windows::ffi::{OsStrExt, OsStringExt};
 use crate::os::windows::io::{AsHandle, AsRawHandle, BorrowedHandle, FromRawHandle, IntoRawHandle};
 use crate::path::{Path, PathBuf};
-use crate::ptr;
 use crate::sync::Mutex;
 use crate::sys::args::{self, Arg};
 use crate::sys::c::{self, EXIT_FAILURE, EXIT_SUCCESS};
-use crate::sys::cvt;
 use crate::sys::fs::{File, OpenOptions};
 use crate::sys::handle::Handle;
-use crate::sys::path;
 use crate::sys::pipe::{self, AnonPipe};
-use crate::sys::stdio;
+use crate::sys::{cvt, path, stdio};
 use crate::sys_common::process::{CommandEnv, CommandEnvs};
 use crate::sys_common::IntoInner;
-
-use core::ffi::c_void;
-
-use super::api::{self, WinError};
+use crate::{cmp, env, fmt, mem, ptr};
 
 ////////////////////////////////////////////////////////////////////////////////
 // Command
diff --git a/library/std/src/sys/pal/windows/process/tests.rs b/library/std/src/sys/pal/windows/process/tests.rs
index 3fc0c75240c..65325fa64a0 100644
--- a/library/std/src/sys/pal/windows/process/tests.rs
+++ b/library/std/src/sys/pal/windows/process/tests.rs
@@ -1,5 +1,4 @@
-use super::make_command_line;
-use super::Arg;
+use super::{make_command_line, Arg};
 use crate::env;
 use crate::ffi::{OsStr, OsString};
 use crate::process::Command;
diff --git a/library/std/src/sys/pal/windows/stdio.rs b/library/std/src/sys/pal/windows/stdio.rs
index c6a21665157..dc63a2219c3 100644
--- a/library/std/src/sys/pal/windows/stdio.rs
+++ b/library/std/src/sys/pal/windows/stdio.rs
@@ -1,16 +1,13 @@
 #![unstable(issue = "none", feature = "windows_stdio")]
 
+use core::str::utf8_char_width;
+
 use super::api::{self, WinError};
-use crate::cmp;
-use crate::io;
 use crate::mem::MaybeUninit;
 use crate::os::windows::io::{FromRawHandle, IntoRawHandle};
-use crate::ptr;
-use crate::str;
-use crate::sys::c;
-use crate::sys::cvt;
 use crate::sys::handle::Handle;
-use core::str::utf8_char_width;
+use crate::sys::{c, cvt};
+use crate::{cmp, io, ptr, str};
 
 #[cfg(test)]
 mod tests;
diff --git a/library/std/src/sys/pal/windows/thread.rs b/library/std/src/sys/pal/windows/thread.rs
index 668a3c05e20..28bce529cd9 100644
--- a/library/std/src/sys/pal/windows/thread.rs
+++ b/library/std/src/sys/pal/windows/thread.rs
@@ -1,18 +1,15 @@
+use core::ffi::c_void;
+
+use super::time::WaitableTimer;
+use super::to_u16s;
 use crate::ffi::CStr;
-use crate::io;
 use crate::num::NonZero;
-use crate::os::windows::io::AsRawHandle;
-use crate::os::windows::io::HandleOrNull;
-use crate::ptr;
-use crate::sys::c;
+use crate::os::windows::io::{AsRawHandle, HandleOrNull};
 use crate::sys::handle::Handle;
-use crate::sys::stack_overflow;
+use crate::sys::{c, stack_overflow};
 use crate::sys_common::FromInner;
 use crate::time::Duration;
-use core::ffi::c_void;
-
-use super::time::WaitableTimer;
-use super::to_u16s;
+use crate::{io, ptr};
 
 pub const DEFAULT_MIN_STACK_SIZE: usize = 2 * 1024 * 1024;
 
diff --git a/library/std/src/sys/pal/windows/time.rs b/library/std/src/sys/pal/windows/time.rs
index 55ff233521a..d9010e39961 100644
--- a/library/std/src/sys/pal/windows/time.rs
+++ b/library/std/src/sys/pal/windows/time.rs
@@ -1,13 +1,12 @@
+use core::hash::{Hash, Hasher};
+use core::ops::Neg;
+
 use crate::cmp::Ordering;
-use crate::fmt;
-use crate::mem;
 use crate::ptr::null;
 use crate::sys::c;
 use crate::sys_common::IntoInner;
 use crate::time::Duration;
-
-use core::hash::{Hash, Hasher};
-use core::ops::Neg;
+use crate::{fmt, mem};
 
 const NANOS_PER_SEC: u64 = 1_000_000_000;
 const INTERVALS_PER_SEC: u64 = NANOS_PER_SEC / 100;
@@ -166,8 +165,7 @@ fn intervals2dur(intervals: u64) -> Duration {
 mod perf_counter {
     use super::NANOS_PER_SEC;
     use crate::sync::atomic::{AtomicU64, Ordering};
-    use crate::sys::c;
-    use crate::sys::cvt;
+    use crate::sys::{c, cvt};
     use crate::sys_common::mul_div_u64;
     use crate::time::Duration;
 
diff --git a/library/std/src/sys/pal/xous/alloc.rs b/library/std/src/sys/pal/xous/alloc.rs
index 601411173aa..9ea43445d02 100644
--- a/library/std/src/sys/pal/xous/alloc.rs
+++ b/library/std/src/sys/pal/xous/alloc.rs
@@ -46,10 +46,8 @@ unsafe impl GlobalAlloc for System {
 }
 
 mod lock {
-    use crate::sync::atomic::{
-        AtomicI32,
-        Ordering::{Acquire, Release},
-    };
+    use crate::sync::atomic::AtomicI32;
+    use crate::sync::atomic::Ordering::{Acquire, Release};
 
     static LOCKED: AtomicI32 = AtomicI32::new(0);
 
diff --git a/library/std/src/sys/pal/xous/net/dns.rs b/library/std/src/sys/pal/xous/net/dns.rs
index 63056324bfb..50efe978c4a 100644
--- a/library/std/src/sys/pal/xous/net/dns.rs
+++ b/library/std/src/sys/pal/xous/net/dns.rs
@@ -1,8 +1,9 @@
+use core::convert::{TryFrom, TryInto};
+
 use crate::io;
 use crate::net::{Ipv4Addr, SocketAddr, SocketAddrV4, SocketAddrV6};
 use crate::os::xous::ffi::lend_mut;
 use crate::os::xous::services::{dns_server, DnsLendMut};
-use core::convert::{TryFrom, TryInto};
 
 pub struct DnsError {
     pub code: u8,
diff --git a/library/std/src/sys/pal/xous/net/tcplistener.rs b/library/std/src/sys/pal/xous/net/tcplistener.rs
index 47305013083..ddfb289162b 100644
--- a/library/std/src/sys/pal/xous/net/tcplistener.rs
+++ b/library/std/src/sys/pal/xous/net/tcplistener.rs
@@ -1,11 +1,11 @@
+use core::convert::TryInto;
+use core::sync::atomic::{AtomicBool, AtomicU16, AtomicUsize, Ordering};
+
 use super::*;
-use crate::fmt;
-use crate::io;
 use crate::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr};
 use crate::os::xous::services;
 use crate::sync::Arc;
-use core::convert::TryInto;
-use core::sync::atomic::{AtomicBool, AtomicU16, AtomicUsize, Ordering};
+use crate::{fmt, io};
 
 macro_rules! unimpl {
     () => {
diff --git a/library/std/src/sys/pal/xous/net/tcpstream.rs b/library/std/src/sys/pal/xous/net/tcpstream.rs
index 0ad88110711..03442cf2fcd 100644
--- a/library/std/src/sys/pal/xous/net/tcpstream.rs
+++ b/library/std/src/sys/pal/xous/net/tcpstream.rs
@@ -1,3 +1,5 @@
+use core::sync::atomic::{AtomicBool, AtomicU32, AtomicUsize, Ordering};
+
 use super::*;
 use crate::fmt;
 use crate::io::{self, BorrowedCursor, IoSlice, IoSliceMut};
@@ -5,7 +7,6 @@ use crate::net::{IpAddr, Ipv4Addr, Shutdown, SocketAddr, SocketAddrV4, SocketAdd
 use crate::os::xous::services;
 use crate::sync::Arc;
 use crate::time::Duration;
-use core::sync::atomic::{AtomicBool, AtomicU32, AtomicUsize, Ordering};
 
 macro_rules! unimpl {
     () => {
diff --git a/library/std/src/sys/pal/xous/net/udp.rs b/library/std/src/sys/pal/xous/net/udp.rs
index 3d0522b25f3..de5133280ba 100644
--- a/library/std/src/sys/pal/xous/net/udp.rs
+++ b/library/std/src/sys/pal/xous/net/udp.rs
@@ -1,13 +1,13 @@
+use core::convert::TryInto;
+use core::sync::atomic::{AtomicUsize, Ordering};
+
 use super::*;
 use crate::cell::Cell;
-use crate::fmt;
-use crate::io;
 use crate::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr};
 use crate::os::xous::services;
 use crate::sync::Arc;
 use crate::time::Duration;
-use core::convert::TryInto;
-use core::sync::atomic::{AtomicUsize, Ordering};
+use crate::{fmt, io};
 
 macro_rules! unimpl {
     () => {
diff --git a/library/std/src/sys/pal/xous/os.rs b/library/std/src/sys/pal/xous/os.rs
index 9be09eed629..8f8f35428c4 100644
--- a/library/std/src/sys/pal/xous/os.rs
+++ b/library/std/src/sys/pal/xous/os.rs
@@ -1,11 +1,10 @@
 use super::unsupported;
 use crate::error::Error as StdError;
 use crate::ffi::{OsStr, OsString};
-use crate::fmt;
-use crate::io;
 use crate::marker::PhantomData;
 use crate::os::xous::ffi::Error as XousError;
 use crate::path::{self, PathBuf};
+use crate::{fmt, io};
 
 #[cfg(not(test))]
 #[cfg(feature = "panic_unwind")]
diff --git a/library/std/src/sys/pal/xous/thread.rs b/library/std/src/sys/pal/xous/thread.rs
index 279f24f9ee8..a95b0aa14d2 100644
--- a/library/std/src/sys/pal/xous/thread.rs
+++ b/library/std/src/sys/pal/xous/thread.rs
@@ -1,3 +1,5 @@
+use core::arch::asm;
+
 use crate::ffi::CStr;
 use crate::io;
 use crate::num::NonZero;
@@ -7,7 +9,6 @@ use crate::os::xous::ffi::{
 };
 use crate::os::xous::services::{ticktimer_server, TicktimerScalar};
 use crate::time::Duration;
-use core::arch::asm;
 
 pub struct Thread {
     tid: ThreadId,
diff --git a/library/std/src/sys/pal/xous/time.rs b/library/std/src/sys/pal/xous/time.rs
index 4e4ae67efff..ae8be81c0b7 100644
--- a/library/std/src/sys/pal/xous/time.rs
+++ b/library/std/src/sys/pal/xous/time.rs
@@ -1,7 +1,7 @@
 use crate::os::xous::ffi::blocking_scalar;
-use crate::os::xous::services::{
-    systime_server, ticktimer_server, SystimeScalar::GetUtcTimeMs, TicktimerScalar::ElapsedMs,
-};
+use crate::os::xous::services::SystimeScalar::GetUtcTimeMs;
+use crate::os::xous::services::TicktimerScalar::ElapsedMs;
+use crate::os::xous::services::{systime_server, ticktimer_server};
 use crate::time::Duration;
 
 #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)]
diff --git a/library/std/src/sys/pal/zkvm/os.rs b/library/std/src/sys/pal/zkvm/os.rs
index e7d6cd52a25..68d91a123ac 100644
--- a/library/std/src/sys/pal/zkvm/os.rs
+++ b/library/std/src/sys/pal/zkvm/os.rs
@@ -1,12 +1,11 @@
 use super::{abi, unsupported, WORD_SIZE};
 use crate::error::Error as StdError;
 use crate::ffi::{OsStr, OsString};
-use crate::fmt;
-use crate::io;
 use crate::marker::PhantomData;
 use crate::path::{self, PathBuf};
 use crate::sys::os_str;
 use crate::sys_common::FromInner;
+use crate::{fmt, io};
 
 pub fn errno() -> i32 {
     0
diff --git a/library/std/src/sys/pal/zkvm/stdio.rs b/library/std/src/sys/pal/zkvm/stdio.rs
index e771ed0de28..dd218c8894c 100644
--- a/library/std/src/sys/pal/zkvm/stdio.rs
+++ b/library/std/src/sys/pal/zkvm/stdio.rs
@@ -1,4 +1,5 @@
-use super::{abi, abi::fileno};
+use super::abi;
+use super::abi::fileno;
 use crate::io;
 
 pub struct Stdin;
diff --git a/library/std/src/sys/path/unix.rs b/library/std/src/sys/path/unix.rs
index 837f68d3eaf..2a7c025c3c4 100644
--- a/library/std/src/sys/path/unix.rs
+++ b/library/std/src/sys/path/unix.rs
@@ -1,7 +1,6 @@
-use crate::env;
 use crate::ffi::OsStr;
-use crate::io;
 use crate::path::{Path, PathBuf, Prefix};
+use crate::{env, io};
 
 #[inline]
 pub fn is_sep_byte(b: u8) -> bool {
diff --git a/library/std/src/sys/path/windows.rs b/library/std/src/sys/path/windows.rs
index 9bd206ae1bf..21841eb18cc 100644
--- a/library/std/src/sys/path/windows.rs
+++ b/library/std/src/sys/path/windows.rs
@@ -1,8 +1,7 @@
 use crate::ffi::{OsStr, OsString};
-use crate::io;
 use crate::path::{Path, PathBuf, Prefix};
-use crate::ptr;
 use crate::sys::pal::{c, fill_utf16_buf, os2path, to_u16s};
+use crate::{io, ptr};
 
 #[cfg(test)]
 mod tests;
diff --git a/library/std/src/sys/personality/dwarf/eh.rs b/library/std/src/sys/personality/dwarf/eh.rs
index 0b81ea9e3d2..89172ecf16b 100644
--- a/library/std/src/sys/personality/dwarf/eh.rs
+++ b/library/std/src/sys/personality/dwarf/eh.rs
@@ -12,9 +12,9 @@
 #![allow(non_upper_case_globals)]
 #![allow(unused)]
 
+use core::{mem, ptr};
+
 use super::DwarfReader;
-use core::mem;
-use core::ptr;
 
 pub const DW_EH_PE_omit: u8 = 0xFF;
 pub const DW_EH_PE_absptr: u8 = 0x00;
diff --git a/library/std/src/sys/personality/emcc.rs b/library/std/src/sys/personality/emcc.rs
index cb52ae89b19..d374e3ad4c8 100644
--- a/library/std/src/sys/personality/emcc.rs
+++ b/library/std/src/sys/personality/emcc.rs
@@ -1,9 +1,10 @@
 //! On Emscripten Rust panics are wrapped in C++ exceptions, so we just forward
 //! to `__gxx_personality_v0` which is provided by Emscripten.
 
-use crate::ffi::c_int;
 use unwind as uw;
 
+use crate::ffi::c_int;
+
 // This is required by the compiler to exist (e.g., it's a lang item), but it's
 // never actually called by the compiler.  Emscripten EH doesn't use a
 // personality function at all, it instead uses __cxa_find_matching_catch.
diff --git a/library/std/src/sys/personality/gcc.rs b/library/std/src/sys/personality/gcc.rs
index 1fb85a10179..f6b1844e153 100644
--- a/library/std/src/sys/personality/gcc.rs
+++ b/library/std/src/sys/personality/gcc.rs
@@ -37,9 +37,10 @@
 //! and the last personality routine transfers control to the catch block.
 #![forbid(unsafe_op_in_unsafe_fn)]
 
+use unwind as uw;
+
 use super::dwarf::eh::{self, EHAction, EHContext};
 use crate::ffi::c_int;
-use unwind as uw;
 
 // Register ids were lifted from LLVM's TargetLowering::getExceptionPointerRegister()
 // and TargetLowering::getExceptionSelectorRegister() for each architecture,
diff --git a/library/std/src/sys/sync/condvar/futex.rs b/library/std/src/sys/sync/condvar/futex.rs
index 4586d0fd941..39cd97c01ea 100644
--- a/library/std/src/sys/sync/condvar/futex.rs
+++ b/library/std/src/sys/sync/condvar/futex.rs
@@ -1,4 +1,5 @@
-use crate::sync::atomic::{AtomicU32, Ordering::Relaxed};
+use crate::sync::atomic::AtomicU32;
+use crate::sync::atomic::Ordering::Relaxed;
 use crate::sys::futex::{futex_wait, futex_wake, futex_wake_all};
 use crate::sys::sync::Mutex;
 use crate::time::Duration;
diff --git a/library/std/src/sys/sync/condvar/itron.rs b/library/std/src/sys/sync/condvar/itron.rs
index 3a3039889e9..f6f2b698e49 100644
--- a/library/std/src/sys/sync/condvar/itron.rs
+++ b/library/std/src/sys/sync/condvar/itron.rs
@@ -1,9 +1,13 @@
 //! POSIX conditional variable implementation based on user-space wait queues.
 
-use crate::sys::pal::itron::{
-    abi, error::expect_success_aborting, spin::SpinMutex, task, time::with_tmos_strong,
-};
-use crate::{mem::replace, ptr::NonNull, sys::sync::Mutex, time::Duration};
+use crate::mem::replace;
+use crate::ptr::NonNull;
+use crate::sys::pal::itron::error::expect_success_aborting;
+use crate::sys::pal::itron::spin::SpinMutex;
+use crate::sys::pal::itron::time::with_tmos_strong;
+use crate::sys::pal::itron::{abi, task};
+use crate::sys::sync::Mutex;
+use crate::time::Duration;
 
 // The implementation is inspired by the queue-based implementation shown in
 // Andrew D. Birrell's paper "Implementing Condition Variables with Semaphores"
diff --git a/library/std/src/sys/sync/condvar/pthread.rs b/library/std/src/sys/sync/condvar/pthread.rs
index a2a96410d93..2b4bdfe415c 100644
--- a/library/std/src/sys/sync/condvar/pthread.rs
+++ b/library/std/src/sys/sync/condvar/pthread.rs
@@ -1,6 +1,7 @@
 use crate::cell::UnsafeCell;
 use crate::ptr;
-use crate::sync::atomic::{AtomicPtr, Ordering::Relaxed};
+use crate::sync::atomic::AtomicPtr;
+use crate::sync::atomic::Ordering::Relaxed;
 use crate::sys::sync::{mutex, Mutex};
 #[cfg(not(target_os = "nto"))]
 use crate::sys::time::TIMESPEC_MAX;
diff --git a/library/std/src/sys/sync/condvar/teeos.rs b/library/std/src/sys/sync/condvar/teeos.rs
index 6457da91c2a..943867cd761 100644
--- a/library/std/src/sys/sync/condvar/teeos.rs
+++ b/library/std/src/sys/sync/condvar/teeos.rs
@@ -1,6 +1,7 @@
 use crate::cell::UnsafeCell;
 use crate::ptr;
-use crate::sync::atomic::{AtomicPtr, Ordering::Relaxed};
+use crate::sync::atomic::AtomicPtr;
+use crate::sync::atomic::Ordering::Relaxed;
 use crate::sys::sync::mutex::{self, Mutex};
 use crate::sys::time::TIMESPEC_MAX;
 use crate::sys_common::lazy_box::{LazyBox, LazyInit};
diff --git a/library/std/src/sys/sync/condvar/windows7.rs b/library/std/src/sys/sync/condvar/windows7.rs
index 07fa5fdd698..56eeeda551e 100644
--- a/library/std/src/sys/sync/condvar/windows7.rs
+++ b/library/std/src/sys/sync/condvar/windows7.rs
@@ -1,7 +1,6 @@
 use crate::cell::UnsafeCell;
-use crate::sys::c;
-use crate::sys::os;
 use crate::sys::sync::{mutex, Mutex};
+use crate::sys::{c, os};
 use crate::time::Duration;
 
 pub struct Condvar {
diff --git a/library/std/src/sys/sync/condvar/xous.rs b/library/std/src/sys/sync/condvar/xous.rs
index 7b218818ef8..007383479a1 100644
--- a/library/std/src/sys/sync/condvar/xous.rs
+++ b/library/std/src/sys/sync/condvar/xous.rs
@@ -1,8 +1,9 @@
+use core::sync::atomic::{AtomicUsize, Ordering};
+
 use crate::os::xous::ffi::{blocking_scalar, scalar};
 use crate::os::xous::services::{ticktimer_server, TicktimerScalar};
 use crate::sys::sync::Mutex;
 use crate::time::Duration;
-use core::sync::atomic::{AtomicUsize, Ordering};
 
 // The implementation is inspired by Andrew D. Birrell's paper
 // "Implementing Condition Variables with Semaphores"
diff --git a/library/std/src/sys/sync/mutex/fuchsia.rs b/library/std/src/sys/sync/mutex/fuchsia.rs
index 5d89e5a13fd..81a6361a83a 100644
--- a/library/std/src/sys/sync/mutex/fuchsia.rs
+++ b/library/std/src/sys/sync/mutex/fuchsia.rs
@@ -37,10 +37,8 @@
 //!
 //! [mutex in Fuchsia's libsync]: https://cs.opensource.google/fuchsia/fuchsia/+/main:zircon/system/ulib/sync/mutex.c
 
-use crate::sync::atomic::{
-    AtomicU32,
-    Ordering::{Acquire, Relaxed, Release},
-};
+use crate::sync::atomic::AtomicU32;
+use crate::sync::atomic::Ordering::{Acquire, Relaxed, Release};
 use crate::sys::futex::zircon::{
     zx_futex_wait, zx_futex_wake_single_owner, zx_handle_t, zx_thread_self, ZX_ERR_BAD_HANDLE,
     ZX_ERR_BAD_STATE, ZX_ERR_INVALID_ARGS, ZX_ERR_TIMED_OUT, ZX_ERR_WRONG_TYPE, ZX_OK,
diff --git a/library/std/src/sys/sync/mutex/itron.rs b/library/std/src/sys/sync/mutex/itron.rs
index a72c30d1fe3..8440ffdd337 100644
--- a/library/std/src/sys/sync/mutex/itron.rs
+++ b/library/std/src/sys/sync/mutex/itron.rs
@@ -2,11 +2,9 @@
 //! `TA_INHERIT` are available.
 #![forbid(unsafe_op_in_unsafe_fn)]
 
-use crate::sys::pal::itron::{
-    abi,
-    error::{expect_success, expect_success_aborting, fail, ItronError},
-    spin::SpinIdOnceCell,
-};
+use crate::sys::pal::itron::abi;
+use crate::sys::pal::itron::error::{expect_success, expect_success_aborting, fail, ItronError};
+use crate::sys::pal::itron::spin::SpinIdOnceCell;
 
 pub struct Mutex {
     /// The ID of the underlying mutex object
diff --git a/library/std/src/sys/sync/mutex/xous.rs b/library/std/src/sys/sync/mutex/xous.rs
index 1426e48f8b7..63efa5a0210 100644
--- a/library/std/src/sys/sync/mutex/xous.rs
+++ b/library/std/src/sys/sync/mutex/xous.rs
@@ -1,9 +1,7 @@
 use crate::os::xous::ffi::{blocking_scalar, do_yield};
 use crate::os::xous::services::{ticktimer_server, TicktimerScalar};
-use crate::sync::atomic::{
-    AtomicBool, AtomicUsize,
-    Ordering::{Acquire, Relaxed, Release},
-};
+use crate::sync::atomic::Ordering::{Acquire, Relaxed, Release};
+use crate::sync::atomic::{AtomicBool, AtomicUsize};
 
 pub struct Mutex {
     /// The "locked" value indicates how many threads are waiting on this
diff --git a/library/std/src/sys/sync/once/futex.rs b/library/std/src/sys/sync/once/futex.rs
index 8a231e65ad1..e683777803f 100644
--- a/library/std/src/sys/sync/once/futex.rs
+++ b/library/std/src/sys/sync/once/futex.rs
@@ -1,9 +1,7 @@
 use crate::cell::Cell;
 use crate::sync as public;
-use crate::sync::atomic::{
-    AtomicU32,
-    Ordering::{Acquire, Relaxed, Release},
-};
+use crate::sync::atomic::AtomicU32;
+use crate::sync::atomic::Ordering::{Acquire, Relaxed, Release};
 use crate::sync::once::ExclusiveState;
 use crate::sys::futex::{futex_wait, futex_wake_all};
 
diff --git a/library/std/src/sys/sync/once/queue.rs b/library/std/src/sys/sync/once/queue.rs
index 730cdb768bd..b04d252f8b9 100644
--- a/library/std/src/sys/sync/once/queue.rs
+++ b/library/std/src/sys/sync/once/queue.rs
@@ -56,12 +56,10 @@
 //   allowed, so no need for `SeqCst`.
 
 use crate::cell::Cell;
-use crate::fmt;
-use crate::ptr;
-use crate::sync as public;
 use crate::sync::atomic::{AtomicBool, AtomicPtr, Ordering};
 use crate::sync::once::ExclusiveState;
 use crate::thread::{self, Thread};
+use crate::{fmt, ptr, sync as public};
 
 type Masked = ();
 
diff --git a/library/std/src/sys/sync/rwlock/futex.rs b/library/std/src/sys/sync/rwlock/futex.rs
index b05c50951ac..75ecc2ab5c5 100644
--- a/library/std/src/sys/sync/rwlock/futex.rs
+++ b/library/std/src/sys/sync/rwlock/futex.rs
@@ -1,7 +1,5 @@
-use crate::sync::atomic::{
-    AtomicU32,
-    Ordering::{Acquire, Relaxed, Release},
-};
+use crate::sync::atomic::AtomicU32;
+use crate::sync::atomic::Ordering::{Acquire, Relaxed, Release};
 use crate::sys::futex::{futex_wait, futex_wake, futex_wake_all};
 
 pub struct RwLock {
diff --git a/library/std/src/sys/sync/rwlock/queue.rs b/library/std/src/sys/sync/rwlock/queue.rs
index 9c59ee53654..458c16516bb 100644
--- a/library/std/src/sys/sync/rwlock/queue.rs
+++ b/library/std/src/sys/sync/rwlock/queue.rs
@@ -111,10 +111,8 @@ use crate::cell::OnceCell;
 use crate::hint::spin_loop;
 use crate::mem;
 use crate::ptr::{self, null_mut, without_provenance_mut, NonNull};
-use crate::sync::atomic::{
-    AtomicBool, AtomicPtr,
-    Ordering::{AcqRel, Acquire, Relaxed, Release},
-};
+use crate::sync::atomic::Ordering::{AcqRel, Acquire, Relaxed, Release};
+use crate::sync::atomic::{AtomicBool, AtomicPtr};
 use crate::thread::{self, Thread};
 
 // Locking uses exponential backoff. `SPIN_COUNT` indicates how many times the
diff --git a/library/std/src/sys/sync/rwlock/solid.rs b/library/std/src/sys/sync/rwlock/solid.rs
index f18831c0692..05371402020 100644
--- a/library/std/src/sys/sync/rwlock/solid.rs
+++ b/library/std/src/sys/sync/rwlock/solid.rs
@@ -1,13 +1,9 @@
 //! A readers-writer lock implementation backed by the SOLID kernel extension.
 #![forbid(unsafe_op_in_unsafe_fn)]
 
-use crate::sys::pal::{
-    abi,
-    itron::{
-        error::{expect_success, expect_success_aborting, fail, ItronError},
-        spin::SpinIdOnceCell,
-    },
-};
+use crate::sys::pal::abi;
+use crate::sys::pal::itron::error::{expect_success, expect_success_aborting, fail, ItronError};
+use crate::sys::pal::itron::spin::SpinIdOnceCell;
 
 pub struct RwLock {
     /// The ID of the underlying mutex object
diff --git a/library/std/src/sys/sync/thread_parking/darwin.rs b/library/std/src/sys/sync/thread_parking/darwin.rs
index 973c08f0317..96e3d23c332 100644
--- a/library/std/src/sys/sync/thread_parking/darwin.rs
+++ b/library/std/src/sys/sync/thread_parking/darwin.rs
@@ -13,10 +13,8 @@
 #![allow(non_camel_case_types)]
 
 use crate::pin::Pin;
-use crate::sync::atomic::{
-    AtomicI8,
-    Ordering::{Acquire, Release},
-};
+use crate::sync::atomic::AtomicI8;
+use crate::sync::atomic::Ordering::{Acquire, Release};
 use crate::time::Duration;
 
 type dispatch_semaphore_t = *mut crate::ffi::c_void;
diff --git a/library/std/src/sys/sync/thread_parking/id.rs b/library/std/src/sys/sync/thread_parking/id.rs
index 57c4daefd55..a7b07b509df 100644
--- a/library/std/src/sys/sync/thread_parking/id.rs
+++ b/library/std/src/sys/sync/thread_parking/id.rs
@@ -9,10 +9,8 @@
 
 use crate::cell::UnsafeCell;
 use crate::pin::Pin;
-use crate::sync::atomic::{
-    fence, AtomicI8,
-    Ordering::{Acquire, Relaxed, Release},
-};
+use crate::sync::atomic::Ordering::{Acquire, Relaxed, Release};
+use crate::sync::atomic::{fence, AtomicI8};
 use crate::sys::thread_parking::{current, park, park_timeout, unpark, ThreadId};
 use crate::time::Duration;
 
diff --git a/library/std/src/sys/sync/thread_parking/windows7.rs b/library/std/src/sys/sync/thread_parking/windows7.rs
index d19df847746..1000b63b6d0 100644
--- a/library/std/src/sys/sync/thread_parking/windows7.rs
+++ b/library/std/src/sys/sync/thread_parking/windows7.rs
@@ -57,14 +57,13 @@
 // [3]: https://docs.microsoft.com/en-us/archive/msdn-magazine/2012/november/windows-with-c-the-evolution-of-synchronization-in-windows-and-c
 // [4]: Windows Internals, Part 1, ISBN 9780735671300
 
+use core::ffi::c_void;
+
 use crate::pin::Pin;
-use crate::sync::atomic::{
-    AtomicI8,
-    Ordering::{Acquire, Release},
-};
+use crate::sync::atomic::AtomicI8;
+use crate::sync::atomic::Ordering::{Acquire, Release};
 use crate::sys::{c, dur2timeout};
 use crate::time::Duration;
-use core::ffi::c_void;
 
 pub struct Parker {
     state: AtomicI8,
@@ -185,16 +184,15 @@ impl Parker {
 
 #[cfg(target_vendor = "win7")]
 mod keyed_events {
-    use super::{Parker, EMPTY, NOTIFIED};
-    use crate::sys::c;
     use core::pin::Pin;
     use core::ptr;
-    use core::sync::atomic::{
-        AtomicPtr,
-        Ordering::{Acquire, Relaxed},
-    };
+    use core::sync::atomic::AtomicPtr;
+    use core::sync::atomic::Ordering::{Acquire, Relaxed};
     use core::time::Duration;
 
+    use super::{Parker, EMPTY, NOTIFIED};
+    use crate::sys::c;
+
     pub unsafe fn park(parker: Pin<&Parker>) {
         // Wait for unpark() to produce this event.
         c::NtWaitForKeyedEvent(keyed_event_handle(), parker.ptr(), 0, ptr::null_mut());
diff --git a/library/std/src/sys/sync/thread_parking/xous.rs b/library/std/src/sys/sync/thread_parking/xous.rs
index 0bd0462d77d..64b6f731f23 100644
--- a/library/std/src/sys/sync/thread_parking/xous.rs
+++ b/library/std/src/sys/sync/thread_parking/xous.rs
@@ -2,10 +2,8 @@ use crate::os::xous::ffi::{blocking_scalar, scalar};
 use crate::os::xous::services::{ticktimer_server, TicktimerScalar};
 use crate::pin::Pin;
 use crate::ptr;
-use crate::sync::atomic::{
-    AtomicI8,
-    Ordering::{Acquire, Release},
-};
+use crate::sync::atomic::AtomicI8;
+use crate::sync::atomic::Ordering::{Acquire, Release};
 use crate::time::Duration;
 
 const NOTIFIED: i8 = 1;
diff --git a/library/std/src/sys/thread_local/guard/solid.rs b/library/std/src/sys/thread_local/guard/solid.rs
index b65d00c5b5f..054b2d561c8 100644
--- a/library/std/src/sys/thread_local/guard/solid.rs
+++ b/library/std/src/sys/thread_local/guard/solid.rs
@@ -3,7 +3,8 @@
 //! destructors for terminated tasks, we still keep our own list.
 
 use crate::cell::Cell;
-use crate::sys::pal::{abi, itron::task};
+use crate::sys::pal::abi;
+use crate::sys::pal::itron::task;
 use crate::sys::thread_local::destructors;
 
 pub fn enable() {
diff --git a/library/std/src/sys/thread_local/guard/windows.rs b/library/std/src/sys/thread_local/guard/windows.rs
index e08ac44e1af..bf94f7d6e3d 100644
--- a/library/std/src/sys/thread_local/guard/windows.rs
+++ b/library/std/src/sys/thread_local/guard/windows.rs
@@ -63,9 +63,10 @@
 //! [1]: https://www.codeproject.com/Articles/8113/Thread-Local-Storage-The-C-Way
 //! [2]: https://github.com/ChromiumWebApps/chromium/blob/master/base/threading/thread_local_storage_win.cc#L42
 
+use core::ffi::c_void;
+
 use crate::ptr;
 use crate::sys::c;
-use core::ffi::c_void;
 
 pub fn enable() {
     // When destructors are used, we don't want LLVM eliminating CALLBACK for any
diff --git a/library/std/src/sys/thread_local/key/windows.rs b/library/std/src/sys/thread_local/key/windows.rs
index 8b43e558d5d..f4e0f25a476 100644
--- a/library/std/src/sys/thread_local/key/windows.rs
+++ b/library/std/src/sys/thread_local/key/windows.rs
@@ -26,10 +26,8 @@
 
 use crate::cell::UnsafeCell;
 use crate::ptr;
-use crate::sync::atomic::{
-    AtomicPtr, AtomicU32,
-    Ordering::{AcqRel, Acquire, Relaxed, Release},
-};
+use crate::sync::atomic::Ordering::{AcqRel, Acquire, Relaxed, Release};
+use crate::sync::atomic::{AtomicPtr, AtomicU32};
 use crate::sys::c;
 use crate::sys::thread_local::guard;
 
diff --git a/library/std/src/sys/thread_local/key/xous.rs b/library/std/src/sys/thread_local/key/xous.rs
index db6dd5a87ba..4fb2fdcc619 100644
--- a/library/std/src/sys/thread_local/key/xous.rs
+++ b/library/std/src/sys/thread_local/key/xous.rs
@@ -36,14 +36,13 @@
 
 // FIXME(joboet): implement support for native TLS instead.
 
-use crate::mem::ManuallyDrop;
-use crate::ptr;
-use crate::sync::atomic::AtomicPtr;
-use crate::sync::atomic::AtomicUsize;
-use crate::sync::atomic::Ordering::{Acquire, Relaxed, Release};
 use core::arch::asm;
 
+use crate::mem::ManuallyDrop;
 use crate::os::xous::ffi::{map_memory, unmap_memory, MemoryFlags};
+use crate::ptr;
+use crate::sync::atomic::Ordering::{Acquire, Relaxed, Release};
+use crate::sync::atomic::{AtomicPtr, AtomicUsize};
 
 pub type Key = usize;
 pub type Dtor = unsafe extern "C" fn(*mut u8);
diff --git a/library/std/src/sys/thread_local/native/eager.rs b/library/std/src/sys/thread_local/native/eager.rs
index f8cd31613ad..fd48c4f7202 100644
--- a/library/std/src/sys/thread_local/native/eager.rs
+++ b/library/std/src/sys/thread_local/native/eager.rs
@@ -1,7 +1,6 @@
 use crate::cell::{Cell, UnsafeCell};
 use crate::ptr::{self, drop_in_place};
-use crate::sys::thread_local::abort_on_dtor_unwind;
-use crate::sys::thread_local::destructors;
+use crate::sys::thread_local::{abort_on_dtor_unwind, destructors};
 
 #[derive(Clone, Copy)]
 enum State {
diff --git a/library/std/src/sys/thread_local/native/lazy.rs b/library/std/src/sys/thread_local/native/lazy.rs
index 9c914834d6e..51294285ba0 100644
--- a/library/std/src/sys/thread_local/native/lazy.rs
+++ b/library/std/src/sys/thread_local/native/lazy.rs
@@ -1,8 +1,7 @@
 use crate::cell::UnsafeCell;
 use crate::hint::unreachable_unchecked;
 use crate::ptr;
-use crate::sys::thread_local::abort_on_dtor_unwind;
-use crate::sys::thread_local::destructors;
+use crate::sys::thread_local::{abort_on_dtor_unwind, destructors};
 
 pub unsafe trait DestroyedState: Sized {
     fn register_dtor<T>(s: &Storage<T, Self>);
diff --git a/library/std/src/sys_common/io.rs b/library/std/src/sys_common/io.rs
index 4a42ff3c618..e386c955f37 100644
--- a/library/std/src/sys_common/io.rs
+++ b/library/std/src/sys_common/io.rs
@@ -5,12 +5,11 @@ pub const DEFAULT_BUF_SIZE: usize = if cfg!(target_os = "espidf") { 512 } else {
 #[cfg(test)]
 #[allow(dead_code)] // not used on emscripten
 pub mod test {
-    use crate::env;
-    use crate::fs;
-    use crate::path::{Path, PathBuf};
-    use crate::thread;
     use rand::RngCore;
 
+    use crate::path::{Path, PathBuf};
+    use crate::{env, fs, thread};
+
     pub struct TempDir(PathBuf);
 
     impl TempDir {
diff --git a/library/std/src/sys_common/lazy_box.rs b/library/std/src/sys_common/lazy_box.rs
index 63c3316bdeb..b45b05f63ba 100644
--- a/library/std/src/sys_common/lazy_box.rs
+++ b/library/std/src/sys_common/lazy_box.rs
@@ -5,10 +5,8 @@
 use crate::marker::PhantomData;
 use crate::ops::{Deref, DerefMut};
 use crate::ptr::null_mut;
-use crate::sync::atomic::{
-    AtomicPtr,
-    Ordering::{AcqRel, Acquire},
-};
+use crate::sync::atomic::AtomicPtr;
+use crate::sync::atomic::Ordering::{AcqRel, Acquire};
 
 pub(crate) struct LazyBox<T: LazyInit> {
     ptr: AtomicPtr<T>,
diff --git a/library/std/src/sys_common/net.rs b/library/std/src/sys_common/net.rs
index 0a82b50ae1a..25ebeb3502d 100644
--- a/library/std/src/sys_common/net.rs
+++ b/library/std/src/sys_common/net.rs
@@ -1,19 +1,14 @@
 #[cfg(test)]
 mod tests;
 
-use crate::cmp;
-use crate::fmt;
+use crate::ffi::{c_int, c_void};
 use crate::io::{self, BorrowedCursor, ErrorKind, IoSlice, IoSliceMut};
-use crate::mem;
 use crate::net::{Ipv4Addr, Ipv6Addr, Shutdown, SocketAddr};
-use crate::ptr;
 use crate::sys::common::small_c_string::run_with_cstr;
-use crate::sys::net::netc as c;
-use crate::sys::net::{cvt, cvt_gai, cvt_r, init, wrlen_t, Socket};
+use crate::sys::net::{cvt, cvt_gai, cvt_r, init, netc as c, wrlen_t, Socket};
 use crate::sys_common::{AsInner, FromInner, IntoInner};
 use crate::time::Duration;
-
-use crate::ffi::{c_int, c_void};
+use crate::{cmp, fmt, mem, ptr};
 
 cfg_if::cfg_if! {
     if #[cfg(any(
diff --git a/library/std/src/sys_common/process.rs b/library/std/src/sys_common/process.rs
index 4d295cf0f09..5333ee146f7 100644
--- a/library/std/src/sys_common/process.rs
+++ b/library/std/src/sys_common/process.rs
@@ -2,12 +2,10 @@
 #![unstable(feature = "process_internals", issue = "none")]
 
 use crate::collections::BTreeMap;
-use crate::env;
 use crate::ffi::{OsStr, OsString};
-use crate::fmt;
-use crate::io;
 use crate::sys::pipe::read2;
 use crate::sys::process::{EnvKey, ExitStatus, Process, StdioPipes};
+use crate::{env, fmt, io};
 
 // Stores a set of changes to an environment
 #[derive(Clone)]
diff --git a/library/std/src/sys_common/wtf8.rs b/library/std/src/sys_common/wtf8.rs
index 6aeeb625928..277c9506feb 100644
--- a/library/std/src/sys_common/wtf8.rs
+++ b/library/std/src/sys_common/wtf8.rs
@@ -23,16 +23,12 @@ use core::str::next_code_point;
 
 use crate::borrow::Cow;
 use crate::collections::TryReserveError;
-use crate::fmt;
 use crate::hash::{Hash, Hasher};
 use crate::iter::FusedIterator;
-use crate::mem;
-use crate::ops;
 use crate::rc::Rc;
-use crate::slice;
-use crate::str;
 use crate::sync::Arc;
 use crate::sys_common::AsInner;
+use crate::{fmt, mem, ops, slice, str};
 
 const UTF8_REPLACEMENT_CHARACTER: &str = "\u{FFFD}";
 
diff --git a/library/std/src/thread/mod.rs b/library/std/src/thread/mod.rs
index ce6a6afdc19..59720f77465 100644
--- a/library/std/src/thread/mod.rs
+++ b/library/std/src/thread/mod.rs
@@ -160,24 +160,19 @@ mod tests;
 
 use crate::any::Any;
 use crate::cell::{Cell, OnceCell, UnsafeCell};
-use crate::env;
 use crate::ffi::CStr;
-use crate::fmt;
-use crate::io;
 use crate::marker::PhantomData;
 use crate::mem::{self, forget, ManuallyDrop};
 use crate::num::NonZero;
-use crate::panic;
-use crate::panicking;
 use crate::pin::Pin;
 use crate::ptr::addr_of_mut;
-use crate::str;
 use crate::sync::atomic::{AtomicUsize, Ordering};
 use crate::sync::Arc;
 use crate::sys::sync::Parker;
 use crate::sys::thread as imp;
 use crate::sys_common::{AsInner, IntoInner};
 use crate::time::{Duration, Instant};
+use crate::{env, fmt, io, panic, panicking, str};
 
 #[stable(feature = "scoped_threads", since = "1.63.0")]
 mod scoped;
@@ -1292,9 +1287,10 @@ enum ThreadName {
 
 // This module ensures private fields are kept private, which is necessary to enforce the safety requirements.
 mod thread_name_string {
+    use core::str;
+
     use super::ThreadName;
     use crate::ffi::{CStr, CString};
-    use core::str;
 
     /// Like a `String` it's guaranteed UTF-8 and like a `CString` it's null terminated.
     pub(crate) struct ThreadNameString {
diff --git a/library/std/src/thread/scoped.rs b/library/std/src/thread/scoped.rs
index fbd6f8feecf..ba27c9220ae 100644
--- a/library/std/src/thread/scoped.rs
+++ b/library/std/src/thread/scoped.rs
@@ -1,10 +1,9 @@
 use super::{current, park, Builder, JoinInner, Result, Thread};
-use crate::fmt;
-use crate::io;
 use crate::marker::PhantomData;
 use crate::panic::{catch_unwind, resume_unwind, AssertUnwindSafe};
 use crate::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
 use crate::sync::Arc;
+use crate::{fmt, io};
 
 /// A scope to spawn scoped threads in.
 ///
diff --git a/library/std/src/thread/tests.rs b/library/std/src/thread/tests.rs
index 1fb1333be0e..aa464d56f95 100644
--- a/library/std/src/thread/tests.rs
+++ b/library/std/src/thread/tests.rs
@@ -1,16 +1,12 @@
 use super::Builder;
 use crate::any::Any;
-use crate::mem;
 use crate::panic::panic_any;
-use crate::result;
-use crate::sync::{
-    atomic::{AtomicBool, Ordering},
-    mpsc::{channel, Sender},
-    Arc, Barrier,
-};
+use crate::sync::atomic::{AtomicBool, Ordering};
+use crate::sync::mpsc::{channel, Sender};
+use crate::sync::{Arc, Barrier};
 use crate::thread::{self, Scope, ThreadId};
-use crate::time::Duration;
-use crate::time::Instant;
+use crate::time::{Duration, Instant};
+use crate::{mem, result};
 
 // !!! These tests are dangerous. If something is buggy, they will hang, !!!
 // !!! instead of exiting cleanly. This might wedge the buildbots.       !!!
diff --git a/library/std/src/time.rs b/library/std/src/time.rs
index 6f1a354d28a..ae46670c25e 100644
--- a/library/std/src/time.rs
+++ b/library/std/src/time.rs
@@ -34,18 +34,17 @@
 #[cfg(test)]
 mod tests;
 
+#[stable(feature = "time", since = "1.3.0")]
+pub use core::time::Duration;
+#[stable(feature = "duration_checked_float", since = "1.66.0")]
+pub use core::time::TryFromFloatSecsError;
+
 use crate::error::Error;
 use crate::fmt;
 use crate::ops::{Add, AddAssign, Sub, SubAssign};
 use crate::sys::time;
 use crate::sys_common::{FromInner, IntoInner};
 
-#[stable(feature = "time", since = "1.3.0")]
-pub use core::time::Duration;
-
-#[stable(feature = "duration_checked_float", since = "1.66.0")]
-pub use core::time::TryFromFloatSecsError;
-
 /// A measurement of a monotonically nondecreasing clock.
 /// Opaque and useful only with [`Duration`].
 ///
diff --git a/library/std/src/time/tests.rs b/library/std/src/time/tests.rs
index 6ed84806e6d..de36dc4c9fd 100644
--- a/library/std/src/time/tests.rs
+++ b/library/std/src/time/tests.rs
@@ -1,8 +1,10 @@
-use super::{Duration, Instant, SystemTime, UNIX_EPOCH};
 use core::fmt::Debug;
+
 #[cfg(not(target_arch = "wasm32"))]
 use test::{black_box, Bencher};
 
+use super::{Duration, Instant, SystemTime, UNIX_EPOCH};
+
 macro_rules! assert_almost_eq {
     ($a:expr, $b:expr) => {{
         let (a, b) = ($a, $b);
diff --git a/library/std/tests/common/mod.rs b/library/std/tests/common/mod.rs
index 1aad6549e76..7cf70c725e4 100644
--- a/library/std/tests/common/mod.rs
+++ b/library/std/tests/common/mod.rs
@@ -1,10 +1,9 @@
 #![allow(unused)]
 
-use rand::RngCore;
-use std::env;
-use std::fs;
 use std::path::{Path, PathBuf};
-use std::thread;
+use std::{env, fs, thread};
+
+use rand::RngCore;
 
 /// Copied from `std::test_helpers::test_rng`, since these tests rely on the
 /// seed not being the same for every RNG invocation too.
diff --git a/library/std/tests/create_dir_all_bare.rs b/library/std/tests/create_dir_all_bare.rs
index 79c3c8f528e..8becf713205 100644
--- a/library/std/tests/create_dir_all_bare.rs
+++ b/library/std/tests/create_dir_all_bare.rs
@@ -3,9 +3,8 @@
 //! Note that this test changes the current directory so
 //! should not be in the same process as other tests.
 
-use std::env;
-use std::fs;
 use std::path::{Path, PathBuf};
+use std::{env, fs};
 
 mod common;
 
diff --git a/library/std/tests/env.rs b/library/std/tests/env.rs
index a1ca85c2145..4e472b4ce99 100644
--- a/library/std/tests/env.rs
+++ b/library/std/tests/env.rs
@@ -4,9 +4,10 @@ use std::ffi::{OsStr, OsString};
 use rand::distributions::{Alphanumeric, DistString};
 
 mod common;
-use common::test_rng;
 use std::thread;
 
+use common::test_rng;
+
 #[track_caller]
 fn make_rand_name() -> OsString {
     let n = format!("TEST{}", Alphanumeric.sample_string(&mut test_rng(), 10));
diff --git a/library/std/tests/pipe_subprocess.rs b/library/std/tests/pipe_subprocess.rs
index c2278098b9b..1535742a83a 100644
--- a/library/std/tests/pipe_subprocess.rs
+++ b/library/std/tests/pipe_subprocess.rs
@@ -3,7 +3,9 @@
 fn main() {
     #[cfg(all(not(miri), any(unix, windows)))]
     {
-        use std::{env, io::Read, pipe::pipe, process};
+        use std::io::Read;
+        use std::pipe::pipe;
+        use std::{env, process};
 
         if env::var("I_AM_THE_CHILD").is_ok() {
             child();
diff --git a/library/std/tests/process_spawning.rs b/library/std/tests/process_spawning.rs
index c56c111c37d..d249eb7d50a 100644
--- a/library/std/tests/process_spawning.rs
+++ b/library/std/tests/process_spawning.rs
@@ -1,9 +1,6 @@
 #![cfg(not(target_env = "sgx"))]
 
-use std::env;
-use std::fs;
-use std::process;
-use std::str;
+use std::{env, fs, process, str};
 
 mod common;
 
diff --git a/library/std/tests/switch-stdout.rs b/library/std/tests/switch-stdout.rs
index 0afe18088fa..42011a9b3da 100644
--- a/library/std/tests/switch-stdout.rs
+++ b/library/std/tests/switch-stdout.rs
@@ -5,11 +5,10 @@ use std::io::{Read, Write};
 
 mod common;
 
-#[cfg(windows)]
-use std::os::windows::io::OwnedHandle;
-
 #[cfg(unix)]
 use std::os::fd::OwnedFd;
+#[cfg(windows)]
+use std::os::windows::io::OwnedHandle;
 
 #[cfg(unix)]
 fn switch_stdout_to(file: OwnedFd) -> OwnedFd {
diff --git a/library/std/tests/windows.rs b/library/std/tests/windows.rs
index 9f7596f1bc2..dab3182b818 100644
--- a/library/std/tests/windows.rs
+++ b/library/std/tests/windows.rs
@@ -1,7 +1,9 @@
 #![cfg(windows)]
 //! An external tests
 
-use std::{ffi::OsString, os::windows::ffi::OsStringExt, path::PathBuf};
+use std::ffi::OsString;
+use std::os::windows::ffi::OsStringExt;
+use std::path::PathBuf;
 
 #[test]
 #[should_panic]
diff --git a/library/test/src/bench.rs b/library/test/src/bench.rs
index 9f34f54c3d6..b71def3b032 100644
--- a/library/test/src/bench.rs
+++ b/library/test/src/bench.rs
@@ -1,19 +1,16 @@
 //! Benchmarking module.
 
-use super::{
-    event::CompletedTest,
-    options::BenchMode,
-    test_result::TestResult,
-    types::{TestDesc, TestId},
-    Sender,
-};
-
-use crate::stats;
-use std::cmp;
-use std::io;
 use std::panic::{catch_unwind, AssertUnwindSafe};
 use std::sync::{Arc, Mutex};
 use std::time::{Duration, Instant};
+use std::{cmp, io};
+
+use super::event::CompletedTest;
+use super::options::BenchMode;
+use super::test_result::TestResult;
+use super::types::{TestDesc, TestId};
+use super::Sender;
+use crate::stats;
 
 /// An identity function that *__hints__* to the compiler to be maximally pessimistic about what
 /// `black_box` could do.
diff --git a/library/test/src/cli.rs b/library/test/src/cli.rs
index b7d24405b77..4ccd825bf8d 100644
--- a/library/test/src/cli.rs
+++ b/library/test/src/cli.rs
@@ -1,11 +1,11 @@
 //! Module converting command-line arguments into test configuration.
 
 use std::env;
+use std::io::{self, IsTerminal};
 use std::path::PathBuf;
 
 use super::options::{ColorConfig, Options, OutputFormat, RunIgnored};
 use super::time::TestTimeOptions;
-use std::io::{self, IsTerminal};
 
 #[derive(Debug)]
 pub struct TestOpts {
diff --git a/library/test/src/console.rs b/library/test/src/console.rs
index 7e224d60d9d..4d4cdcf4d7b 100644
--- a/library/test/src/console.rs
+++ b/library/test/src/console.rs
@@ -5,19 +5,19 @@ use std::io;
 use std::io::prelude::Write;
 use std::time::Instant;
 
-use super::{
-    bench::fmt_bench_samples,
-    cli::TestOpts,
-    event::{CompletedTest, TestEvent},
-    filter_tests,
-    formatters::{JsonFormatter, JunitFormatter, OutputFormatter, PrettyFormatter, TerseFormatter},
-    helpers::{concurrency::get_concurrency, metrics::MetricMap},
-    options::{Options, OutputFormat},
-    run_tests, term,
-    test_result::TestResult,
-    time::{TestExecTime, TestSuiteExecTime},
-    types::{NamePadding, TestDesc, TestDescAndFn},
+use super::bench::fmt_bench_samples;
+use super::cli::TestOpts;
+use super::event::{CompletedTest, TestEvent};
+use super::formatters::{
+    JsonFormatter, JunitFormatter, OutputFormatter, PrettyFormatter, TerseFormatter,
 };
+use super::helpers::concurrency::get_concurrency;
+use super::helpers::metrics::MetricMap;
+use super::options::{Options, OutputFormat};
+use super::test_result::TestResult;
+use super::time::{TestExecTime, TestSuiteExecTime};
+use super::types::{NamePadding, TestDesc, TestDescAndFn};
+use super::{filter_tests, run_tests, term};
 
 /// Generic wrapper over stdout.
 pub enum OutputLocation<T> {
diff --git a/library/test/src/formatters/json.rs b/library/test/src/formatters/json.rs
index 6245aae17c4..aa1c50641cb 100644
--- a/library/test/src/formatters/json.rs
+++ b/library/test/src/formatters/json.rs
@@ -1,12 +1,12 @@
-use std::{borrow::Cow, io, io::prelude::Write};
+use std::borrow::Cow;
+use std::io;
+use std::io::prelude::Write;
 
 use super::OutputFormatter;
-use crate::{
-    console::{ConsoleTestDiscoveryState, ConsoleTestState, OutputLocation},
-    test_result::TestResult,
-    time,
-    types::TestDesc,
-};
+use crate::console::{ConsoleTestDiscoveryState, ConsoleTestState, OutputLocation};
+use crate::test_result::TestResult;
+use crate::time;
+use crate::types::TestDesc;
 
 pub(crate) struct JsonFormatter<T> {
     out: OutputLocation<T>,
diff --git a/library/test/src/formatters/junit.rs b/library/test/src/formatters/junit.rs
index a211ebf1ded..96b43200840 100644
--- a/library/test/src/formatters/junit.rs
+++ b/library/test/src/formatters/junit.rs
@@ -1,13 +1,12 @@
-use std::io::{self, prelude::Write};
+use std::io::prelude::Write;
+use std::io::{self};
 use std::time::Duration;
 
 use super::OutputFormatter;
-use crate::{
-    console::{ConsoleTestDiscoveryState, ConsoleTestState, OutputLocation},
-    test_result::TestResult,
-    time,
-    types::{TestDesc, TestType},
-};
+use crate::console::{ConsoleTestDiscoveryState, ConsoleTestState, OutputLocation};
+use crate::test_result::TestResult;
+use crate::time;
+use crate::types::{TestDesc, TestType};
 
 pub struct JunitFormatter<T> {
     out: OutputLocation<T>,
diff --git a/library/test/src/formatters/mod.rs b/library/test/src/formatters/mod.rs
index bc6ffebc1d3..f1225fecfef 100644
--- a/library/test/src/formatters/mod.rs
+++ b/library/test/src/formatters/mod.rs
@@ -1,11 +1,10 @@
-use std::{io, io::prelude::Write};
+use std::io;
+use std::io::prelude::Write;
 
-use crate::{
-    console::{ConsoleTestDiscoveryState, ConsoleTestState},
-    test_result::TestResult,
-    time,
-    types::{TestDesc, TestName},
-};
+use crate::console::{ConsoleTestDiscoveryState, ConsoleTestState};
+use crate::test_result::TestResult;
+use crate::time;
+use crate::types::{TestDesc, TestName};
 
 mod json;
 mod junit;
diff --git a/library/test/src/formatters/pretty.rs b/library/test/src/formatters/pretty.rs
index 22654a3400b..7089eae4330 100644
--- a/library/test/src/formatters/pretty.rs
+++ b/library/test/src/formatters/pretty.rs
@@ -1,14 +1,12 @@
-use std::{io, io::prelude::Write};
+use std::io;
+use std::io::prelude::Write;
 
 use super::OutputFormatter;
-use crate::{
-    bench::fmt_bench_samples,
-    console::{ConsoleTestDiscoveryState, ConsoleTestState, OutputLocation},
-    term,
-    test_result::TestResult,
-    time,
-    types::TestDesc,
-};
+use crate::bench::fmt_bench_samples;
+use crate::console::{ConsoleTestDiscoveryState, ConsoleTestState, OutputLocation};
+use crate::test_result::TestResult;
+use crate::types::TestDesc;
+use crate::{term, time};
 
 pub(crate) struct PrettyFormatter<T> {
     out: OutputLocation<T>,
diff --git a/library/test/src/formatters/terse.rs b/library/test/src/formatters/terse.rs
index 875c66e5fa3..534aa2f3311 100644
--- a/library/test/src/formatters/terse.rs
+++ b/library/test/src/formatters/terse.rs
@@ -1,15 +1,12 @@
-use std::{io, io::prelude::Write};
+use std::io;
+use std::io::prelude::Write;
 
 use super::OutputFormatter;
-use crate::{
-    bench::fmt_bench_samples,
-    console::{ConsoleTestDiscoveryState, ConsoleTestState, OutputLocation},
-    term,
-    test_result::TestResult,
-    time,
-    types::NamePadding,
-    types::TestDesc,
-};
+use crate::bench::fmt_bench_samples;
+use crate::console::{ConsoleTestDiscoveryState, ConsoleTestState, OutputLocation};
+use crate::test_result::TestResult;
+use crate::types::{NamePadding, TestDesc};
+use crate::{term, time};
 
 // We insert a '\n' when the output hits 100 columns in quiet mode. 88 test
 // result chars leaves 12 chars for a progress count like " 11704/12853".
diff --git a/library/test/src/helpers/concurrency.rs b/library/test/src/helpers/concurrency.rs
index 1854c6a7652..b1545cbec43 100644
--- a/library/test/src/helpers/concurrency.rs
+++ b/library/test/src/helpers/concurrency.rs
@@ -1,7 +1,8 @@
 //! Helper module which helps to determine amount of threads to be used
 //! during tests execution.
 
-use std::{env, num::NonZero, thread};
+use std::num::NonZero;
+use std::{env, thread};
 
 pub fn get_concurrency() -> usize {
     if let Ok(value) = env::var("RUST_TEST_THREADS") {
diff --git a/library/test/src/helpers/shuffle.rs b/library/test/src/helpers/shuffle.rs
index 2ac3bfbd4d6..14389eb0e37 100644
--- a/library/test/src/helpers/shuffle.rs
+++ b/library/test/src/helpers/shuffle.rs
@@ -1,8 +1,9 @@
-use crate::cli::TestOpts;
-use crate::types::{TestDescAndFn, TestId, TestName};
 use std::hash::{DefaultHasher, Hasher};
 use std::time::{SystemTime, UNIX_EPOCH};
 
+use crate::cli::TestOpts;
+use crate::types::{TestDescAndFn, TestId, TestName};
+
 pub fn get_shuffle_seed(opts: &TestOpts) -> Option<u64> {
     opts.shuffle_seed.or_else(|| {
         if opts.shuffle {
diff --git a/library/test/src/lib.rs b/library/test/src/lib.rs
index 71cb796b937..516e3f1300e 100644
--- a/library/test/src/lib.rs
+++ b/library/test/src/lib.rs
@@ -25,45 +25,39 @@
 #![feature(test)]
 #![allow(internal_features)]
 
+pub use cli::TestOpts;
+
 pub use self::bench::{black_box, Bencher};
 pub use self::console::run_tests_console;
 pub use self::options::{ColorConfig, Options, OutputFormat, RunIgnored, ShouldPanic};
 pub use self::types::TestName::*;
 pub use self::types::*;
 pub use self::ColorConfig::*;
-pub use cli::TestOpts;
 
 // Module to be used by rustc to compile tests in libtest
 pub mod test {
-    pub use crate::{
-        assert_test_result,
-        bench::Bencher,
-        cli::{parse_opts, TestOpts},
-        filter_tests,
-        helpers::metrics::{Metric, MetricMap},
-        options::{Options, RunIgnored, RunStrategy, ShouldPanic},
-        run_test, test_main, test_main_static,
-        test_result::{TestResult, TrFailed, TrFailedMsg, TrIgnored, TrOk},
-        time::{TestExecTime, TestTimeOptions},
-        types::{
-            DynTestFn, DynTestName, StaticBenchFn, StaticTestFn, StaticTestName, TestDesc,
-            TestDescAndFn, TestId, TestName, TestType,
-        },
+    pub use crate::bench::Bencher;
+    pub use crate::cli::{parse_opts, TestOpts};
+    pub use crate::helpers::metrics::{Metric, MetricMap};
+    pub use crate::options::{Options, RunIgnored, RunStrategy, ShouldPanic};
+    pub use crate::test_result::{TestResult, TrFailed, TrFailedMsg, TrIgnored, TrOk};
+    pub use crate::time::{TestExecTime, TestTimeOptions};
+    pub use crate::types::{
+        DynTestFn, DynTestName, StaticBenchFn, StaticTestFn, StaticTestName, TestDesc,
+        TestDescAndFn, TestId, TestName, TestType,
     };
+    pub use crate::{assert_test_result, filter_tests, run_test, test_main, test_main_static};
 }
 
-use std::{
-    collections::VecDeque,
-    env, io,
-    io::prelude::Write,
-    mem::ManuallyDrop,
-    panic::{self, catch_unwind, AssertUnwindSafe, PanicHookInfo},
-    process::{self, Command, Termination},
-    sync::mpsc::{channel, Sender},
-    sync::{Arc, Mutex},
-    thread,
-    time::{Duration, Instant},
-};
+use std::collections::VecDeque;
+use std::io::prelude::Write;
+use std::mem::ManuallyDrop;
+use std::panic::{self, catch_unwind, AssertUnwindSafe, PanicHookInfo};
+use std::process::{self, Command, Termination};
+use std::sync::mpsc::{channel, Sender};
+use std::sync::{Arc, Mutex};
+use std::time::{Duration, Instant};
+use std::{env, io, thread};
 
 pub mod bench;
 mod cli;
@@ -82,6 +76,7 @@ mod types;
 mod tests;
 
 use core::any::Any;
+
 use event::{CompletedTest, TestEvent};
 use helpers::concurrency::get_concurrency;
 use helpers::shuffle::{get_shuffle_seed, shuffle_tests};
diff --git a/library/test/src/stats/tests.rs b/library/test/src/stats/tests.rs
index 3a6e8401bf1..4b209dcf214 100644
--- a/library/test/src/stats/tests.rs
+++ b/library/test/src/stats/tests.rs
@@ -1,10 +1,11 @@
 use super::*;
 
 extern crate test;
-use self::test::test::Bencher;
 use std::io;
 use std::io::prelude::*;
 
+use self::test::test::Bencher;
+
 // Test vectors generated from R, using the script src/etc/stat-test-vectors.r.
 
 macro_rules! assert_approx_eq {
diff --git a/library/test/src/term.rs b/library/test/src/term.rs
index a14b0d4f5a9..e736e85d469 100644
--- a/library/test/src/term.rs
+++ b/library/test/src/term.rs
@@ -12,7 +12,8 @@
 
 #![deny(missing_docs)]
 
-use std::io::{self, prelude::*};
+use std::io::prelude::*;
+use std::io::{self};
 
 pub(crate) use terminfo::TerminfoTerminal;
 #[cfg(windows)]
diff --git a/library/test/src/term/terminfo/mod.rs b/library/test/src/term/terminfo/mod.rs
index 67ba89410cd..67eec3ca50f 100644
--- a/library/test/src/term/terminfo/mod.rs
+++ b/library/test/src/term/terminfo/mod.rs
@@ -1,20 +1,18 @@
 //! Terminfo database interface.
 
 use std::collections::HashMap;
-use std::env;
-use std::error;
-use std::fmt;
 use std::fs::File;
-use std::io::{self, prelude::*, BufReader};
+use std::io::prelude::*;
+use std::io::{self, BufReader};
 use std::path::Path;
-
-use super::color;
-use super::Terminal;
+use std::{env, error, fmt};
 
 use parm::{expand, Param, Variables};
 use parser::compiled::{msys_terminfo, parse};
 use searcher::get_dbpath_for_term;
 
+use super::{color, Terminal};
+
 /// A parsed terminfo database entry.
 #[allow(unused)]
 #[derive(Debug)]
diff --git a/library/test/src/term/terminfo/parm.rs b/library/test/src/term/terminfo/parm.rs
index c5b4ef01893..529ec0c36e4 100644
--- a/library/test/src/term/terminfo/parm.rs
+++ b/library/test/src/term/terminfo/parm.rs
@@ -1,10 +1,10 @@
 //! Parameterized string expansion
 
+use std::iter::repeat;
+
 use self::Param::*;
 use self::States::*;
 
-use std::iter::repeat;
-
 #[cfg(test)]
 mod tests;
 
diff --git a/library/test/src/term/terminfo/parser/compiled.rs b/library/test/src/term/terminfo/parser/compiled.rs
index 5d40b7988b5..e687b3be41f 100644
--- a/library/test/src/term/terminfo/parser/compiled.rs
+++ b/library/test/src/term/terminfo/parser/compiled.rs
@@ -2,11 +2,12 @@
 
 //! ncurses-compatible compiled terminfo format parsing (term(5))
 
-use super::super::TermInfo;
 use std::collections::HashMap;
 use std::io;
 use std::io::prelude::*;
 
+use super::super::TermInfo;
+
 #[cfg(test)]
 mod tests;
 
diff --git a/library/test/src/term/terminfo/searcher.rs b/library/test/src/term/terminfo/searcher.rs
index 8b8df34b079..1b29598cf80 100644
--- a/library/test/src/term/terminfo/searcher.rs
+++ b/library/test/src/term/terminfo/searcher.rs
@@ -2,9 +2,8 @@
 //!
 //! Does not support hashed database, only filesystem!
 
-use std::env;
-use std::fs;
 use std::path::PathBuf;
+use std::{env, fs};
 
 #[cfg(test)]
 mod tests;
diff --git a/library/test/src/term/win.rs b/library/test/src/term/win.rs
index 65764c0ffc1..ce9cad37f30 100644
--- a/library/test/src/term/win.rs
+++ b/library/test/src/term/win.rs
@@ -5,8 +5,7 @@
 use std::io;
 use std::io::prelude::*;
 
-use super::color;
-use super::Terminal;
+use super::{color, Terminal};
 
 /// A Terminal implementation that uses the Win32 Console API.
 pub(crate) struct WinConsole<T> {
diff --git a/library/test/src/test_result.rs b/library/test/src/test_result.rs
index 98c54f038da..c5f4b03bfc9 100644
--- a/library/test/src/test_result.rs
+++ b/library/test/src/test_result.rs
@@ -1,16 +1,14 @@
 use std::any::Any;
-use std::process::ExitStatus;
-
 #[cfg(unix)]
 use std::os::unix::process::ExitStatusExt;
+use std::process::ExitStatus;
 
+pub use self::TestResult::*;
 use super::bench::BenchSamples;
 use super::options::ShouldPanic;
 use super::time;
 use super::types::TestDesc;
 
-pub use self::TestResult::*;
-
 // Return code for secondary process.
 // Start somewhere other than 0 so we know the return code means what we think
 // it means.
diff --git a/library/test/src/tests.rs b/library/test/src/tests.rs
index 43a906ad298..ba2f35362c5 100644
--- a/library/test/src/tests.rs
+++ b/library/test/src/tests.rs
@@ -1,5 +1,4 @@
 use super::*;
-
 use crate::{
     console::OutputLocation,
     formatters::PrettyFormatter,
@@ -237,8 +236,9 @@ fn test_should_panic_bad_message() {
 #[cfg(not(target_os = "emscripten"))]
 #[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
 fn test_should_panic_non_string_message_type() {
-    use crate::tests::TrFailedMsg;
     use std::any::TypeId;
+
+    use crate::tests::TrFailedMsg;
     fn f() -> Result<(), String> {
         std::panic::panic_any(1i32);
     }
diff --git a/library/test/src/time.rs b/library/test/src/time.rs
index 7fd69d7f7e7..02ae050db55 100644
--- a/library/test/src/time.rs
+++ b/library/test/src/time.rs
@@ -5,10 +5,9 @@
 //! - Provide helpers for `report-time` and `measure-time` options.
 //! - Provide newtypes for executions times.
 
-use std::env;
-use std::fmt;
 use std::str::FromStr;
 use std::time::{Duration, Instant};
+use std::{env, fmt};
 
 use super::types::{TestDesc, TestType};
 
@@ -24,9 +23,10 @@ pub const TEST_WARN_TIMEOUT_S: u64 = 60;
 /// Example of the expected format is `RUST_TEST_TIME_xxx=100,200`, where 100 means
 /// warn time, and 200 means critical time.
 pub mod time_constants {
-    use super::TEST_WARN_TIMEOUT_S;
     use std::time::Duration;
 
+    use super::TEST_WARN_TIMEOUT_S;
+
     /// Environment variable for overriding default threshold for unit-tests.
     pub const UNIT_ENV_NAME: &str = "RUST_TEST_TIME_UNIT";
 
diff --git a/library/test/src/types.rs b/library/test/src/types.rs
index 6a7035a8e29..c3be3466cb9 100644
--- a/library/test/src/types.rs
+++ b/library/test/src/types.rs
@@ -4,15 +4,14 @@ use std::borrow::Cow;
 use std::fmt;
 use std::sync::mpsc::Sender;
 
-use super::__rust_begin_short_backtrace;
-use super::bench::Bencher;
-use super::event::CompletedTest;
-use super::options;
-
 pub use NamePadding::*;
 pub use TestFn::*;
 pub use TestName::*;
 
+use super::bench::Bencher;
+use super::event::CompletedTest;
+use super::{__rust_begin_short_backtrace, options};
+
 /// Type of the test according to the [Rust book](https://doc.rust-lang.org/cargo/guide/tests.html)
 /// conventions.
 #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
diff --git a/library/unwind/src/unwinding.rs b/library/unwind/src/unwinding.rs
index 083acaeb56a..b3460791ce5 100644
--- a/library/unwind/src/unwinding.rs
+++ b/library/unwind/src/unwinding.rs
@@ -28,9 +28,7 @@ pub enum _Unwind_Reason_Code {
     _URC_FAILURE = 9, // used only by ARM EHABI
 }
 pub use _Unwind_Reason_Code::*;
-
-pub use unwinding::abi::UnwindContext;
-pub use unwinding::abi::UnwindException;
+pub use unwinding::abi::{UnwindContext, UnwindException};
 pub enum _Unwind_Context {}
 
 pub use unwinding::custom_eh_frame_finder::{