[Under strict provenance, it is sound to] forge an allocation of size zero at any sufficiently aligned non-null address. i.e. the usual “ZSTs are fake, do what you want” rules apply but this only applies for actual forgery (integers cast to pointers). If you borrow some struct’s field that happens to be zero-sized, the resulting pointer will have provenance tied to that allocation, and it will still get invalidated if the allocation gets deallocated. In the future we may introduce an API to make such a forged allocation explicit.
Per the nightly
std::ptr
docs:Along the same lines as https://github.com/rust-lang/unsafe-code-guidelines/issues/529, IIUC this violates provenance monotonicity.