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:
Mazdak Farrokhzad 2019-10-03 08:04:33 +02:00 committed by GitHub
commit b131230c3b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -252,7 +252,7 @@ Basic usage:
$EndFeature, "
```"),
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
#[inline(always)]
#[rustc_promotable]
pub const fn min_value() -> Self {
!0 ^ ((!0 as $UnsignedT) >> 1) as Self
@ -271,7 +271,7 @@ Basic usage:
$EndFeature, "
```"),
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
#[inline(always)]
#[rustc_promotable]
pub const fn max_value() -> Self {
!Self::min_value()
@ -2311,7 +2311,7 @@ Basic usage:
```"),
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_promotable]
#[inline]
#[inline(always)]
pub const fn min_value() -> Self { 0 }
}
@ -2328,7 +2328,7 @@ stringify!($MaxV), ");", $EndFeature, "
```"),
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_promotable]
#[inline]
#[inline(always)]
pub const fn max_value() -> Self { !0 }
}