Skip to content

Commit 1b9838c

Browse files
committed
FIX: Silence clippy::eq_op on the AD commutativity check (CI hotfix)
Clippy 1.95 on the CI runner promotes `clippy::eq_op` from warn to deny for the commutativity assertion in examples/ad.rs: assert_eq!(2f64 * b, b * 2f64); The two sides are intentionally identical — the test exists to confirm that `2 * b == b * 2` holds for `AD` types — but the lint normalizes both sides and reports them as a no-op comparison. Wrap the assertion in a block-level `#[allow(clippy::eq_op)]` with a short note. The check itself is preserved verbatim. Local clippy run (Rust 1.93 stable) now finishes with zero errors; the previously failing CI clippy job will follow.
1 parent bb1d636 commit 1b9838c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎examples/ad.rs‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ fn main() {
3131
(b * 2f64).print();
3232
(b / 2f64).print();
3333
assert_eq!(-(1f64 - b), b - 1f64);
34-
assert_eq!(2f64 * b, b * 2f64);
34+
#[allow(clippy::eq_op)] // commutativity check: 2*b vs b*2
35+
{
36+
assert_eq!(2f64 * b, b * 2f64);
37+
}
3538
assert_eq!(1f64 / (2f64 / b), b / 2f64);
3639
}
3740

0 commit comments

Comments
 (0)