Make the Vec data structure layout match raw::Slice.

Fixes #18302

r? @thestinger