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

Stabilize unsafe_cell_get_mut #79485

Merged
merged 2 commits into from
Dec 18, 2020

Conversation

BoxyUwU
Copy link
Member

@BoxyUwU BoxyUwU commented Nov 28, 2020

Tracking issue: #76943

r? @m-ou-se

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 28, 2020
@m-ou-se m-ou-se added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Nov 28, 2020
@m-ou-se
Copy link
Member

m-ou-se commented Nov 28, 2020

@rfcbot merge

This change stabilizes UnsafeCell::get_mut().

@rfcbot
Copy link

rfcbot commented Nov 28, 2020

Team member @m-ou-se 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 Nov 28, 2020
@RalfJung
Copy link
Member

Cc @rust-lang/lang since UnsafeCell is a language primitive, not just a library type -- but I agree that adding this operation makes sense.

@RalfJung
Copy link
Member

RalfJung commented Nov 28, 2020

@EllenNyan I also have a small proposal for a docs improvement (in the UnsafeCell type docs):

This is showcased by the .get_mut() accessor, which is a non-unsafe getter that yields a &mut T.

Why "non-unsafe"? I think it would make sense to avoid the double negation and just say "safe", in italics for emphasis.

@m-ou-se
Copy link
Member

m-ou-se commented Nov 28, 2020

Why "non-unsafe"?

That was the original wording added in #76936. But it looks like there was no discussion about that wording there.

@m-ou-se m-ou-se added S-waiting-on-fcp Status: PR is in FCP and is awaiting for FCP to complete. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 28, 2020
@danielhenrymantilla
Copy link
Contributor

danielhenrymantilla commented Nov 29, 2020

Phrasing it as "non-unsafe" instead of as "safe" is something I usually do,

  • (For those curious as to why)

    unsafe, with code formatting, has a very specific meaning, relating to the Rust guarantees w.r.t. memory (un)safety and contractual UB.

    Hence, non-unsafe inherits from this very specific meaning, contrary to "safe", which is kind of ambiguous: for instance, I'd rather say that ::std::fs::remove_dir_all("/") "is not unsafe" or "non-unsafe", rather than saying it is safe 😉.

and which kind of slipped through my implementation PR, sorry. Since Rust's standard documentation does use "safe" without these concerns of mine, there is no reason not to do that here too, so feel free to rephrase it!

@BurntSushi
Copy link
Member

BurntSushi commented Nov 29, 2020

@danielhenrymantilla I like that reasoning. But I do tend to avoid using unsafe anywhere other than where it's actually used, because it means grep produces less noise when looking for uses of unsafe. :-)

(I have no opinions in this particular example, but just wanted to throw this out there.)

@BoxyUwU
Copy link
Member Author

BoxyUwU commented Nov 29, 2020

I changed the "non-unsafe" to "safe" since no-one seems to have any objections and this is more in line with the rest of docs :)

@rfcbot
Copy link

rfcbot commented Dec 8, 2020

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

@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 Dec 8, 2020
@rfcbot rfcbot added finished-final-comment-period The final comment period is finished for this PR / Issue. and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. labels Dec 18, 2020
@rfcbot
Copy link

rfcbot commented Dec 18, 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.

@rfcbot rfcbot added the to-announce Announce this issue on triage meeting label Dec 18, 2020
@m-ou-se
Copy link
Member

m-ou-se commented Dec 18, 2020

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Dec 18, 2020

📌 Commit 1a1a99c has been approved by m-ou-se

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Dec 18, 2020
@bors
Copy link
Contributor

bors commented Dec 18, 2020

⌛ Testing commit 1a1a99c with merge 6340607...

@bors
Copy link
Contributor

bors commented Dec 18, 2020

☀️ Test successful - checks-actions
Approved by: m-ou-se
Pushing 6340607 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 18, 2020
@bors bors merged commit 6340607 into rust-lang:master Dec 18, 2020
@rustbot rustbot added this to the 1.50.0 milestone Dec 18, 2020
@m-ou-se
Copy link
Member

m-ou-se commented Dec 18, 2020

@EllenNyan Congrats on getting your first stabilization PR merged! And thanks again!

@spastorino spastorino removed the to-announce Announce this issue on triage meeting label Dec 31, 2020
@pthariensflame
Copy link
Contributor

Does this need relnotes?

@RalfJung RalfJung added the relnotes Marks issues that should be documented in the release notes of the next release. label Jan 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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. merged-by-bors This PR was explicitly merged by bors. relnotes Marks issues that should be documented in the release notes of the next release. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. S-waiting-on-fcp Status: PR is in FCP and is awaiting for FCP to complete. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.