Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b998d82

Browse filesBrowse files
committed
Remove too long example
1 parent 5c69055 commit b998d82
Copy full SHA for b998d82

File tree

Expand file treeCollapse file tree

1 file changed

+2
-58
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-58
lines changed
Open diff view settings
Collapse file

‎library/core/src/num/int_macros.rs‎

Copy file name to clipboardExpand all lines: library/core/src/num/int_macros.rs
+2-58Lines changed: 2 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1520,35 +1520,7 @@ macro_rules! int_impl {
15201520
///
15211521
/// # Examples
15221522
///
1523-
/// Standard signed bit integer implementation
1524-
///
1525-
/// ```rs
1526-
/// #![feature(bigint_helper_methods)]
1527-
/// struct I16 {
1528-
/// pub low: u8, // Low-order bytes has to be unsigned.
1529-
/// /// Most Significant Data has to be of the same signedness as the desired type.
1530-
/// /// So u8 to implement U16, i8 to implement I16.
1531-
/// pub high: i8,
1532-
/// }
1533-
///
1534-
/// impl I16 {
1535-
/// /// Adds `rhs` to `self` and returns true if signed overflow occurs, false otherwise.
1536-
/// pub fn overflowing_add(&mut self, rhs: Self) -> bool {
1537-
/// let (low_res, low_carry) = self.low.carrying_add(rhs.low, false);
1538-
///
1539-
/// // The signed `carrying_add` method is used to detect signed overflow.
1540-
/// let (high_res, high_carry) = self.high.carrying_add(rhs.high, low_carry);
1541-
///
1542-
/// self.low = low_res;
1543-
/// self.high = high_res;
1544-
/// high_carry
1545-
/// }
1546-
/// }
1547-
///
1548-
/// fn main() {}
1549-
/// ```
1550-
///
1551-
/// General behavior
1523+
/// Basic usage:
15521524
///
15531525
/// ```
15541526
/// #![feature(bigint_helper_methods)]
@@ -1644,35 +1616,7 @@ macro_rules! int_impl {
16441616
///
16451617
/// # Examples
16461618
///
1647-
/// Standard signed bit integer implementation
1648-
///
1649-
/// ```rs
1650-
/// #![feature(bigint_helper_methods)]
1651-
/// struct I16 {
1652-
/// pub low: u8, // Low-order bytes has to be unsigned.
1653-
/// /// Most Significant Data has to be of the same signedness as the desired type.
1654-
/// /// So u8 to implement U16, i8 to implement I16.
1655-
/// pub high: i8,
1656-
/// }
1657-
///
1658-
/// impl I16 {
1659-
/// /// Subtracts `rhs` from `self` and returns true if signed overflow occurs, false otherwise.
1660-
/// pub fn overflowing_sub(&mut self, rhs: Self) -> bool {
1661-
/// let (low_res, low_carry) = self.low.borrowing_sub(rhs.low, false);
1662-
///
1663-
/// // The signed `borrowing_sub` method is used to detect signed overflow.
1664-
/// let (high_res, high_carry) = self.high.borrowing_sub(rhs.high, low_carry);
1665-
///
1666-
/// self.low = low_res;
1667-
/// self.high = high_res;
1668-
/// high_carry
1669-
/// }
1670-
/// }
1671-
///
1672-
/// fn main() {}
1673-
/// ```
1674-
///
1675-
/// General behavior
1619+
/// Basic usage:
16761620
///
16771621
/// ```
16781622
/// #![feature(bigint_helper_methods)]

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.