fn check_enum(tcx: TyCtxt<'_>, def_id: LocalDefId)