Macro if_zst

Source
macro_rules! if_zst {
    (mut $this:ident, $len:ident => $zst_body:expr, $end:ident => $other_body:expr,) => { ... };
    ($this:ident, $len:ident => $zst_body:expr, $end:ident => $other_body:expr,) => { ... };
}
Expand description

Convenience & performance macro for consuming the end_or_len field, by giving a (&mut) usize or (&mut) NonNull<T> depending whether T is or is not a ZST respectively.

Internally, this reads the end through a pointer-to-NonNull so that it’ll get the appropriate non-null metadata in the backend without needing to call assume manually.