We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ded9c56 commit 8947c19Copy full SHA for 8947c19
library/core/src/num/uint_macros.rs
@@ -1491,6 +1491,8 @@ macro_rules! uint_impl {
1491
without modifying the original"]
1492
#[inline]
1493
pub const fn checked_ilog(self, base: Self) -> Option<u32> {
1494
+ // Inform compiler of optimizations when the base is known at
1495
+ // compile time and there's a cheaper method available.
1496
if core::intrinsics::is_val_statically_known(base) {
1497
if base == 2 {
1498
return self.checked_ilog2();
0 commit comments