Skip to content

Bytes: Use ManuallyDrop instead of mem::forget#678

Merged
Darksonn merged 4 commits intotokio-rs:masterfrom
braddunbar:more-manuallydrop
Apr 8, 2024
Merged

Bytes: Use ManuallyDrop instead of mem::forget#678
Darksonn merged 4 commits intotokio-rs:masterfrom
braddunbar:more-manuallydrop

Conversation

@braddunbar
Copy link
Copy Markdown
Contributor

Note: The tsan job is failing in CI due to rust-lang/rust#122476, which should be resolved in the next few days.

Much like #675, I found a few places we can more idiomatically use ManuallyDrop.

ManuallyDrop allows us to prevent a destructor from running before
accessing its members during transfer of ownership. Let's do that!
@braddunbar
Copy link
Copy Markdown
Contributor Author

rust-lang/rust#122476 is fixed now and the tsan job is passing again.

Comment thread src/bytes.rs Outdated
@Darksonn Darksonn merged commit 0d4cc7f into tokio-rs:master Apr 8, 2024
@braddunbar braddunbar deleted the more-manuallydrop branch April 9, 2024 14:04
@mox692 mox692 mentioned this pull request Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants