Skip to content

Implement additional split_inclusive variants for slices - #91546

Closed
Jules-Bertholet wants to merge 10 commits into
rust-lang:masterfrom
Jules-Bertholet:rsplit_inclusive
Closed

Implement additional split_inclusive variants for slices#91546
Jules-Bertholet wants to merge 10 commits into
rust-lang:masterfrom
Jules-Bertholet:rsplit_inclusive

Conversation

@Jules-Bertholet

@Jules-BertholetJules-Bertholet commented Dec 5, 2021

Copy link
Copy Markdown
Contributor

Implements additional variants of the split iterator methods for strings and slices.

Methods implemented:

  • slice::{r}split{n}{left}_inclusive{_mut}(), str::{r}split{n}{left}_inclusive(), and str::split_once{_left}_inclusive: The inclusive variants include the separator at the end of the returned elements, while the left_inclusive variants include it at the beginning.
  • str::{r}split_initiator, and str::{r}split_ends: Variants of split_terminator that skip empty subslices at the beginning of the string, and at both ends of the string respectively.

In addition, this PR implements Clone when appropriate for the splitn iterators, and changes the return value of size_hint in a few cases.

Unresolved questions

This adds a lot of new methods because of all the possible permutations. The implementations are unified via macros, but it's a lot of choices to sort through in the documentation. Maybe some variants should be omitted, or a more generic interface should be provided?

One possibility to limit the combinatorial explosion, which I'm currently implementing, is to not have the additional "n" variant methods be defined directly on str/slice, but on their base iterator.


Interacts with #77998 (I haven't yet implemented as_str for all the new iterators)

@rust-highfive

Copy link
Copy Markdown
Contributor

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @scottmcm (or someone else) soon.

Please see the contribution instructions for more information.

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 5, 2021
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@Jules-BertholetJules-Bertholet changed the title Implement rsplit_inclusive for slicesImplement additional split_inclusive variants for slicesDec 5, 2021
@Jules-Bertholet
Jules-Bertholetforce-pushed the rsplit_inclusive branch 3 times, most recently from 0d3a25c to f28ed5cCompareDecember 11, 2021 08:33
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@Jules-Bertholet
Jules-Bertholet marked this pull request as ready for review December 23, 2021 04:15
@Jules-Bertholet

Copy link
Copy Markdown
ContributorAuthor

@scottmcm This is complete and ready for review!

@bors

bors commented Jan 4, 2022

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #92556) made this pull request unmergeable. Please resolve the merge conflicts.

@scottmcm

Copy link
Copy Markdown
Member

(Sorry for not responding over winter break)

Hmm, have you had any libs team feedback on all these? This is a great many new iterator types, for example, as you mentioned.

If not, maybe start a zulip thread to collect some thoughts?

@scottmcmscottmcm added the T-libs-api [DEPRECATED; DO NOT USE] label Jan 11, 2022
@Jules-Bertholet

Copy link
Copy Markdown
ContributorAuthor

@scottmcm The final form of this PR is a lot more extensive than I initially intended; I set out to add a single "obviously" missing iterator, but then realized there were many other "obvious" additions to be made. I'll make a thread on Zulip

@Jules-Bertholet
Jules-Bertholetforce-pushed the rsplit_inclusive branch 2 times, most recently from 0c842c6 to 663ae21CompareJanuary 15, 2022 21:29
@bors

bors commented Jan 16, 2022

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #92598) made this pull request unmergeable. Please resolve the merge conflicts.

@rust-log-analyzer

This comment has been minimized.

@bors

bors commented Mar 26, 2022

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #95274) made this pull request unmergeable. Please resolve the merge conflicts.

@JohnCSimon

Copy link
Copy Markdown

ping from triage:
@Jules-Bertholet - can you please post the status of this PR?

FYI: when a PR is ready for review, send a message containing
@rustbot ready to switch to S-waiting-on-review so the PR is in the reviewer's backlog.

@Jules-Bertholet

Jules-Bertholet commented Apr 23, 2022

Copy link
Copy Markdown
ContributorAuthor

This PR isn't ready as is, I need to integrate some libs team comments.

