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

Allow obtaining &mut OsStr #70048

Merged
merged 6 commits into from Mar 27, 2020
Merged

Allow obtaining &mut OsStr #70048

merged 6 commits into from Mar 27, 2020

Conversation

@TyPR124
Copy link
Contributor

TyPR124 commented Mar 16, 2020

impl DerefMut for OsString {...}              // type Target = OsStr
impl IndexMut<RangeFull> for OsString {...}   // type Output = OsStr

This change is pulled out of #69937 per @dtolnay

This implements DerefMut for OsString to allow obtaining a &mut OsStr. This also implements IndexMut for OsString, which is used by DerefMut. This pattern is the same as is used by Deref.

This is necessary to for methods like make_ascii_lowercase which need to mutate the underlying value.

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Mar 16, 2020

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Mark-Simulacrum (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@dtolnay

This comment has been minimized.

Copy link
Member

dtolnay commented Mar 16, 2020

@rust-lang/libs: This PR adds stable impls for:

impl DerefMut for OsString {...}              // type Target = OsStr
impl IndexMut<RangeFull> for OsString {...}   // type Output = OsStr

The behavior matches the existing Deref and Index impls for OsString. Currently a &mut OsStr is not very useful but this change will allow introducing (unstable, in a separate PR) things like make_ascii_uppercase(&mut self) on OsStr and having it be callable on OsString through derefmut.

@rfcbot fcp merge

@rfcbot

This comment has been minimized.

Copy link

rfcbot commented Mar 16, 2020

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

No concerns currently listed.

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

This comment has been minimized.

Copy link

rfcbot commented Mar 16, 2020

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

@rfcbot

This comment has been minimized.

Copy link

rfcbot commented Mar 26, 2020

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

As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

The RFC will be merged soon.

@dtolnay dtolnay added the relnotes label Mar 26, 2020
@dtolnay dtolnay added this to the 1.44 milestone Mar 26, 2020
@dtolnay

This comment has been minimized.

Copy link
Member

dtolnay commented Mar 26, 2020

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Mar 26, 2020

📌 Commit 45416cd has been approved by dtolnay

bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 27, 2020
Rollup of 5 pull requests

Successful merges:

 - rust-lang#69644 (Remove framework in `dataflow/mod.rs` in favor of "generic" one)
 - rust-lang#69936 (Fix cycle error when emitting suggestion for mismatched `fn` type)
 - rust-lang#70048 (Allow obtaining &mut OsStr)
 - rust-lang#70344 (Decouple `rustc_hir::print` into `rustc_hir_pretty`)
 - rust-lang#70435 (Add regression test for rust-lang#66706)

Failed merges:

r? @ghost
@bors bors merged commit c0369c4 into rust-lang:master Mar 27, 2020
4 checks passed
4 checks passed
pr Build #20200320.21 succeeded
Details
pr (Linux mingw-check) Linux mingw-check succeeded
Details
pr (Linux x86_64-gnu-llvm-7) Linux x86_64-gnu-llvm-7 succeeded
Details
pr (Linux x86_64-gnu-tools) Linux x86_64-gnu-tools succeeded
Details
@TyPR124 TyPR124 mentioned this pull request Mar 28, 2020
0 of 1 task complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

10 participants
You can’t perform that action at this time.