RS.CLIPPY.ASSERTIONS_ON_CONSTANTS
`assert!(true)` / `assert!(false)` will be optimized out by the compiler, and should probably be replaced by a `panic!()` or `unreachable!()`
This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: assertions_on_constants. Copyright ©2025 The Rust Team. All rights reserved.
What it does
Checks for assert!(true) and assert!(false) calls.
Why is this bad?
Will be optimized out by the compiler or should probably be replaced by a
panic!() or unreachable!()
Example
assert!(false)
assert!(true)
const B: bool = false;
assert!(B)