@@ -642,11 +642,11 @@ returning `None` if `rhs == 0` or the division results in overflow.
642
642
Basic usage:
643
643
644
644
```
645
- " , $Feature, "assert_eq!((" , stringify!( $SelfT) ,
645
+ #![feature(euclidean_division)]
646
+ assert_eq!((" , stringify!( $SelfT) ,
646
647
"::min_value() + 1).checked_div_euc(-1), Some(" , stringify!( $Max) , "));
647
648
assert_eq!(" , stringify!( $SelfT) , "::min_value().checked_div_euc(-1), None);
648
- assert_eq!((1" , stringify!( $SelfT) , ").checked_div_euc(0), None);" ,
649
- $EndFeature, "
649
+ assert_eq!((1" , stringify!( $SelfT) , ").checked_div_euc(0), None);
650
650
```" ) ,
651
651
#[ unstable( feature = "euclidean_division" , issue = "49048" ) ]
652
652
#[ inline]
@@ -695,12 +695,12 @@ $EndFeature, "
695
695
Basic usage:
696
696
697
697
```
698
- " , $Feature, "use std::" , stringify!( $SelfT) , ";
698
+ #![feature(euclidean_division)]
699
+ use std::" , stringify!( $SelfT) , ";
699
700
700
701
assert_eq!(5" , stringify!( $SelfT) , ".checked_mod_euc(2), Some(1));
701
702
assert_eq!(5" , stringify!( $SelfT) , ".checked_mod_euc(0), None);
702
- assert_eq!(" , stringify!( $SelfT) , "::MIN.checked_mod_euc(-1), None);" ,
703
- $EndFeature, "
703
+ assert_eq!(" , stringify!( $SelfT) , "::MIN.checked_mod_euc(-1), None);
704
704
```" ) ,
705
705
#[ unstable( feature = "euclidean_division" , issue = "49048" ) ]
706
706
#[ inline]
@@ -1063,9 +1063,9 @@ This function will panic if `rhs` is 0.
1063
1063
Basic usage:
1064
1064
1065
1065
```
1066
+ #![feature(euclidean_division)]
1066
1067
assert_eq!(100" , stringify!( $SelfT) , ".wrapping_div_euc(10), 10);
1067
- assert_eq!((-128i8).wrapping_div_euc(-1), -128);" ,
1068
- $EndFeature, "
1068
+ assert_eq!((-128i8).wrapping_div_euc(-1), -128);
1069
1069
```" ) ,
1070
1070
#[ unstable( feature = "euclidean_division" , issue = "49048" ) ]
1071
1071
#[ inline]
@@ -1119,9 +1119,9 @@ This function will panic if `rhs` is 0.
1119
1119
Basic usage:
1120
1120
1121
1121
```
1122
- " , $Feature , "assert_eq!(100" , stringify! ( $SelfT ) , ".wrapping_mod_euc(10), 0);
1123
- assert_eq!((-128i8) .wrapping_mod_euc(-1 ), 0);" ,
1124
- $EndFeature , "
1122
+ #![feature(euclidean_division)]
1123
+ assert_eq!(100" , stringify! ( $SelfT ) , " .wrapping_mod_euc(10 ), 0);
1124
+ assert_eq!((-128i8).wrapping_mod_euc(-1), 0);
1125
1125
```" ) ,
1126
1126
#[ unstable( feature = "euclidean_division" , issue = "49048" ) ]
1127
1127
#[ inline]
@@ -1410,12 +1410,12 @@ This function will panic if `rhs` is 0.
1410
1410
Basic usage:
1411
1411
1412
1412
```
1413
- " , $Feature, "use std::" , stringify!( $SelfT) , ";
1413
+ #![feature(euclidean_division)]
1414
+ use std::" , stringify!( $SelfT) , ";
1414
1415
1415
1416
assert_eq!(5" , stringify!( $SelfT) , ".overflowing_div_euc(2), (2, false));
1416
1417
assert_eq!(" , stringify!( $SelfT) , "::MIN.overflowing_div_euc(-1), (" , stringify!( $SelfT) ,
1417
- "::MIN, true));" ,
1418
- $EndFeature, "
1418
+ "::MIN, true));
1419
1419
```" ) ,
1420
1420
#[ inline]
1421
1421
#[ unstable( feature = "euclidean_division" , issue = "49048" ) ]
@@ -1476,11 +1476,11 @@ This function will panic if `rhs` is 0.
1476
1476
Basic usage:
1477
1477
1478
1478
```
1479
- " , $Feature, "use std::" , stringify!( $SelfT) , ";
1479
+ #![feature(euclidean_division)]
1480
+ use std::" , stringify!( $SelfT) , ";
1480
1481
1481
1482
assert_eq!(5" , stringify!( $SelfT) , ".overflowing_mod_euc(2), (1, false));
1482
- assert_eq!(" , stringify!( $SelfT) , "::MIN.overflowing_mod_euc(-1), (0, true));" ,
1483
- $EndFeature, "
1483
+ assert_eq!(" , stringify!( $SelfT) , "::MIN.overflowing_mod_euc(-1), (0, true));
1484
1484
```" ) ,
1485
1485
#[ unstable( feature = "euclidean_division" , issue = "49048" ) ]
1486
1486
#[ inline]
@@ -1704,14 +1704,14 @@ This function will panic if `rhs` is 0.
1704
1704
Basic usage:
1705
1705
1706
1706
```
1707
- " , $Feature, "let a: " , stringify!( $SelfT) , " = 7; // or any other integer type
1707
+ #![feature(euclidean_division)]
1708
+ let a: " , stringify!( $SelfT) , " = 7; // or any other integer type
1708
1709
let b = 4;
1709
1710
1710
1711
assert_eq!(a.div_euc(b), 1); // 7 >= 4 * 1
1711
1712
assert_eq!(a.div_euc(-b), -1); // 7 >= -4 * -1
1712
1713
assert_eq!((-a).div_euc(b), -2); // -7 >= 4 * -2
1713
- assert_eq!((-a).div_euc(-b), 2); // -7 >= -4 * 2" ,
1714
- $EndFeature, "
1714
+ assert_eq!((-a).div_euc(-b), 2); // -7 >= -4 * 2
1715
1715
```" ) ,
1716
1716
#[ unstable( feature = "euclidean_division" , issue = "49048" ) ]
1717
1717
#[ inline]
@@ -1740,14 +1740,14 @@ This function will panic if `rhs` is 0.
1740
1740
Basic usage:
1741
1741
1742
1742
```
1743
- " , $Feature, "let a: " , stringify!( $SelfT) , " = 7; // or any other integer type
1743
+ #![feature(euclidean_division)]
1744
+ let a: " , stringify!( $SelfT) , " = 7; // or any other integer type
1744
1745
let b = 4;
1745
1746
1746
1747
assert_eq!(a.mod_euc(b), 3);
1747
1748
assert_eq!((-a).mod_euc(b), 1);
1748
1749
assert_eq!(a.mod_euc(-b), 3);
1749
- assert_eq!((-a).mod_euc(-b), 1);" ,
1750
- $EndFeature, "
1750
+ assert_eq!((-a).mod_euc(-b), 1);
1751
1751
```" ) ,
1752
1752
#[ unstable( feature = "euclidean_division" , issue = "49048" ) ]
1753
1753
#[ inline]
@@ -2362,7 +2362,8 @@ if `rhs == 0`.
2362
2362
Basic usage:
2363
2363
2364
2364
```
2365
- " , $Feature, "assert_eq!(128" , stringify!( $SelfT) , ".checked_div(2), Some(64));
2365
+ #![feature(euclidean_division)]
2366
+ assert_eq!(128" , stringify!( $SelfT) , ".checked_div(2), Some(64));
2366
2367
assert_eq!(1" , stringify!( $SelfT) , ".checked_div_euc(0), None);
2367
2368
```" ) ,
2368
2369
#[ unstable( feature = "euclidean_division" , issue = "49048" ) ]
@@ -2409,9 +2410,9 @@ if `rhs == 0`.
2409
2410
Basic usage:
2410
2411
2411
2412
```
2412
- " , $Feature , "assert_eq!(5" , stringify! ( $SelfT ) , ".checked_mod_euc(2), Some(1));
2413
- assert_eq!(5" , stringify!( $SelfT) , ".checked_mod_euc(0 ), None);" ,
2414
- $EndFeature , "
2413
+ #![feature(euclidean_division)]
2414
+ assert_eq!(5" , stringify!( $SelfT) , ".checked_mod_euc(2 ), Some(1));
2415
+ assert_eq!(5" , stringify! ( $SelfT ) , ".checked_mod_euc(0), None);
2415
2416
```" ) ,
2416
2417
#[ unstable( feature = "euclidean_division" , issue = "49048" ) ]
2417
2418
#[ inline]
@@ -2715,7 +2716,8 @@ are accounted for in the wrapping operations.
2715
2716
Basic usage:
2716
2717
2717
2718
```
2718
- " , $Feature, "assert_eq!(100" , stringify!( $SelfT) , ".wrapping_div_euc(10), 10);" , $EndFeature, "
2719
+ #![feature(euclidean_division)]
2720
+ assert_eq!(100" , stringify!( $SelfT) , ".wrapping_div_euc(10), 10);
2719
2721
```" ) ,
2720
2722
#[ unstable( feature = "euclidean_division" , issue = "49048" ) ]
2721
2723
#[ inline]
@@ -2759,7 +2761,8 @@ are accounted for in the wrapping operations.
2759
2761
Basic usage:
2760
2762
2761
2763
```
2762
- " , $Feature, "assert_eq!(100" , stringify!( $SelfT) , ".wrapping_mod_euc(10), 0);" , $EndFeature, "
2764
+ #![feature(euclidean_division)]
2765
+ assert_eq!(100" , stringify!( $SelfT) , ".wrapping_mod_euc(10), 0);
2763
2766
```" ) ,
2764
2767
#[ unstable( feature = "euclidean_division" , issue = "49048" ) ]
2765
2768
#[ inline]
@@ -3018,8 +3021,8 @@ This function will panic if `rhs` is 0.
3018
3021
Basic usage
3019
3022
3020
3023
```
3021
- " , $Feature , "assert_eq!(5" , stringify! ( $SelfT ) , ".overflowing_div_euc(2), (2, false));" ,
3022
- $EndFeature , "
3024
+ #![feature(euclidean_division)]
3025
+ assert_eq!(5" , stringify! ( $SelfT ) , ".overflowing_div_euc(2), (2, false));
3023
3026
```" ) ,
3024
3027
#[ inline]
3025
3028
#[ unstable( feature = "euclidean_division" , issue = "49048" ) ]
@@ -3071,8 +3074,8 @@ This function will panic if `rhs` is 0.
3071
3074
Basic usage
3072
3075
3073
3076
```
3074
- " , $Feature , "assert_eq!(5" , stringify! ( $SelfT ) , ".overflowing_mod_euc(2), (1, false));" ,
3075
- $EndFeature , "
3077
+ #![feature(euclidean_division)]
3078
+ assert_eq!(5" , stringify! ( $SelfT ) , ".overflowing_mod_euc(2), (1, false));
3076
3079
```" ) ,
3077
3080
#[ inline]
3078
3081
#[ unstable( feature = "euclidean_division" , issue = "49048" ) ]
@@ -3248,8 +3251,8 @@ For unsigned types, this is just the same as `self / rhs`.
3248
3251
Basic usage:
3249
3252
3250
3253
```
3251
- " , $Feature , "assert_eq(7" , stringify! ( $SelfT ) , ".div_euc(4), 1); // or any other integer type" ,
3252
- $EndFeature , "
3254
+ #![feature(euclidean_division)]
3255
+ assert_eq(7" , stringify! ( $SelfT ) , ".div_euc(4), 1); // or any other integer type
3253
3256
```" ) ,
3254
3257
#[ unstable( feature = "euclidean_division" , issue = "49048" ) ]
3255
3258
#[ inline]
@@ -3270,8 +3273,8 @@ For unsigned types, this is just the same as `self % rhs`.
3270
3273
Basic usage:
3271
3274
3272
3275
```
3273
- " , $Feature , "assert_eq(7" , stringify! ( $SelfT ) , ".mod_euc(4), 3); // or any other integer type" ,
3274
- $EndFeature , "
3276
+ #![feature(euclidean_division)]
3277
+ assert_eq(7" , stringify! ( $SelfT ) , ".mod_euc(4), 3); // or any other integer type
3275
3278
```" ) ,
3276
3279
#[ unstable( feature = "euclidean_division" , issue = "49048" ) ]
3277
3280
#[ inline]
0 commit comments