@@ -300,18 +300,18 @@ macro_rules! nonzero_unsigned_operations {
300
300
///
301
301
/// ```
302
302
/// #![feature(nonzero_ops)]
303
- /// # #![feature(try_trait)]
304
303
#[ doc = concat!( "# use std::num::" , stringify!( $Ty) , ";" ) ]
305
304
///
306
- /// # fn main() -> Result<(), std::option::NoneError> {
305
+ /// # fn main() { test().unwrap(); }
306
+ /// # fn test() -> Option<()> {
307
307
#[ doc = concat!( "let one = " , stringify!( $Ty) , "::new(1)?;" ) ]
308
308
#[ doc = concat!( "let two = " , stringify!( $Ty) , "::new(2)?;" ) ]
309
309
#[ doc = concat!( "let max = " , stringify!( $Ty) , "::new(" ,
310
310
stringify!( $Int) , "::MAX)?;" ) ]
311
311
///
312
312
/// assert_eq!(Some(two), one.checked_add(1));
313
313
/// assert_eq!(None, max.checked_add(1));
314
- /// # Ok (())
314
+ /// # Some (())
315
315
/// # }
316
316
/// ```
317
317
#[ unstable( feature = "nonzero_ops" , issue = "84186" ) ]
@@ -333,18 +333,18 @@ macro_rules! nonzero_unsigned_operations {
333
333
///
334
334
/// ```
335
335
/// #![feature(nonzero_ops)]
336
- /// # #![feature(try_trait)]
337
336
#[ doc = concat!( "# use std::num::" , stringify!( $Ty) , ";" ) ]
338
337
///
339
- /// # fn main() -> Result<(), std::option::NoneError> {
338
+ /// # fn main() { test().unwrap(); }
339
+ /// # fn test() -> Option<()> {
340
340
#[ doc = concat!( "let one = " , stringify!( $Ty) , "::new(1)?;" ) ]
341
341
#[ doc = concat!( "let two = " , stringify!( $Ty) , "::new(2)?;" ) ]
342
342
#[ doc = concat!( "let max = " , stringify!( $Ty) , "::new(" ,
343
343
stringify!( $Int) , "::MAX)?;" ) ]
344
344
///
345
345
/// assert_eq!(two, one.saturating_add(1));
346
346
/// assert_eq!(max, max.saturating_add(1));
347
- /// # Ok (())
347
+ /// # Some (())
348
348
/// # }
349
349
/// ```
350
350
#[ unstable( feature = "nonzero_ops" , issue = "84186" ) ]
@@ -366,15 +366,15 @@ macro_rules! nonzero_unsigned_operations {
366
366
///
367
367
/// ```
368
368
/// #![feature(nonzero_ops)]
369
- /// # #![feature(try_trait)]
370
369
#[ doc = concat!( "# use std::num::" , stringify!( $Ty) , ";" ) ]
371
370
///
372
- /// # fn main() -> Result<(), std::option::NoneError> {
371
+ /// # fn main() { test().unwrap(); }
372
+ /// # fn test() -> Option<()> {
373
373
#[ doc = concat!( "let one = " , stringify!( $Ty) , "::new(1)?;" ) ]
374
374
#[ doc = concat!( "let two = " , stringify!( $Ty) , "::new(2)?;" ) ]
375
375
///
376
376
/// assert_eq!(two, unsafe { one.unchecked_add(1) });
377
- /// # Ok (())
377
+ /// # Some (())
378
378
/// # }
379
379
/// ```
380
380
#[ unstable( feature = "nonzero_ops" , issue = "84186" ) ]
@@ -393,10 +393,10 @@ macro_rules! nonzero_unsigned_operations {
393
393
///
394
394
/// ```
395
395
/// #![feature(nonzero_ops)]
396
- /// # #![feature(try_trait)]
397
396
#[ doc = concat!( "# use std::num::" , stringify!( $Ty) , ";" ) ]
398
397
///
399
- /// # fn main() -> Result<(), std::option::NoneError> {
398
+ /// # fn main() { test().unwrap(); }
399
+ /// # fn test() -> Option<()> {
400
400
#[ doc = concat!( "let two = " , stringify!( $Ty) , "::new(2)?;" ) ]
401
401
#[ doc = concat!( "let three = " , stringify!( $Ty) , "::new(3)?;" ) ]
402
402
#[ doc = concat!( "let four = " , stringify!( $Ty) , "::new(4)?;" ) ]
@@ -406,7 +406,7 @@ macro_rules! nonzero_unsigned_operations {
406
406
/// assert_eq!(Some(two), two.checked_next_power_of_two() );
407
407
/// assert_eq!(Some(four), three.checked_next_power_of_two() );
408
408
/// assert_eq!(None, max.checked_next_power_of_two() );
409
- /// # Ok (())
409
+ /// # Some (())
410
410
/// # }
411
411
/// ```
412
412
#[ unstable( feature = "nonzero_ops" , issue = "84186" ) ]
@@ -447,16 +447,16 @@ macro_rules! nonzero_signed_operations {
447
447
///
448
448
/// ```
449
449
/// #![feature(nonzero_ops)]
450
- /// # #![feature(try_trait)]
451
450
#[ doc = concat!( "# use std::num::" , stringify!( $Ty) , ";" ) ]
452
451
///
453
- /// # fn main() -> Result<(), std::option::NoneError> {
452
+ /// # fn main() { test().unwrap(); }
453
+ /// # fn test() -> Option<()> {
454
454
#[ doc = concat!( "let pos = " , stringify!( $Ty) , "::new(1)?;" ) ]
455
455
#[ doc = concat!( "let neg = " , stringify!( $Ty) , "::new(-1)?;" ) ]
456
456
///
457
457
/// assert_eq!(pos, pos.abs());
458
458
/// assert_eq!(pos, neg.abs());
459
- /// # Ok (())
459
+ /// # Some (())
460
460
/// # }
461
461
/// ```
462
462
#[ unstable( feature = "nonzero_ops" , issue = "84186" ) ]
@@ -475,18 +475,18 @@ macro_rules! nonzero_signed_operations {
475
475
///
476
476
/// ```
477
477
/// #![feature(nonzero_ops)]
478
- /// # #![feature(try_trait)]
479
478
#[ doc = concat!( "# use std::num::" , stringify!( $Ty) , ";" ) ]
480
479
///
481
- /// # fn main() -> Result<(), std::option::NoneError> {
480
+ /// # fn main() { test().unwrap(); }
481
+ /// # fn test() -> Option<()> {
482
482
#[ doc = concat!( "let pos = " , stringify!( $Ty) , "::new(1)?;" ) ]
483
483
#[ doc = concat!( "let neg = " , stringify!( $Ty) , "::new(-1)?;" ) ]
484
484
#[ doc = concat!( "let min = " , stringify!( $Ty) , "::new(" ,
485
485
stringify!( $Int) , "::MIN)?;" ) ]
486
486
///
487
487
/// assert_eq!(Some(pos), neg.checked_abs());
488
488
/// assert_eq!(None, min.checked_abs());
489
- /// # Ok (())
489
+ /// # Some (())
490
490
/// # }
491
491
/// ```
492
492
#[ unstable( feature = "nonzero_ops" , issue = "84186" ) ]
@@ -508,10 +508,10 @@ macro_rules! nonzero_signed_operations {
508
508
///
509
509
/// ```
510
510
/// #![feature(nonzero_ops)]
511
- /// # #![feature(try_trait)]
512
511
#[ doc = concat!( "# use std::num::" , stringify!( $Ty) , ";" ) ]
513
512
///
514
- /// # fn main() -> Result<(), std::option::NoneError> {
513
+ /// # fn main() { test().unwrap(); }
514
+ /// # fn test() -> Option<()> {
515
515
#[ doc = concat!( "let pos = " , stringify!( $Ty) , "::new(1)?;" ) ]
516
516
#[ doc = concat!( "let neg = " , stringify!( $Ty) , "::new(-1)?;" ) ]
517
517
#[ doc = concat!( "let min = " , stringify!( $Ty) , "::new(" ,
@@ -520,7 +520,7 @@ macro_rules! nonzero_signed_operations {
520
520
/// assert_eq!((pos, false), pos.overflowing_abs());
521
521
/// assert_eq!((pos, false), neg.overflowing_abs());
522
522
/// assert_eq!((min, true), min.overflowing_abs());
523
- /// # Ok (())
523
+ /// # Some (())
524
524
/// # }
525
525
/// ```
526
526
#[ unstable( feature = "nonzero_ops" , issue = "84186" ) ]
@@ -541,10 +541,10 @@ macro_rules! nonzero_signed_operations {
541
541
///
542
542
/// ```
543
543
/// #![feature(nonzero_ops)]
544
- /// # #![feature(try_trait)]
545
544
#[ doc = concat!( "# use std::num::" , stringify!( $Ty) , ";" ) ]
546
545
///
547
- /// # fn main() -> Result<(), std::option::NoneError> {
546
+ /// # fn main() { test().unwrap(); }
547
+ /// # fn test() -> Option<()> {
548
548
#[ doc = concat!( "let pos = " , stringify!( $Ty) , "::new(1)?;" ) ]
549
549
#[ doc = concat!( "let neg = " , stringify!( $Ty) , "::new(-1)?;" ) ]
550
550
#[ doc = concat!( "let min = " , stringify!( $Ty) , "::new(" ,
@@ -558,7 +558,7 @@ macro_rules! nonzero_signed_operations {
558
558
/// assert_eq!(pos, neg.saturating_abs());
559
559
/// assert_eq!(max, min.saturating_abs());
560
560
/// assert_eq!(max, min_plus.saturating_abs());
561
- /// # Ok (())
561
+ /// # Some (())
562
562
/// # }
563
563
/// ```
564
564
#[ unstable( feature = "nonzero_ops" , issue = "84186" ) ]
@@ -575,10 +575,10 @@ macro_rules! nonzero_signed_operations {
575
575
///
576
576
/// ```
577
577
/// #![feature(nonzero_ops)]
578
- /// # #![feature(try_trait)]
579
578
#[ doc = concat!( "# use std::num::" , stringify!( $Ty) , ";" ) ]
580
579
///
581
- /// # fn main() -> Result<(), std::option::NoneError> {
580
+ /// # fn main() { test().unwrap(); }
581
+ /// # fn test() -> Option<()> {
582
582
#[ doc = concat!( "let pos = " , stringify!( $Ty) , "::new(1)?;" ) ]
583
583
#[ doc = concat!( "let neg = " , stringify!( $Ty) , "::new(-1)?;" ) ]
584
584
#[ doc = concat!( "let min = " , stringify!( $Ty) , "::new(" ,
@@ -591,7 +591,7 @@ macro_rules! nonzero_signed_operations {
591
591
/// assert_eq!(min, min.wrapping_abs());
592
592
/// # // FIXME: add once Neg is implemented?
593
593
/// # // assert_eq!(max, (-max).wrapping_abs());
594
- /// # Ok (())
594
+ /// # Some (())
595
595
/// # }
596
596
/// ```
597
597
#[ unstable( feature = "nonzero_ops" , issue = "84186" ) ]
@@ -608,11 +608,11 @@ macro_rules! nonzero_signed_operations {
608
608
///
609
609
/// ```
610
610
/// #![feature(nonzero_ops)]
611
- /// # #![feature(try_trait)]
612
611
#[ doc = concat!( "# use std::num::" , stringify!( $Ty) , ";" ) ]
613
612
#[ doc = concat!( "# use std::num::" , stringify!( $Uty) , ";" ) ]
614
613
///
615
- /// # fn main() -> Result<(), std::option::NoneError> {
614
+ /// # fn main() { test().unwrap(); }
615
+ /// # fn test() -> Option<()> {
616
616
#[ doc = concat!( "let u_pos = " , stringify!( $Uty) , "::new(1)?;" ) ]
617
617
#[ doc = concat!( "let i_pos = " , stringify!( $Ty) , "::new(1)?;" ) ]
618
618
#[ doc = concat!( "let i_neg = " , stringify!( $Ty) , "::new(-1)?;" ) ]
@@ -624,7 +624,7 @@ macro_rules! nonzero_signed_operations {
624
624
/// assert_eq!(u_pos, i_pos.unsigned_abs());
625
625
/// assert_eq!(u_pos, i_neg.unsigned_abs());
626
626
/// assert_eq!(u_max, i_min.unsigned_abs());
627
- /// # Ok (())
627
+ /// # Some (())
628
628
/// # }
629
629
/// ```
630
630
#[ unstable( feature = "nonzero_ops" , issue = "84186" ) ]
@@ -660,18 +660,18 @@ macro_rules! nonzero_unsigned_signed_operations {
660
660
///
661
661
/// ```
662
662
/// #![feature(nonzero_ops)]
663
- /// # #![feature(try_trait)]
664
663
#[ doc = concat!( "# use std::num::" , stringify!( $Ty) , ";" ) ]
665
664
///
666
- /// # fn main() -> Result<(), std::option::NoneError> {
665
+ /// # fn main() { test().unwrap(); }
666
+ /// # fn test() -> Option<()> {
667
667
#[ doc = concat!( "let two = " , stringify!( $Ty) , "::new(2)?;" ) ]
668
668
#[ doc = concat!( "let four = " , stringify!( $Ty) , "::new(4)?;" ) ]
669
669
#[ doc = concat!( "let max = " , stringify!( $Ty) , "::new(" ,
670
670
stringify!( $Int) , "::MAX)?;" ) ]
671
671
///
672
672
/// assert_eq!(Some(four), two.checked_mul(two));
673
673
/// assert_eq!(None, max.checked_mul(two));
674
- /// # Ok (())
674
+ /// # Some (())
675
675
/// # }
676
676
/// ```
677
677
#[ unstable( feature = "nonzero_ops" , issue = "84186" ) ]
@@ -694,18 +694,18 @@ macro_rules! nonzero_unsigned_signed_operations {
694
694
///
695
695
/// ```
696
696
/// #![feature(nonzero_ops)]
697
- /// # #![feature(try_trait)]
698
697
#[ doc = concat!( "# use std::num::" , stringify!( $Ty) , ";" ) ]
699
698
///
700
- /// # fn main() -> Result<(), std::option::NoneError> {
699
+ /// # fn main() { test().unwrap(); }
700
+ /// # fn test() -> Option<()> {
701
701
#[ doc = concat!( "let two = " , stringify!( $Ty) , "::new(2)?;" ) ]
702
702
#[ doc = concat!( "let four = " , stringify!( $Ty) , "::new(4)?;" ) ]
703
703
#[ doc = concat!( "let max = " , stringify!( $Ty) , "::new(" ,
704
704
stringify!( $Int) , "::MAX)?;" ) ]
705
705
///
706
706
/// assert_eq!(four, two.saturating_mul(two));
707
707
/// assert_eq!(max, four.saturating_mul(max));
708
- /// # Ok (())
708
+ /// # Some (())
709
709
/// # }
710
710
/// ```
711
711
#[ unstable( feature = "nonzero_ops" , issue = "84186" ) ]
@@ -737,15 +737,15 @@ macro_rules! nonzero_unsigned_signed_operations {
737
737
///
738
738
/// ```
739
739
/// #![feature(nonzero_ops)]
740
- /// # #![feature(try_trait)]
741
740
#[ doc = concat!( "# use std::num::" , stringify!( $Ty) , ";" ) ]
742
741
///
743
- /// # fn main() -> Result<(), std::option::NoneError> {
742
+ /// # fn main() { test().unwrap(); }
743
+ /// # fn test() -> Option<()> {
744
744
#[ doc = concat!( "let two = " , stringify!( $Ty) , "::new(2)?;" ) ]
745
745
#[ doc = concat!( "let four = " , stringify!( $Ty) , "::new(4)?;" ) ]
746
746
///
747
747
/// assert_eq!(four, unsafe { two.unchecked_mul(two) });
748
- /// # Ok (())
748
+ /// # Some (())
749
749
/// # }
750
750
/// ```
751
751
#[ unstable( feature = "nonzero_ops" , issue = "84186" ) ]
@@ -763,18 +763,18 @@ macro_rules! nonzero_unsigned_signed_operations {
763
763
///
764
764
/// ```
765
765
/// #![feature(nonzero_ops)]
766
- /// # #![feature(try_trait)]
767
766
#[ doc = concat!( "# use std::num::" , stringify!( $Ty) , ";" ) ]
768
767
///
769
- /// # fn main() -> Result<(), std::option::NoneError> {
768
+ /// # fn main() { test().unwrap(); }
769
+ /// # fn test() -> Option<()> {
770
770
#[ doc = concat!( "let three = " , stringify!( $Ty) , "::new(3)?;" ) ]
771
771
#[ doc = concat!( "let twenty_seven = " , stringify!( $Ty) , "::new(27)?;" ) ]
772
772
#[ doc = concat!( "let half_max = " , stringify!( $Ty) , "::new(" ,
773
773
stringify!( $Int) , "::MAX / 2)?;" ) ]
774
774
///
775
775
/// assert_eq!(Some(twenty_seven), three.checked_pow(3));
776
776
/// assert_eq!(None, half_max.checked_pow(3));
777
- /// # Ok (())
777
+ /// # Some (())
778
778
/// # }
779
779
/// ```
780
780
#[ unstable( feature = "nonzero_ops" , issue = "84186" ) ]
@@ -805,18 +805,18 @@ macro_rules! nonzero_unsigned_signed_operations {
805
805
///
806
806
/// ```
807
807
/// #![feature(nonzero_ops)]
808
- /// # #![feature(try_trait)]
809
808
#[ doc = concat!( "# use std::num::" , stringify!( $Ty) , ";" ) ]
810
809
///
811
- /// # fn main() -> Result<(), std::option::NoneError> {
810
+ /// # fn main() { test().unwrap(); }
811
+ /// # fn test() -> Option<()> {
812
812
#[ doc = concat!( "let three = " , stringify!( $Ty) , "::new(3)?;" ) ]
813
813
#[ doc = concat!( "let twenty_seven = " , stringify!( $Ty) , "::new(27)?;" ) ]
814
814
#[ doc = concat!( "let max = " , stringify!( $Ty) , "::new(" ,
815
815
stringify!( $Int) , "::MAX)?;" ) ]
816
816
///
817
817
/// assert_eq!(twenty_seven, three.saturating_pow(3));
818
818
/// assert_eq!(max, max.saturating_pow(3));
819
- /// # Ok (())
819
+ /// # Some (())
820
820
/// # }
821
821
/// ```
822
822
#[ unstable( feature = "nonzero_ops" , issue = "84186" ) ]
0 commit comments