Skip to content

Commit b131230

Browse files
authored
Rollup merge of rust-lang#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
2 parents c6293e3 + 3b49ab6 commit b131230

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/libcore/num/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ Basic usage:
252252
$EndFeature, "
253253
```"),
254254
#[stable(feature = "rust1", since = "1.0.0")]
255-
#[inline]
255+
#[inline(always)]
256256
#[rustc_promotable]
257257
pub const fn min_value() -> Self {
258258
!0 ^ ((!0 as $UnsignedT) >> 1) as Self
@@ -271,7 +271,7 @@ Basic usage:
271271
$EndFeature, "
272272
```"),
273273
#[stable(feature = "rust1", since = "1.0.0")]
274-
#[inline]
274+
#[inline(always)]
275275
#[rustc_promotable]
276276
pub const fn max_value() -> Self {
277277
!Self::min_value()
@@ -2311,7 +2311,7 @@ Basic usage:
23112311
```"),
23122312
#[stable(feature = "rust1", since = "1.0.0")]
23132313
#[rustc_promotable]
2314-
#[inline]
2314+
#[inline(always)]
23152315
pub const fn min_value() -> Self { 0 }
23162316
}
23172317

@@ -2328,7 +2328,7 @@ stringify!($MaxV), ");", $EndFeature, "
23282328
```"),
23292329
#[stable(feature = "rust1", since = "1.0.0")]
23302330
#[rustc_promotable]
2331-
#[inline]
2331+
#[inline(always)]
23322332
pub const fn max_value() -> Self { !0 }
23332333
}
23342334

0 commit comments

Comments
 (0)