From f74fdd21d89b246b6e233bd34700cf4160ea08cf Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Thu, 21 Nov 2024 17:19:54 +0100 Subject: [PATCH] Add code example for `wrapping_neg` method for signed integers --- library/core/src/num/int_macros.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/library/core/src/num/int_macros.rs b/library/core/src/num/int_macros.rs index 318bb8ee4cda2..8f3694de94884 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")]