@Jules-Bertholet
Jules-Bertholet marked this pull request as draft April 23, 2022 11:59
@Dylan-DPC

Copy link
Copy Markdown
Member

@Jules-Bertholet any updates on this

@Jules-Bertholet

Copy link
Copy Markdown
ContributorAuthor

@Dylan-DPC Not at present. I'm planning to make an API change proposal before continuing to work on the implementation, that should be ready soon

@rustbot

Copy link
Copy Markdown
Collaborator

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job x86_64-gnu-llvm-12 failed! Check out the build log: (web)(plain)

Click to see the possible cause of the failure (guessed by this bot)
 --> library/core/src/slice/iter/macros.rs:823:13
|
751 | / macro_rules! iter_n {
752 | | (
753 | | #[$stability:meta]
754 | | #[fused($fused_stability:meta)]
... |
823 | | pub fn max_items(self, n: usize) -> $iter_n<'a, T, P> {
... |
827 | | };
828 | | }
| |_- in this expansion of `iter_n!`
| |_- in this expansion of `iter_n!`
|
::: library/core/src/slice/iter.rs:726:1
|
726 | / iter_n! {
727 | | #[stable(feature = "rust1", since = "1.0.0")]
728 | | #[fused(stable(feature = "fused", since = "1.26.0"))]
729 | | #[must_use = "iterators are lazy and do nothing unless consumed"]
747 | | fn max_items;
748 | | }
| |_- in this macro invocation
|
|
= note: `-D missing-docs` implied by `-D warnings`
error: missing documentation for an associated function
--> library/core/src/slice/iter/macros.rs:823:13
|
751 | / macro_rules! iter_n {
751 | / macro_rules! iter_n {
752 | | (
753 | | #[$stability:meta]
754 | | #[fused($fused_stability:meta)]
... |
823 | | pub fn max_items(self, n: usize) -> $iter_n<'a, T, P> {
... |
827 | | };
828 | | }
| |__- in this expansion of `iter_n!`
| |__- in this expansion of `iter_n!`
|
::: library/core/src/slice/iter.rs:750:1
|
750 | / iter_n! {
751 | | #[stable(feature = "rust1", since = "1.0.0")]
752 | | #[fused(stable(feature = "fused", since = "1.26.0"))]
753 | | #[must_use = "iterators are lazy and do nothing unless consumed"]
772 | | fn max_items;
773 | | }
| |_- in this macro invocation
error: missing documentation for an associated function
--> library/core/src/slice/iter/macros.rs:823:13
|
751 | / macro_rules! iter_n {
752 | | (
753 | | #[$stability:meta]
754 | | #[fused($fused_stability:meta)]
... |
823 | | pub fn max_items(self, n: usize) -> $iter_n<'a, T, P> {
... |
827 | | };
828 | | }
| |_- in this expansion of `iter_n!`
| |_- in this expansion of `iter_n!`
|
::: library/core/src/slice/iter.rs:775:1
|
775 | / iter_n! {
776 | | #[stable(feature = "rust1", since = "1.0.0")]
777 | | #[fused(stable(feature = "fused", since = "1.26.0"))]
778 | | #[must_use = "iterators are lazy and do nothing unless consumed"]
796 | | fn max_items;
797 | | }
| |__- in this macro invocation
error: missing documentation for an associated function
--> library/core/src/slice/iter/macros.rs:823:13
|
751 | / macro_rules! iter_n {
752 | | (
753 | | #[$stability:meta]
754 | | #[fused($fused_stability:meta)]
... |
823 | | pub fn max_items(self, n: usize) -> $iter_n<'a, T, P> {
... |
827 | | };
828 | | }
| |_- in this expansion of `iter_n!`
| |_- in this expansion of `iter_n!`
|
::: library/core/src/slice/iter.rs:799:1
|
799 | / iter_n! {
800 | | #[stable(feature = "rust1", since = "1.0.0")]
801 | | #[fused(stable(feature = "fused", since = "1.26.0"))]
802 | | #[must_use = "iterators are lazy and do nothing unless consumed"]
821 | | fn max_items;
822 | | }
| |__- in this macro invocation
error: missing documentation for an associated function
--> library/core/src/slice/iter/macros.rs:823:13
|
751 | / macro_rules! iter_n {
752 | | (
753 | | #[$stability:meta]
754 | | #[fused($fused_stability:meta)]
... |
823 | | pub fn max_items(self, n: usize) -> $iter_n<'a, T, P> {
... |
827 | | };
828 | | }
| |_- in this expansion of `iter_n!`
| |_- in this expansion of `iter_n!`
|
::: library/core/src/slice/iter.rs:824:1
|
824 | / iter_n! {
825 | | #[unstable(feature = "split_inclusive_variants", issue = "none")]
826 | | #[fused(unstable(feature = "split_inclusive_variants", issue = "none"))]
827 | | #[must_use = "iterators are lazy and do nothing unless consumed"]
848 | | fn max_items;
849 | | }
| |__- in this macro invocation
error: missing documentation for an associated function
--> library/core/src/slice/iter/macros.rs:823:13
|
751 | / macro_rules! iter_n {
752 | | (
753 | | #[$stability:meta]
754 | | #[fused($fused_stability:meta)]
... |
823 | | pub fn max_items(self, n: usize) -> $iter_n<'a, T, P> {
... |
827 | | };
828 | | }
| |_- in this expansion of `iter_n!`
| |_- in this expansion of `iter_n!`
|
::: library/core/src/slice/iter.rs:851:1
|
851 | / iter_n! {
852 | | #[unstable(feature = "split_inclusive_variants", issue = "none")]
853 | | #[fused(unstable(feature = "split_inclusive_variants", issue = "none"))]
854 | | #[must_use = "iterators are lazy and do nothing unless consumed"]
875 | | fn max_items;
876 | | }
| |_- in this macro invocation
error: missing documentation for an associated function
--> library/core/src/slice/iter/macros.rs:823:13
|
751 | / macro_rules! iter_n {
752 | | (
753 | | #[$stability:meta]
754 | | #[fused($fused_stability:meta)]
... |
823 | | pub fn max_items(self, n: usize) -> $iter_n<'a, T, P> {
... |
827 | | };
828 | | }
| |_- in this expansion of `iter_n!`
| |_- in this expansion of `iter_n!`
|
::: library/core/src/slice/iter.rs:878:1
|
878 | / iter_n! {
879 | | #[unstable(feature = "split_inclusive_variants", issue = "none")]
880 | | #[fused(unstable(feature = "split_inclusive_variants", issue = "none"))]
881 | | #[must_use = "iterators are lazy and do nothing unless consumed"]
902 | | fn max_items;
903 | | }
| |_- in this macro invocation
error: missing documentation for an associated function
--> library/core/src/slice/iter/macros.rs:823:13
|
751 | / macro_rules! iter_n {
752 | | (
753 | | #[$stability:meta]
754 | | #[fused($fused_stability:meta)]
... |
823 | | pub fn max_items(self, n: usize) -> $iter_n<'a, T, P> {
... |
827 | | };
828 | | }
| |_- in this expansion of `iter_n!`
| |_- in this expansion of `iter_n!`
|
::: library/core/src/slice/iter.rs:905:1
|
905 | / iter_n! {
906 | | #[unstable(feature = "split_inclusive_variants", issue = "none")]
907 | | #[fused(unstable(feature = "split_inclusive_variants", issue = "none"))]
908 | | #[must_use = "iterators are lazy and do nothing unless consumed"]
929 | | fn max_items;
930 | | }
| |_- in this macro invocation
error: missing documentation for an associated function
--> library/core/src/slice/iter/macros.rs:823:13
|
751 | / macro_rules! iter_n {
752 | | (
753 | | #[$stability:meta]
754 | | #[fused($fused_stability:meta)]
... |
823 | | pub fn max_items(self, n: usize) -> $iter_n<'a, T, P> {
... |
827 | | };
828 | | }
| |_- in this expansion of `iter_n!`
| |_- in this expansion of `iter_n!`
|
::: library/core/src/slice/iter.rs:932:1
|
932 | / iter_n! {
933 | | #[unstable(feature = "split_inclusive_variants", issue = "none")]
934 | | #[fused(unstable(feature = "split_inclusive_variants", issue = "none"))]
935 | | #[must_use = "iterators are lazy and do nothing unless consumed"]
956 | | fn max_items;
957 | | }
| |_- in this macro invocation
error: missing documentation for an associated function
--> library/core/src/slice/iter/macros.rs:823:13
|
751 | / macro_rules! iter_n {
752 | | (
753 | | #[$stability:meta]
754 | | #[fused($fused_stability:meta)]
... |
823 | | pub fn max_items(self, n: usize) -> $iter_n<'a, T, P> {
... |
827 | | };
828 | | }
| |_- in this expansion of `iter_n!`
| |_- in this expansion of `iter_n!`
|
::: library/core/src/slice/iter.rs:959:1
|
959 | / iter_n! {
960 | | #[unstable(feature = "split_inclusive_variants", issue = "none")]
961 | | #[fused(unstable(feature = "split_inclusive_variants", issue = "none"))]
962 | | #[must_use = "iterators are lazy and do nothing unless consumed"]
983 | | fn max_items;
984 | | }
| |_- in this macro invocation
error: missing documentation for an associated function
--> library/core/src/slice/iter/macros.rs:823:13
|
751 | / macro_rules! iter_n {
752 | | (
753 | | #[$stability:meta]
754 | | #[fused($fused_stability:meta)]
... |
823 | | pub fn max_items(self, n: usize) -> $iter_n<'a, T, P> {
... |
827 | | };
828 | | }
| |_- in this expansion of `iter_n!`
| |_- in this expansion of `iter_n!`
|
::: library/core/src/slice/iter.rs:986:1
|
986 | / iter_n! {
987 | | #[unstable(feature = "split_inclusive_variants", issue = "none")]
988 | | #[fused(unstable(feature = "split_inclusive_variants", issue = "none"))]
989 | | #[must_use = "iterators are lazy and do nothing unless consumed"]
1010 | | fn max_items;
1011 | | }
| |_- in this macro invocation
error: missing documentation for an associated function
--> library/core/src/slice/iter/macros.rs:823:13
|
751 | / macro_rules! iter_n {
752 | | (
753 | | #[$stability:meta]
754 | | #[fused($fused_stability:meta)]
... |
823 | | pub fn max_items(self, n: usize) -> $iter_n<'a, T, P> {
... |
827 | | };
828 | | }
| |_- in this expansion of `iter_n!`
| |_- in this expansion of `iter_n!`
|
::: library/core/src/slice/iter.rs:1013:1
|
1013 | / iter_n! {
1014 | | #[unstable(feature = "split_inclusive_variants", issue = "none")]
1015 | | #[fused(unstable(feature = "split_inclusive_variants", issue = "none"))]
1016 | | #[must_use = "iterators are lazy and do nothing unless consumed"]
1037 | | fn max_items;
1038 | | }
| |_- in this macro invocation
error: missing documentation for an associated function
--> library/core/src/str/iter.rs:849:13
|
771 | / macro_rules! generate_n_iterators {
772 | | (
773 | | forward:
774 | | #[$forward_stability_attribute:meta]
... |
849 | | pub fn as_str(&self) -> &'a str {
... |
949 | | }
950 | | }
950 | | }
| |_- in this expansion of `generate_n_iterators!`
...
1013 | / generate_n_iterators! {
1014 | | forward:
1015 | | #[stable(feature = "rust1", since = "1.0.0")]
1016 | | #[fused(stable(feature = "fused", since = "1.26.0"))]
1040 | | fn as_str;
1041 | | }
| |_- in this macro invocation
error: missing documentation for an associated function
--> library/core/src/str/iter.rs:857:13
|
771 | / macro_rules! generate_n_iterators {
772 | | (
773 | | forward:
774 | | #[$forward_stability_attribute:meta]
... |
857 | | pub fn max_items(self, n: usize) -> $forward_n_iterator<'a, P> {
... |
949 | | }
950 | | }
950 | | }
| |_- in this expansion of `generate_n_iterators!`
...
1013 | / generate_n_iterators! {
1014 | | forward:
1015 | | #[stable(feature = "rust1", since = "1.0.0")]
1016 | | #[fused(stable(feature = "fused", since = "1.26.0"))]
1040 | | fn as_str;
1041 | | }
| |_- in this macro invocation
error: missing documentation for an associated function
--> library/core/src/str/iter.rs:927:13
|
771 | / macro_rules! generate_n_iterators {
772 | | (
773 | | forward:
774 | | #[$forward_stability_attribute:meta]
... |
927 | | pub fn as_str(&self) -> &'a str {
... |
949 | | }
950 | | }
950 | | }
| |_- in this expansion of `generate_n_iterators!`
...
1013 | / generate_n_iterators! {
1014 | | forward:
1015 | | #[stable(feature = "rust1", since = "1.0.0")]
1016 | | #[fused(stable(feature = "fused", since = "1.26.0"))]
1040 | | fn as_str;
1041 | | }
| |_- in this macro invocation
error: missing documentation for an associated function
--> library/core/src/str/iter.rs:939:13
|
771 | / macro_rules! generate_n_iterators {
772 | | (
773 | | forward:
774 | | #[$forward_stability_attribute:meta]
... |
939 | | pub fn max_items(self, n: usize) -> $reverse_n_iterator<'a, P> {
... |
949 | | }
950 | | }
950 | | }
| |_- in this expansion of `generate_n_iterators!`
...
1013 | / generate_n_iterators! {
1014 | | forward:
1015 | | #[stable(feature = "rust1", since = "1.0.0")]
1016 | | #[fused(stable(feature = "fused", since = "1.26.0"))]
1040 | | fn as_str;
1041 | | }
| |_- in this macro invocation
---
423 | | {
424 | | // Forward iterator
425 | | forward:
... |
533 | | pub fn as_str(&self) -> &'a str {
... |
589 | | } => {}
590 | | }
| |_- in this expansion of `generate_pattern_iterators!`
| |_- in this expansion of `generate_pattern_iterators!`
...
1051 | / generate_pattern_iterators! {
1052 | | forward:
1053 | | #[stable(feature = "split_inclusive", since = "1.51.0")]
1054 | | #[fused(stable(feature = "split_inclusive", since = "1.51.0"))]
1089 | | delegate double ended;
1090 | | }
| |_- in this macro invocation
error: missing documentation for an associated function
--> library/core/src/str/iter.rs:849:13
|
771 | / macro_rules! generate_n_iterators {
772 | | (
773 | | forward:
774 | | #[$forward_stability_attribute:meta]
... |
849 | | pub fn as_str(&self) -> &'a str {
... |
949 | | }
950 | | }
950 | | }
| |_- in this expansion of `generate_n_iterators!`
...
1092 | / generate_n_iterators! {
1093 | | forward:
1094 | | #[unstable(feature = "split_inclusive_variants", issue = "none")]
1095 | | #[fused(unstable(feature = "split_inclusive_variants", issue = "none"))]
1119 | | fn as_str;
1120 | | }
| |_- in this macro invocation
error: missing documentation for an associated function
--> library/core/src/str/iter.rs:857:13
|
771 | / macro_rules! generate_n_iterators {
772 | | (
773 | | forward:
774 | | #[$forward_stability_attribute:meta]
... |
857 | | pub fn max_items(self, n: usize) -> $forward_n_iterator<'a, P> {
... |
949 | | }
950 | | }
950 | | }
| |_- in this expansion of `generate_n_iterators!`
...
1092 | / generate_n_iterators! {
1093 | | forward:
1094 | | #[unstable(feature = "split_inclusive_variants", issue = "none")]
1095 | | #[fused(unstable(feature = "split_inclusive_variants", issue = "none"))]
1119 | | fn as_str;
1120 | | }
| |_- in this macro invocation
error: missing documentation for an associated function
--> library/core/src/str/iter.rs:927:13
|
771 | / macro_rules! generate_n_iterators {
772 | | (
773 | | forward:
774 | | #[$forward_stability_attribute:meta]
... |
927 | | pub fn as_str(&self) -> &'a str {
... |
949 | | }
950 | | }
950 | | }
| |_- in this expansion of `generate_n_iterators!`
...
1092 | / generate_n_iterators! {
1093 | | forward:
1094 | | #[unstable(feature = "split_inclusive_variants", issue = "none")]
1095 | | #[fused(unstable(feature = "split_inclusive_variants", issue = "none"))]
1119 | | fn as_str;
1120 | | }
| |_- in this macro invocation
error: missing documentation for an associated function
--> library/core/src/str/iter.rs:939:13
|
771 | / macro_rules! generate_n_iterators {
772 | | (
773 | | forward:
774 | | #[$forward_stability_attribute:meta]
... |
939 | | pub fn max_items(self, n: usize) -> $reverse_n_iterator<'a, P> {
... |
949 | | }
950 | | }
950 | | }
| |_- in this expansion of `generate_n_iterators!`
...
1092 | / generate_n_iterators! {
1093 | | forward:
1094 | | #[unstable(feature = "split_inclusive_variants", issue = "none")]
1095 | | #[fused(unstable(feature = "split_inclusive_variants", issue = "none"))]
1119 | | fn as_str;
1120 | | }
| |_- in this macro invocation
---
423 | | {
424 | | // Forward iterator
425 | | forward:
... |
533 | | pub fn as_str(&self) -> &'a str {
... |
589 | | } => {}
590 | | }
| |_- in this expansion of `generate_pattern_iterators!`
| |_- in this expansion of `generate_pattern_iterators!`
...
1130 | / generate_pattern_iterators! {
1131 | | forward:
1132 | | #[unstable(feature = "split_inclusive_variants", issue = "none")]
1133 | | #[fused(unstable(feature = "split_inclusive_variants", issue = "none"))]
1169 | | delegate double ended;
1170 | | }
| |_- in this macro invocation
error: missing documentation for an associated function
--> library/core/src/str/iter.rs:849:13
|
771 | / macro_rules! generate_n_iterators {
772 | | (
773 | | forward:
774 | | #[$forward_stability_attribute:meta]
... |
849 | | pub fn as_str(&self) -> &'a str {
... |
949 | | }
950 | | }
950 | | }
| |_- in this expansion of `generate_n_iterators!`
...
1172 | / generate_n_iterators! {
1173 | | forward:
1174 | | #[unstable(feature = "split_inclusive_variants", issue = "none")]
1175 | | #[fused(unstable(feature = "split_inclusive_variants", issue = "none"))]
1199 | | fn as_str;
1200 | | }
| |_- in this macro invocation
error: missing documentation for an associated function
--> library/core/src/str/iter.rs:857:13
|
771 | / macro_rules! generate_n_iterators {
772 | | (
773 | | forward:
774 | | #[$forward_stability_attribute:meta]
... |
857 | | pub fn max_items(self, n: usize) -> $forward_n_iterator<'a, P> {
... |
949 | | }
950 | | }
950 | | }
| |_- in this expansion of `generate_n_iterators!`
...
1172 | / generate_n_iterators! {
1173 | | forward:
1174 | | #[unstable(feature = "split_inclusive_variants", issue = "none")]
1175 | | #[fused(unstable(feature = "split_inclusive_variants", issue = "none"))]
1199 | | fn as_str;
1200 | | }
| |_- in this macro invocation
error: missing documentation for an associated function
--> library/core/src/str/iter.rs:927:13
|
771 | / macro_rules! generate_n_iterators {
772 | | (
773 | | forward:
774 | | #[$forward_stability_attribute:meta]
... |
927 | | pub fn as_str(&self) -> &'a str {
... |
949 | | }
950 | | }
950 | | }
| |_- in this expansion of `generate_n_iterators!`
...
1172 | / generate_n_iterators! {
1173 | | forward:
1174 | | #[unstable(feature = "split_inclusive_variants", issue = "none")]
1175 | | #[fused(unstable(feature = "split_inclusive_variants", issue = "none"))]
1199 | | fn as_str;
1200 | | }
| |_- in this macro invocation
error: missing documentation for an associated function
--> library/core/src/str/iter.rs:939:13
|
771 | / macro_rules! generate_n_iterators {
772 | | (
773 | | forward:
774 | | #[$forward_stability_attribute:meta]
... |
939 | | pub fn max_items(self, n: usize) -> $reverse_n_iterator<'a, P> {
... |
949 | | }
950 | | }
950 | | }
| |_- in this expansion of `generate_n_iterators!`
...
1172 | / generate_n_iterators! {
1173 | | forward:
1174 | | #[unstable(feature = "split_inclusive_variants", issue = "none")]
1175 | | #[fused(unstable(feature = "split_inclusive_variants", issue = "none"))]
1199 | | fn as_str;
1200 | | }
| |_- in this macro invocation
---
423 | | {
424 | | // Forward iterator
425 | | forward:
... |
484 | | pub fn as_str(&self) -> &'a str {
... |
589 | | } => {}
590 | | }
| |_- in this expansion of `generate_pattern_iterators!`
| |_- in this expansion of `generate_pattern_iterators!`
...
1210 | / generate_pattern_iterators! {
1211 | | forward:
1212 | | #[unstable(feature = "split_inclusive_variants", issue = "none")]
1213 | | #[fused(unstable(feature = "split_inclusive_variants", issue = "none"))]
1235 | | delegate double ended;
1236 | | }
| |_- in this macro invocation
---
423 | | {
424 | | // Forward iterator
425 | | forward:
... |
533 | | pub fn as_str(&self) -> &'a str {
... |
589 | | } => {}
590 | | }
| |_- in this expansion of `generate_pattern_iterators!`
| |_- in this expansion of `generate_pattern_iterators!`
...
1210 | / generate_pattern_iterators! {
1211 | | forward:
1212 | | #[unstable(feature = "split_inclusive_variants", issue = "none")]
1213 | | #[fused(unstable(feature = "split_inclusive_variants", issue = "none"))]
1235 | | delegate double ended;
1236 | | }
| |_- in this macro invocation
error: missing documentation for an associated function
--> library/core/src/str/iter.rs:857:13
|
771 | / macro_rules! generate_n_iterators {
772 | | (
773 | | forward:
774 | | #[$forward_stability_attribute:meta]
... |
857 | | pub fn max_items(self, n: usize) -> $forward_n_iterator<'a, P> {
... |
949 | | }
950 | | }
950 | | }
| |_- in this expansion of `generate_n_iterators!`
...
1238 | / generate_n_iterators! {
1239 | | forward:
1240 | | #[unstable(feature = "split_inclusive_variants", issue = "none")]
1241 | | #[fused(unstable(feature = "split_inclusive_variants", issue = "none"))]
1259 | | fn as_str;
1260 | | }
| |_- in this macro invocation
error: missing documentation for an associated function
--> library/core/src/str/iter.rs:939:13
|
771 | / macro_rules! generate_n_iterators {
772 | | (
773 | | forward:
774 | | #[$forward_stability_attribute:meta]
... |
939 | | pub fn max_items(self, n: usize) -> $reverse_n_iterator<'a, P> {
... |
949 | | }
950 | | }
950 | | }
| |_- in this expansion of `generate_n_iterators!`
...
1238 | / generate_n_iterators! {
1239 | | forward:
1240 | | #[unstable(feature = "split_inclusive_variants", issue = "none")]
1241 | | #[fused(unstable(feature = "split_inclusive_variants", issue = "none"))]
1259 | | fn as_str;
1260 | | }
| |_- in this macro invocation
error: missing documentation for an associated function
--> library/core/src/str/iter.rs:857:13
|
771 | / macro_rules! generate_n_iterators {
772 | | (
773 | | forward:
774 | | #[$forward_stability_attribute:meta]
... |
857 | | pub fn max_items(self, n: usize) -> $forward_n_iterator<'a, P> {
... |
949 | | }
950 | | }
950 | | }
| |_- in this expansion of `generate_n_iterators!`
...
1324 | / generate_n_iterators! {
1325 | | forward:
1326 | | #[unstable(feature = "split_inclusive_variants", issue = "none")]
1327 | | #[fused(unstable(feature = "split_inclusive_variants", issue = "none"))]
1345 | | fn as_str;
1346 | | }
| |_- in this macro invocation
error: missing documentation for an associated function
--> library/core/src/str/iter.rs:939:13
|
771 | / macro_rules! generate_n_iterators {
772 | | (
773 | | forward:
774 | | #[$forward_stability_attribute:meta]
... |
939 | | pub fn max_items(self, n: usize) -> $reverse_n_iterator<'a, P> {
... |
949 | | }
950 | | }
950 | | }
| |_- in this expansion of `generate_n_iterators!`
...
1324 | / generate_n_iterators! {
1325 | | forward:
1326 | | #[unstable(feature = "split_inclusive_variants", issue = "none")]
1327 | | #[fused(unstable(feature = "split_inclusive_variants", issue = "none"))]
1345 | | fn as_str;
1346 | | }
| |_- in this macro invocation
---
423 | | {
424 | | // Forward iterator
425 | | forward:
... |
484 | | pub fn as_str(&self) -> &'a str {
... |
589 | | } => {}
590 | | }
| |_- in this expansion of `generate_pattern_iterators!`
| |_- in this expansion of `generate_pattern_iterators!`
...
1357 | / generate_pattern_iterators! {
1358 | | forward:
1359 | | #[unstable(feature = "split_inclusive_variants", issue = "none")]
1360 | | #[fused(unstable(feature = "split_inclusive_variants", issue = "none"))]
1382 | | delegate double ended;
1383 | | }
| |_- in this macro invocation
---
423 | | {
424 | | // Forward iterator
425 | | forward:
... |
533 | | pub fn as_str(&self) -> &'a str {
... |
589 | | } => {}
590 | | }
| |_- in this expansion of `generate_pattern_iterators!`
| |_- in this expansion of `generate_pattern_iterators!`
...
1357 | / generate_pattern_iterators! {
1358 | | forward:
1359 | | #[unstable(feature = "split_inclusive_variants", issue = "none")]
1360 | | #[fused(unstable(feature = "split_inclusive_variants", issue = "none"))]
1382 | | delegate double ended;
1383 | | }
| |_- in this macro invocation
error: missing documentation for an associated function
--> library/core/src/str/iter.rs:857:13
|
771 | / macro_rules! generate_n_iterators {
772 | | (
773 | | forward:
774 | | #[$forward_stability_attribute:meta]
... |
857 | | pub fn max_items(self, n: usize) -> $forward_n_iterator<'a, P> {
... |
949 | | }
950 | | }
950 | | }
| |_- in this expansion of `generate_n_iterators!`
...
1385 | / generate_n_iterators! {
1386 | | forward:
1387 | | #[unstable(feature = "split_inclusive_variants", issue = "none")]
1388 | | #[fused(unstable(feature = "split_inclusive_variants", issue = "none"))]
1406 | | fn as_str;
1407 | | }
| |_- in this macro invocation
error: missing documentation for an associated function
--> library/core/src/str/iter.rs:939:13
|
771 | / macro_rules! generate_n_iterators {
772 | | (
773 | | forward:
774 | | #[$forward_stability_attribute:meta]
... |
939 | | pub fn max_items(self, n: usize) -> $reverse_n_iterator<'a, P> {
... |
949 | | }
950 | | }
950 | | }
| |_- in this expansion of `generate_n_iterators!`
...
1385 | / generate_n_iterators! {
1386 | | forward:
1387 | | #[unstable(feature = "split_inclusive_variants", issue = "none")]
1388 | | #[fused(unstable(feature = "split_inclusive_variants", issue = "none"))]
1406 | | fn as_str;
1407 | | }
| |_- in this macro invocation

@bors

bors commented Jul 18, 2022

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #99223) made this pull request unmergeable. Please resolve the merge conflicts.

@pitaj

pitaj commented Jan 21, 2023

Copy link
Copy Markdown
Contributor

I've implemented an alternate API using combinators. It's available in the str_splitter crate. May be useful if you need something like rsplit_inclusive.

@Dylan-DPC

Copy link
Copy Markdown
Member

Closing this as it is a draft and is inactive for some time. Feel free to reöpen this or create a new pr if you want to continue with this. Thanks

@Dylan-DPCDylan-DPC added S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 6, 2023
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-inactiveStatus: Inactive and waiting on the author. This is often applied to closed PRs.T-libs-api[DEPRECATED; DO NOT USE]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants

@Jules-Bertholet@rust-highfive@rust-log-analyzer@bors@scottmcm@m-ou-se@JohnCSimon@Dylan-DPC@rustbot@pitaj