mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-30 16:39:26 +00:00
23 lines
402 B
Rust
23 lines
402 B
Rust
macro_rules! assert_const {
|
|
($len:expr) => {
|
|
assert!($len > 0);
|
|
debug_assert!($len < 0);
|
|
};
|
|
}
|
|
|
|
fn main() {
|
|
assert!(true);
|
|
assert!(false);
|
|
assert!(true, "true message");
|
|
assert!(false, "false message");
|
|
|
|
const B: bool = true;
|
|
assert!(B);
|
|
|
|
const C: bool = false;
|
|
assert!(C);
|
|
|
|
debug_assert!(true);
|
|
assert_const!(3);
|
|
assert_const!(-1);
|
|
}
|