FWIW (and this might be a change for rust-core), a malloc could be offered that takes an alignment parameter, which is used by the raw implementation to ensure it is returning a buffer with the correct alignment. The implementation will know how to allocate in such a way that alignment is possible.

Not something to fix in your diff, but something to consider. I might have a look and see about doing this, if I have time, actually.