Skip to content

Commit cf255c6

Browse files
committed
Use new preferred consts in int docs
1 parent fd71fbe commit cf255c6

File tree

1 file changed

+13
-35
lines changed

1 file changed

+13
-35
lines changed

src/libcore/num/mod.rs

Lines changed: 13 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -805,8 +805,7 @@ assert_eq!((1", stringify!($SelfT), ").checked_div_euclid(0), None);
805805
Basic usage:
806806
807807
```
808-
", $Feature, "use std::", stringify!($SelfT), ";
809-
808+
", $Feature, "
810809
assert_eq!(5", stringify!($SelfT), ".checked_rem(2), Some(1));
811810
assert_eq!(5", stringify!($SelfT), ".checked_rem(0), None);
812811
assert_eq!(", stringify!($SelfT), "::MIN.checked_rem(-1), None);",
@@ -836,8 +835,6 @@ if `rhs == 0` or the division results in overflow.
836835
Basic usage:
837836
838837
```
839-
use std::", stringify!($SelfT), ";
840-
841838
assert_eq!(5", stringify!($SelfT), ".checked_rem_euclid(2), Some(1));
842839
assert_eq!(5", stringify!($SelfT), ".checked_rem_euclid(0), None);
843840
assert_eq!(", stringify!($SelfT), "::MIN.checked_rem_euclid(-1), None);
@@ -864,8 +861,7 @@ assert_eq!(", stringify!($SelfT), "::MIN.checked_rem_euclid(-1), None);
864861
Basic usage:
865862
866863
```
867-
", $Feature, "use std::", stringify!($SelfT), ";
868-
864+
", $Feature, "
869865
assert_eq!(5", stringify!($SelfT), ".checked_neg(), Some(-5));
870866
assert_eq!(", stringify!($SelfT), "::MIN.checked_neg(), None);",
871867
$EndFeature, "
@@ -936,8 +932,7 @@ $EndFeature, "
936932
Basic usage:
937933
938934
```
939-
", $Feature, "use std::", stringify!($SelfT), ";
940-
935+
", $Feature, "
941936
assert_eq!((-5", stringify!($SelfT), ").checked_abs(), Some(5));
942937
assert_eq!(", stringify!($SelfT), "::MIN.checked_abs(), None);",
943938
$EndFeature, "
@@ -1115,8 +1110,7 @@ numeric bounds instead of overflowing.
11151110
Basic usage:
11161111
11171112
```
1118-
", $Feature, "use std::", stringify!($SelfT), ";
1119-
1113+
", $Feature, "
11201114
assert_eq!(10", stringify!($SelfT), ".saturating_mul(12), 120);
11211115
assert_eq!(", stringify!($SelfT), "::MAX.saturating_mul(10), ", stringify!($SelfT), "::MAX);
11221116
assert_eq!(", stringify!($SelfT), "::MIN.saturating_mul(10), ", stringify!($SelfT), "::MIN);",
@@ -1148,8 +1142,7 @@ saturating at the numeric bounds instead of overflowing.
11481142
Basic usage:
11491143
11501144
```
1151-
", $Feature, "use std::", stringify!($SelfT), ";
1152-
1145+
", $Feature, "
11531146
assert_eq!((-4", stringify!($SelfT), ").saturating_pow(3), -64);
11541147
assert_eq!(", stringify!($SelfT), "::MIN.saturating_pow(2), ", stringify!($SelfT), "::MAX);
11551148
assert_eq!(", stringify!($SelfT), "::MIN.saturating_pow(3), ", stringify!($SelfT), "::MIN);",
@@ -1536,8 +1529,7 @@ occur. If an overflow would have occurred then the wrapped value is returned.
15361529
Basic usage:
15371530
15381531
```
1539-
", $Feature, "use std::", stringify!($SelfT), ";
1540-
1532+
", $Feature, "
15411533
assert_eq!(5", stringify!($SelfT), ".overflowing_add(2), (7, false));
15421534
assert_eq!(", stringify!($SelfT), "::MAX.overflowing_add(1), (", stringify!($SelfT),
15431535
"::MIN, true));", $EndFeature, "
@@ -1564,8 +1556,7 @@ would occur. If an overflow would have occurred then the wrapped value is return
15641556
Basic usage:
15651557
15661558
```
1567-
", $Feature, "use std::", stringify!($SelfT), ";
1568-
1559+
", $Feature, "
15691560
assert_eq!(5", stringify!($SelfT), ".overflowing_sub(2), (3, false));
15701561
assert_eq!(", stringify!($SelfT), "::MIN.overflowing_sub(1), (", stringify!($SelfT),
15711562
"::MAX, true));", $EndFeature, "
@@ -1622,8 +1613,7 @@ This function will panic if `rhs` is 0.
16221613
Basic usage:
16231614
16241615
```
1625-
", $Feature, "use std::", stringify!($SelfT), ";
1626-
1616+
", $Feature, "
16271617
assert_eq!(5", stringify!($SelfT), ".overflowing_div(2), (2, false));
16281618
assert_eq!(", stringify!($SelfT), "::MIN.overflowing_div(-1), (", stringify!($SelfT),
16291619
"::MIN, true));",
@@ -1658,8 +1648,6 @@ This function will panic if `rhs` is 0.
16581648
Basic usage:
16591649
16601650
```
1661-
use std::", stringify!($SelfT), ";
1662-
16631651
assert_eq!(5", stringify!($SelfT), ".overflowing_div_euclid(2), (2, false));
16641652
assert_eq!(", stringify!($SelfT), "::MIN.overflowing_div_euclid(-1), (", stringify!($SelfT),
16651653
"::MIN, true));
@@ -1693,8 +1681,7 @@ This function will panic if `rhs` is 0.
16931681
Basic usage:
16941682
16951683
```
1696-
", $Feature, "use std::", stringify!($SelfT), ";
1697-
1684+
", $Feature, "
16981685
assert_eq!(5", stringify!($SelfT), ".overflowing_rem(2), (1, false));
16991686
assert_eq!(", stringify!($SelfT), "::MIN.overflowing_rem(-1), (0, true));",
17001687
$EndFeature, "
@@ -1729,8 +1716,6 @@ This function will panic if `rhs` is 0.
17291716
Basic usage:
17301717
17311718
```
1732-
use std::", stringify!($SelfT), ";
1733-
17341719
assert_eq!(5", stringify!($SelfT), ".overflowing_rem_euclid(2), (1, false));
17351720
assert_eq!(", stringify!($SelfT), "::MIN.overflowing_rem_euclid(-1), (0, true));
17361721
```"),
@@ -1761,8 +1746,6 @@ minimum value will be returned again and `true` will be returned for an overflow
17611746
Basic usage:
17621747
17631748
```
1764-
", $Feature, "use std::", stringify!($SelfT), ";
1765-
17661749
assert_eq!(2", stringify!($SelfT), ".overflowing_neg(), (-2, false));
17671750
assert_eq!(", stringify!($SelfT), "::MIN.overflowing_neg(), (", stringify!($SelfT),
17681751
"::MIN, true));", $EndFeature, "
@@ -3187,8 +3170,7 @@ saturating at the numeric bounds instead of overflowing.
31873170
Basic usage:
31883171
31893172
```
3190-
", $Feature, "use std::", stringify!($SelfT), ";
3191-
3173+
", $Feature, "
31923174
assert_eq!(2", stringify!($SelfT), ".saturating_mul(10), 20);
31933175
assert_eq!((", stringify!($SelfT), "::MAX).saturating_mul(10), ", stringify!($SelfT),
31943176
"::MAX);", $EndFeature, "
@@ -3215,8 +3197,7 @@ saturating at the numeric bounds instead of overflowing.
32153197
Basic usage:
32163198
32173199
```
3218-
", $Feature, "use std::", stringify!($SelfT), ";
3219-
3200+
", $Feature, "
32203201
assert_eq!(4", stringify!($SelfT), ".saturating_pow(3), 64);
32213202
assert_eq!(", stringify!($SelfT), "::MAX.saturating_pow(2), ", stringify!($SelfT), "::MAX);",
32223203
$EndFeature, "
@@ -3553,8 +3534,7 @@ have occurred then the wrapped value is returned.
35533534
Basic usage
35543535
35553536
```
3556-
", $Feature, "use std::", stringify!($SelfT), ";
3557-
3537+
", $Feature, "
35583538
assert_eq!(5", stringify!($SelfT), ".overflowing_add(2), (7, false));
35593539
assert_eq!(", stringify!($SelfT), "::MAX.overflowing_add(1), (0, true));", $EndFeature, "
35603540
```"),
@@ -3581,8 +3561,7 @@ have occurred then the wrapped value is returned.
35813561
Basic usage
35823562
35833563
```
3584-
", $Feature, "use std::", stringify!($SelfT), ";
3585-
3564+
", $Feature, "
35863565
assert_eq!(5", stringify!($SelfT), ".overflowing_sub(2), (3, false));
35873566
assert_eq!(0", stringify!($SelfT), ".overflowing_sub(1), (", stringify!($SelfT), "::MAX, true));",
35883567
$EndFeature, "
@@ -4868,7 +4847,6 @@ impl usize {
48684847
///
48694848
/// ```
48704849
/// use std::num::FpCategory;
4871-
/// use std::f32;
48724850
///
48734851
/// let num = 12.4_f32;
48744852
/// let inf = f32::INFINITY;

0 commit comments

Comments
 (0)