Function trivially_zst

Source
fn trivially_zst<'tcx>(ty: Ty<'tcx>, tcx: TyCtxt<'tcx>) -> Option<bool>
Expand description

A cheap, approximate check to avoid unnecessary layout_of calls.

Some(true) is definitely ZST; Some(false) is definitely not ZST.

None may or may not be, and must check layout_of to be sure.