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

@ -452,7 +452,7 @@ fn get_body_span<'tcx>(
fn hash_mir_source<'tcx>(tcx: TyCtxt<'tcx>, hir_body: &'tcx rustc_hir::Body<'tcx>) -> u64 {
// FIXME(cjgillot) Stop hashing HIR manually here.
let owner = hir_body.id().hir_id.owner;
tcx.hir_owner_nodes(owner)
tcx.opt_hir_owner_nodes(owner)
.unwrap()
.opt_hash_including_bodies
.unwrap()