docs: correct panic conditions for rem_euclid and similar functions · patricklam/verify-rust-std@f3a198e (original) (raw)

`@@ -2826,8 +2826,8 @@ macro_rules! int_impl {

`

2826

2826

`///

`

2827

2827

`/// # Panics

`

2828

2828

`///

`

2829

``

`` -

/// This function will panic if rhs is 0 or if self is -1 and rhs is

``

2830

``

`` -

/// Self::MIN. This behavior is not affected by the overflow-checks flag.

``

``

2829

`` +

/// This function will panic if rhs is 0 or if self is Self::MIN

``

``

2830

`` +

/// and rhs is -1. This behavior is not affected by the overflow-checks flag.

``

2831

2831

`///

`

2832

2832

`/// # Examples

`

2833

2833

`///

`

`@@ -2865,8 +2865,8 @@ macro_rules! int_impl {

`

2865

2865

`///

`

2866

2866

`/// # Panics

`

2867

2867

`///

`

2868

``

`` -

/// This function will panic if rhs is 0 or if self is -1 and rhs is

``

2869

``

`` -

/// Self::MIN. This behavior is not affected by the overflow-checks flag.

``

``

2868

`` +

/// This function will panic if rhs is 0 or if self is Self::MIN and

``

``

2869

`` +

/// rhs is -1. This behavior is not affected by the overflow-checks flag.

``

2870

2870

`///

`

2871

2871

`/// # Examples

`

2872

2872

`///

`

`@@ -2881,6 +2881,11 @@ macro_rules! int_impl {

`

2881

2881

`/// assert_eq!(a.rem_euclid(-b), 3);

`

2882

2882

`/// assert_eq!((-a).rem_euclid(-b), 1);

`

2883

2883

```` /// ```


``

`2884`

`+

///

`

``

`2885`

`+

/// This will panic:

`

``

`2886`

```` +

/// ```should_panic

``

2887

`+

#[doc = concat!("let _ = ", stringify!($SelfT), "::MIN.rem_euclid(-1);")]

`

``

2888


/// ```

2884

2889

` #[doc(alias = "modulo", alias = "mod")]

`

2885

2890

` #[stable(feature = "euclidean_division", since = "1.38.0")]

`

2886

2891

` #[rustc_const_stable(feature = "const_euclidean_int_methods", since = "1.52.0")]

`

`@@ -2909,8 +2914,8 @@ macro_rules! int_impl {

`

2909

2914

`///

`

2910

2915

`/// # Panics

`

2911

2916

`///

`

2912

``

`` -

/// This function will panic if rhs is 0 or if self is -1 and rhs is

``

2913

``

`` -

/// Self::MIN. This behavior is not affected by the overflow-checks flag.

``

``

2917

`` +

/// This function will panic if rhs is 0 or if self is Self::MIN

``

``

2918

`` +

/// and rhs is -1. This behavior is not affected by the overflow-checks flag.

``

2914

2919

`///

`

2915

2920

`/// # Examples

`

2916

2921

`///

`

`@@ -2945,8 +2950,8 @@ macro_rules! int_impl {

`

2945

2950

`///

`

2946

2951

`/// # Panics

`

2947

2952

`///

`

2948

``

`` -

/// This function will panic if rhs is 0 or if self is -1 and rhs is

``

2949

``

`` -

/// Self::MIN. This behavior is not affected by the overflow-checks flag.

``

``

2953

`` +

/// This function will panic if rhs is 0 or if self is Self::MIN

``

``

2954

`` +

/// and rhs is -1. This behavior is not affected by the overflow-checks flag.

``

2950

2955

`///

`

2951

2956

`/// # Examples

`

2952

2957

`///

`