@@ -1431,17 +1431,17 @@ macro_rules! int_impl {
14311431 /// ```
14321432 /// #![feature(exact_bitshifts)]
14331433 ///
1434- #[ doc = concat!( "assert_eq!(0x1" , stringify!( $SelfT) , ".exact_shl (4), Some(0x10));" ) ]
1435- #[ doc = concat!( "assert_eq!(0x1" , stringify!( $SelfT) , ".exact_shl (" , stringify!( $SelfT) , "::BITS - 2), Some(1 << " , stringify!( $SelfT) , "::BITS - 2));" ) ]
1436- #[ doc = concat!( "assert_eq!(0x1" , stringify!( $SelfT) , ".exact_shl (" , stringify!( $SelfT) , "::BITS - 1), None);" ) ]
1437- #[ doc = concat!( "assert_eq!((-0x2" , stringify!( $SelfT) , ").exact_shl (" , stringify!( $SelfT) , "::BITS - 2), Some(-0x2 << " , stringify!( $SelfT) , "::BITS - 2));" ) ]
1438- #[ doc = concat!( "assert_eq!((-0x2" , stringify!( $SelfT) , ").exact_shl (" , stringify!( $SelfT) , "::BITS - 1), None);" ) ]
1434+ #[ doc = concat!( "assert_eq!(0x1" , stringify!( $SelfT) , ".shl_exact (4), Some(0x10));" ) ]
1435+ #[ doc = concat!( "assert_eq!(0x1" , stringify!( $SelfT) , ".shl_exact (" , stringify!( $SelfT) , "::BITS - 2), Some(1 << " , stringify!( $SelfT) , "::BITS - 2));" ) ]
1436+ #[ doc = concat!( "assert_eq!(0x1" , stringify!( $SelfT) , ".shl_exact (" , stringify!( $SelfT) , "::BITS - 1), None);" ) ]
1437+ #[ doc = concat!( "assert_eq!((-0x2" , stringify!( $SelfT) , ").shl_exact (" , stringify!( $SelfT) , "::BITS - 2), Some(-0x2 << " , stringify!( $SelfT) , "::BITS - 2));" ) ]
1438+ #[ doc = concat!( "assert_eq!((-0x2" , stringify!( $SelfT) , ").shl_exact (" , stringify!( $SelfT) , "::BITS - 1), None);" ) ]
14391439 /// ```
14401440 #[ unstable( feature = "exact_bitshifts" , issue = "144336" ) ]
14411441 #[ must_use = "this returns the result of the operation, \
14421442 without modifying the original"]
14431443 #[ inline]
1444- pub const fn exact_shl ( self , rhs: u32 ) -> Option <$SelfT> {
1444+ pub const fn shl_exact ( self , rhs: u32 ) -> Option <$SelfT> {
14451445 if rhs < self . leading_zeros( ) || rhs < self . leading_ones( ) {
14461446 // SAFETY: rhs is checked above
14471447 Some ( unsafe { self . unchecked_shl( rhs) } )
@@ -1458,16 +1458,16 @@ macro_rules! int_impl {
14581458 ///
14591459 /// This results in undefined behavior when `rhs >= self.leading_zeros() && rhs >=
14601460 /// self.leading_ones()` i.e. when
1461- #[ doc = concat!( "[`" , stringify!( $SelfT) , "::exact_shl `]" ) ]
1461+ #[ doc = concat!( "[`" , stringify!( $SelfT) , "::shl_exact `]" ) ]
14621462 /// would return `None`.
14631463 #[ unstable( feature = "exact_bitshifts" , issue = "144336" ) ]
14641464 #[ must_use = "this returns the result of the operation, \
14651465 without modifying the original"]
14661466 #[ inline]
1467- pub const unsafe fn unchecked_exact_shl ( self , rhs: u32 ) -> $SelfT {
1467+ pub const unsafe fn unchecked_shl_exact ( self , rhs: u32 ) -> $SelfT {
14681468 assert_unsafe_precondition!(
14691469 check_library_ub,
1470- concat!( stringify!( $SelfT) , "::unchecked_exact_shl cannot shift out bits that would change the value of the first bit" ) ,
1470+ concat!( stringify!( $SelfT) , "::unchecked_shl_exact cannot shift out bits that would change the value of the first bit" ) ,
14711471 (
14721472 zeros: u32 = self . leading_zeros( ) ,
14731473 ones: u32 = self . leading_ones( ) ,
@@ -1611,14 +1611,14 @@ macro_rules! int_impl {
16111611 /// ```
16121612 /// #![feature(exact_bitshifts)]
16131613 ///
1614- #[ doc = concat!( "assert_eq!(0x10" , stringify!( $SelfT) , ".exact_shr (4), Some(0x1));" ) ]
1615- #[ doc = concat!( "assert_eq!(0x10" , stringify!( $SelfT) , ".exact_shr (5), None);" ) ]
1614+ #[ doc = concat!( "assert_eq!(0x10" , stringify!( $SelfT) , ".shr_exact (4), Some(0x1));" ) ]
1615+ #[ doc = concat!( "assert_eq!(0x10" , stringify!( $SelfT) , ".shr_exact (5), None);" ) ]
16161616 /// ```
16171617 #[ unstable( feature = "exact_bitshifts" , issue = "144336" ) ]
16181618 #[ must_use = "this returns the result of the operation, \
16191619 without modifying the original"]
16201620 #[ inline]
1621- pub const fn exact_shr ( self , rhs: u32 ) -> Option <$SelfT> {
1621+ pub const fn shr_exact ( self , rhs: u32 ) -> Option <$SelfT> {
16221622 if rhs <= self . trailing_zeros( ) && rhs < <$SelfT>:: BITS {
16231623 // SAFETY: rhs is checked above
16241624 Some ( unsafe { self . unchecked_shr( rhs) } )
@@ -1636,16 +1636,16 @@ macro_rules! int_impl {
16361636 /// This results in undefined behavior when `rhs > self.trailing_zeros() || rhs >=
16371637 #[ doc = concat!( stringify!( $SelfT) , "::BITS`" ) ]
16381638 /// i.e. when
1639- #[ doc = concat!( "[`" , stringify!( $SelfT) , "::exact_shr `]" ) ]
1639+ #[ doc = concat!( "[`" , stringify!( $SelfT) , "::shr_exact `]" ) ]
16401640 /// would return `None`.
16411641 #[ unstable( feature = "exact_bitshifts" , issue = "144336" ) ]
16421642 #[ must_use = "this returns the result of the operation, \
16431643 without modifying the original"]
16441644 #[ inline]
1645- pub const unsafe fn unchecked_exact_shr ( self , rhs: u32 ) -> $SelfT {
1645+ pub const unsafe fn unchecked_shr_exact ( self , rhs: u32 ) -> $SelfT {
16461646 assert_unsafe_precondition!(
16471647 check_library_ub,
1648- concat!( stringify!( $SelfT) , "::unchecked_exact_shr cannot shift out non-zero bits" ) ,
1648+ concat!( stringify!( $SelfT) , "::unchecked_shr_exact cannot shift out non-zero bits" ) ,
16491649 (
16501650 zeros: u32 = self . trailing_zeros( ) ,
16511651 bits: u32 = <$SelfT>:: BITS ,
0 commit comments