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

Tracking Issue for string_remove_matches #72826

Open
2 tasks
jcotton42 opened this issue May 31, 2020 · 5 comments
Open
2 tasks

Tracking Issue for string_remove_matches #72826

jcotton42 opened this issue May 31, 2020 · 5 comments
Labels
A-str Area: str and String B-unstable Blocker: Implemented in the nightly compiler and unstable. C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC Libs-Tracked Libs issues that are tracked on the team's project board. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@jcotton42
Copy link
Contributor

jcotton42 commented May 31, 2020

This is a tracking issue for string_remove_matches implemented in #71780
The feature gate for the issue is #![feature(string_remove_matches)].

Implementation history

#50015 first attempt at this by @frewsxcv.

@jcotton42 jcotton42 added the C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC label May 31, 2020
@jonas-schievink jonas-schievink added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label May 31, 2020
@JohnTitor JohnTitor added the B-unstable Blocker: Implemented in the nightly compiler and unstable. label May 31, 2020
@KodrAus KodrAus added A-str Area: str and String Libs-Tracked Libs issues that are tracked on the team's project board. labels Jul 29, 2020
@frewsxcv
Copy link
Member

frewsxcv commented Mar 5, 2021

Can we add a note in the Issue description mentioning we should remove allocations from the current implementation? Not necessarily a blocker to stabilizing, mostly to document the discussion we had in #71780

@sciguy16
Copy link

sciguy16 commented Nov 7, 2022

Would it be possible to start an FCP for stabilising this feature? As long as we're happy with the public API, optimising the implementation to reduce/remove allocations can be done post-stabilisation.

@andylizi
Copy link
Contributor

andylizi commented Nov 7, 2022

Would it be possible to start an FCP for stabilising this feature? As long as we're happy with the public API

According to the discussion in #71780, the current API is considered too restrictive. Improving it would depend on redesigning the Pattern API, so this probably won't be stabilized anytime soon.

@allaboutevemirolive
Copy link
Contributor

allaboutevemirolive commented Jul 26, 2023

Hi, novice here. I have read the discussion in (#71780) and understand that the current API has memory allocation and they want to remove HRTB.

I'm curious: why not just design the current API to yield back strings that don't have the same pattern if we really don't want memory allocation, thus simplifying ownership and borrowing?

Edit:

After further analysis, I found that the current remove_matches API is challenging to stabilize since it uses another unstable function, as discussed in this discussion (#27721)

Another thing is that it is much easier to avoid memory allocation when manipulating &str compared to String, since String is a heap-allocated data structure. Thus, developing memory-efficient functions for different types is challenging.

I think we probably need to make a separate function to remove patterns from strings, especially for the String type where optimization is needed.

@axeld-galadrim
Copy link

The main PR has been merged a few months ago.
Is it planned to move this feature as not experimental anytime soon ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-str Area: str and String B-unstable Blocker: Implemented in the nightly compiler and unstable. C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC Libs-Tracked Libs issues that are tracked on the team's project board. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

9 participants