We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 19a949c commit c27b72eCopy full SHA for c27b72e
src/test/run-pass/expr-block.rs
@@ -0,0 +1,31 @@
1
+// xfail-boot
2
+// -*- rust -*-
3
+
4
+// Tests for standalone blocks as expressions
5
6
+fn test_basic() {
7
+ let bool res = { true };
8
+ check (res);
9
+}
10
11
+fn test_rec() {
12
+ auto res = { rec(v1 = 10, v2 = 20) };
13
+ check (res.v2 == 20);
14
15
16
+fn test_filled_with_stuff() {
17
+ auto res = {
18
+ auto a = 0;
19
+ while (a < 10) {
20
+ a += 1;
21
+ }
22
+ a
23
+ };
24
+ check (res == 10);
25
26
27
+fn main() {
28
+ test_basic();
29
+ test_rec();
30
+ test_filled_with_stuff();
31
0 commit comments