3 ms·
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
by aliceryhl 5y ago
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:
self.len = new_len;
No unsafe operations in sight. Should the compiler emit a warning here?