add a function for testing if a ty is uninhabited from all modules
Desired by miri.
This commit is contained in:
parent
0f568e2f34
commit
47449ea513
|
@ -108,6 +108,10 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
|
|||
self.ty_inhabitedness_forest(ty).contains(self, module)
|
||||
}
|
||||
|
||||
pub fn is_ty_uninhabited_from_all_modules(self, ty: Ty<'tcx>) -> bool {
|
||||
!self.ty_inhabitedness_forest(ty).is_empty()
|
||||
}
|
||||
|
||||
fn ty_inhabitedness_forest(self, ty: Ty<'tcx>) -> DefIdForest {
|
||||
ty.uninhabited_from(&mut FxHashMap(), self)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue