mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-28 01:34:21 +00:00
49319b4206
set_len(0) does not create uninitialized elements. Fixes a false positive with the following pattern: fn copy_slice_into_vec(dst: &mut Vec<u8>, src: &[u8]) { dst.reserve(src.len().saturating_sub(dst.len())); unsafe { dst.set_len(0); std::ptr::copy_nonoverlapping(src.as_ptr(), dst.as_mut_ptr(), src.len()); dst.set_len(src.len()); } } |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
README.md |