Skip to content

Commit db9f0bb

Browse files
committed
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`.
1 parent 7671b5a commit db9f0bb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

compiler/rustc_mir_transform/src/coverage/hir_info.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,12 @@ pub(crate) fn extract_hir_info<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> E
6767
}
6868

6969
fn hash_mir_source<'tcx>(tcx: TyCtxt<'tcx>, hir_body: &'tcx hir::Body<'tcx>) -> u64 {
70-
// FIXME(cjgillot) Stop hashing HIR manually here.
7170
let owner = hir_body.id().hir_id.owner;
72-
tcx.hir_owner_nodes(owner).opt_hash_including_bodies.unwrap().to_smaller_hash().as_u64()
71+
tcx.hir_owner_nodes(owner)
72+
.opt_hash_including_bodies
73+
.expect("hash should be present when coverage instrumentation is enabled")
74+
.to_smaller_hash()
75+
.as_u64()
7376
}
7477

7578
fn extract_hole_spans_from_hir<'tcx>(tcx: TyCtxt<'tcx>, hir_body: &hir::Body<'tcx>) -> Vec<Span> {

0 commit comments

Comments
 (0)