Function rustc_lint::types::is_niche_optimization_candidate
source · fn is_niche_optimization_candidate<'tcx>(
tcx: TyCtxt<'tcx>,
param_env: ParamEnv<'tcx>,
ty: Ty<'tcx>,
) -> bool
Expand description
A type is niche-optimization candidate iff:
- Is a zero-sized type with alignment 1 (a “1-ZST”).
- Has no fields.
- Does not have the
#[non_exhaustive]
attribute.