We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0da1bd9 commit 4cd0a34Copy full SHA for 4cd0a34
2 files changed
tests/ui/pass/annot_preds.rs
tests/ui/pass/annot_preds_raw_define.rs
@@ -0,0 +1,25 @@
1
+//@check-pass
2
+//@compile-flags: -Adead_code -C debug-assertions=off
3
+
4
+// Insert definitions written in SMT-LIB2 format into .smt file directly.
5
+// This feature is intended for debug or experiment purpose.
6
+#![feature(custom_inner_attributes)]
7
+#![thrust::raw_define("(define-fun is_double ((x Int) (doubled_x Int)) Bool
8
+ (=
9
+ (* x 2)
10
+ doubled_x
11
+ )
12
+)")]
13
14
+#[thrust::requires(true)]
15
+// #[thrust::ensures(result == 2 * x)]
16
+#[thrust::ensures(is_double(x, result))]
17
+fn double(x: i64) -> i64 {
18
+ x + x
19
+}
20
21
+fn main() {
22
+ let a = 3;
23
+ assert!(double(a) == 6);
24
+ // assert!(is_double(a, double(a)));
25
0 commit comments