Re:What Is Rust's Unsafe? (2019)
by aliceryhl on Monday April 11, 2022 @04:55AM
(#30986267)
The Rust Vec type has an unsafe function called `set_len` that changes the length of the vector without checking whether the new length is in bounds, or whether the memory containing any new values is initialized. The body of the function is the following:
No unsafe operations in sight. Should the compiler emit a warning here?
[ Parent
| on HN ]
There are no comments on this comment yet.