Skip to content

Commit 048ba3e

Browse files
committed
Fix doc nits
Many tiny changes to stdlib doc comments to make them consistent (for example "Returns foo", rather than "Return foo", per RFC1574), adding missing periods, paragraph breaks, backticks for monospace style, and other minor nits. https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md#appendix-a-full-conventions-text
1 parent b173176 commit 048ba3e

File tree

6 files changed

+23
-23
lines changed

6 files changed

+23
-23
lines changed

crates/core_simd/src/masks.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ where
137137
T: MaskElement,
138138
LaneCount<N>: SupportedLaneCount,
139139
{
140-
/// Construct a mask by setting all elements to the given value.
140+
/// Constructs a mask by setting all elements to the given value.
141141
#[inline]
142142
pub fn splat(value: bool) -> Self {
143143
Self(mask_impl::Mask::splat(value))
@@ -288,7 +288,7 @@ where
288288
self.0.all()
289289
}
290290

291-
/// Create a bitmask from a mask.
291+
/// Creates a bitmask from a mask.
292292
///
293293
/// Each bit is set if the corresponding element in the mask is `true`.
294294
/// If the mask contains more than 64 elements, the bitmask is truncated to the first 64.
@@ -298,7 +298,7 @@ where
298298
self.0.to_bitmask_integer()
299299
}
300300

301-
/// Create a mask from a bitmask.
301+
/// Creates a mask from a bitmask.
302302
///
303303
/// For each bit, if it is set, the corresponding element in the mask is set to `true`.
304304
/// If the mask contains more than 64 elements, the remainder are set to `false`.
@@ -308,7 +308,7 @@ where
308308
Self(mask_impl::Mask::from_bitmask_integer(bitmask))
309309
}
310310

311-
/// Create a bitmask vector from a mask.
311+
/// Creates a bitmask vector from a mask.
312312
///
313313
/// Each bit is set if the corresponding element in the mask is `true`.
314314
/// The remaining bits are unset.
@@ -328,7 +328,7 @@ where
328328
self.0.to_bitmask_vector()
329329
}
330330

331-
/// Create a mask from a bitmask vector.
331+
/// Creates a mask from a bitmask vector.
332332
///
333333
/// For each bit, if it is set, the corresponding element in the mask is set to `true`.
334334
///
@@ -350,7 +350,7 @@ where
350350
Self(mask_impl::Mask::from_bitmask_vector(bitmask))
351351
}
352352

353-
/// Find the index of the first set element.
353+
/// Finds the index of the first set element.
354354
///
355355
/// ```
356356
/// # #![feature(portable_simd)]

crates/core_simd/src/simd/ptr/const_ptr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pub trait SimdConstPtr: Copy + Sealed {
5454
/// [`Self::with_exposed_provenance`] and returns the "address" portion.
5555
fn expose_provenance(self) -> Self::Usize;
5656

57-
/// Convert an address back to a pointer, picking up a previously "exposed" provenance.
57+
/// Converts an address back to a pointer, picking up a previously "exposed" provenance.
5858
///
5959
/// Equivalent to calling [`core::ptr::with_exposed_provenance`] on each element.
6060
fn with_exposed_provenance(addr: Self::Usize) -> Self;

crates/core_simd/src/simd/ptr/mut_ptr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ pub trait SimdMutPtr: Copy + Sealed {
5151
/// [`Self::with_exposed_provenance`] and returns the "address" portion.
5252
fn expose_provenance(self) -> Self::Usize;
5353

54-
/// Convert an address back to a pointer, picking up a previously "exposed" provenance.
54+
/// Converts an address back to a pointer, picking up a previously "exposed" provenance.
5555
///
5656
/// Equivalent to calling [`core::ptr::with_exposed_provenance_mut`] on each element.
5757
fn with_exposed_provenance(addr: Self::Usize) -> Self;

crates/core_simd/src/swizzle.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@ pub macro simd_swizzle {
6969
}
7070
}
7171

72-
/// Create a vector from the elements of another vector.
72+
/// Creates a vector from the elements of another vector.
7373
pub trait Swizzle<const N: usize> {
7474
/// Map from the elements of the input vector to the output vector.
7575
const INDEX: [usize; N];
7676

77-
/// Create a new vector from the elements of `vector`.
77+
/// Creates a new vector from the elements of `vector`.
7878
///
7979
/// Lane `i` of the output is `vector[Self::INDEX[i]]`.
8080
#[inline]
@@ -109,7 +109,7 @@ pub trait Swizzle<const N: usize> {
109109
}
110110
}
111111

112-
/// Create a new vector from the elements of `first` and `second`.
112+
/// Creates a new vector from the elements of `first` and `second`.
113113
///
114114
/// Lane `i` of the output is `concat[Self::INDEX[i]]`, where `concat` is the concatenation of
115115
/// `first` and `second`.
@@ -145,7 +145,7 @@ pub trait Swizzle<const N: usize> {
145145
}
146146
}
147147

