@@ -642,11 +642,11 @@ returning `None` if `rhs == 0` or the division results in overflow.
642642Basic usage:
643643
644644```
645- " , $Feature, "assert_eq!((" , stringify!( $SelfT) ,
645+ #![feature(euclidean_division)]
646+ assert_eq!((" , stringify!( $SelfT) ,
646647"::min_value() + 1).checked_div_euc(-1), Some(" , stringify!( $Max) , "));
647648assert_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);
650650```" ) ,
651651 #[ unstable( feature = "euclidean_division" , issue = "49048" ) ]
652652 #[ inline]
@@ -695,12 +695,12 @@ $EndFeature, "
695695Basic usage:
696696
697697```
698- " , $Feature, "use std::" , stringify!( $SelfT) , ";
698+ #![feature(euclidean_division)]
699+ use std::" , stringify!( $SelfT) , ";
699700
700701assert_eq!(5" , stringify!( $SelfT) , ".checked_mod_euc(2), Some(1));
701702assert_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);
704704```" ) ,
705705 #[ unstable( feature = "euclidean_division" , issue = "49048" ) ]
706706 #[ inline]
@@ -1063,9 +1063,9 @@ This function will panic if `rhs` is 0.
10631063Basic usage:
10641064
10651065```
1066+ #![feature(euclidean_division)]
10661067assert_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);
10691069```" ) ,
10701070 #[ unstable( feature = "euclidean_division" , issue = "49048" ) ]
10711071 #[ inline]
@@ -1119,9 +1119,9 @@ This function will panic if `rhs` is 0.
11191119Basic usage:
11201120
11211121```
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);
11251125```" ) ,
11261126 #[ unstable( feature = "euclidean_division" , issue = "49048" ) ]
11271127 #[ inline]
@@ -1410,12 +1410,12 @@ This function will panic if `rhs` is 0.
14101410Basic usage:
14111411
14121412```
1413- " , $Feature, "use std::" , stringify!( $SelfT) , ";
1413+ #![feature(euclidean_division)]
1414+ use std::" , stringify!( $SelfT) , ";
14141415
14151416assert_eq!(5" , stringify!( $SelfT) , ".overflowing_div_euc(2), (2, false));
14161417assert_eq!(" , stringify!( $SelfT) , "::MIN.overflowing_div_euc(-1), (" , stringify!( $SelfT) ,
1417- "::MIN, true));" ,
1418- $EndFeature, "
1418+ "::MIN, true));
14191419```" ) ,
14201420 #[ inline]
14211421 #[ unstable( feature = "euclidean_division" , issue = "49048" ) ]
@@ -1476,11 +1476,11 @@ This function will panic if `rhs` is 0.
14761476Basic usage:
14771477
14781478```
1479- " , $Feature, "use std::" , stringify!( $SelfT) , ";
1479+ #![feature(euclidean_division)]
1480+ use std::" , stringify!( $SelfT) , ";
14801481
14811482assert_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));
14841484```" ) ,
14851485 #[ unstable( feature = "euclidean_division" , issue = "49048" ) ]
14861486 #[ inline]
@@ -1704,14 +1704,14 @@ This function will panic if `rhs` is 0.
17041704Basic usage:
17051705
17061706```
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
17081709let b = 4;
17091710
17101711assert_eq!(a.div_euc(b), 1); // 7 >= 4 * 1
17111712assert_eq!(a.div_euc(-b), -1); // 7 >= -4 * -1
17121713assert_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
17151715```" ) ,
17161716 #[ unstable( feature = "euclidean_division" , issue = "49048" ) ]
17171717 #[ inline]
@@ -1740,14 +1740,14 @@ This function will panic if `rhs` is 0.
17401740Basic usage:
17411741
17421742```
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
17441745let b = 4;
17451746
17461747assert_eq!(a.mod_euc(b), 3);
17471748assert_eq!((-a).mod_euc(b), 1);
17481749assert_eq!(a.mod_euc(-b), 3);
1749- assert_eq!((-a).mod_euc(-b), 1);" ,
1750- $EndFeature, "
1750+ assert_eq!((-a).mod_euc(-b), 1);
17511751```" ) ,
17521752 #[ unstable( feature = "euclidean_division" , issue = "49048" ) ]
17531753 #[ inline]
@@ -2362,7 +2362,8 @@ if `rhs == 0`.
23622362Basic usage:
23632363
23642364```
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));
23662367assert_eq!(1" , stringify!( $SelfT) , ".checked_div_euc(0), None);
23672368```" ) ,
23682369 #[ unstable( feature = "euclidean_division" , issue = "49048" ) ]
@@ -2409,9 +2410,9 @@ if `rhs == 0`.
24092410Basic usage:
24102411
24112412```
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);
24152416```" ) ,
24162417 #[ unstable( feature = "euclidean_division" , issue = "49048" ) ]
24172418 #[ inline]
@@ -2715,7 +2716,8 @@ are accounted for in the wrapping operations.
27152716Basic usage:
27162717
27172718```
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);
27192721```" ) ,
27202722 #[ unstable( feature = "euclidean_division" , issue = "49048" ) ]
27212723 #[ inline]
@@ -2759,7 +2761,8 @@ are accounted for in the wrapping operations.
27592761Basic usage:
27602762
27612763```
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);
27632766```" ) ,
27642767 #[ unstable( feature = "euclidean_division" , issue = "49048" ) ]
27652768 #[ inline]
@@ -3018,8 +3021,8 @@ This function will panic if `rhs` is 0.
30183021Basic usage
30193022
30203023```
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));
30233026```" ) ,
30243027 #[ inline]
30253028 #[ unstable( feature = "euclidean_division" , issue = "49048" ) ]
@@ -3071,8 +3074,8 @@ This function will panic if `rhs` is 0.
30713074Basic usage
30723075
30733076```
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));
30763079```" ) ,
30773080 #[ inline]
30783081 #[ unstable( feature = "euclidean_division" , issue = "49048" ) ]
@@ -3248,8 +3251,8 @@ For unsigned types, this is just the same as `self / rhs`.
32483251Basic usage:
32493252
32503253```
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
32533256```" ) ,
32543257 #[ unstable( feature = "euclidean_division" , issue = "49048" ) ]
32553258 #[ inline]
@@ -3270,8 +3273,8 @@ For unsigned types, this is just the same as `self % rhs`.
32703273Basic usage:
32713274
32723275```
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
32753278```" ) ,
32763279 #[ unstable( feature = "euclidean_division" , issue = "49048" ) ]
32773280 #[ inline]
0 commit comments