@@ -1544,27 +1544,26 @@ macro_rules! nonzero_integer_signedness_dependent_methods {
15441544 #[ must_use = "this returns the result of the operation, \
15451545 without modifying the original"]
15461546 pub const fn isqrt( self ) -> Self {
1547- let result = super :: int_sqrt :: $Int ( self . get( ) ) ;
1547+ let result = self . get( ) . isqrt ( ) ;
15481548
15491549 // SAFETY: Inform the optimizer what the range of outputs is.
1550+ // If testing `core` crashes with no panic message and a
1551+ // `num::int_sqrt::u*` test failed, it's because your edits
1552+ // caused these assertions or the assertions in `fn isqrt` of
1553+ // `uint_macros.rs` to become false.
15501554 //
15511555 // Integer square root is a monotonically nondecreasing
15521556 // function, which means that increasing the input will never
15531557 // cause the output to decrease.
15541558 //
1555- // The minimum input is 1. The maximum input is `<$Int>::MAX`.
1559+ // The minimum input is 1. When n is 1, sqrt(n) is 1. If n
1560+ // increases above 1, sqrt(n) can't decrease below 1, so sqrt(n)
1561+ // can't decrease below 1 no matter what n is.
15561562 //
1557- // When n is 1, sqrt(n) is 1. If n increases above 1, sqrt(n)
1558- // can't decrease below 1, so sqrt(n) can't decrease below 1 no
1559- // matter what n is.
1560- //
1561- // When n is below `<$Int>::MAX`, sqrt(n) can't decrease at all
1562- // when you increase n to `<$Int>::MAX`, so sqrt(n) can't be above
1563- // sqrt(`<$Int>::MAX`) no matter what n is.
1563+ // The maximum possible output already has an assertion in
1564+ // `fn isqrt` of `uint_macros.rs`.
15641565 unsafe {
15651566 hint:: assert_unchecked( result > 0 ) ;
1566- const MAX_RESULT : $Int = super :: int_sqrt:: $Int( <$Int>:: MAX ) ;
1567- hint:: assert_unchecked( result <= MAX_RESULT ) ;
15681567 }
15691568
15701569 // SAFETY: As explained above, the minimum integer square root is
0 commit comments