Implement DerefMut for PathBuf by zertosh · Pull Request #105018 · rust-lang/rus...
source link: https://github.com/rust-lang/rust/pull/105018
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Implement DerefMut for PathBuf #105018
Conversation
Contributor
zertosh commented Nov 28, 2022
Without this, there's no way to get a &mut Path
from PathBuf
without
going through into_boxed_path
. This is relevant now that #105002 addsPathBuf::as_mut_os_string
and Path::as_mut_os_str
.
Collaborator
rustbot commented Nov 28, 2022
r? @thomcc (rustbot has picked a reviewer for you, use r? to override) |
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
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 Examples of
|
Contributor
Author
zertosh commented Nov 28, 2022
Now sure if I should include these here or make separate PRs, but the following impls would also be useful now but are missing:
|
added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
and removed T-libs Relevant to the library team, which will review and decide on the PR/issue.
labels
Member
dtolnay commented Nov 28, 2022
Deref from
@rust-lang/libs-api: |
rfcbot commented Nov 28, 2022 •
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. |
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
added the final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. label
rfcbot commented Dec 6, 2022
This is now entering its final comment period, as per the review above. |
removed the proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. label
fn from_inner_mut(inner: &mut OsStr) -> &mut Path { |
||
// SAFETY: Path is just a wrapper around OsStr, |
||
// therefore converting &mut OsStr to &mut Path is safe. |
||
unsafe { &mut *(inner as *mut OsStr as *mut Path) } |
I don't see a #[repr(transparent)]
on the struct definition - I don't think this transmute is correct.
This is correct for standard library code.
added finished-final-comment-period The final comment period is finished for this PR / Issue. to-announce Announce this issue on triage meeting
and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised.
labels
rfcbot commented Dec 16, 2022
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. This will be merged soon. |
Member
dtolnay commented Dec 16, 2022
@bors r+ |
Contributor
bors commented Dec 16, 2022
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
Contributor
bors commented Dec 16, 2022
Contributor
bors commented Dec 16, 2022
Test successful - checks-actions |
Collaborator
rust-timer commented Dec 16, 2022
Finished benchmarking commit (9c07efe): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results CyclesThis benchmark run did not return any relevant results for this metric. |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Successfully merging this pull request may close these issues.
None yet
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK