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
Not sure if this is supposed to do, as the documentation of std::slice::from_raw_parts indicates that the len parameter of it is the number of elements, not the number of bytes.
If it is supposed to do, how about to allow this lint rule with #[allow(clippy::size_of_in_element_count)]?
The text was updated successfully, but these errors were encountered:
The code linted by this is really debugging code (correct code ought never to run into it); while the lint itself is a false positive (I'll have it silenced before the next release), it is true that it does something unorthodox: it reinterprets a type as its raw bytes, potentially exposing padding or uninit bytes, which is not great. So, all in all, I guess I could (default) feature-gate this snippet so that people can disable it
The link of this lint rule is https://rust-lang.github.io/rust-clippy/master/index.html#size_of_in_element_count.
Not sure if this is supposed to do, as the documentation of std::slice::from_raw_parts indicates that the
len
parameter of it is the number of elements, not the number of bytes.If it is supposed to do, how about to allow this lint rule with
#[allow(clippy::size_of_in_element_count)]
?The text was updated successfully, but these errors were encountered: