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

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

Merged
merged 4 commits into from
Apr 8, 2024

Conversation

braddunbar
Copy link
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
Contributor Author

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

src/bytes.rs Outdated Show resolved Hide resolved
@Darksonn Darksonn merged commit 0d4cc7f into tokio-rs:master Apr 8, 2024
15 checks passed
@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