diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2024-11-21 17:19:54 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2024-11-22 22:01:09 +0100 |
| commit | 67bdc9b33710c21b4e19abd3e2b8aa95c1ccfaed (patch) | |
| tree | 799487c5ec3c5a23cfcac0eb26ed8967cd5946f1 | |
| parent | 717f5df2c308dfb4b7b8e6c002c11fe8269c4011 (diff) | |
| download | rust-67bdc9b33710c21b4e19abd3e2b8aa95c1ccfaed.tar.gz rust-67bdc9b33710c21b4e19abd3e2b8aa95c1ccfaed.zip | |
Add code example for `wrapping_neg` method for signed integers
| -rw-r--r-- | library/core/src/num/int_macros.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/library/core/src/num/int_macros.rs b/library/core/src/num/int_macros.rs index 318bb8ee4cd..64dcb4c91e6 100644 --- a/library/core/src/num/int_macros.rs +++ b/library/core/src/num/int_macros.rs @@ -2101,6 +2101,7 @@ macro_rules! int_impl { /// /// ``` #[doc = concat!("assert_eq!(100", stringify!($SelfT), ".wrapping_neg(), -100);")] + #[doc = concat!("assert_eq!((-100", stringify!($SelfT), ").wrapping_neg(), 100);")] #[doc = concat!("assert_eq!(", stringify!($SelfT), "::MIN.wrapping_neg(), ", stringify!($SelfT), "::MIN);")] /// ``` #[stable(feature = "num_wrapping", since = "1.2.0")] |
