Skip to content

Commit f9f5809

Browse files
committed
Auto merge of #26776 - bluss:num-inline, r=eddyb
Add missing #[inline] to min_value/max_value on integers Spotted a compiled function call to num::usize::min_value, I'd prefer the 0 to be inlined.
2 parents 42e545f + e689342 commit f9f5809

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/libcore/num/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -668,10 +668,12 @@ macro_rules! uint_impl {
668668
$mul_with_overflow:path) => {
669669
/// Returns the smallest value that can be represented by this integer type.
670670
#[stable(feature = "rust1", since = "1.0.0")]
671+
#[inline]
671672
pub fn min_value() -> Self { 0 }
672673

673674
/// Returns the largest value that can be represented by this integer type.
674675
#[stable(feature = "rust1", since = "1.0.0")]
676+
#[inline]
675677
pub fn max_value() -> Self { !0 }
676678

677679
/// Converts a string slice in a given base to an integer.

0 commit comments

Comments
 (0)