Skip to content

Commit 3b63e16

Browse files
committed
Auto merge of rust-lang#80717 - mbartlett21:patch-2, r=dtolnay
Add more code spans to docs in intrinsics.rs I have added some more code spans in core/src/intrinsics.rs, changing some `=` to `==`, etc. I also changed the wording in some sections.
2 parents 68ec332 + 63dd00b commit 3b63e16

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

library/core/src/intrinsics.rs

+12-12
Original file line numberDiff line numberDiff line change
@@ -712,8 +712,8 @@ extern "rust-intrinsic" {
712712
/// [`std::process::abort`](../../std/process/fn.abort.html).
713713
pub fn abort() -> !;
714714

715-
/// Tells LLVM that this point in the code is not reachable, enabling
716-
/// further optimizations.
715+
/// Informs the optimizer that this point in the code is not reachable,
716+
/// enabling further optimizations.
717717
///
718718
/// N.B., this is very different from the `unreachable!()` macro: Unlike the
719719
/// macro, which panics when it is executed, it is *undefined behavior* to
@@ -1133,7 +1133,7 @@ extern "rust-intrinsic" {
11331133
/// This intrinsic does not have a stable counterpart.
11341134
pub fn volatile_copy_nonoverlapping_memory<T>(dst: *mut T, src: *const T, count: usize);
11351135
/// Equivalent to the appropriate `llvm.memmove.p0i8.0i8.*` intrinsic, with
1136-
/// a size of `count` * `size_of::<T>()` and an alignment of
1136+
/// a size of `count * size_of::<T>()` and an alignment of
11371137
/// `min_align_of::<T>()`
11381138
///
11391139
/// The volatile parameter is set to `true`, so it will not be optimized out
@@ -1142,7 +1142,7 @@ extern "rust-intrinsic" {
11421142
/// This intrinsic does not have a stable counterpart.
11431143
pub fn volatile_copy_memory<T>(dst: *mut T, src: *const T, count: usize);
11441144
/// Equivalent to the appropriate `llvm.memset.p0i8.*` intrinsic, with a
1145-
/// size of `count` * `size_of::<T>()` and an alignment of
1145+
/// size of `count * size_of::<T>()` and an alignment of
11461146
/// `min_align_of::<T>()`.
11471147
///
11481148
/// The volatile parameter is set to `true`, so it will not be optimized out
@@ -1588,15 +1588,15 @@ extern "rust-intrinsic" {
15881588
pub fn exact_div<T: Copy>(x: T, y: T) -> T;
15891589

15901590
/// Performs an unchecked division, resulting in undefined behavior
1591-
/// where y = 0 or x = `T::MIN` and y = -1
1591+
/// where `y == 0` or `x == T::MIN && y == -1`
15921592
///
15931593
/// Safe wrappers for this intrinsic are available on the integer
15941594
/// primitives via the `checked_div` method. For example,
15951595
/// [`u32::checked_div`]
15961596
#[rustc_const_unstable(feature = "const_int_unchecked_arith", issue = "none")]
15971597
pub fn unchecked_div<T: Copy>(x: T, y: T) -> T;
15981598
/// Returns the remainder of an unchecked division, resulting in
1599-
/// undefined behavior where y = 0 or x = `T::MIN` and y = -1
1599+
/// undefined behavior when `y == 0` or `x == T::MIN && y == -1`
16001600
///
16011601
/// Safe wrappers for this intrinsic are available on the integer
16021602
/// primitives via the `checked_rem` method. For example,
@@ -1605,15 +1605,15 @@ extern "rust-intrinsic" {
16051605
pub fn unchecked_rem<T: Copy>(x: T, y: T) -> T;
16061606

16071607
/// Performs an unchecked left shift, resulting in undefined behavior when
1608-
/// y < 0 or y >= N, where N is the width of T in bits.
1608+
/// `y < 0` or `y >= N`, where N is the width of T in bits.
16091609
///
16101610
/// Safe wrappers for this intrinsic are available on the integer
16111611
/// primitives via the `checked_shl` method. For example,
16121612
/// [`u32::checked_shl`]
16131613
#[rustc_const_stable(feature = "const_int_unchecked", since = "1.40.0")]
16141614
pub fn unchecked_shl<T: Copy>(x: T, y: T) -> T;
16151615
/// Performs an unchecked right shift, resulting in undefined behavior when
1616-
/// y < 0 or y >= N, where N is the width of T in bits.
1616+
/// `y < 0` or `y >= N`, where N is the width of T in bits.
16171617
///
16181618
/// Safe wrappers for this intrinsic are available on the integer
16191619
/// primitives via the `checked_shr` method. For example,
@@ -1680,14 +1680,14 @@ extern "rust-intrinsic" {
16801680
#[rustc_const_stable(feature = "const_int_wrapping", since = "1.40.0")]
16811681
pub fn wrapping_mul<T: Copy>(a: T, b: T) -> T;
16821682

1683-
/// Computes `a + b`, while saturating at numeric bounds.
1683+
/// Computes `a + b`, saturating at numeric bounds.
16841684
///
16851685
/// The stabilized versions of this intrinsic are available on the integer
16861686
/// primitives via the `saturating_add` method. For example,
16871687
/// [`u32::saturating_add`]
16881688
#[rustc_const_stable(feature = "const_int_saturating", since = "1.40.0")]
16891689
pub fn saturating_add<T: Copy>(a: T, b: T) -> T;
1690-
/// Computes `a - b`, while saturating at numeric bounds.
1690+
/// Computes `a - b`, saturating at numeric bounds.
16911691
///
16921692
/// The stabilized versions of this intrinsic are available on the integer
16931693
/// primitives via the `saturating_sub` method. For example,
@@ -1696,14 +1696,14 @@ extern "rust-intrinsic" {
16961696
pub fn saturating_sub<T: Copy>(a: T, b: T) -> T;
16971697

16981698
/// Returns the value of the discriminant for the variant in 'v',
1699-
/// cast to a `u64`; if `T` has no discriminant, returns 0.
1699+
/// cast to a `u64`; if `T` has no discriminant, returns `0`.
17001700
///
17011701
/// The stabilized version of this intrinsic is [`core::mem::discriminant`](crate::mem::discriminant).
17021702
#[rustc_const_unstable(feature = "const_discriminant", issue = "69821")]
17031703
pub fn discriminant_value<T>(v: &T) -> <T as DiscriminantKind>::Discriminant;
17041704

17051705
/// Returns the number of variants of the type `T` cast to a `usize`;
1706-
/// if `T` has no variants, returns 0. Uninhabited variants will be counted.
1706+
/// if `T` has no variants, returns `0`. Uninhabited variants will be counted.
17071707
///
17081708
/// The to-be-stabilized version of this intrinsic is [`mem::variant_count`].
17091709
#[rustc_const_unstable(feature = "variant_count", issue = "73662")]

0 commit comments

Comments
 (0)