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

Safely transmute vectors #79

Merged
merged 2 commits into from
May 29, 2024
Merged

Safely transmute vectors #79

merged 2 commits into from
May 29, 2024

Conversation

EAimTY
Copy link
Contributor

@EAimTY EAimTY commented May 25, 2024

Data layout of Vec is unspecified. Transmuting vectors can cause Undefined Behavior even when items are transparent types:

https://doc.rust-lang.org/std/mem/fn.transmute.html#alternatives

This PR replaced transmuting on vectors with the recommended way mentioned in link above.

@davidli2010 davidli2010 merged commit d2fa07a into etcdv3:master May 29, 2024
1 check passed
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