From a21f686393965685296e0f41bc0f106135afb09c Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Thu, 20 Jun 2024 20:10:25 +1000 Subject: [PATCH] Adjust some comments on individual `use` declarations. When we do the big `use` reformatting there are a tiny number of cases where rustfmt moves a comment from one `use` item to another in an undesirable way. This commit pre-emptively rearranges things to prevent this from happening. --- compiler/rustc_data_structures/src/sip128.rs | 7 ++++--- library/alloc/src/testing/crash_test.rs | 3 +-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/compiler/rustc_data_structures/src/sip128.rs b/compiler/rustc_data_structures/src/sip128.rs index 4c9acfe0f7155..e5d4799facf1b 100644 --- a/compiler/rustc_data_structures/src/sip128.rs +++ b/compiler/rustc_data_structures/src/sip128.rs @@ -1,12 +1,13 @@ //! This is a copy of `core::hash::sip` adapted to providing 128 bit hashes. -// This code is very hot and uses lots of arithmetic, avoid overflow checks for performance. -// See https://github.com/rust-lang/rust/pull/119440#issuecomment-1874255727 -use rustc_serialize::int_overflow::{DebugStrictAdd, DebugStrictSub}; use std::hash::Hasher; use std::mem::{self, MaybeUninit}; use std::ptr; +// This code is very hot and uses lots of arithmetic, avoid overflow checks for performance. +// See https://github.com/rust-lang/rust/pull/119440#issuecomment-1874255727 +use rustc_serialize::int_overflow::{DebugStrictAdd, DebugStrictSub}; + #[cfg(test)] mod tests; diff --git a/library/alloc/src/testing/crash_test.rs b/library/alloc/src/testing/crash_test.rs index bcf5f5f72510e..ff72f99b2cbed 100644 --- a/library/alloc/src/testing/crash_test.rs +++ b/library/alloc/src/testing/crash_test.rs @@ -1,5 +1,4 @@ -// We avoid relying on anything else in the crate, apart from the `Debug` trait. -use crate::fmt::Debug; +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};