summaryrefslogtreecommitdiffstats
path: root/src/test/ui/drop/repeat-drop-2.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/drop/repeat-drop-2.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/ui/drop/repeat-drop-2.rs b/src/test/ui/drop/repeat-drop-2.rs
new file mode 100644
index 000000000..59d5ef202
--- /dev/null
+++ b/src/test/ui/drop/repeat-drop-2.rs
@@ -0,0 +1,15 @@
+fn borrowck_catch() {
+ let foo = String::new();
+ let _bar = foo;
+ let _baz = [foo; 0]; //~ ERROR use of moved value: `foo` [E0382]
+}
+
+const _: [String; 0] = [String::new(); 0];
+//~^ ERROR destructors cannot be evaluated at compile-time [E0493]
+
+fn must_be_init() {
+ let x: u8;
+ let _ = [x; 0]; //~ ERROR E0381
+}
+
+fn main() {}