Turn type inhabitedness into a query
This commit is contained in:
parent
b82f149d08
commit
8598c9f6e5
4 changed files with 64 additions and 31 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue