Skip to content

Commit e8b70b8

Browse files
authored
Replace module MIN/MAX and min/max_value() with assoc consts (#843)
1 parent d13edca commit e8b70b8

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

crates/core_arch/src/wasm32/memory.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ pub fn memory_size(mem: u32) -> usize {
4141
/// by the specified `delta` of pages. The current WebAssembly page size is
4242
/// 65536 bytes (64 KB). If memory is successfully grown then the previous size
4343
/// of memory, in pages, is returned. If memory cannot be grown then
44-
/// `usize::max_value()` is returned.
44+
/// `usize::MAX` is returned.
4545
///
4646
/// The argument `mem` is the numerical index of which memory to return the
4747
/// size of. Note that currently the WebAssembly specification only supports one

crates/core_arch/src/wasm32/simd128.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -1059,15 +1059,15 @@ pub fn i8x16_add(a: v128, b: v128) -> v128 {
10591059
}
10601060

10611061
/// Adds two 128-bit vectors as if they were two packed sixteen 8-bit signed
1062-
/// integers, saturating on overflow to `i8::max_value()`.
1062+
/// integers, saturating on overflow to `i8::MAX`.
10631063
#[inline]
10641064
#[cfg_attr(test, assert_instr(i8x16.add_saturate_s))]
10651065
pub fn i8x16_add_saturate_s(a: v128, b: v128) -> v128 {
10661066
unsafe { transmute(llvm_i8x16_add_saturate_s(a.as_i8x16(), b.as_i8x16())) }
10671067
}
10681068

10691069
/// Adds two 128-bit vectors as if they were two packed sixteen 8-bit unsigned
1070-
/// integers, saturating on overflow to `u8::max_value()`.
1070+
/// integers, saturating on overflow to `u8::MAX`.
10711071
#[inline]
10721072
#[cfg_attr(test, assert_instr(i8x16.add_saturate_u))]
10731073
pub fn i8x16_add_saturate_u(a: v128, b: v128) -> v128 {
@@ -1082,7 +1082,7 @@ pub fn i8x16_sub(a: v128, b: v128) -> v128 {
10821082
}
10831083

10841084
/// Subtracts two 128-bit vectors as if they were two packed sixteen 8-bit
1085-
/// signed integers, saturating on overflow to `i8::min_value()`.
1085+
/// signed integers, saturating on overflow to `i8::MIN`.
10861086
#[inline]
10871087
#[cfg_attr(test, assert_instr(i8x16.sub_saturate_s))]
10881088
pub fn i8x16_sub_saturate_s(a: v128, b: v128) -> v128 {
@@ -1169,15 +1169,15 @@ pub fn i16x8_add(a: v128, b: v128) -> v128 {
11691169
}
11701170

11711171
/// Adds two 128-bit vectors as if they were two packed eight 16-bit signed
1172-
/// integers, saturating on overflow to `i16::max_value()`.
1172+
/// integers, saturating on overflow to `i16::MAX`.
11731173
#[inline]
11741174
#[cfg_attr(test, assert_instr(i16x8.add_saturate_s))]
11751175
pub fn i16x8_add_saturate_s(a: v128, b: v128) -> v128 {
11761176
unsafe { transmute(llvm_i16x8_add_saturate_s(a.as_i16x8(), b.as_i16x8())) }
11771177
}
11781178

11791179
/// Adds two 128-bit vectors as if they were two packed eight 16-bit unsigned
1180-
/// integers, saturating on overflow to `u16::max_value()`.
1180+
/// integers, saturating on overflow to `u16::MAX`.
11811181
#[inline]
11821182
#[cfg_attr(test, assert_instr(i16x8.add_saturate_u))]
11831183
pub fn i16x8_add_saturate_u(a: v128, b: v128) -> v128 {
@@ -1192,7 +1192,7 @@ pub fn i16x8_sub(a: v128, b: v128) -> v128 {
11921192
}
11931193

11941194
/// Subtracts two 128-bit vectors as if they were two packed eight 16-bit
1195-
/// signed integers, saturating on overflow to `i16::min_value()`.
1195+
/// signed integers, saturating on overflow to `i16::MIN`.
11961196
#[inline]
11971197
#[cfg_attr(test, assert_instr(i16x8.sub_saturate_s))]
11981198
pub fn i16x8_sub_saturate_s(a: v128, b: v128) -> v128 {

crates/core_arch/src/x86/sse.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ pub unsafe fn _mm_ucomineq_ss(a: __m128, b: __m128) -> i32 {
790790
///
791791
/// The result is rounded according to the current rounding mode. If the result
792792
/// cannot be represented as a 32 bit integer the result will be `0x8000_0000`
793-
/// (`std::i32::MIN`) or an invalid operation floating point exception if
793+
/// (`i32::MIN`) or an invalid operation floating point exception if
794794
/// unmasked (see [`_mm_setcsr`](fn._mm_setcsr.html)).
795795
///
796796
/// This corresponds to the `CVTSS2SI` instruction (with 32 bit output).
@@ -821,7 +821,7 @@ pub unsafe fn _mm_cvt_ss2si(a: __m128) -> i32 {
821821
///
822822
/// The result is rounded always using truncation (round towards zero). If the
823823
/// result cannot be represented as a 32 bit integer the result will be
824-
/// `0x8000_0000` (`std::i32::MIN`) or an invalid operation floating point
824+
/// `0x8000_0000` (`i32::MIN`) or an invalid operation floating point
825825
/// exception if unmasked (see [`_mm_setcsr`](fn._mm_setcsr.html)).
826826
///
827827
/// This corresponds to the `CVTTSS2SI` instruction (with 32 bit output).

crates/core_arch/src/x86_64/sse.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ extern "C" {
1919
///
2020
/// The result is rounded according to the current rounding mode. If the result
2121
/// cannot be represented as a 64 bit integer the result will be
22-
/// `0x8000_0000_0000_0000` (`std::i64::MIN`) or trigger an invalid operation
22+
/// `0x8000_0000_0000_0000` (`i64::MIN`) or trigger an invalid operation
2323
/// floating point exception if unmasked (see
2424
/// [`_mm_setcsr`](fn._mm_setcsr.html)).
2525
///
@@ -39,7 +39,7 @@ pub unsafe fn _mm_cvtss_si64(a: __m128) -> i64 {
3939
///
4040
/// The result is rounded always using truncation (round towards zero). If the
4141
/// result cannot be represented as a 64 bit integer the result will be
42-
/// `0x8000_0000_0000_0000` (`std::i64::MIN`) or an invalid operation floating
42+
/// `0x8000_0000_0000_0000` (`i64::MIN`) or an invalid operation floating
4343
/// point exception if unmasked (see [`_mm_setcsr`](fn._mm_setcsr.html)).
4444
///
4545
/// This corresponds to the `CVTTSS2SI` instruction (with 64 bit output).

crates/std_detect/src/detect/cache.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ impl Initializer {
8080
// Note: on x64, we only use the first slot
8181
static CACHE: [Cache; 2] = [Cache::uninitialized(), Cache::uninitialized()];
8282

83-
/// Feature cache with capacity for `usize::max_value() - 1` features.
83+
/// Feature cache with capacity for `usize::MAX - 1` features.
8484
///
8585
/// Note: the last feature bit is used to represent an
8686
/// uninitialized cache.

0 commit comments

Comments
 (0)