1
Fork 0

Turn type inhabitedness into a query

This commit is contained in:
Nadrieril 2020-12-03 00:25:04 +00:00
parent b82f149d08
commit 8598c9f6e5
4 changed files with 64 additions and 31 deletions

View file

@ -1308,6 +1308,15 @@ rustc_queries! {
eval_always
desc { |tcx| "computing visibility of `{}`", tcx.def_path_str(def_id) }
}
/// Computes the set of modules from which this type is visibly uninhabited.
/// To check whether a type is uninhabited at all (not just from a given module), you could
/// check whether the forest is empty.
query type_uninhabited_from(
key: ty::ParamEnvAnd<'tcx, Ty<'tcx>>
) -> Arc<ty::inhabitedness::DefIdForest> {
desc { "computing the inhabitedness of `{:?}`", key }
}
}
Other {