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

Add PathBuf::as_mut_os_string and Path::as_mut_os_str #105002

Merged
merged 1 commit into from
Nov 30, 2022

Conversation

zertosh
Copy link
Contributor

@zertosh zertosh commented Nov 28, 2022

Implements rust-lang/libs-team#140 (tracking issue #105021).

@rustbot
Copy link
Collaborator

rustbot commented Nov 28, 2022

r? @Mark-Simulacrum

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Nov 28, 2022
@rustbot
Copy link
Collaborator

rustbot commented Nov 28, 2022

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@zertosh
Copy link
Contributor Author

zertosh commented Nov 28, 2022

Not sure if this is worth marking as "unstable", but if it is, not sure what to use for "issue" since those seem to point to rust-lang/rust issues, and not rust-lang/libs-team issues.

And if it's not worth marking "unstable", not sure what to put for since.

@ChrisDenton
Copy link
Member

Using none is fine initially but this feature should have a tracking issue so that stabilization progress can be tracked. Once that's created, the "issue" number can refer to that.

Also note that adding a DerefMut implementation is public and instantly stable so would require an FCP (a vote on stabilizing it) before it can be merged. It would likely be better to implement this without it and then add it separately if desired.

@dtolnay dtolnay assigned dtolnay and unassigned Mark-Simulacrum Nov 28, 2022
Copy link
Member

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

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

Thanks!

library/std/src/path.rs Outdated Show resolved Hide resolved
library/std/src/path.rs Outdated Show resolved Hide resolved
library/std/src/path.rs Outdated Show resolved Hide resolved
@dtolnay dtolnay changed the title Add as_mut_os_string to &mut PathBuf and as_mut_os_str to &mut Path Add PathBuf::as_mut_os_string and Path::as_mut_os_str Nov 28, 2022
@dtolnay
Copy link
Member

dtolnay commented Nov 28, 2022

@bors r+

@bors
Copy link
Contributor

bors commented Nov 28, 2022

📌 Commit 9d66ab0 has been approved by dtolnay

It is now in the queue for this repository.

@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-review Status: Awaiting review from the assignee but also interested parties. labels Nov 28, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Nov 29, 2022
Add `PathBuf::as_mut_os_string` and `Path::as_mut_os_str`

Implements rust-lang/libs-team#140 (tracking issue rust-lang#105021).
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 30, 2022
…iaskrgr

Rollup of 14 pull requests

Successful merges:

 - rust-lang#103876 (type alias impl trait: add tests showing that hidden type only outlives lifetimes that occur in bounds)
 - rust-lang#104427 (Explain why `rematch_impl` fails to be infallible)
 - rust-lang#104436 (Add slice to the stack allocated string comment)
 - rust-lang#104523 (Don't use periods in target names)
 - rust-lang#104627 (Print all features with --print target-features)
 - rust-lang#104911 (Make inferred_outlives_crate return Clause)
 - rust-lang#105002 (Add `PathBuf::as_mut_os_string` and `Path::as_mut_os_str`)
 - rust-lang#105023 (Statics used in reachable function's inline asm are reachable)
 - rust-lang#105045 (`rustc_ast_{passes,pretty}`: remove `ref` patterns)
 - rust-lang#105049 (Hermit: Minor build fixes)
 - rust-lang#105051 (Replace a macro with a function)
 - rust-lang#105062 (rustdoc: use shorthand background for rustdoc toggle CSS)
 - rust-lang#105066 (move `candidate_from_obligation` out of assembly)
 - rust-lang#105068 (Run patchelf also on rust-analyzer-proc-macro-srv.)

Failed merges:

 - rust-lang#105050 (Remove useless borrows and derefs)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 804fa66 into rust-lang:master Nov 30, 2022
@rustbot rustbot added this to the 1.67.0 milestone Nov 30, 2022
@zertosh zertosh deleted the acp-140 branch November 30, 2022 04:00
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 16, 2022
Implement DerefMut for PathBuf

Without this, there's no way to get a `&mut Path` from `PathBuf` without
going through `into_boxed_path`. This is relevant now that rust-lang#105002 adds
`PathBuf::as_mut_os_string` and `Path::as_mut_os_str`.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 19, 2022
…r=dtolnay

Realistic `Path::as_mut_os_str` doctest

With "Implement DerefMut for PathBuf" (rust-lang#105018) now merged, it's
possible to exercise `Path::as_mut_os_str` (rust-lang#105002) without going
through `into_boxed_path`.
Aaron1011 pushed a commit to Aaron1011/rust that referenced this pull request Jan 6, 2023
Implement DerefMut for PathBuf

Without this, there's no way to get a `&mut Path` from `PathBuf` without
going through `into_boxed_path`. This is relevant now that rust-lang#105002 adds
`PathBuf::as_mut_os_string` and `Path::as_mut_os_str`.
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.

6 participants