We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 37d742f commit b8c999dCopy full SHA for b8c999d
library/std/src/lib.rs
@@ -54,7 +54,7 @@ macro_rules! assert {
54
// strategy, which is tracked in
55
// https://github.com/model-checking/kani/issues/692
56
if false {
57
- let _ = format_args!($($arg)+);
+ ::std::panic!($($arg)+);
58
}
59
}};
60
tests/kani/Assert/in_const_fn_args.rs
@@ -0,0 +1,16 @@
1
+// Copyright Kani Contributors
2
+// SPDX-License-Identifier: Apache-2.0 OR MIT
3
+
4
+//! This test checks that `assert!` with a custom message can be used in a const
5
+//! fn
6
7
+const fn const_add(x: i32, y: i32) {
8
+ assert!(x + y == x, "some message");
9
+}
10
11
+#[kani::proof]
12
+fn check() {
13
+ let x = kani::any();
14
+ let y = 0;
15
+ const_add(x, y);
16
0 commit comments