148-
/// Create a new mask from the elements of `mask`.
148+
/// Creates a new mask from the elements of `mask`.
149149
///
150150
/// Element `i` of the output is `concat[Self::INDEX[i]]`, where `concat` is the concatenation of
151151
/// `first` and `second`.
@@ -161,7 +161,7 @@ pub trait Swizzle<const N: usize> {
161161
unsafe { Mask::from_int_unchecked(Self::swizzle(mask.to_int())) }
162162
}
163163

164-
/// Create a new mask from the elements of `first` and `second`.
164+
/// Creates a new mask from the elements of `first` and `second`.
165165
///
166166
/// Element `i` of the output is `concat[Self::INDEX[i]]`, where `concat` is the concatenation of
167167
/// `first` and `second`.

crates/core_simd/src/to_bytes.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ mod sealed {
1010
}
1111
use sealed::Sealed;
1212

13-
/// Convert SIMD vectors to vectors of bytes
13+
/// Converts SIMD vectors to vectors of bytes
1414
pub trait ToBytes: Sealed {
1515
/// This type, reinterpreted as bytes.
1616
type Bytes: Copy
@@ -22,26 +22,26 @@ pub trait ToBytes: Sealed {
2222
+ SimdUint<Scalar = u8>
2323
+ 'static;
2424

25-
/// Return the memory representation of this integer as a byte array in native byte
25+
/// Returns the memory representation of this integer as a byte array in native byte
2626
/// order.
2727
fn to_ne_bytes(self) -> Self::Bytes;
2828

29-
/// Return the memory representation of this integer as a byte array in big-endian
29+
/// Returns the memory representation of this integer as a byte array in big-endian
3030
/// (network) byte order.
3131
fn to_be_bytes(self) -> Self::Bytes;
3232

33-
/// Return the memory representation of this integer as a byte array in little-endian
33+
/// Returns the memory representation of this integer as a byte array in little-endian
3434
/// byte order.
3535
fn to_le_bytes(self) -> Self::Bytes;
3636

37-
/// Create a native endian integer value from its memory representation as a byte array
37+
/// Creates a native endian integer value from its memory representation as a byte array
3838
/// in native endianness.
3939
fn from_ne_bytes(bytes: Self::Bytes) -> Self;
4040

41-
/// Create an integer value from its representation as a byte array in big endian.
41+
/// Creates an integer value from its representation as a byte array in big endian.
4242
fn from_be_bytes(bytes: Self::Bytes) -> Self;
4343

44-
/// Create an integer value from its representation as a byte array in little endian.
44+
/// Creates an integer value from its representation as a byte array in little endian.
4545
fn from_le_bytes(bytes: Self::Bytes) -> Self;
4646
}
4747

crates/core_simd/src/vector.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ where
187187
unsafe { &mut *(self as *mut Self as *mut [T; N]) }
188188
}
189189

190-
/// Load a vector from an array of `T`.
190+
/// Loads a vector from an array of `T`.
191191
///
192192
/// This function is necessary since `repr(simd)` has padding for non-power-of-2 vectors (at the time of writing).
193193
/// With padding, `read_unaligned` will read past the end of an array of N elements.
@@ -567,7 +567,7 @@ where
567567
unsafe { Self::gather_select_ptr(ptrs, enable, or) }
568568
}
569569

570-
/// Read elementwise from pointers into a SIMD vector.
570+
/// Reads elementwise from pointers into a SIMD vector.
571571
///
572572
/// # Safety
573573
///
@@ -808,7 +808,7 @@ where
808808
}
809809
}
810810

811-
/// Write pointers elementwise into a SIMD vector.
811+
/// Writes pointers elementwise into a SIMD vector.
812812
///
813813
/// # Safety
814814
///

0 commit comments

Comments
 (0)