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

Stabilize std::path::Path::ancestors #50894

Merged
merged 1 commit into from
Jun 18, 2018
Merged

Stabilize std::path::Path::ancestors #50894

merged 1 commit into from
Jun 18, 2018

Conversation

teiesti
Copy link
Contributor

@teiesti teiesti commented May 19, 2018

Closes #48581

r? @BurntSushi

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 19, 2018
@kennytm kennytm added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. relnotes Marks issues that should be documented in the release notes of the next release. labels May 19, 2018
@BurntSushi
Copy link
Member

r? @alexcrichton

@alexcrichton
Copy link
Member

@rfcbot fcp merge

Thanks for the PR @teiesti! This all looks good to me, let's see what the libs team thinks

@rfcbot
Copy link

rfcbot commented May 21, 2018

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

No concerns currently listed.

Once a majority of reviewers approve (and none object), 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 May 21, 2018
@teiesti teiesti changed the title Stabilize std::path::Path:ancestors Stabilize std::path::Path::ancestors May 24, 2018
@shepmaster shepmaster added S-waiting-on-team Status: Awaiting decision from the relevant subteam (see the T-<team> label). and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 2, 2018
@Mark-Simulacrum
Copy link
Member

Did the decision around calling this ancestors vs. parents get settled? parents seems more appropriate to me since it's more readily searchable/recognizable with relation to the existing parent method.

@teiesti
Copy link
Contributor Author

teiesti commented Jun 3, 2018

There has been a long lasting debate around the naming issue in the initial PR (#48420). The discussion was then postponed to the tracking issue/stabilization in order to get this feature working on nightly. There has indeed never been a deliberate decision but the discussion immediately ebbed away after the feature was merged.

When writing the stabilization PR, I consciously decided not to bring up this issue again in order to see if there's still need for further debate. @Mark-Simulacrum: Thank You for mentioning this, because this shows me that we should indeed talk about this again!

Here is a list of arguments already raised:

Pro ancestors:

  1. Cargo has a similar method called ancestors.
  2. It might be weird that an iterator called Ancestor yields the current path. It is more reasonable that the current path is a "null ancestor" than a "null parent".
  3. The name parents might be misleading.
  4. Changing the name would break existing code in nightly.

Pro parents:

  1. When sorted, parents comes right after parent. It is therefore grouped with its more specific counterpart within the documentation. (This argument is ruled out by the fact that the standard library is not sorted by name but by the order in which functions appear in the source code. It is therefore possible to put ancestors right after parents.)
  2. parents is more easily searchable/recognizable, given you are familiar with parent.

There have been arguments against both, ancestors and parents, but nobody came up with an idea that was clearly superior. Therefore, I suggest that we limit the decision to the choice between these two.

I, personally, have a slight tendency towards ancestors but in the end I don't really care about the name as long as it is one of the two. I do care about a fast stabilization because the functionality is highly useful for me.

In order to have both, fast stabilization and a good decision about the name, I propose to announce some kind of a final comment period about the name. This would give anyone the chance to raise new arguments. After that, @rust-lang/libs could decide.

@Mark-Simulacrum
Copy link
Member

Just wanted to check that it was brought up before stabilization, but looks like there has been debate about the topic already -- I'm fine with ancestors per the arguments you linked to.

@rfcbot
Copy link

rfcbot commented Jun 4, 2018

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

@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 Jun 4, 2018
@dtolnay
Copy link
Member

dtolnay commented Jun 4, 2018

I have only read @teiesti's recap of the arguments and not the original tracking issue, but I prefer ancestors over parents for a reason that hasn't been listed so far. An iterator called parents implies to me that a path can have multiple parents. In reality a path has at most one parent. There is no transitive property where a parent of my parent would be considered my parent. In contrast, it seems easy to accept that an ancestor of my ancestor would be considered my ancestor, and thus ancestors would be an iterator over the chain of ancestors.

@rfcbot rfcbot added finished-final-comment-period The final comment period is finished for this PR / Issue. and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. labels Jun 14, 2018
@rfcbot
Copy link

rfcbot commented Jun 14, 2018

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

@teiesti
Copy link
Contributor Author

teiesti commented Jun 18, 2018

@alexcrichton, what about merging this now?

(The final comment period is complete. No concern was listed. The naming debate was - as I understand - finally settled by @dtolnay's comment. Time is running short for having this stabilized in 1.28.0.)

@dtolnay
Copy link
Member

dtolnay commented Jun 18, 2018

@bors r+

@bors
Copy link
Contributor

bors commented Jun 18, 2018

📌 Commit 19aa79f has been approved by dtolnay

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-team Status: Awaiting decision from the relevant subteam (see the T-<team> label). labels Jun 18, 2018
@bors
Copy link
Contributor

bors commented Jun 18, 2018

🔒 Merge conflict

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 18, 2018
@teiesti
Copy link
Contributor Author

teiesti commented Jun 18, 2018

I've rebased this branch. Can we try again?

@dtolnay
Copy link
Member

dtolnay commented Jun 18, 2018

Thank you @teiesti.

@bors r+

@bors
Copy link
Contributor

bors commented Jun 18, 2018

📌 Commit 65d119c has been approved by dtolnay

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 18, 2018
@bors
Copy link
Contributor

bors commented Jun 18, 2018

⌛ Testing commit 65d119c with merge 5230979...

bors added a commit that referenced this pull request Jun 18, 2018
@bors
Copy link
Contributor

bors commented Jun 18, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: dtolnay
Pushing 5230979 to master...

@bors bors merged commit 65d119c into rust-lang:master Jun 18, 2018
@teiesti teiesti deleted the stabilize_path_ancestors branch June 18, 2018 21:51
@dtolnay dtolnay self-assigned this Mar 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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. relnotes Marks issues that should be documented in the release notes of the next release. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

Tracking issue for std::path::Path::ancestors
10 participants