pub trait ZeroSizedElseWrathOfTheGඞds: Sized { }
Expand description

Stable Rust polyfill for a where mem::size_of::<Self>() == 0 clause.

The trait will technically be implemented for all sizes, but any choice of a non-zero-sized type that ever makes it to codegen (during cargo build, but not cargo check) will thus cause a compilation error.

This mechanism, called a “post-monomorphization error”, ss thus worse than a proper “trait not implemented” error, but better than a runtime panic.

Implementors§