diff options
| author | Stovent <elian.hamon@viacesi.fr> | 2022-02-11 15:47:37 -0500 |
|---|---|---|
| committer | Stovent <elian.hamon@viacesi.fr> | 2022-05-30 18:32:37 -0400 |
| commit | b998d82d8d098ee0e5127123543f5720965c6648 (patch) | |
| tree | 96fae2b609164d80a2f26772b1baef15c476365d | |
| parent | 5c690555f226909786a43b4bf0dc58f8bffa7a6b (diff) | |
| download | rust-b998d82d8d098ee0e5127123543f5720965c6648.tar.gz rust-b998d82d8d098ee0e5127123543f5720965c6648.zip | |
Remove too long example
| -rw-r--r-- | library/core/src/num/int_macros.rs | 60 |
1 files changed, 2 insertions, 58 deletions
diff --git a/library/core/src/num/int_macros.rs b/library/core/src/num/int_macros.rs index 0cd64753f9b..2d97fa62acc 100644 --- a/library/core/src/num/int_macros.rs +++ b/library/core/src/num/int_macros.rs @@ -1520,35 +1520,7 @@ macro_rules! int_impl { /// /// # Examples /// - /// Standard signed bit integer implementation - /// - /// ```rs - /// #![feature(bigint_helper_methods)] - /// struct I16 { - /// pub low: u8, // Low-order bytes has to be unsigned. - /// /// Most Significant Data has to be of the same signedness as the desired type. - /// /// So u8 to implement U16, i8 to implement I16. - /// pub high: i8, - /// } - /// - /// impl I16 { - /// /// Adds `rhs` to `self` and returns true if signed overflow occurs, false otherwise. - /// pub fn overflowing_add(&mut self, rhs: Self) -> bool { - /// let (low_res, low_carry) = self.low.carrying_add(rhs.low, false); - /// - /// // The signed `carrying_add` method is used to detect signed overflow. - /// let (high_res, high_carry) = self.high.carrying_add(rhs.high, low_carry); - /// - /// self.low = low_res; - /// self.high = high_res; - /// high_carry - /// } - /// } - /// - /// fn main() {} - /// ``` - /// - /// General behavior + /// Basic usage: /// /// ``` /// #![feature(bigint_helper_methods)] @@ -1644,35 +1616,7 @@ macro_rules! int_impl { /// /// # Examples /// - /// Standard signed bit integer implementation - /// - /// ```rs - /// #![feature(bigint_helper_methods)] - /// struct I16 { - /// pub low: u8, // Low-order bytes has to be unsigned. - /// /// Most Significant Data has to be of the same signedness as the desired type. - /// /// So u8 to implement U16, i8 to implement I16. - /// pub high: i8, - /// } - /// - /// impl I16 { - /// /// Subtracts `rhs` from `self` and returns true if signed overflow occurs, false otherwise. - /// pub fn overflowing_sub(&mut self, rhs: Self) -> bool { - /// let (low_res, low_carry) = self.low.borrowing_sub(rhs.low, false); - /// - /// // The signed `borrowing_sub` method is used to detect signed overflow. - /// let (high_res, high_carry) = self.high.borrowing_sub(rhs.high, low_carry); - /// - /// self.low = low_res; - /// self.high = high_res; - /// high_carry - /// } - /// } - /// - /// fn main() {} - /// ``` - /// - /// General behavior + /// Basic usage: /// /// ``` /// #![feature(bigint_helper_methods)] |
