Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a274405

Browse files
Unrolled build for #146136
Rollup merge of #146136 - AudaciousAxiom:docs/missing-closing-code-block-fences, r=tgross35 docs(std): add missing closing code block fences in doc comments This PR adds a few closing code block fences which I believe are missing in some doc comments. It seems that rustdoc just autocloses code blocks at the end of doc comments and thus these were easily overlooked: I do not think these code blocks are special in any way. I found these when working on a Clippy lint that checks the last sentence of doc comments for terminal punctuation, and these were failing cases when testing against the std. Therefore I am not entirely sure these are all such cases, but still have high hopes that they are (or at least a well-defined subset of them).
2 parents 9385c64 + 5a9e2e4 commit a274405

File tree

7 files changed

+7
-2
lines changed

7 files changed

+7
-2
lines changed

‎library/core/src/iter/adapters/chain.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ impl<A: Default, B: Default> Default for Chain<A, B> {
321321
///
322322
/// // take requires `Default`
323323
/// let _: Chain<_, _> = mem::take(&mut foo.0);
324+
/// ```
324325
fn default() -> Self {
325326
Chain::new(Default::default(), Default::default())
326327
}

‎library/core/src/num/int_macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1285,7 +1285,7 @@ macro_rules! int_impl {
12851285
///
12861286
/// ```should_panic
12871287
#[doc = concat!("let _ = ", stringify!($SelfT), "::MIN.strict_neg();")]
1288-
///
1288+
/// ```
12891289
#[stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
12901290
#[rustc_const_stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
12911291
#[must_use = "this returns the result of the operation, \

‎library/core/src/num/uint_macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1620,7 +1620,7 @@ macro_rules! uint_impl {
16201620
///
16211621
/// ```should_panic
16221622
#[doc = concat!("let _ = 1", stringify!($SelfT), ".strict_neg();")]
1623-
///
1623+
/// ```
16241624
#[stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
16251625
#[rustc_const_stable(feature = "strict_overflow_ops", since = "CURRENT_RUSTC_VERSION")]
16261626
#[must_use = "this returns the result of the operation, \

‎library/core/src/ops/range.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,7 @@ pub trait RangeBounds<T: ?Sized> {
836836
/// assert!(!(0.0..1.0).contains(&f32::NAN));
837837
/// assert!(!(0.0..f32::NAN).contains(&0.5));
838838
/// assert!(!(f32::NAN..1.0).contains(&0.5));
839+
/// ```
839840
#[inline]
840841
#[stable(feature = "range_contains", since = "1.35.0")]
841842
fn contains<U>(&self, item: &U) -> bool

‎library/core/src/ptr/mut_ptr.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ impl<T: PointeeSized> *mut T {
106106
///
107107
/// // This dereference is UB. The pointer only has provenance for `x` but points to `y`.
108108
/// println!("{:?}", unsafe { &*bad });
109+
/// ```
109110
#[unstable(feature = "set_ptr_value", issue = "75091")]
110111
#[must_use = "returns a new pointer rather than modifying its argument"]
111112
#[inline]

‎library/portable-simd/crates/core_simd/src/simd/num/int.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ pub trait SimdInt: Copy + Sealed {
5858
/// let sat = x.saturating_sub(max);
5959
/// assert_eq!(unsat, Simd::from_array([1, MAX, MIN, 0]));
6060
/// assert_eq!(sat, Simd::from_array([MIN, MIN, MIN, 0]));
61+
/// ```
6162
fn saturating_sub(self, second: Self) -> Self;
6263

6364
/// Lanewise absolute value, implemented in Rust.

‎library/portable-simd/crates/core_simd/src/simd/num/uint.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ pub trait SimdUint: Copy + Sealed {
5555
/// let sat = x.saturating_sub(max);
5656
/// assert_eq!(unsat, Simd::from_array([3, 2, 1, 0]));
5757
/// assert_eq!(sat, Simd::splat(0));
58+
/// ```
5859
fn saturating_sub(self, second: Self) -> Self;
5960

6061
/// Lanewise absolute difference.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /