summaryrefslogtreecommitdiffstats
path: root/src/test/ui/dst/dst-rvalue.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/dst/dst-rvalue.rs')
-rw-r--r--src/test/ui/dst/dst-rvalue.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/ui/dst/dst-rvalue.rs b/src/test/ui/dst/dst-rvalue.rs
new file mode 100644
index 000000000..b52a95a70
--- /dev/null
+++ b/src/test/ui/dst/dst-rvalue.rs
@@ -0,0 +1,12 @@
+// Check that dynamically sized rvalues are forbidden
+
+#![feature(box_syntax)]
+
+pub fn main() {
+ let _x: Box<str> = box *"hello world";
+ //~^ ERROR E0277
+
+ let array: &[isize] = &[1, 2, 3];
+ let _x: Box<[isize]> = box *array;
+ //~^ ERROR E0277
+}