diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-10-03 08:04:33 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-10-03 08:04:33 +0200 |
| commit | b131230c3bd2d1d73d69a676e204f9d6ee72f5fb (patch) | |
| tree | 4865cc544a52bf2b14720e85479362bf00ff7050 /src/libcore/num | |
| parent | c6293e359848c8c7275330719b33ccd168df04c3 (diff) | |
| parent | 3b49ab6e4816fd79cf77d0813ceb17d5696d577c (diff) | |
| download | rust-b131230c3bd2d1d73d69a676e204f9d6ee72f5fb.tar.gz rust-b131230c3bd2d1d73d69a676e204f9d6ee72f5fb.zip | |
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
Diffstat (limited to 'src/libcore/num')
| -rw-r--r-- | src/libcore/num/mod.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index 83ffa8f8a84..ebde82de834 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -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 } } |
