1
Fork 0

hir: Simplify hir_owner_nodes query

The query accept arbitrary DefIds, not just owner DefIds.
The return can be an `Option` because if there are no nodes, then it doesn't matter whether it's due to NonOwner or Phantom.
Also rename the query to `opt_hir_owner_nodes`.
This commit is contained in:
Vadim Petrochenkov 2024-01-25 19:16:38 +03:00
parent c401f09979
commit 64b6b5b6ce
40 changed files with 862 additions and 867 deletions

View file

@ -131,7 +131,7 @@ impl<'tcx> IfThisChanged<'tcx> {
None => DepNode::from_def_path_hash(
self.tcx,
def_path_hash,
dep_kinds::hir_owner_nodes,
dep_kinds::opt_hir_owner_nodes,
),
Some(n) => {
match DepNode::from_label_string(self.tcx, n.as_str(), def_path_hash) {

View file

@ -57,8 +57,8 @@ const BASE_FN: &[&str] = &[
/// DepNodes for Hir, which is pretty much everything
const BASE_HIR: &[&str] = &[
// hir_owner_nodes should be computed for all nodes
label_strs::hir_owner_nodes,
// opt_hir_owner_nodes should be computed for all nodes
label_strs::opt_hir_owner_nodes,
];
/// `impl` implementation of struct/trait