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

Don't have important data in unused capacity when calling reserve #563

Merged
merged 1 commit into from Aug 12, 2022

Conversation

Darksonn
Copy link
Contributor

Closes: #562
Cc: @steffahn

@steffahn
Copy link
Contributor

I believe this matches the code location I used to stumble across a while back, and the fix seems appropriate (and straightforward). I also ran miri with the modified standard library and it passes with this PR.

Copy link

@hds hds left a comment

Choose a reason for hiding this comment

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

Discussed assert! vs. debug_assert! here on Discord, decided that this is enough given the context. Looks good to me.

@Darksonn Darksonn merged commit d1b5d4c into master Aug 12, 2022
@Darksonn Darksonn deleted the alice/reserve-unused-cap branch August 12, 2022 10:22
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.

Bytes assumes that Vec::reserve retains data in the unused capacity
3 participants