Uh oh!
There was an error while loading. Please reload this page.
Stabilize partition_in_place - #76505
Conversation
rust-highfive
commented
Sep 9, 2020
r? @dtolnay (rust_highfive has picked a reviewer for you, use r? to override) |
scottmcm
commented
Sep 12, 2020
To copy an open question from the tracking issue:
|
bors
commented
Oct 1, 2020
☔ The latest upstream changes (presumably #77381) made this pull request unmergeable. Please resolve the merge conflicts. Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels: |
dtolnay
commented
Oct 15, 2020
@rust-lang/libs: This PR stabilizes https://doc.rust-lang.org/1.47.0/std/iter/trait.Iterator.html#method.partition_in_place. pubtraitIterator{
...
fnpartition_in_place<'a,T,P>(self,predicate:P) -> usizewhereSelf:Sized + DoubleEndedIterator<Item = &'amutT>,P:FnMut(&T) -> bool,T:'a{/*...*/}}Some design questions from the tracking issue:
@rfcbot fcp merge |
Team member @dtolnay has proposed to merge this. The next step is review by the rest of the tagged team members: Concerns:
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
commented
Oct 23, 2020
🔔 This is now entering its final comment period, as per the review above. 🔔 |
withoutboats
commented
Oct 23, 2020
@rfcbot concern should-this-be-an-iter-method I'm vaguely concerned about the precedent set by this API addition, and I'd like to see more justification for it. It's a very strange and novel addition actually because of how it uses iterator, and I don't really see any big discussion of this.
|
timvermeulen
commented
Oct 25, 2020
Alexander Stepanov, author of the partition functions in the C++ STL, considers it to have been a mistake to place the elements that satisfy the predicate at the start, rather than at the end. See page 167 of his Notes on Programming at http://stepanovpapers.com/notes.pdf. Should we consider "fixing" this? |
cuviper
commented
Oct 26, 2020
I think it falls in the category of "simple, but hard" that's good for My motivation was to match the C++
Any iterator with
Any ordered collection with mutable iterators would apply. It's more questionable whether it makes sense to be swapping items around. Yes for slices, It could be a method for slices instead, but I think that restriction is only useful if it helps the implementation. Maybe that would make a stable variant feasible, but I haven't given that algorithm much thought.
I think there's value in keeping that precedent as a point of consistency for C++ defectors. We also have some precedent of our own in that |
m-ou-se
commented
Dec 8, 2020
This PR was discussed in the libs team meeting of 2020-11-18. The consensus was that functions for algorithms like this should probably not be part of |
cuviper
commented
Dec 14, 2020
That does exist as |
bors
commented
Dec 31, 2020
☔ The latest upstream changes (presumably #80530) made this pull request unmergeable. Please resolve the merge conflicts. |
m-ou-se
commented
Jan 1, 2021
@rfcbot cancel |
rfcbot
commented
Jan 1, 2021
@m-ou-se proposal cancelled. |
crlf0710
commented
Jan 22, 2021
@slo1 Ping from triage, according to previous discussions. Would you like to help change the forementioned method into free functions? Thanks! |
slo1
commented
Jan 22, 2021
Oh whoops, I'm a beginner so a lot of the discussion went over my head. I didn't realize there was something actionable to do. When you say free functions, do you mean point free functions? |
m-ou-se
commented
Jan 22, 2021
@slo1 The conclusion was that we'd probably not want functions like this directly on the If you want to work towards that or discuss the stabilization of this feature more, you're very welcome to do so. But for now, I'm closing this PR and directing the discussion back to the tracking issue: #62543 Thanks! |
Closes#62543