", $Feature, "assert_eq!(", stringify!($SelfT), "::min_value(), 0);", $EndFeature, "
```"),
#[stable(feature = "rust1", since = "1.0.0")]
+ #[rustc_promotable]
#[inline]
pub const fn min_value() -> Self { 0 }
}
stringify!($MaxV), ");", $EndFeature, "
```"),
#[stable(feature = "rust1", since = "1.0.0")]
+ #[rustc_promotable]
#[inline]
pub const fn max_value() -> Self { !0 }
}
#[rustc_const_unstable(feature = "const_int_rotate")]
#[inline]
pub const fn rotate_left(self, n: u32) -> Self {
- (self << (n % $BITS)) | (self >> (($BITS - (n % $BITS)) % $BITS))
+ #[cfg(not(stage0))] {
+ unsafe { intrinsics::rotate_left(self, n as $SelfT) }
+ }
+ #[cfg(stage0)] {
+ (self << (n % $BITS)) | (self >> (($BITS - (n % $BITS)) % $BITS))
+ }
}
}
#[rustc_const_unstable(feature = "const_int_rotate")]
#[inline]
pub const fn rotate_right(self, n: u32) -> Self {
- (self >> (n % $BITS)) | (self << (($BITS - (n % $BITS)) % $BITS))
+ #[cfg(not(stage0))] {
+ unsafe { intrinsics::rotate_right(self, n as $SelfT) }
+ }
+ #[cfg(stage0)] {
+ (self >> (n % $BITS)) | (self << (($BITS - (n % $BITS)) % $BITS))
+ }
}
}