Remove unsafe from ManuallyDropCtor::new.#1535
Open
copybara-service[bot] wants to merge 1 commit into
Open
Conversation
copybara-service
Bot
force-pushed
the
test_954449981
branch
2 times, most recently
from
July 27, 2026 12:08
72c0ede to
847f891
Compare
Firstly, `ManuallyDropCtor` explicitly, albeit obliquely, states that it supports use with pinned data: the `drop` method says it "can be used to safely drop pinned data". So, it would appear that the type is structurally pinned, and people would be incorrect for assuming otherwise. I think I just missed this the first time around! Anyway, good enough to get rid of this very silly `unsafe`. Even if that weren't true, it's a very unlikely thing to go wrong, and I want to add a more dangerous API as a followup CL -- and so it's useful to make this safe by contrast, given how astronomically poor taste it would have been to assume ManuallyDrop isn't structurally pinned. That said... it is. PiperOrigin-RevId: 954449981
copybara-service
Bot
force-pushed
the
test_954449981
branch
from
July 27, 2026 12:47
847f891 to
8ded6d1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remove
unsafefromManuallyDropCtor::new.Firstly,
ManuallyDropCtorexplicitly, albeit obliquely, states that it supports use with pinned data: thedropmethod says it "can be used to safely drop pinned data". So, it would appear that the type is structurally pinned, and people would be incorrect for assuming otherwise. I think I just missed this the first time around! Anyway, good enough to get rid of this very sillyunsafe.Even if that weren't true, it's a very unlikely thing to go wrong, and I want to add a more dangerous API as a followup CL -- and so it's useful to make this safe by contrast, given how astronomically poor taste it would have been to assume ManuallyDrop isn't structurally pinned.
That said... it is.