@@ -84,7 +84,10 @@ impl FunctionCoverage {
8484 rhs : ExpressionOperandId ,
8585 region : Option < CodeRegion > ,
8686 ) {
87- debug ! ( "add_counter_expression({:?}, lhs={:?}, op={:?}, rhs={:?} at {:?}" , expression_id, lhs, op, rhs, region) ;
87+ debug ! (
88+ "add_counter_expression({:?}, lhs={:?}, op={:?}, rhs={:?} at {:?}" ,
89+ expression_id, lhs, op, rhs, region
90+ ) ;
8891 let expression_index = self . expression_index ( u32:: from ( expression_id) ) ;
8992 self . expressions [ expression_index]
9093 . replace ( Expression { lhs, op, rhs, region } )
@@ -134,8 +137,7 @@ impl FunctionCoverage {
134137 ) -> ( Vec < CounterExpression > , impl Iterator < Item = ( Counter , & ' a CodeRegion ) > ) {
135138 let mut counter_expressions = Vec :: with_capacity ( self . expressions . len ( ) ) ;
136139 let mut expression_regions = Vec :: with_capacity ( self . expressions . len ( ) ) ;
137- let mut new_indexes =
138- IndexVec :: from_elem_n ( None , self . expressions . len ( ) ) ;
140+ let mut new_indexes = IndexVec :: from_elem_n ( None , self . expressions . len ( ) ) ;
139141 // Note that an `Expression`s at any given index can include other expressions as
140142 // operands, but expression operands can only come from the subset of expressions having
141143 // `expression_index`s lower than the referencing `Expression`. Therefore, it is
@@ -175,8 +177,6 @@ impl FunctionCoverage {
175177 entry. as_ref ( ) . map ( |expression| ( original_index, expression) )
176178 } )
177179 {
178- // TODO(richkadel): remove this debug:
179- debug ! ( "Attempting to add {:?} = {:?}" , original_index, expression) ;
180180 let optional_region = & expression. region ;
181181 let Expression { lhs, op, rhs, .. } = * expression;
182182
@@ -185,8 +185,14 @@ impl FunctionCoverage {
185185 id_to_counter ( & new_indexes, rhs) . map ( |rhs_counter| ( lhs_counter, rhs_counter) )
186186 } )
187187 {
188- debug_assert ! ( ( lhs_counter. id as usize ) < usize :: max( self . counters. len( ) , self . expressions. len( ) ) ) ;
189- debug_assert ! ( ( rhs_counter. id as usize ) < usize :: max( self . counters. len( ) , self . expressions. len( ) ) ) ;
188+ debug_assert ! (
189+ ( lhs_counter. id as usize )
190+ < usize :: max( self . counters. len( ) , self . expressions. len( ) )
191+ ) ;
192+ debug_assert ! (
193+ ( rhs_counter. id as usize )
194+ < usize :: max( self . counters. len( ) , self . expressions. len( ) )
195+ ) ;
190196 // Both operands exist. `Expression` operands exist in `self.expressions` and have
191197 // been assigned a `new_index`.
192198 let mapped_expression_index =
0 commit comments