about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/coverageinfo/map_data.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-11-28 00:51:37 +0000
committerbors <bors@rust-lang.org>2024-11-28 00:51:37 +0000
commiteddb717281a9031f645d88dd3b8323a7e25632cc (patch)
tree0a9df155daa91a5aa5720e39cad9fe79c2b51864 /compiler/rustc_codegen_llvm/src/coverageinfo/map_data.rs
parent66adeaf46b7a646daeed29518ef76235fcdb9726 (diff)
parent5fc4f85f60f9b1169bddf62d4f23340d81f14a0a (diff)
downloadrust-eddb717281a9031f645d88dd3b8323a7e25632cc.tar.gz
rust-eddb717281a9031f645d88dd3b8323a7e25632cc.zip
Auto merge of #133551 - matthiaskrgr:rollup-m0rr5oz, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #132410 (Some more refactorings towards removing driver queries)
 - #133418 (coverage: Store coverage source regions as `Span` until codegen)
 - #133498 (Add missing code examples on `LocalKey`)
 - #133518 (Structurally resolve before checking `!` in HIR typeck)
 - #133521 (Structurally resolve before matching on type of projection)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/coverageinfo/map_data.rs')
-rw-r--r--compiler/rustc_codegen_llvm/src/coverageinfo/map_data.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/compiler/rustc_codegen_llvm/src/coverageinfo/map_data.rs b/compiler/rustc_codegen_llvm/src/coverageinfo/map_data.rs
index e3c0df27883..95746b88ced 100644
--- a/compiler/rustc_codegen_llvm/src/coverageinfo/map_data.rs
+++ b/compiler/rustc_codegen_llvm/src/coverageinfo/map_data.rs
@@ -3,9 +3,9 @@ use rustc_data_structures::fx::FxIndexSet;
 use rustc_index::bit_set::BitSet;
 use rustc_middle::mir::coverage::{
     CounterId, CovTerm, Expression, ExpressionId, FunctionCoverageInfo, Mapping, MappingKind, Op,
-    SourceRegion,
 };
 use rustc_middle::ty::Instance;
+use rustc_span::Span;
 use tracing::{debug, instrument};
 
 use crate::coverageinfo::ffi::{Counter, CounterExpression, ExprKind};
@@ -220,16 +220,16 @@ impl<'tcx> FunctionCoverage<'tcx> {
         })
     }
 
-    /// Converts this function's coverage mappings into an intermediate form
-    /// that will be used by `mapgen` when preparing for FFI.
-    pub(crate) fn counter_regions(
+    /// Yields all this function's coverage mappings, after simplifying away
+    /// unused counters and counter expressions.
+    pub(crate) fn mapping_spans(
         &self,
-    ) -> impl Iterator<Item = (MappingKind, &SourceRegion)> + ExactSizeIterator {
+    ) -> impl Iterator<Item = (MappingKind, Span)> + ExactSizeIterator + Captures<'_> {
         self.function_coverage_info.mappings.iter().map(move |mapping| {
-            let Mapping { kind, source_region } = mapping;
+            let &Mapping { ref kind, span } = mapping;
             let kind =
                 kind.map_terms(|term| if self.is_zero_term(term) { CovTerm::Zero } else { term });
-            (kind, source_region)
+            (kind, span)
         })
     }