Skip to content

Commit 4723dd0

Browse files
author
zhuyunxing
committed
coverage. Change doc comments of MCDCState::record_conditions to idiomatic because it only describes the implementation and has no doc test
1 parent 2788afe commit 4723dd0

File tree

1 file changed

+40
-40
lines changed

1 file changed

+40
-40
lines changed

compiler/rustc_mir_build/src/build/coverageinfo.rs

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -192,46 +192,46 @@ impl MCDCState {
192192
.then(|| Self { decision_stack: VecDeque::new(), processing_decision: None })
193193
}
194194

195-
/// At first we assign ConditionIds for each sub expression.
196-
/// If the sub expression is composite, re-assign its ConditionId to its LHS and generate a new ConditionId for its RHS.
197-
///
198-
/// Example: "x = (A && B) || (C && D) || (D && F)"
199-
///
200-
/// Visit Depth1:
201-
/// (A && B) || (C && D) || (D && F)
202-
/// ^-------LHS--------^ ^-RHS--^
203-
/// ID=1 ID=2
204-
///
205-
/// Visit LHS-Depth2:
206-
/// (A && B) || (C && D)
207-
/// ^-LHS--^ ^-RHS--^
208-
/// ID=1 ID=3
209-
///
210-
/// Visit LHS-Depth3:
211-
/// (A && B)
212-
/// LHS RHS
213-
/// ID=1 ID=4
214-
///
215-
/// Visit RHS-Depth3:
216-
/// (C && D)
217-
/// LHS RHS
218-
/// ID=3 ID=5
219-
///
220-
/// Visit RHS-Depth2: (D && F)
221-
/// LHS RHS
222-
/// ID=2 ID=6
223-
///
224-
/// Visit Depth1:
225-
/// (A && B) || (C && D) || (D && F)
226-
/// ID=1 ID=4 ID=3 ID=5 ID=2 ID=6
227-
///
228-
/// A node ID of '0' always means MC/DC isn't being tracked.
229-
///
230-
/// If a "next" node ID is '0', it means it's the end of the test vector.
231-
///
232-
/// As the compiler tracks expression in pre-order, we can ensure that condition info of parents are always properly assigned when their children are visited.
233-
/// - If the op is AND, the "false_next" of LHS and RHS should be the parent's "false_next". While "true_next" of the LHS is the RHS, the "true next" of RHS is the parent's "true_next".
234-
/// - If the op is OR, the "true_next" of LHS and RHS should be the parent's "true_next". While "false_next" of the LHS is the RHS, the "false next" of RHS is the parent's "false_next".
195+
// At first we assign ConditionIds for each sub expression.
196+
// If the sub expression is composite, re-assign its ConditionId to its LHS and generate a new ConditionId for its RHS.
197+
//
198+
// Example: "x = (A && B) || (C && D) || (D && F)"
199+
//
200+
// Visit Depth1:
201+
// (A && B) || (C && D) || (D && F)
202+
// ^-------LHS--------^ ^-RHS--^
203+
// ID=1 ID=2
204+
//
205+
// Visit LHS-Depth2:
206+
// (A && B) || (C && D)
207+
// ^-LHS--^ ^-RHS--^
208+
// ID=1 ID=3
209+
//
210+
// Visit LHS-Depth3:
211+
// (A && B)
212+
// LHS RHS
213+
// ID=1 ID=4
214+
//
215+
// Visit RHS-Depth3:
216+
// (C && D)
217+
// LHS RHS
218+
// ID=3 ID=5
219+
//
220+
// Visit RHS-Depth2: (D && F)
221+
// LHS RHS
222+
// ID=2 ID=6
223+
//
224+
// Visit Depth1:
225+
// (A && B) || (C && D) || (D && F)
226+
// ID=1 ID=4 ID=3 ID=5 ID=2 ID=6
227+
//
228+
// A node ID of '0' always means MC/DC isn't being tracked.
229+
//
230+
// If a "next" node ID is '0', it means it's the end of the test vector.
231+
//
232+
// As the compiler tracks expression in pre-order, we can ensure that condition info of parents are always properly assigned when their children are visited.
233+
// - If the op is AND, the "false_next" of LHS and RHS should be the parent's "false_next". While "true_next" of the LHS is the RHS, the "true next" of RHS is the parent's "true_next".
234+
// - If the op is OR, the "true_next" of LHS and RHS should be the parent's "true_next". While "false_next" of the LHS is the RHS, the "false next" of RHS is the parent's "false_next".
235235
fn record_conditions(&mut self, op: LogicalOp, span: Span) {
236236
let decision = match self.processing_decision.as_mut() {
237237
Some(decision) => {

0 commit comments

Comments
 (0)