Rollup merge of #64941 - lzutao:inline-max_min_value, r=nnethercote
Inline `{min,max}_value` even in debug builds
I think it is worth to inline `{min,max}_value` even in debug builds.
See this godbolt link: https://godbolt.org/z/-COkVS
This commit is contained in:
@@ -252,7 +252,7 @@ Basic usage:
|
|||||||
$EndFeature, "
|
$EndFeature, "
|
||||||
```"),
|
```"),
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[inline]
|
#[inline(always)]
|
||||||
#[rustc_promotable]
|
#[rustc_promotable]
|
||||||
pub const fn min_value() -> Self {
|
pub const fn min_value() -> Self {
|
||||||
!0 ^ ((!0 as $UnsignedT) >> 1) as Self
|
!0 ^ ((!0 as $UnsignedT) >> 1) as Self
|
||||||
@@ -271,7 +271,7 @@ Basic usage:
|
|||||||
$EndFeature, "
|
$EndFeature, "
|
||||||
```"),
|
```"),
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[inline]
|
#[inline(always)]
|
||||||
#[rustc_promotable]
|
#[rustc_promotable]
|
||||||
pub const fn max_value() -> Self {
|
pub const fn max_value() -> Self {
|
||||||
!Self::min_value()
|
!Self::min_value()
|
||||||
@@ -2311,7 +2311,7 @@ Basic usage:
|
|||||||
```"),
|
```"),
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[rustc_promotable]
|
#[rustc_promotable]
|
||||||
#[inline]
|
#[inline(always)]
|
||||||
pub const fn min_value() -> Self { 0 }
|
pub const fn min_value() -> Self { 0 }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2328,7 +2328,7 @@ stringify!($MaxV), ");", $EndFeature, "
|
|||||||
```"),
|
```"),
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[rustc_promotable]
|
#[rustc_promotable]
|
||||||
#[inline]
|
#[inline(always)]
|
||||||
pub const fn max_value() -> Self { !0 }
|
pub const fn max_value() -> Self { !0 }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user