diff options
| author | Zalathar <Zalathar@users.noreply.github.com> | 2023-08-02 15:55:37 +1000 |
|---|---|---|
| committer | Zalathar <Zalathar@users.noreply.github.com> | 2023-09-21 18:32:49 +1000 |
| commit | 659575aade611f19b8e75e39224781b1f6f15ee6 (patch) | |
| tree | 2e7d256f8cb34d7924e0e980152326418fdd25d9 /compiler/rustc_codegen_llvm/src/coverageinfo/map_data.rs | |
| parent | 0a689c1be85d635bf61ffb7922ef9ce02587a3b1 (diff) | |
| download | rust-659575aade611f19b8e75e39224781b1f6f15ee6.tar.gz rust-659575aade611f19b8e75e39224781b1f6f15ee6.zip | |
coverage: Make the zero counter a constant
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/coverageinfo/map_data.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/coverageinfo/map_data.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_codegen_llvm/src/coverageinfo/map_data.rs b/compiler/rustc_codegen_llvm/src/coverageinfo/map_data.rs index f1e68af25d4..cf0de817f48 100644 --- a/compiler/rustc_codegen_llvm/src/coverageinfo/map_data.rs +++ b/compiler/rustc_codegen_llvm/src/coverageinfo/map_data.rs @@ -191,7 +191,7 @@ impl<'tcx> FunctionCoverage<'tcx> { // vector is only complete up to the current `ExpressionIndex`. type NewIndexes = IndexSlice<ExpressionId, Option<MappedExpressionIndex>>; let id_to_counter = |new_indexes: &NewIndexes, operand: Operand| match operand { - Operand::Zero => Some(Counter::zero()), + Operand::Zero => Some(Counter::ZERO), Operand::Counter(id) => Some(Counter::counter_value_reference(id)), Operand::Expression(id) => { self.expressions @@ -201,7 +201,7 @@ impl<'tcx> FunctionCoverage<'tcx> { // If an expression was optimized out, assume it would have produced a count // of zero. This ensures that expressions dependent on optimized-out // expressions are still valid. - .map_or(Some(Counter::zero()), |_| new_indexes[id].map(Counter::expression)) + .map_or(Some(Counter::ZERO), |_| new_indexes[id].map(Counter::expression)) } }; @@ -237,7 +237,7 @@ impl<'tcx> FunctionCoverage<'tcx> { original_index={:?}, lhs={:?}, op={:?}, rhs={:?}, region={:?}", original_index, lhs, op, rhs, optional_region, ); - rhs_counter = Counter::zero(); + rhs_counter = Counter::ZERO; } debug_assert!( lhs_counter.is_zero() @@ -306,6 +306,6 @@ impl<'tcx> FunctionCoverage<'tcx> { } fn unreachable_regions(&self) -> impl Iterator<Item = (Counter, &CodeRegion)> { - self.unreachable_regions.iter().map(|region| (Counter::zero(), region)) + self.unreachable_regions.iter().map(|region| (Counter::ZERO, region)) } } |
