aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/test/run-pass/expr-if-box.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/run-pass/expr-if-box.rs b/src/test/run-pass/expr-if-box.rs
new file mode 100644
index 00000000..98503211
--- /dev/null
+++ b/src/test/run-pass/expr-if-box.rs
@@ -0,0 +1,14 @@
+// xfail-boot
+// xfail-stage0
+// -*- rust -*-
+
+// Tests for if as expressions returning boxed types
+
+fn test_box() {
+ auto res = if (true) { @100 } else { @101 };
+ check (*res == 100);
+}
+
+fn main() {
+ test_box();
+} \ No newline at end of file