Skip to content

Remove T: Debug bound on UnsafeCell Debug impl - #83707

Merged
bors merged 1 commit into
rust-lang:masterfrom
exrook:unsafecell
Apr 13, 2021
Merged

Remove T: Debug bound on UnsafeCell Debug impl#83707
bors merged 1 commit into
rust-lang:masterfrom
exrook:unsafecell

Conversation

@exrook

@exrookexrook commented Mar 31, 2021

Copy link
Copy Markdown
Contributor

Prior art: #65013

@bjorn3

Copy link
Copy Markdown
Member

Assigned to a random member of the libs team as highfive didn't respond.

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 31, 2021
@JohnTitorJohnTitor added the T-libs-api [DEPRECATED; DO NOT USE] label Mar 31, 2021
@Mark-Simulacrum

Copy link
Copy Markdown
Member

Not a member of the libs team :)

cc @rust-lang/libs, do we want to do a full FCP here? It seems clear we can't print the value in a safe way, so there's not much we can do with the Debug bound I think, even if we have it.

@Amanieu

Copy link
Copy Markdown
Member

It doesn't hurt to be sure. I can't see any reason why this would cause any issues though.

@rfcbot merge

@rfcbot

rfcbot commented Apr 2, 2021

Copy link
Copy Markdown

Team member @Amanieu 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.

@rfcbotrfcbot 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 Apr 2, 2021

@dtolnaydtolnay left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I agree -- we can't possibly go from &UnsafeCell<T> to &T in order to invoke T's Debug impl, so the T: Debug bound is not useful.

ConceivablyDebug could grow a defaulted method which takes an argument of type &UnsafeCell<Self>, which this PR rules out, but I am comfortable ruling that out because there isn't a type which could meaningfully format an arbitrary &UnsafeCell<Self>.

@joshtriplett

Copy link
Copy Markdown
Member

This seems reasonable to me as well. Because of the rules regarding trait impls, nobody could have an impl Debug for UnsafeCell<SomeType>, even for a type or trait defined in their crate, without having a wrapper type.

@rfcbot reviewed

@rfcbot

Copy link
Copy Markdown

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

@rfcbotrfcbot 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 Apr 2, 2021
@rfcbotrfcbot 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 Apr 12, 2021
@rfcbot

Copy link
Copy Markdown

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.

@rfcbotrfcbot added the to-announce Announce this issue on triage meeting label Apr 12, 2021
@m-ou-se

Copy link
Copy Markdown
Member

@bors r+ rolllup

@bors

bors commented Apr 12, 2021

Copy link
Copy Markdown
Collaborator

📌 Commit 58218f6 has been approved by m-ou-se

@borsbors 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 Apr 12, 2021
@m-ou-se

Copy link
Copy Markdown
Member

@bors rollup

Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Apr 12, 2021
Remove `T: Debug` bound on UnsafeCell Debug impl
Prior art: rust-lang#65013
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 13, 2021
Rollup of 6 pull requests
Successful merges:
- rust-lang#83438 (Update RELEASES.md)
- rust-lang#83707 (Remove `T: Debug` bound on UnsafeCell Debug impl)
- rust-lang#84084 (Stabilize duration_zero.)
- rust-lang#84121 (Stabilize BTree{Map,Set}::retain)
- rust-lang#84140 (Don't call bump in check_mistyped_turbofish_with_multiple_type_params)
- rust-lang#84141 (Fix typo in error message)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit 1cc4b6d into rust-lang:masterApr 13, 2021
@rustbotrustbot added this to the 1.53.0 milestone Apr 13, 2021
@apirainoapiraino removed the to-announce Announce this issue on triage meeting label Apr 15, 2021
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-libs-api[DEPRECATED; DO NOT USE]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

13 participants

@exrook@bjorn3@Mark-Simulacrum@Amanieu@rfcbot@joshtriplett@m-ou-se@bors@dtolnay@apiraino@rust-highfive@JohnTitor@rustbot