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 retain() method for HashMap (retain_hash_collection) #36648

Closed
navaati opened this issue Sep 22, 2016 · 16 comments
Closed

Tracking issue for retain() method for HashMap (retain_hash_collection) #36648

navaati opened this issue Sep 22, 2016 · 16 comments
Labels
B-unstable Blocker: Implemented in the nightly compiler and unstable. final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@navaati
Copy link

navaati commented Sep 22, 2016

The HashMap type does not have a retain method like the one in Vec.

@sfackler sfackler added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Sep 22, 2016
@Cobrand
Copy link
Contributor

Cobrand commented Sep 22, 2016

I wonder if that needs an RFC ? Pretty small change to std, but still a change to std

@nagisa
Copy link
Member

nagisa commented Sep 22, 2016

Small backward-compatible additions do not need an RFC unless they hit some sort of controversy.

frewsxcv added a commit to frewsxcv/rust that referenced this issue Feb 14, 2017
std: Add retain method for HashMap and HashSet

Fix rust-lang#36648

r? @bluss
frewsxcv added a commit to frewsxcv/rust that referenced this issue Feb 14, 2017
std: Add retain method for HashMap and HashSet

Fix rust-lang#36648

r? @bluss
frewsxcv added a commit to frewsxcv/rust that referenced this issue Feb 14, 2017
std: Add retain method for HashMap and HashSet

Fix rust-lang#36648

r? @bluss
frewsxcv added a commit to frewsxcv/rust that referenced this issue Feb 15, 2017
std: Add retain method for HashMap and HashSet

Fix rust-lang#36648

r? @bluss
bors added a commit that referenced this issue Feb 15, 2017
std: Add retain method for HashMap and HashSet

Fix #36648

r? @bluss
@mbrubeck
Copy link
Contributor

mbrubeck commented Mar 9, 2017

This was added in nightly as an unstable feature retain_hash_collection with a link to this issue. The issue should be re-opened for tracking stabilization. CC @rust-lang/libs

@mbrubeck mbrubeck reopened this Mar 9, 2017
@mbrubeck mbrubeck added the B-unstable Blocker: Implemented in the nightly compiler and unstable. label Mar 9, 2017
@jrmuizel
Copy link
Contributor

jrmuizel commented Mar 9, 2017

It would be nice if BTreeMap got retain() as well

@alexbool
Copy link
Contributor

What is holding stabilization now?

@sfackler
Copy link
Member

Nothing as far as I know!

@rfcbot fcp merge

@alexbool
Copy link
Contributor

Thanks for lightning quick answer @sfackler !

@rfcbot
Copy link

rfcbot commented Apr 14, 2017

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

No concerns currently listed.

Once these reviewers reach consensus, 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.

@bluss bluss changed the title Have a retain() method for HashMap Tracking issue for retain() method for HashMap (retain_hash_collection) Apr 15, 2017
@alexcrichton
Copy link
Member

alexcrichton commented Apr 16, 2017 via email

@rfcbot
Copy link

rfcbot commented Apr 25, 2017

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

@rfcbot rfcbot added the final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. label Apr 25, 2017
@Mark-Simulacrum
Copy link
Member

BTreeMap, as mentioned above doesn't appear to have this method. Should that be added before stabilization? Would that require a separate feature at this point?

@F001
Copy link
Contributor

F001 commented Apr 26, 2017

This feature retain_hash_collection is only for HashMap and HashSet. We should assign another name for the feature for BTreeMap and BTreeSet, such as retain_btree_collection.

@alexcrichton
Copy link
Member

@Mark-Simulacrum yeah at this point we'd probably have a separate issue for that, but we'd definitely welcome a PR to implement it!

@rfcbot
Copy link

rfcbot commented May 5, 2017

The final comment period is now complete.

sfackler added a commit to sfackler/rust that referenced this issue May 21, 2017
bors added a commit that referenced this issue May 21, 2017
Stabilize library features for 1.18.0

Closes #38863
Closes #38980
Closes #38903
Closes #36648

r? @alexcrichton

@rust-lang/libs
brson pushed a commit to brson/rust that referenced this issue May 23, 2017
@ahicks92
Copy link
Contributor

If doing these isn't going to need an RFC, can someone (me? I feel like I'm volunteering) put them on all the containers?

Doing an RFC for this was something I was planning to do when I had this hypothetical thing called time, but if it's not needed then someone should just go for it. Retain is the only way to express loops that might delete, and I don't see why we shouldn't have it on everything where it makes sense.

@Mark-Simulacrum
Copy link
Member

Yeah, I think the other containers just need implementations and another tracking issue opened, as per #36648 (comment). Go right ahead!

Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Nov 13, 2020
Implement BTreeMap::retain and BTreeSet::retain

Adds new methods `BTreeMap::retain` and `BTreeSet::retain`.  These are implemented on top of `drain_filter` (rust-lang#70530).

The API of these methods is identical to `HashMap::retain` and `HashSet::retain`, which were implemented in rust-lang#39560 and stabilized in rust-lang#36648.  The docs and tests are also copied from HashMap/HashSet.

The new methods are unstable, behind the `btree_retain` feature gate, with tracking issue rust-lang#79025.  See also rust-lang/rfcs#1338.
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Nov 13, 2020
Implement BTreeMap::retain and BTreeSet::retain

Adds new methods `BTreeMap::retain` and `BTreeSet::retain`.  These are implemented on top of `drain_filter` (rust-lang#70530).

The API of these methods is identical to `HashMap::retain` and `HashSet::retain`, which were implemented in rust-lang#39560 and stabilized in rust-lang#36648.  The docs and tests are also copied from HashMap/HashSet.

The new methods are unstable, behind the `btree_retain` feature gate, with tracking issue rust-lang#79025.  See also rust-lang/rfcs#1338.
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Nov 14, 2020
Implement BTreeMap::retain and BTreeSet::retain

Adds new methods `BTreeMap::retain` and `BTreeSet::retain`.  These are implemented on top of `drain_filter` (rust-lang#70530).

The API of these methods is identical to `HashMap::retain` and `HashSet::retain`, which were implemented in rust-lang#39560 and stabilized in rust-lang#36648.  The docs and tests are also copied from HashMap/HashSet.

The new methods are unstable, behind the `btree_retain` feature gate, with tracking issue rust-lang#79025.  See also rust-lang/rfcs#1338.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B-unstable Blocker: Implemented in the nightly compiler and unstable. final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. 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