about summary refs log tree commit diff
diff options
context:
space:
mode:
authorZalathar <Zalathar@users.noreply.github.com>2025-08-02 22:39:54 +1000
committerZalathar <Zalathar@users.noreply.github.com>2025-08-08 20:04:15 +1000
commitdb9f0bb5326b8726c2760ffb2f17977118534c2c (patch)
tree09914d63b943368782f7f9176182d8d380bc80cc
parent7671b5af71deb6c43cb466b333c821b03eb98b65 (diff)
downloadrust-db9f0bb5326b8726c2760ffb2f17977118534c2c.tar.gz
rust-db9f0bb5326b8726c2760ffb2f17977118534c2c.zip
coverage: Remove obsolete comment about hashing HIR
This code does not hash HIR manually (and has not done so for some time); it
merely obtains a hash returned as part of `hir_owner_nodes`.
-rw-r--r--compiler/rustc_mir_transform/src/coverage/hir_info.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/rustc_mir_transform/src/coverage/hir_info.rs b/compiler/rustc_mir_transform/src/coverage/hir_info.rs
index 7d720159295..28fdc52b06c 100644
--- a/compiler/rustc_mir_transform/src/coverage/hir_info.rs
+++ b/compiler/rustc_mir_transform/src/coverage/hir_info.rs
@@ -67,9 +67,12 @@ pub(crate) fn extract_hir_info<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> E
 }
 
 fn hash_mir_source<'tcx>(tcx: TyCtxt<'tcx>, hir_body: &'tcx hir::Body<'tcx>) -> u64 {
-    // FIXME(cjgillot) Stop hashing HIR manually here.
     let owner = hir_body.id().hir_id.owner;
-    tcx.hir_owner_nodes(owner).opt_hash_including_bodies.unwrap().to_smaller_hash().as_u64()
+    tcx.hir_owner_nodes(owner)
+        .opt_hash_including_bodies
+        .expect("hash should be present when coverage instrumentation is enabled")
+        .to_smaller_hash()
+        .as_u64()
 }
 
 fn extract_hole_spans_from_hir<'tcx>(tcx: TyCtxt<'tcx>, hir_body: &hir::Body<'tcx>) -> Vec<Span> {