Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement DoubleEndedSearcher for CharArray[Ref]Searcher #111922

Merged
merged 1 commit into from
Nov 17, 2023
Merged

feat: implement DoubleEndedSearcher for CharArray[Ref]Searcher #111922

merged 1 commit into from
Nov 17, 2023

Conversation

vaporoxx
Copy link
Contributor

This PR implements DoubleEndedSearcher for both CharArraySearcher and CharArrayRefSearcher. I'm not sure whether this was just overlooked or if there is a reason for it, but since it behaves exactly like CharSliceSearcher, I think the implementations should be appropriate.

@rustbot
Copy link
Collaborator

rustbot commented May 24, 2023

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. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels May 24, 2023
@scottmcm
Copy link
Member

I'm going to flip this to libs-api, on the assumption that this implies more stuff from Pattern on stable.

r? rust-lang/libs-api

@rustbot rustbot assigned joshtriplett and unassigned scottmcm May 24, 2023
@scottmcm scottmcm added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label May 24, 2023
@workingjubilee
Copy link
Member

This may be made more relevant by #100806

@workingjubilee workingjubilee added needs-fcp This change is insta-stable, so needs a completed FCP to proceed. and removed T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jul 31, 2023
@dtolnay dtolnay assigned dtolnay and unassigned joshtriplett Sep 17, 2023
@dtolnay
Copy link
Member

dtolnay commented Sep 17, 2023

@rust-lang/libs-api:
@rfcbot fcp merge

This PR makes iterators from split_inclusive([char; N]) and split_inclusive(&[char; N]) usable as a DoubleEndedIterator. The searcher when a slice is used as the pattern, split_inclusive(&[char]), already has the impl for this. All 3 of these iterators perform the same behavior so it makes no sense to have DoubleEndedIterator for some but not all.

fn main() {
    let mut iter = "x86_64-unknown-none".split_inclusive(['-', '_']);
    let _ = iter.next_back();
}

Be aware that the above code already compiles without this PR, but that is a bug. #100806

@rfcbot
Copy link

rfcbot commented Sep 17, 2023

Team member @dtolnay has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

@rfcbot rfcbot added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. labels Sep 17, 2023
@dtolnay dtolnay added S-waiting-on-fcp Status: PR is in FCP and is awaiting for FCP to complete. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 15, 2023
@rfcbot rfcbot added final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. and removed proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. labels Nov 7, 2023
@rfcbot
Copy link

rfcbot commented Nov 7, 2023

🔔 This is now entering its final comment period, as per the review above. 🔔

@rfcbot rfcbot added finished-final-comment-period The final comment period is finished for this PR / Issue. to-announce Announce this issue on triage meeting and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. labels Nov 17, 2023
@rfcbot
Copy link

rfcbot commented Nov 17, 2023

The final comment period, with a disposition to merge, as per the review above, is now complete.

As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

This will be merged soon.

Copy link
Member

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@dtolnay
Copy link
Member

dtolnay commented Nov 17, 2023

@bors r+

@bors
Copy link
Contributor

bors commented Nov 17, 2023

📌 Commit c6ed532 has been approved by dtolnay

It is now in the queue for this repository.

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Nov 17, 2023
@bors
Copy link
Contributor

bors commented Nov 17, 2023

⌛ Testing commit c6ed532 with merge f6dcaee...

@bors
Copy link
Contributor

bors commented Nov 17, 2023

☀️ Test successful - checks-actions
Approved by: dtolnay
Pushing f6dcaee to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 17, 2023
@bors bors merged commit f6dcaee into rust-lang:master Nov 17, 2023
1 check passed
@rustbot rustbot added this to the 1.76.0 milestone Nov 17, 2023
@vaporoxx vaporoxx deleted the feat-searcher branch November 17, 2023 21:39
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (f6dcaee): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
2.3% [0.5%, 4.1%] 4
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.4% [-0.4%, -0.4%] 1
Improvements ✅
(secondary)
-1.6% [-1.8%, -1.5%] 2
All ❌✅ (primary) 1.8% [-0.4%, 4.1%] 5

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.9% [0.9%, 0.9%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.9% [0.9%, 0.9%] 1

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 674.246s -> 675.186s (0.14%)
Artifact size: 313.61 MiB -> 313.59 MiB (-0.01%)

@dtolnay dtolnay added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Nov 22, 2023
@dtolnay
Copy link
Member

dtolnay commented Nov 22, 2023

Nominating for backport into 1.75.0 to put this into the same release as #100806. It would be needlessly annoying to break "...".split_inclusive([...]).rev() in one release and unbreak it in the next release, when we can just not break it.

@Amanieu Amanieu added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Nov 22, 2023
@cuviper cuviper mentioned this pull request Nov 27, 2023
@cuviper cuviper modified the milestones: 1.76.0, 1.75.0 Nov 27, 2023
@cuviper cuviper removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Nov 27, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 28, 2023
[beta] backports

- feat: implement `DoubleEndedSearcher` for `CharArray[Ref]Searcher` rust-lang#111922
- Update to LLVM 17.0.5 rust-lang#117907
- clarify `fn discriminant` guarantees: only free lifetimes may get erased rust-lang#118006

r? ghost
@apiraino apiraino removed the to-announce Announce this issue on triage meeting label Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. merged-by-bors This PR was explicitly merged by bors. needs-fcp This change is insta-stable, so needs a completed FCP to proceed. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. S-waiting-on-fcp Status: PR is in FCP and is awaiting for FCP to complete. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.