Skip to content

Tracking Issue for UnsafeCell::from_mut #111645

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
3 of 4 tasks
joseph-gio opened this issue May 16, 2023 · 7 comments · Fixed by #131261
Closed
3 of 4 tasks

Tracking Issue for UnsafeCell::from_mut #111645

joseph-gio opened this issue May 16, 2023 · 7 comments · Fixed by #131261
Labels
C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC 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. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@joseph-gio
Copy link
Contributor

joseph-gio commented May 16, 2023

Feature gate: #![feature(unsafe_cell_from_mut)]

This is a tracking issue for UnsafeCell::from_mut, which makes it possible to convert &mut T to &mut UnsafeCell<T> in safe code.

Public API

// core::cell

impl<T: ?Sized> UnsafeCell<T> {
    pub fn from_mut(&mut T) -> &mut Self;
}

Steps / History

Unresolved Questions

  • None yet.

Footnotes

  1. https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html

@joseph-gio joseph-gio added C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels May 16, 2023
@joseph-gio
Copy link
Contributor Author

For a straightforward addition like this, what's an appropriate amount of time to wait before pushing for stabilization?

@QuineDot
Copy link

This should also be added to SyncUnsafeCell to keep their APIs the same.

@clarfonthey
Copy link
Contributor

Since Cell::from_mut is stabilised, it feels weird that this isn't.

@dtolnay
Copy link
Member

dtolnay commented Sep 5, 2024

@rust-lang/libs-api:
@rfcbot fcp merge

@rfcbot
Copy link
Collaborator

rfcbot commented Sep 5, 2024

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 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 Sep 5, 2024
@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 Sep 24, 2024
@rfcbot
Copy link
Collaborator

rfcbot commented Sep 24, 2024

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

@rfcbot rfcbot 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 Oct 4, 2024
@rfcbot
Copy link
Collaborator

rfcbot commented Oct 4, 2024

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.

@apiraino apiraino removed the to-announce Announce this issue on triage meeting label Oct 17, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Nov 5, 2024
…r=m-ou-se

Stabilize `UnsafeCell::from_mut`

Closes rust-lang#111645.
FCP: rust-lang#111645 (comment)

Note that because `const_mut_refs` and `const_refs_to_cell` was stabilized, it's okay to const-stabilize this method as well.
@bors bors closed this as completed in efa5af9 Nov 6, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Nov 6, 2024
Rollup merge of rust-lang#131261 - clarfonthey:unsafe-cell-from-mut, r=m-ou-se

Stabilize `UnsafeCell::from_mut`

Closes rust-lang#111645.
FCP: rust-lang#111645 (comment)

Note that because `const_mut_refs` and `const_refs_to_cell` was stabilized, it's okay to const-stabilize this method as well.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC 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. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants