The current implementation of ArrayVec uses repr(C), which allows passing it between separately compiled rust programs. This is nice. It would be great to have documentation on which parts of the ArrayVec ABI are considered stable and which are considered to be implementation details. Specifically, I care about these questions:
- Will future versions of
ArrayVec<T> have the same data layout as the same future version of ArrayVec<T> compiled separately?
- Will future versions of
ArrayVec<T> have the same data layout as the current version of ArrayVec<T>?
- Do
ArrayVec<T> and ArrayVec<U> have compatible layouts if T and U are compatible? e. g. can I transmute ArrayVec<u32> to ArrayVec<UnsafeCell<u32>>
The current implementation of ArrayVec uses
repr(C), which allows passing it between separately compiled rust programs. This is nice. It would be great to have documentation on which parts of the ArrayVec ABI are considered stable and which are considered to be implementation details. Specifically, I care about these questions:ArrayVec<T>have the same data layout as the same future version ofArrayVec<T>compiled separately?ArrayVec<T>have the same data layout as the current version ofArrayVec<T>?ArrayVec<T>andArrayVec<U>have compatible layouts ifTandUare compatible? e. g. can I transmuteArrayVec<u32>toArrayVec<UnsafeCell<u32>>