Skip to content

Commit 5a808d4

Browse files
committed
Add some line comments to enum CoverageKind
The actual motivation here is to prevent `rustfmt` from suddenly reformatting these enum variants onto a single line, when they become slightly shorter in the future. But there's no harm in adding some helpful documentation at the same time.
1 parent db7ff98 commit 5a808d4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

compiler/rustc_middle/src/mir/coverage.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,13 @@ impl From<InjectedExpressionId> for ExpressionOperandId {
9999
pub enum CoverageKind {
100100
Counter {
101101
function_source_hash: u64,
102+
/// ID of this counter within its enclosing function.
103+
/// Expressions in the same function can refer to it as an operand.
102104
id: CounterValueReference,
103105
},
104106
Expression {
107+
/// ID of this coverage-counter expression within its enclosing function.
108+
/// Other expressions in the same function can refer to it as an operand.
105109
id: InjectedExpressionId,
106110
lhs: ExpressionOperandId,
107111
op: Op,

0 commit comments

Comments
 (0)