Skip to content

Commit

Permalink
Add blank lines after module-level //! comments.
Browse files Browse the repository at this point in the history
Most modules have such a blank line, but some don't. Inserting the blank
line makes it clearer that the `//!` comments are describing the entire
module, rather than the `use` declaration(s) that immediately follows.
  • Loading branch information
nnethercote committed Jun 19, 2024
1 parent 4e67110 commit 36ad0db
Show file tree
Hide file tree
Showing 19 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions alloc/src/vec/in_place_collect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@
//! }
//! vec.truncate(write_idx);
//! ```

use crate::alloc::{handle_alloc_error, Global};
use core::alloc::Allocator;
use core::alloc::Layout;
Expand Down
1 change: 1 addition & 0 deletions core/src/str/count.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
//! Note: Because the term "leading byte" can sometimes be ambiguous (for
//! example, it could also refer to the first byte of a slice), we'll often use
//! the term "non-continuation byte" to refer to these bytes in the code.

use core::intrinsics::unlikely;

const USIZE_SIZE: usize = core::mem::size_of::<usize>();
Expand Down
1 change: 1 addition & 0 deletions core/tests/iter/adapters/map_windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use std::sync::atomic::{AtomicUsize, 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};

#[derive(Debug)]
Expand Down
1 change: 1 addition & 0 deletions core/tests/num/ieee754.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
//! standard. That is why they accept wildly diverse inputs or may seem to duplicate other tests.
//! Please consider this carefully when adding, removing, or reorganizing these tests. They are
//! here so that it is clear what tests are required by the standard and what can be changed.

use ::core::str::FromStr;

// IEEE 754 for many tests is applied to specific bit patterns.
Expand Down
1 change: 1 addition & 0 deletions panic_unwind/src/miri.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//! Unwinding panics for Miri.

use alloc::boxed::Box;
use core::any::Any;

Expand Down
1 change: 1 addition & 0 deletions portable-simd/crates/core_simd/src/ops/assign.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//! Assignment operators

use super::*;
use core::ops::{AddAssign, MulAssign}; // commutative binary op-assignment
use core::ops::{BitAndAssign, BitOrAssign, BitXorAssign}; // commutative bit binary op-assignment
Expand Down
1 change: 1 addition & 0 deletions portable-simd/crates/core_simd/src/ops/deref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
//! Ideally, Rust would take care of this itself,
//! and method calls usually handle the LHS implicitly.
//! But this is not the case with arithmetic ops.

use super::*;

macro_rules! deref_lhs {
Expand Down
1 change: 1 addition & 0 deletions std/src/hash/random.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//! outside this crate.
//!
//! [`collections`]: crate::collections

#[allow(deprecated)]
use super::{BuildHasher, Hasher, SipHasher13};
use crate::cell::Cell;
Expand Down
1 change: 1 addition & 0 deletions std/src/sys/pal/itron/thread.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//! Thread implementation backed by μITRON tasks. Assumes `acre_tsk` and
//! `exd_tsk` are available.

use super::{
abi,
error::{expect_success, expect_success_aborting, ItronError},
Expand Down
1 change: 1 addition & 0 deletions std/src/sys/pal/solid/abi/fs.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//! `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,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! Emulated wait status for non-Unix #[cfg(unix) platforms
//!
//! Separate module to facilitate testing against a real Unix implementation.

use crate::ffi::c_int;
use crate::fmt;
use crate::num::NonZero;
Expand Down
1 change: 1 addition & 0 deletions std/src/sys/pal/unix/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,7 @@ mod cgroups {
//! * cgroup v2 in non-standard mountpoints
//! * paths containing control characters or spaces, since those would be escaped in procfs
//! output and we don't unescape

use crate::borrow::Cow;
use crate::ffi::OsString;
use crate::fs::{try_exists, File};
Expand Down
1 change: 1 addition & 0 deletions std/src/sys/sync/condvar/itron.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//! 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,
};
Expand Down
1 change: 1 addition & 0 deletions std/src/sys/sync/mutex/itron.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//! Mutex implementation backed by μITRON mutexes. Assumes `acre_mtx` and
//! `TA_INHERIT` are available.

use crate::sys::pal::itron::{
abi,
error::{expect_success, expect_success_aborting, fail, ItronError},
Expand Down
1 change: 1 addition & 0 deletions std/src/sys/sync/rwlock/solid.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//! A readers-writer lock implementation backed by the SOLID kernel extension.

use crate::sys::pal::{
abi,
itron::{
Expand Down
1 change: 1 addition & 0 deletions std/tests/create_dir_all_bare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

//! 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};
Expand Down
1 change: 1 addition & 0 deletions test/src/bench.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//! Benchmarking module.

use super::{
event::CompletedTest,
options::BenchMode,
Expand Down
1 change: 1 addition & 0 deletions test/src/helpers/concurrency.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//! Helper module which helps to determine amount of threads to be used
//! during tests execution.

use std::{env, num::NonZero, thread};

pub fn get_concurrency() -> usize {
Expand Down
1 change: 1 addition & 0 deletions test/src/helpers/metrics.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//! Benchmark metrics.

use std::collections::BTreeMap;

#[derive(Clone, PartialEq, Debug, Copy)]
Expand Down

0 comments on commit 36ad0db

Please sign in to comment.