Skip to content

Commit 6d9f589

Browse files
authored
Rollup merge of rust-lang#143426 - hkBst:clippy-fix-indent-1, r=jhpratt
clippy fix: indentation Fixes indentation of markdown comments.
2 parents f205b45 + 1a1b52a commit 6d9f589

File tree

8 files changed

+47
-46
lines changed

8 files changed

+47
-46
lines changed

library/core/src/alloc/layout.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ impl Layout {
6161
/// * `align` must be a power of two,
6262
///
6363
/// * `size`, when rounded up to the nearest multiple of `align`,
64-
/// must not overflow `isize` (i.e., the rounded value must be
65-
/// less than or equal to `isize::MAX`).
64+
/// must not overflow `isize` (i.e., the rounded value must be
65+
/// less than or equal to `isize::MAX`).
6666
#[stable(feature = "alloc_layout", since = "1.28.0")]
6767
#[rustc_const_stable(feature = "const_alloc_layout_size_align", since = "1.50.0")]
6868
#[inline]

library/core/src/cell.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1940,32 +1940,32 @@ impl<T: ?Sized + fmt::Display> fmt::Display for RefMut<'_, T> {
19401940
/// The precise Rust aliasing rules are somewhat in flux, but the main points are not contentious:
19411941
///
19421942
/// - If you create a safe reference with lifetime `'a` (either a `&T` or `&mut T` reference), then
1943-
/// you must not access the data in any way that contradicts that reference for the remainder of
1944-
/// `'a`. For example, this means that if you take the `*mut T` from an `UnsafeCell<T>` and cast it
1945-
/// to an `&T`, then the data in `T` must remain immutable (modulo any `UnsafeCell` data found
1946-
/// within `T`, of course) until that reference's lifetime expires. Similarly, if you create a `&mut
1947-
/// T` reference that is released to safe code, then you must not access the data within the
1948-
/// `UnsafeCell` until that reference expires.
1943+
/// you must not access the data in any way that contradicts that reference for the remainder of
1944+
/// `'a`. For example, this means that if you take the `*mut T` from an `UnsafeCell<T>` and cast it
1945+
/// to an `&T`, then the data in `T` must remain immutable (modulo any `UnsafeCell` data found
1946+
/// within `T`, of course) until that reference's lifetime expires. Similarly, if you create a
1947+
/// `&mut T` reference that is released to safe code, then you must not access the data within the
1948+
/// `UnsafeCell` until that reference expires.
19491949
///
19501950
/// - For both `&T` without `UnsafeCell<_>` and `&mut T`, you must also not deallocate the data
1951-
/// until the reference expires. As a special exception, given an `&T`, any part of it that is
1952-
/// inside an `UnsafeCell<_>` may be deallocated during the lifetime of the reference, after the
1953-
/// last time the reference is used (dereferenced or reborrowed). Since you cannot deallocate a part
1954-
/// of what a reference points to, this means the memory an `&T` points to can be deallocated only if
1955-
/// *every part of it* (including padding) is inside an `UnsafeCell`.
1951+
/// until the reference expires. As a special exception, given an `&T`, any part of it that is
1952+
/// inside an `UnsafeCell<_>` may be deallocated during the lifetime of the reference, after the
1953+
/// last time the reference is used (dereferenced or reborrowed). Since you cannot deallocate a part
1954+
/// of what a reference points to, this means the memory an `&T` points to can be deallocated only if
1955+
/// *every part of it* (including padding) is inside an `UnsafeCell`.
19561956
///
1957-
/// However, whenever a `&UnsafeCell<T>` is constructed or dereferenced, it must still point to
1957+
/// However, whenever a `&UnsafeCell<T>` is constructed or dereferenced, it must still point to
19581958
/// live memory and the compiler is allowed to insert spurious reads if it can prove that this
19591959
/// memory has not yet been deallocated.
19601960
///
19611961
/// To assist with proper design, the following scenarios are explicitly declared legal
19621962
/// for single-threaded code:
19631963
///
19641964
/// 1. A `&T` reference can be released to safe code and there it can co-exist with other `&T`
1965-
/// references, but not with a `&mut T`
1965+
/// references, but not with a `&mut T`
19661966
///
19671967
/// 2. A `&mut T` reference may be released to safe code provided neither other `&mut T` nor `&T`
1968-
/// co-exist with it. A `&mut T` must always be unique.
1968+
/// co-exist with it. A `&mut T` must always be unique.
19691969
///
19701970
/// Note that whilst mutating the contents of an `&UnsafeCell<T>` (even while other
19711971
/// `&UnsafeCell<T>` references alias the cell) is

library/core/src/error.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -447,28 +447,28 @@ where
447447
/// separated by API boundaries:
448448
///
449449
/// * Consumer - the consumer requests objects using a Request instance; eg a crate that offers
450-
/// fancy `Error`/`Result` reporting to users wants to request a Backtrace from a given `dyn Error`.
450+
/// fancy `Error`/`Result` reporting to users wants to request a Backtrace from a given `dyn Error`.
451451
///
452452
/// * Producer - the producer provides objects when requested via Request; eg. a library with an
453-
/// an `Error` implementation that automatically captures backtraces at the time instances are
454-
/// created.
453+
/// an `Error` implementation that automatically captures backtraces at the time instances are
454+
/// created.
455455
///
456456
/// The consumer only needs to know where to submit their request and are expected to handle the
457457
/// request not being fulfilled by the use of `Option<T>` in the responses offered by the producer.
458458
///
459459
/// * A Producer initializes the value of one of its fields of a specific type. (or is otherwise
460-
/// prepared to generate a value requested). eg, `backtrace::Backtrace` or
461-
/// `std::backtrace::Backtrace`
460+
/// prepared to generate a value requested). eg, `backtrace::Backtrace` or
461+
/// `std::backtrace::Backtrace`
462462
/// * A Consumer requests an object of a specific type (say `std::backtrace::Backtrace`). In the
463-
/// case of a `dyn Error` trait object (the Producer), there are functions called `request_ref` and
464-
/// `request_value` to simplify obtaining an `Option<T>` for a given type.
463+
/// case of a `dyn Error` trait object (the Producer), there are functions called `request_ref` and
464+
/// `request_value` to simplify obtaining an `Option<T>` for a given type.
465465
/// * The Producer, when requested, populates the given Request object which is given as a mutable
466-
/// reference.
466+
/// reference.
467467
/// * The Consumer extracts a value or reference to the requested type from the `Request` object
468-
/// wrapped in an `Option<T>`; in the case of `dyn Error` the aforementioned `request_ref` and `
469-
/// request_value` methods mean that `dyn Error` users don't have to deal with the `Request` type at
470-
/// all (but `Error` implementors do). The `None` case of the `Option` suggests only that the
471-
/// Producer cannot currently offer an instance of the requested type, not it can't or never will.
468+
/// wrapped in an `Option<T>`; in the case of `dyn Error` the aforementioned `request_ref` and `
469+
/// request_value` methods mean that `dyn Error` users don't have to deal with the `Request` type at
470+
/// all (but `Error` implementors do). The `None` case of the `Option` suggests only that the
471+
/// Producer cannot currently offer an instance of the requested type, not it can't or never will.
472472
///
473473
/// # Examples
474474
///

library/core/src/fmt/mod.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -353,10 +353,10 @@ impl FormattingOptions {
353353
/// Sets or removes the sign (the `+` or the `-` flag).
354354
///
355355
/// - `+`: This is intended for numeric types and indicates that the sign
356-
/// should always be printed. By default only the negative sign of signed
357-
/// values is printed, and the sign of positive or unsigned values is
358-
/// omitted. This flag indicates that the correct sign (+ or -) should
359-
/// always be printed.
356+
/// should always be printed. By default only the negative sign of signed
357+
/// values is printed, and the sign of positive or unsigned values is
358+
/// omitted. This flag indicates that the correct sign (+ or -) should
359+
/// always be printed.
360360
/// - `-`: Currently not used
361361
#[unstable(feature = "formatting_options", issue = "118117")]
362362
pub fn sign(&mut self, sign: Option<Sign>) -> &mut Self {
@@ -443,9 +443,9 @@ impl FormattingOptions {
443443
/// Sets or removes the precision.
444444
///
445445
/// - For non-numeric types, this can be considered a “maximum width”. If
446-
/// the resulting string is longer than this width, then it is truncated
447-
/// down to this many characters and that truncated value is emitted with
448-
/// proper fill, alignment and width if those parameters are set.
446+
/// the resulting string is longer than this width, then it is truncated
447+
/// down to this many characters and that truncated value is emitted with
448+
/// proper fill, alignment and width if those parameters are set.
449449
/// - For integral types, this is ignored.
450450
/// - For floating-point types, this indicates how many digits after the
451451
/// decimal point should be printed.

library/core/src/marker.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ pub trait PointeeSized {
211211
/// - The type is sized.
212212
/// - The type outlives `'a`.
213213
/// - Structs `Foo<..., T1, ..., Tn, ...>` implement `Unsize<Foo<..., U1, ..., Un, ...>>`
214-
/// where any number of (type and const) parameters may be changed if all of these conditions
215-
/// are met:
214+
/// where any number of (type and const) parameters may be changed if all of these conditions
215+
/// are met:
216216
/// - Only the last field of `Foo` has a type involving the parameters `T1`, ..., `Tn`.
217217
/// - All other parameters of the struct are equal.
218218
/// - `Field<T1, ..., Tn>: Unsize<Field<U1, ..., Un>>`, where `Field<...>` stands for the actual

library/core/src/ops/drop.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/// This destructor consists of two components:
1212
/// - A call to `Drop::drop` for that value, if this special `Drop` trait is implemented for its type.
1313
/// - The automatically generated "drop glue" which recursively calls the destructors
14-
/// of all the fields of this value.
14+
/// of all the fields of this value.
1515
///
1616
/// As Rust automatically calls the destructors of all contained fields,
1717
/// you don't have to implement `Drop` in most cases. But there are some cases where

library/core/src/option.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@
125125
//! `Option::<T>::None`
126126
//! - `transmute::<_, [u8; size_of::<T>()]>(Option::<T>::None)` is sound and produces
127127
//! `[0u8; size_of::<T>()]`
128+
//!
128129
//! These cases are identified by the second column:
129130
//!
130131
//! | `T` | Transmuting between `[0u8; size_of::<T>()]` and `Option::<T>::None` sound? |

library/core/src/pin.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,19 +137,19 @@
137137
//! 2. An operation causes the value to depend on its own address not changing
138138
//! * e.g. calling [`poll`] for the first time on the produced [`Future`]
139139
//! 3. Further pieces of the safe interface of the type use internal [`unsafe`] operations which
140-
//! assume that the address of the value is stable
140+
//! assume that the address of the value is stable
141141
//! * e.g. subsequent calls to [`poll`]
142142
//! 4. Before the value is invalidated (e.g. deallocated), it is *dropped*, giving it a chance to
143-
//! notify anything with pointers to itself that those pointers will be invalidated
143+
//! notify anything with pointers to itself that those pointers will be invalidated
144144
//! * e.g. [`drop`]ping the [`Future`] [^pin-drop-future]
145145
//!
146146
//! There are two possible ways to ensure the invariants required for 2. and 3. above (which
147147
//! apply to any address-sensitive type, not just self-referential types) do not get broken.
148148
//!
149149
//! 1. Have the value detect when it is moved and update all the pointers that point to itself.
150150
//! 2. Guarantee that the address of the value does not change (and that memory is not re-used
151-
//! for anything else) during the time that the pointers to it are expected to be valid to
152-
//! dereference.
151+
//! for anything else) during the time that the pointers to it are expected to be valid to
152+
//! dereference.
153153
//!
154154
//! Since, as we discussed, Rust can move values without notifying them that they have moved, the
155155
//! first option is ruled out.
@@ -160,11 +160,11 @@
160160
//! be able to enforce this invariant in Rust:
161161
//!
162162
//! 1. Offer a wholly `unsafe` API to interact with the object, thus requiring every caller to
163-
//! uphold the invariant themselves
163+
//! uphold the invariant themselves
164164
//! 2. Store the value that must not be moved behind a carefully managed pointer internal to
165-
//! the object
165+
//! the object
166166
//! 3. Leverage the type system to encode and enforce this invariant by presenting a restricted
167-
//! API surface to interact with *any* object that requires these invariants
167+
//! API surface to interact with *any* object that requires these invariants
168168
//!
169169
//! The first option is quite obviously undesirable, as the [`unsafe`]ty of the interface will
170170
//! become viral throughout all code that interacts with the object.
@@ -530,7 +530,7 @@
530530
//! but it also implies that,
531531
//!
532532
//! 2. The memory location that stores the value must not get invalidated or otherwise repurposed
533-
//! during the lifespan of the pinned value until its [`drop`] returns or panics
533+
//! during the lifespan of the pinned value until its [`drop`] returns or panics
534534
//!
535535
//! This point is subtle but required for intrusive data structures to be implemented soundly.
536536
//!

0 commit comments

Comments
 (0)