Skip to content

Add Path::absolute method as alias for std::path::absolute#153272

Open
wmmc88 wants to merge 1 commit intorust-lang:mainfrom
wmmc88:add-path-absolute-method
Open

Add Path::absolute method as alias for std::path::absolute#153272
wmmc88 wants to merge 1 commit intorust-lang:mainfrom
wmmc88:add-path-absolute-method

Conversation

@wmmc88
Copy link

@wmmc88 wmmc88 commented Mar 2, 2026

Path::canonicalize() is an alias for fs::canonicalize(), but there's no equivalent Path::absolute() for path::absolute(). This adds one.

Discussed in #92750 (comment), Chris said a PR would be welcome.

Tracking issue: #153328

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Mar 2, 2026
@wmmc88 wmmc88 marked this pull request as ready for review March 2, 2026 05:04
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 2, 2026
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Mar 2, 2026
@rustbot
Copy link
Collaborator

rustbot commented Mar 2, 2026

r? @tgross35

rustbot has assigned @tgross35.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ChrisDenton, libs
  • @ChrisDenton, libs expanded to 8 candidates
  • Random selection from Mark-Simulacrum, joboet, tgross35

Copy link
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically this should probably get an ACP, but given this is pretty straightforward and Chris is in favor it seems fine to just nominated here.

@rustbot label +I-libs-api-nominated

View changes since this review

@rustbot rustbot added I-libs-api-nominated Nominated for discussion during a libs-api team meeting. 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-review Status: Awaiting review from the assignee but also interested parties. labels Mar 2, 2026
@rustbot
Copy link
Collaborator

rustbot commented Mar 2, 2026

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@tgross35
Copy link
Contributor

tgross35 commented Mar 2, 2026

Also, please handwrite the PR description; the AI-generated restatement of diff contents is not helpful.

(small typo in the commit message as well, says s:: rather than fs::)

@wmmc88 wmmc88 force-pushed the add-path-absolute-method branch 3 times, most recently from be051c9 to daee312 Compare March 3, 2026 15:43
@rust-log-analyzer

This comment has been minimized.

@Amanieu
Copy link
Member

Amanieu commented Mar 3, 2026

This was discussed in the @rust-lang/libs-api meeting and we're happy to approve this.

@Amanieu Amanieu removed the I-libs-api-nominated Nominated for discussion during a libs-api team meeting. label Mar 3, 2026
Add a convenience method Path::absolute() that delegates to the
existing free function std::path::absolute(), mirroring the pattern of
Path::canonicalize() delegating to fs::canonicalize().

Tracking issue: rust-lang#153328
@wmmc88 wmmc88 force-pushed the add-path-absolute-method branch from daee312 to bde5b58 Compare March 3, 2026 18:40
Copy link
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me once CI passes (GH seems to be flaky currently)

View changes since this review

@tgross35
Copy link
Contributor

tgross35 commented Mar 3, 2026

@bors r+ rollup

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 3, 2026

📌 Commit bde5b58 has been approved by tgross35

It is now in the queue for this repository.

🌲 The tree is currently closed for pull requests below priority 1000. This pull request will be tested once the tree is reopened.

@rust-bors rust-bors bot 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 Mar 3, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Mar 3, 2026
…=tgross35

Add `Path::absolute` method as alias for `std::path::absolute`

`Path::canonicalize()` is an alias for `fs::canonicalize()`, but there's no equivalent `Path::absolute()` for `path::absolute()`. This adds one.

Discussed in rust-lang#92750 (comment), Chris [said](rust-lang#92750 (comment)) a PR would be welcome.

Tracking issue: rust-lang#153328
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants