Skip to content

Commit cb6f09f

Browse files
authored
Rollup merge of rust-lang#126717 - nnethercote:rustfmt-use-pre-cleanups, r=jieyouxu
Clean up some comments near `use` declarations rust-lang#125443 will reformat all `use` declarations in the repository. There are a few edge cases involving comments on `use` declarations that require care. This PR cleans up some clumsy comment cases, taking us a step closer to rust-lang#125443 being able to merge. r? ``@lqd``
2 parents 0450dd3 + 6f20172 commit cb6f09f

File tree

25 files changed

+41
-18
lines changed

25 files changed

+41
-18
lines changed

alloc/src/boxed/thin.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
// Based on
2-
// https://github.com/matthieu-m/rfc2580/blob/b58d1d3cba0d4b5e859d3617ea2d0943aaa31329/examples/thin.rs
3-
// by matthieu-m
1+
//! Based on
2+
//! <https://github.com/matthieu-m/rfc2580/blob/b58d1d3cba0d4b5e859d3617ea2d0943aaa31329/examples/thin.rs>
3+
//! by matthieu-m
4+
45
use crate::alloc::{self, Layout, LayoutError};
56
use core::error::Error;
67
use core::fmt::{self, Debug, Display, Formatter};

alloc/src/vec/in_place_collect.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@
154154
//! }
155155
//! vec.truncate(write_idx);
156156
//! ```
157+
157158
use crate::alloc::{handle_alloc_error, Global};
158159
use core::alloc::Allocator;
159160
use core::alloc::Layout;

core/src/str/count.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
//! Note: Because the term "leading byte" can sometimes be ambiguous (for
1818
//! example, it could also refer to the first byte of a slice), we'll often use
1919
//! the term "non-continuation byte" to refer to these bytes in the code.
20+
2021
use core::intrinsics::unlikely;
2122

2223
const USIZE_SIZE: usize = core::mem::size_of::<usize>();

core/tests/iter/adapters/map_windows.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use std::sync::atomic::{AtomicUsize, Ordering::SeqCst};
33
#[cfg(not(panic = "abort"))]
44
mod drop_checks {
55
//! These tests mainly make sure the elements are correctly dropped.
6+
67
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering::SeqCst};
78

89
#[derive(Debug)]

core/tests/net/parser.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// FIXME: These tests are all excellent candidates for AFL fuzz testing
2+
23
use core::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6};
34
use core::str::FromStr;
45

core/tests/num/ieee754.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
//! standard. That is why they accept wildly diverse inputs or may seem to duplicate other tests.
2828
//! Please consider this carefully when adding, removing, or reorganizing these tests. They are
2929
//! here so that it is clear what tests are required by the standard and what can be changed.
30+
3031
use ::core::str::FromStr;
3132

3233
// IEEE 754 for many tests is applied to specific bit patterns.

core/tests/pin_macro.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// edition:2021
2+
23
use core::{
34
marker::PhantomPinned,
45
mem::{drop as stuff, transmute},

panic_unwind/src/miri.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
//! Unwinding panics for Miri.
2+
23
use alloc::boxed::Box;
34
use core::any::Any;
45

portable-simd/crates/core_simd/examples/dot_product.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
// Code taken from the `packed_simd` crate
2-
// Run this code with `cargo test --example dot_product`
3-
//use std::iter::zip;
1+
//! Code taken from the `packed_simd` crate.
2+
//! Run this code with `cargo test --example dot_product`.
43
54
#![feature(array_chunks)]
65
#![feature(slice_as_chunks)]

portable-simd/crates/core_simd/src/ops/assign.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
//! Assignment operators
2+
23
use super::*;
34
use core::ops::{AddAssign, MulAssign}; // commutative binary op-assignment
45
use core::ops::{BitAndAssign, BitOrAssign, BitXorAssign}; // commutative bit binary op-assignment

0 commit comments

Comments
 (0)