Doing some further research you can make the optimized initialization of the WrappedByte vector by using it as a iterator.
vec![0u8; len]
.into_iter()
.map(|x| WrappedByte(x))
.collect::<Vec<_>>()
which will give you a list of WrappedBytes but initialized with calloc. I assume this is because llvm can see that the map is a identity function in this case and then can optimize it out.Godbolt: https://godbolt.org/z/hxnnPcjvG