aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian Anderson <[email protected]>2011-03-27 19:59:33 -0400
committerGraydon Hoare <[email protected]>2011-03-28 21:14:06 -0700
commit38d54535840603b131cfac0aafc4133e62a7fb56 (patch)
tree045816b3d2d9d668e2d4aa48ec2a779bc0c2dc95 /src
parentHandle structural types as the result of if expressions (diff)
downloadrust-38d54535840603b131cfac0aafc4133e62a7fb56.tar.xz
rust-38d54535840603b131cfac0aafc4133e62a7fb56.zip
Add an XFAILed test for if expressions resulting in boxes
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