mirror of
https://github.com/rust-lang/rust
synced 2024-09-15 22:50:55 +00:00
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 @@ pub fn is_ty_uninhabited_from(self, module: DefId, ty: Ty<'tcx>) -> bool {
|
|||
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