@@ -376,6 +376,7 @@ pub(super) trait SplitIter: DoubleEndedIterator {
376
376
377
377
split_iter ! {
378
378
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
379
+ #[ debug( stable( feature = "core_impl_debug" , since = "1.9.0" ) ) ]
379
380
#[ fused( stable( feature = "fused" , since = "1.26.0" ) ) ]
380
381
#[ must_use = "iterators are lazy and do nothing unless consumed" ]
381
382
/// An iterator over subslices separated by elements that match a predicate
@@ -393,12 +394,16 @@ split_iter! {
393
394
/// [`split`]: slice::split
394
395
/// [slices]: slice
395
396
struct Split <shared_ref: & ' a> {
396
- #[ stable( feature = "core_impl_debug" , since = "1.9.0" ) ]
397
- debug: "Split" ,
398
397
include_leading: false ,
399
398
include_trailing: false ,
400
399
}
400
+ }
401
401
402
+ impl < ' a , T , P > Split < ' a , T , P >
403
+ where
404
+ T : ' a ,
405
+ P : FnMut ( & T ) -> bool ,
406
+ {
402
407
/// Returns a slice which contains items not yet handled by split.
403
408
/// # Example
404
409
///
@@ -417,6 +422,7 @@ split_iter! {
417
422
418
423
split_iter ! {
419
424
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
425
+ #[ debug( stable( feature = "core_impl_debug" , since = "1.9.0" ) ) ]
420
426
#[ fused( stable( feature = "fused" , since = "1.26.0" ) ) ]
421
427
#[ must_use = "iterators are lazy and do nothing unless consumed" ]
422
428
/// An iterator over the mutable subslices of the vector which are separated
@@ -434,15 +440,14 @@ split_iter! {
434
440
/// [`split_mut`]: slice::split_mut
435
441
/// [slices]: slice
436
442
struct SplitMut <mut_ref: & ' a> {
437
- #[ stable( feature = "core_impl_debug" , since = "1.9.0" ) ]
438
- debug: "SplitMut" ,
439
443
include_leading: false ,
440
444
include_trailing: false ,
441
445
}
442
446
}
443
447
444
448
split_iter ! {
445
449
#[ stable( feature = "split_inclusive" , since = "1.51.0" ) ]
450
+ #[ debug( stable( feature = "core_impl_debug" , since = "1.9.0" ) ) ]
446
451
#[ fused( stable( feature = "split_inclusive" , since = "1.51.0" ) ) ]
447
452
#[ must_use = "iterators are lazy and do nothing unless consumed" ]
448
453
/// An iterator over subslices separated by elements that match a predicate
@@ -461,15 +466,14 @@ split_iter! {
461
466
/// [`split_inclusive`]: slice::split_inclusive
462
467
/// [slices]: slice
463
468
struct SplitInclusive <shared_ref: & ' a> {
464
- #[ stable( feature = "split_inclusive" , since = "1.51.0" ) ]
465
- debug: "SplitInclusive" ,
466
469
include_leading: false ,
467
470
include_trailing: true ,
468
471
}
469
472
}
470
473
471
474
split_iter ! {
472
475
#[ stable( feature = "split_inclusive" , since = "1.51.0" ) ]
476
+ #[ debug( stable( feature = "split_inclusive" , since = "1.51.0" ) ) ]
473
477
#[ fused( stable( feature = "split_inclusive" , since = "1.51.0" ) ) ]
474
478
#[ must_use = "iterators are lazy and do nothing unless consumed" ]
475
479
/// An iterator over the mutable subslices of the vector which are separated
@@ -488,15 +492,14 @@ split_iter! {
488
492
/// [`split_inclusive_mut`]: slice::split_inclusive_mut
489
493
/// [slices]: slice
490
494
struct SplitInclusiveMut <mut_ref: & ' a> {
491
- #[ stable( feature = "split_inclusive" , since = "1.51.0" ) ]
492
- debug: "SplitInclusiveMut" ,
493
495
include_leading: false ,
494
496
include_trailing: true ,
495
497
}
496
498
}
497
499
498
500
split_iter ! {
499
501
#[ unstable( feature = "split_inclusive_variants" , issue = "none" ) ]
502
+ #[ debug( stable( feature = "split_inclusive" , since = "1.51.0" ) ) ]
500
503
#[ fused( unstable( feature = "split_inclusive_variants" , issue = "none" ) ) ]
501
504
#[ must_use = "iterators are lazy and do nothing unless consumed" ]
502
505
/// An iterator over subslices separated by elements that match a predicate
@@ -517,15 +520,14 @@ split_iter! {
517
520
/// [`split_left_inclusive`]: slice::split_left_inclusive
518
521
/// [slices]: slice
519
522
struct SplitLeftInclusive <shared_ref: & ' a> {
520
- #[ unstable( feature = "split_inclusive_variants" , issue = "none" ) ]
521
- debug: "SplitLeftInclusive" ,
522
523
include_leading: true ,
523
524
include_trailing: false ,
524
525
}
525
526
}
526
527
527
528
split_iter ! {
528
529
#[ unstable( feature = "split_inclusive_variants" , issue = "none" ) ]
530
+ #[ debug( unstable( feature = "split_inclusive_variants" , issue = "none" ) ) ]
529
531
#[ fused( unstable( feature = "split_inclusive_variants" , issue = "none" ) ) ]
530
532
#[ must_use = "iterators are lazy and do nothing unless consumed" ]
531
533
/// An iterator over the mutable subslices of the vector which are separated
@@ -547,8 +549,6 @@ split_iter! {
547
549
/// [`split_left_inclusive_mut`]: slice::split_left_inclusive_mut
548
550
/// [slices]: slice
549
551
struct SplitLeftInclusiveMut <mut_ref: & ' a> {
550
- #[ unstable( feature = "split_inclusive_variants" , issue = "none" ) ]
551
- debug: "SplitLeftInclusiveMut" ,
552
552
include_leading: true ,
553
553
include_trailing: false ,
554
554
}
@@ -571,7 +571,7 @@ reverse_iter! {
571
571
///
572
572
/// [`rsplit`]: slice::rsplit
573
573
/// [slices]: slice
574
- pub struct RSplit { "RSplit" ; Split } : Clone
574
+ pub struct RSplit { inner : Split } : Clone
575
575
}
576
576
577
577
reverse_iter ! {
@@ -594,7 +594,7 @@ reverse_iter! {
594
594
///
595
595
/// [`rsplit_left_inclusive`]: slice::rsplit_inclusive
596
596
/// [slices]: slice
597
- pub struct RSplitInclusive { "RSplitInclusive" ; SplitInclusive } : Clone
597
+ pub struct RSplitInclusive { inner : SplitInclusive } : Clone
598
598
}
599
599
600
600
reverse_iter ! {
@@ -617,7 +617,7 @@ reverse_iter! {
617
617
///
618
618
/// [`rsplit_left_inclusive`]: slice::rsplit_left_inclusive
619
619
/// [slices]: slice
620
- pub struct RSplitLeftInclusive { "RSplitLeftInclusive" ; SplitLeftInclusive } : Clone
620
+ pub struct RSplitLeftInclusive { inner : SplitLeftInclusive } : Clone
621
621
}
622
622
623
623
reverse_iter ! {
@@ -637,7 +637,7 @@ reverse_iter! {
637
637
///
638
638
/// [`rsplit_mut`]: slice::rsplit_mut
639
639
/// [slices]: slice
640
- pub struct RSplitMut { "RSplitMut" ; SplitMut }
640
+ pub struct RSplitMut { inner : SplitMut }
641
641
}
642
642
643
643
reverse_iter ! {
@@ -660,7 +660,7 @@ reverse_iter! {
660
660
///
661
661
/// [`rsplit_inclusive_mut`]: slice::rsplit_inclusive_mut
662
662
/// [slices]: slice
663
- pub struct RSplitInclusiveMut { "RSplitInclusiveMut" ; SplitInclusiveMut }
663
+ pub struct RSplitInclusiveMut { inner : SplitInclusiveMut }
664
664
}
665
665
666
666
reverse_iter ! {
@@ -683,7 +683,7 @@ reverse_iter! {
683
683
///
684
684
/// [`rsplit_left_inclusive_mut`]: slice::rsplit_left_inclusive_mut
685
685
/// [slices]: slice
686
- pub struct RSplitLeftInclusiveMut { "RSplitLeftInclusiveMut" ; SplitLeftInclusiveMut }
686
+ pub struct RSplitLeftInclusiveMut { inner : SplitLeftInclusiveMut }
687
687
}
688
688
689
689
/// An private iterator over subslices separated by elements that
@@ -741,7 +741,10 @@ iter_n! {
741
741
///
742
742
/// [`splitn`]: slice::splitn
743
743
/// [slices]: slice
744
- pub struct SplitN { "SplitN" ; Split } : Clone
744
+ pub struct SplitN { inner: Split } : Clone
745
+
746
+ #[ unstable( feature = "split_inclusive_variants" , issue = "none" ) ]
747
+ fn max_items;
745
748
}
746
749
747
750
iter_n ! {
@@ -763,7 +766,10 @@ iter_n! {
763
766
///
764
767
/// [`rsplitn`]: slice::rsplitn
765
768
/// [slices]: slice
766
- pub struct RSplitN { "RSplitN" ; RSplit } : Clone
769
+ pub struct RSplitN { inner: RSplit } : Clone
770
+
771
+ #[ unstable( feature = "split_inclusive_variants" , issue = "none" ) ]
772
+ fn max_items;
767
773
}
768
774
769
775
iter_n ! {
@@ -784,7 +790,10 @@ iter_n! {
784
790
///
785
791
/// [`splitn_mut`]: slice::splitn_mut
786
792
/// [slices]: slice
787
- pub struct SplitNMut { "SplitNMut" ; SplitMut }
793
+ pub struct SplitNMut { inner: SplitMut }
794
+
795
+ #[ unstable( feature = "split_inclusive_variants" , issue = "none" ) ]
796
+ fn max_items;
788
797
}
789
798
790
799
iter_n ! {
@@ -806,7 +815,10 @@ iter_n! {
806
815
///
807
816
/// [`rsplitn_mut`]: slice::rsplitn_mut
808
817
/// [slices]: slice
809
- pub struct RSplitNMut { "RSplitNMut" ; RSplitMut }
818
+ pub struct RSplitNMut { inner: RSplitMut }
819
+
820
+ #[ unstable( feature = "split_inclusive_variants" , issue = "none" ) ]
821
+ fn max_items;
810
822
}
811
823
812
824
iter_n ! {
@@ -830,7 +842,10 @@ iter_n! {
830
842
///
831
843
/// [`splitn_inclusive`]: slice::splitn_inclusive
832
844
/// [slices]: slice
833
- pub struct SplitNInclusive { "SplitNInclusive" ; SplitInclusive } : Clone
845
+ pub struct SplitNInclusive { inner: SplitInclusive } : Clone
846
+
847
+ #[ unstable( feature = "split_inclusive_variants" , issue = "none" ) ]
848
+ fn max_items;
834
849
}
835
850
836
851
iter_n ! {
@@ -854,7 +869,10 @@ iter_n! {
854
869
///
855
870
/// [`splitn_left_inclusive`]: slice::splitn_left_inclusive
856
871
/// [slices]: slice
857
- pub struct SplitNLeftInclusive { "SplitNLeftInclusive" ; SplitLeftInclusive } : Clone
872
+ pub struct SplitNLeftInclusive { inner: SplitLeftInclusive } : Clone
873
+
874
+ #[ unstable( feature = "split_inclusive_variants" , issue = "none" ) ]
875
+ fn max_items;
858
876
}
859
877
860
878
iter_n ! {
@@ -878,7 +896,10 @@ iter_n! {
878
896
///
879
897
/// [`rsplitn_inclusive`]: slice::rsplitn_inclusive
880
898
/// [slices]: slice
881
- pub struct RSplitNInclusive { "RSplitNInclusive" ; RSplitInclusive } : Clone
899
+ pub struct RSplitNInclusive { inner: RSplitInclusive } : Clone
900
+
901
+ #[ unstable( feature = "split_inclusive_variants" , issue = "none" ) ]
902
+ fn max_items;
882
903
}
883
904
884
905
iter_n ! {
@@ -902,7 +923,10 @@ iter_n! {
902
923
///
903
924
/// [`rsplitn_left_inclusive`]: slice::rsplitn_left_inclusive
904
925
/// [slices]: slice
905
- pub struct RSplitNLeftInclusive { "RSplitNLeftInclusive" ; RSplitLeftInclusive } : Clone
926
+ pub struct RSplitNLeftInclusive { inner: RSplitLeftInclusive } : Clone
927
+
928
+ #[ unstable( feature = "split_inclusive_variants" , issue = "none" ) ]
929
+ fn max_items;
906
930
}
907
931
908
932
iter_n ! {
@@ -926,7 +950,10 @@ iter_n! {
926
950
///
927
951
/// [`splitn_inclusive_mut`]: slice::splitn_inclusive_mut
928
952
/// [slices]: slice
929
- pub struct SplitNInclusiveMut { "SplitNInclusiveMut" ; SplitInclusiveMut }
953
+ pub struct SplitNInclusiveMut { inner: SplitInclusiveMut }
954
+
955
+ #[ unstable( feature = "split_inclusive_variants" , issue = "none" ) ]
956
+ fn max_items;
930
957
}
931
958
932
959
iter_n ! {
@@ -950,7 +977,10 @@ iter_n! {
950
977
///
951
978
/// [`splitn_left_inclusive_mut`]: slice::splitn_left_inclusive_mut
952
979
/// [slices]: slice
953
- pub struct SplitNLeftInclusiveMut { "SplitNLeftInclusiveMut" ; SplitLeftInclusiveMut }
980
+ pub struct SplitNLeftInclusiveMut { inner: SplitLeftInclusiveMut }
981
+
982
+ #[ unstable( feature = "split_inclusive_variants" , issue = "none" ) ]
983
+ fn max_items;
954
984
}
955
985
956
986
iter_n ! {
@@ -974,7 +1004,10 @@ iter_n! {
974
1004
///
975
1005
/// [`rsplitn_inclusive_mut`]: slice::rsplitn_inclusive_mut
976
1006
/// [slices]: slice
977
- pub struct RSplitNInclusiveMut { "RSplitNInclusiveMut" ; RSplitInclusiveMut }
1007
+ pub struct RSplitNInclusiveMut { inner: RSplitInclusiveMut }
1008
+
1009
+ #[ unstable( feature = "split_inclusive_variants" , issue = "none" ) ]
1010
+ fn max_items;
978
1011
}
979
1012
980
1013
iter_n ! {
@@ -998,7 +1031,10 @@ iter_n! {
998
1031
///
999
1032
/// [`rsplitn_left_inclusive_mut`]: slice::rsplitn_left_inclusive_mut
1000
1033
/// [slices]: slice
1001
- pub struct RSplitNLeftInclusiveMut { "RSplitNLeftInclusiveMut" ; RSplitLeftInclusiveMut }
1034
+ pub struct RSplitNLeftInclusiveMut { inner: RSplitLeftInclusiveMut }
1035
+
1036
+ #[ unstable( feature = "split_inclusive_variants" , issue = "none" ) ]
1037
+ fn max_items;
1002
1038
}
1003
1039
1004
1040
/// An iterator over overlapping subslices of length `size`.
0 commit comments