Skip to content

Tracking Issue for string_remove_matches #72826

Open

Description

@jcotton42

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.

Activity

  1. added
    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFC
    on May 31, 2020
  2. added
    B-unstableBlocker: Implemented in the nightly compiler and unstable.
    on May 31, 2020
  3. added
    A-strArea: `str` and `String`
    I-libs-radarLibs issues that are tracked on the team's radar.
    on Jul 29, 2020
  4. frewsxcv commented on Mar 5, 2021

    @frewsxcv
    Contributor

    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

  5. sciguy16 commented on Nov 7, 2022

    @sciguy16

    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.

  6. andylizi commented on Nov 7, 2022

    @andylizi
    Contributor

    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.

  7. allaboutevemirolive commented on Jul 26, 2023

    @allaboutevemirolive
    Contributor

    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.

  8. axeld-galadrim commented on Mar 18, 2024

    @axeld-galadrim

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

  9. added
    T-libsRelevant to the library team, which will review and decide on the PR/issue.
    and removed
    T-libs-api[DEPRECATED; DO NOT USE]
    on Aug 12, 2026
  10. removed
    I-libs-radarLibs issues that are tracked on the team's radar.
    on Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-strArea: `str` and `String`B-unstableBlocker: Implemented in the nightly compiler and unstable.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libsRelevant to the library team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions