about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src/coverageinfo/map.rs
diff options
context:
space:
mode:
authorScott McMurray <scottmcm@users.noreply.github.com>2023-03-31 00:32:44 -0700
committerScott McMurray <scottmcm@users.noreply.github.com>2023-04-02 17:35:37 -0700
commita2ee7592d6b7c0daa62b7870ade85e0cc0acca05 (patch)
tree4ab6bedbd53989ea3c1b556e4d61c33f469c536b /compiler/rustc_codegen_ssa/src/coverageinfo/map.rs
parenta93bcdc30771340dfff914a1cf48556886ad33a6 (diff)
downloadrust-a2ee7592d6b7c0daa62b7870ade85e0cc0acca05.tar.gz
rust-a2ee7592d6b7c0daa62b7870ade85e0cc0acca05.zip
Use `&IndexSlice` instead of `&IndexVec` where possible
All the same reasons as for `[T]`: more general, less pointer chasing, and `&mut IndexSlice` emphasizes that it doesn't change *length*.
Diffstat (limited to 'compiler/rustc_codegen_ssa/src/coverageinfo/map.rs')
-rw-r--r--compiler/rustc_codegen_ssa/src/coverageinfo/map.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_ssa/src/coverageinfo/map.rs b/compiler/rustc_codegen_ssa/src/coverageinfo/map.rs
index 1a6495cb15c..1ea13040072 100644
--- a/compiler/rustc_codegen_ssa/src/coverageinfo/map.rs
+++ b/compiler/rustc_codegen_ssa/src/coverageinfo/map.rs
@@ -1,6 +1,6 @@
 pub use super::ffi::*;
 
-use rustc_index::vec::IndexVec;
+use rustc_index::vec::{IndexSlice, IndexVec};
 use rustc_middle::mir::coverage::{
     CodeRegion, CounterValueReference, ExpressionOperandId, InjectedExpressionId,
     InjectedExpressionIndex, MappedExpressionIndex, Op,
@@ -205,7 +205,7 @@ impl<'tcx> FunctionCoverage<'tcx> {
         // `expression_index`s lower than the referencing `Expression`. Therefore, it is
         // reasonable to look up the new index of an expression operand while the `new_indexes`
         // vector is only complete up to the current `ExpressionIndex`.
-        let id_to_counter = |new_indexes: &IndexVec<
+        let id_to_counter = |new_indexes: &IndexSlice<
             InjectedExpressionIndex,
             Option<MappedExpressionIndex>,
         >,