Skip to content

Conversation

Nopey
Copy link

@Nopey Nopey commented Jun 28, 2025

The clippy::uninit_vec lint pointed out this issue in a few places, and then some manual review found many more places where Vec::set_len was being abused.

This introduces buffer zeroing in several places, which will have a performance impact. In order to safely avoid this zeroing, we will need to support &mut [MaybeUninit<u8>] as an output buffer.

For more information, see the clippy lint's documentation: https://rust-lang.github.io/rust-clippy/master/index.html#uninit_vec

The clippy::uninit_vec lint caught this issue, which I discovered while
cleaning those warnings up.

This introduces buffer zeroing in several places, which will have a
performance impact. In order to safely avoid this zeroing, we will need
to support `&mut [MaybeUninit<u8>]` as an output buffer.
@Nopey Nopey requested a review from jschwe July 11, 2025 21:41
@Nopey
Copy link
Author

Nopey commented Jul 11, 2025

force pushed to rephrase two of my safety comments.

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