@@ -1425,17 +1425,17 @@ macro_rules! int_impl {
14251425 /// ```
14261426 /// #![feature(exact_bitshifts)]
14271427 ///
1428- #[ doc = concat!( "assert_eq!(0x1" , stringify!( $SelfT) , ".exact_shl (4), Some(0x10));" ) ]
1429- #[ doc = concat!( "assert_eq!(0x1" , stringify!( $SelfT) , ".exact_shl (" , stringify!( $SelfT) , "::BITS - 2), Some(1 << " , stringify!( $SelfT) , "::BITS - 2));" ) ]
1430- #[ doc = concat!( "assert_eq!(0x1" , stringify!( $SelfT) , ".exact_shl (" , stringify!( $SelfT) , "::BITS - 1), None);" ) ]
1431- #[ doc = concat!( "assert_eq!((-0x2" , stringify!( $SelfT) , ").exact_shl (" , stringify!( $SelfT) , "::BITS - 2), Some(-0x2 << " , stringify!( $SelfT) , "::BITS - 2));" ) ]
1432- #[ doc = concat!( "assert_eq!((-0x2" , stringify!( $SelfT) , ").exact_shl (" , stringify!( $SelfT) , "::BITS - 1), None);" ) ]
1428+ #[ doc = concat!( "assert_eq!(0x1" , stringify!( $SelfT) , ".shl_exact (4), Some(0x10));" ) ]
1429+ #[ doc = concat!( "assert_eq!(0x1" , stringify!( $SelfT) , ".shl_exact (" , stringify!( $SelfT) , "::BITS - 2), Some(1 << " , stringify!( $SelfT) , "::BITS - 2));" ) ]
1430+ #[ doc = concat!( "assert_eq!(0x1" , stringify!( $SelfT) , ".shl_exact (" , stringify!( $SelfT) , "::BITS - 1), None);" ) ]
1431+ #[ doc = concat!( "assert_eq!((-0x2" , stringify!( $SelfT) , ").shl_exact (" , stringify!( $SelfT) , "::BITS - 2), Some(-0x2 << " , stringify!( $SelfT) , "::BITS - 2));" ) ]
1432+ #[ doc = concat!( "assert_eq!((-0x2" , stringify!( $SelfT) , ").shl_exact (" , stringify!( $SelfT) , "::BITS - 1), None);" ) ]
14331433 /// ```
14341434 #[ unstable( feature = "exact_bitshifts" , issue = "144336" ) ]
14351435 #[ must_use = "this returns the result of the operation, \
14361436 without modifying the original"]
14371437 #[ inline]
1438- pub const fn exact_shl ( self , rhs: u32 ) -> Option <$SelfT> {
1438+ pub const fn shl_exact ( self , rhs: u32 ) -> Option <$SelfT> {
14391439 if rhs < self . leading_zeros( ) || rhs < self . leading_ones( ) {
14401440 // SAFETY: rhs is checked above
14411441 Some ( unsafe { self . unchecked_shl( rhs) } )
@@ -1452,16 +1452,16 @@ macro_rules! int_impl {
14521452 ///
14531453 /// This results in undefined behavior when `rhs >= self.leading_zeros() && rhs >=
14541454 /// self.leading_ones()` i.e. when
1455- #[ doc = concat!( "[`" , stringify!( $SelfT) , "::exact_shl `]" ) ]
1455+ #[ doc = concat!( "[`" , stringify!( $SelfT) , "::shl_exact `]" ) ]
14561456 /// would return `None`.
14571457 #[ unstable( feature = "exact_bitshifts" , issue = "144336" ) ]
14581458 #[ must_use = "this returns the result of the operation, \
14591459 without modifying the original"]
14601460 #[ inline]
1461- pub const unsafe fn unchecked_exact_shl ( self , rhs: u32 ) -> $SelfT {
1461+ pub const unsafe fn unchecked_shl_exact ( self , rhs: u32 ) -> $SelfT {
14621462 assert_unsafe_precondition!(
14631463 check_library_ub,
1464- concat!( stringify!( $SelfT) , "::unchecked_exact_shl cannot shift out bits that would change the value of the first bit" ) ,
1464+ concat!( stringify!( $SelfT) , "::unchecked_shl_exact cannot shift out bits that would change the value of the first bit" ) ,
14651465 (
14661466 zeros: u32 = self . leading_zeros( ) ,
14671467 ones: u32 = self . leading_ones( ) ,
@@ -1605,14 +1605,14 @@ macro_rules! int_impl {
16051605 /// ```
16061606 /// #![feature(exact_bitshifts)]
16071607 ///
1608- #[ doc = concat!( "assert_eq!(0x10" , stringify!( $SelfT) , ".exact_shr (4), Some(0x1));" ) ]
1609- #[ doc = concat!( "assert_eq!(0x10" , stringify!( $SelfT) , ".exact_shr (5), None);" ) ]
1608+ #[ doc = concat!( "assert_eq!(0x10" , stringify!( $SelfT) , ".shr_exact (4), Some(0x1));" ) ]
1609+ #[ doc = concat!( "assert_eq!(0x10" , stringify!( $SelfT) , ".shr_exact (5), None);" ) ]
16101610 /// ```
16111611 #[ unstable( feature = "exact_bitshifts" , issue = "144336" ) ]
16121612 #[ must_use = "this returns the result of the operation, \
16131613 without modifying the original"]
16141614 #[ inline]
1615- pub const fn exact_shr ( self , rhs: u32 ) -> Option <$SelfT> {
1615+ pub const fn shr_exact ( self , rhs: u32 ) -> Option <$SelfT> {
16161616 if rhs <= self . trailing_zeros( ) && rhs < <$SelfT>:: BITS {
16171617 // SAFETY: rhs is checked above
16181618 Some ( unsafe { self . unchecked_shr( rhs) } )
@@ -1630,16 +1630,16 @@ macro_rules! int_impl {
16301630 /// This results in undefined behavior when `rhs > self.trailing_zeros() || rhs >=
16311631 #[ doc = concat!( stringify!( $SelfT) , "::BITS`" ) ]
16321632 /// i.e. when
1633- #[ doc = concat!( "[`" , stringify!( $SelfT) , "::exact_shr `]" ) ]
1633+ #[ doc = concat!( "[`" , stringify!( $SelfT) , "::shr_exact `]" ) ]
16341634 /// would return `None`.
16351635 #[ unstable( feature = "exact_bitshifts" , issue = "144336" ) ]
16361636 #[ must_use = "this returns the result of the operation, \
16371637 without modifying the original"]
16381638 #[ inline]
1639- pub const unsafe fn unchecked_exact_shr ( self , rhs: u32 ) -> $SelfT {
1639+ pub const unsafe fn unchecked_shr_exact ( self , rhs: u32 ) -> $SelfT {
16401640 assert_unsafe_precondition!(
16411641 check_library_ub,
1642- concat!( stringify!( $SelfT) , "::unchecked_exact_shr cannot shift out non-zero bits" ) ,
1642+ concat!( stringify!( $SelfT) , "::unchecked_shr_exact cannot shift out non-zero bits" ) ,
16431643 (
16441644 zeros: u32 = self . trailing_zeros( ) ,
16451645 bits: u32 = <$SelfT>:: BITS ,
0 commit comments