about summary refs log tree commit diff
path: root/compiler/rustc_thread_pool
diff options
context:
space:
mode:
authorJosh Triplett <josh@joshtriplett.org>2025-07-25 17:35:47 -0700
committerJosh Triplett <josh@joshtriplett.org>2025-07-25 22:02:09 -0700
commit715088094c2e2ef31158b4767ceacfba62c8e6ef (patch)
treec77dafc3f33ea355553e412bc2c2a0bebac1156c /compiler/rustc_thread_pool
parent3352dfc4a232fa6f38db3ea3ed465f56e6c8f85b (diff)
downloadrust-715088094c2e2ef31158b4767ceacfba62c8e6ef.tar.gz
rust-715088094c2e2ef31158b4767ceacfba62c8e6ef.zip
Improve and regularize comment placement in doc code
Because doc code does not get automatically formatted, some doc code has
creative placements of comments that automatic formatting can't handle.
Reformat those comments to make the resulting code support standard Rust
formatting without breaking; this is generally an improvement to
readability as well.

Some comments are not indented to the prevailing indent, and are instead
aligned under some bit of code. Indent them to the prevailing indent,
and put spaces *inside* the comments to align them with code.

Some comments span several lines of code (which aren't the line the
comment is about) and expect alignment. Reformat them into one comment
not broken up by unrelated intervening code.

Some comments are placed on the same line as an opening brace, placing
them effectively inside the subsequent block, such that formatting would
typically format them like a line of that block. Move those comments to
attach them to what they apply to.

Some comments are placed on the same line as a one-line braced block,
effectively attaching them to the closing brace, even though they're
about the code inside the block. Reformat to make sure the comment will
stay on the same line as the code it's commenting.
Diffstat (limited to 'compiler/rustc_thread_pool')
-rw-r--r--compiler/rustc_thread_pool/src/scope/mod.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_thread_pool/src/scope/mod.rs b/compiler/rustc_thread_pool/src/scope/mod.rs
index 38230383965..677009a9bc3 100644
--- a/compiler/rustc_thread_pool/src/scope/mod.rs
+++ b/compiler/rustc_thread_pool/src/scope/mod.rs
@@ -501,9 +501,9 @@ impl<'scope> Scope<'scope> {
     /// let mut value_c = None;
     /// rayon::scope(|s| {
     ///     s.spawn(|s1| {
-    ///           // ^ this is the same scope as `s`; this handle `s1`
-    ///           //   is intended for use by the spawned task,
-    ///           //   since scope handles cannot cross thread boundaries.
+    ///         //   ^ this is the same scope as `s`; this handle `s1`
+    ///         //     is intended for use by the spawned task,
+    ///         //     since scope handles cannot cross thread boundaries.
     ///
     ///         value_a = Some(22);
     ///