Vec::as_ptr returns a pointer to address 0x1 for empty vectors. As it seems, this is an internal implementation detail for RawVec and allocation.
This behavior is unexpected and not documented. In certain scenarios it might cause a segmentation fault (e.g. due to failed checks for a null pointer when dealing with FFI).
Vec::as_ptrreturns a pointer to address0x1for empty vectors. As it seems, this is an internal implementation detail forRawVecand allocation.This behavior is unexpected and not documented. In certain scenarios it might cause a segmentation fault (e.g. due to failed checks for a null pointer when dealing with FFI).