You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The usual fix is to use std::mem::MaybeUninit, but this crate has a minimum supported Rust version of 1.34, which predates the stabilization of std::mem::MaybeUninit in 1.36.
There are a few possible fixes:
Zero-initialize the array, either accepting extra generated code size or hoping the compiler optimizes it away.
Increase the minimum supported Rust version to 1.36 and use std::mem::MaybeUninit.
Re-implement std::mem::MaybeUninit in this crate (i.e. use a union to make it sound), which involves significantly more unsafe code.
The text was updated successfully, but these errors were encountered:
Actually, looking again, encode_utf8 takes a &mut [u8], so it requires its input to be initialized. Therefore I believe solutions 2 and 3 from my post are unsound.
An additional option to avoid unnecessary overhead is to implement our own char-to-utf8 logic.
uWrite::write_char
contains an unsound use ofcore::mem::uninitialized
(see the docs forstd::mem::MaybeUninit
):The usual fix is to use
std::mem::MaybeUninit
, but this crate has a minimum supported Rust version of 1.34, which predates the stabilization ofstd::mem::MaybeUninit
in 1.36.There are a few possible fixes:
std::mem::MaybeUninit
.std::mem::MaybeUninit
in this crate (i.e. use a union to make it sound), which involves significantly more unsafe code.The text was updated successfully, but these errors were encountered: