about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/coverageinfo/mapgen/covfun.rs
diff options
context:
space:
mode:
authorZalathar <Zalathar@users.noreply.github.com>2025-01-22 12:58:37 +1100
committerZalathar <Zalathar@users.noreply.github.com>2025-01-24 16:13:11 +1100
commitff48331588e74dc381374d7f474d85adc4dd3b4b (patch)
tree5e7c8f9501dbfb1e87a5157ba84adf24b84e1112 /compiler/rustc_codegen_llvm/src/coverageinfo/mapgen/covfun.rs
parentec6fc95d6d808d0407a80e7e3e3b4d82f03a09d7 (diff)
downloadrust-ff48331588e74dc381374d7f474d85adc4dd3b4b.tar.gz
rust-ff48331588e74dc381374d7f474d85adc4dd3b4b.zip
coverage: Make query `coverage_ids_info` return an Option
This reflects the fact that we can't compute meaningful info for a function
that wasn't instrumented and therefore doesn't have `function_coverage_info`.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/coverageinfo/mapgen/covfun.rs')
-rw-r--r--compiler/rustc_codegen_llvm/src/coverageinfo/mapgen/covfun.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_llvm/src/coverageinfo/mapgen/covfun.rs b/compiler/rustc_codegen_llvm/src/coverageinfo/mapgen/covfun.rs
index 5428d776f41..460a4664615 100644
--- a/compiler/rustc_codegen_llvm/src/coverageinfo/mapgen/covfun.rs
+++ b/compiler/rustc_codegen_llvm/src/coverageinfo/mapgen/covfun.rs
@@ -51,7 +51,7 @@ pub(crate) fn prepare_covfun_record<'tcx>(
     is_used: bool,
 ) -> Option<CovfunRecord<'tcx>> {
     let fn_cov_info = tcx.instance_mir(instance.def).function_coverage_info.as_deref()?;
-    let ids_info = tcx.coverage_ids_info(instance.def);
+    let ids_info = tcx.coverage_ids_info(instance.def)?;
 
     let expressions = prepare_expressions(fn_cov_info, ids_info, is_used);