1
Fork 0

Factor out conservative_is_privately_uninhabited

This commit is contained in:
Cameron Steffen 2022-10-23 17:32:40 -05:00
parent 34cbe72780
commit cc8dddbac9
11 changed files with 25 additions and 81 deletions

View file

@ -264,10 +264,10 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
let irrefutable = adt_def.variants().iter_enumerated().all(|(i, v)| {
i == variant_index || {
self.tcx.features().exhaustive_patterns
&& v.inhabited_predicate(self.tcx, adt_def)
&& !v
.inhabited_predicate(self.tcx, adt_def)
.subst(self.tcx, substs)
.apply_any_module(self.tcx, self.param_env)
!= Some(true)
.apply_ignore_module(self.tcx, self.param_env)
}
}) && (adt_def.did().is_local()
|| !adt_def.is_variant_list_non_exhaustive());