summaryrefslogtreecommitdiffstats
path: root/tests/ui/coroutine/unsized-local-across-yield.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/coroutine/unsized-local-across-yield.rs')
-rw-r--r--tests/ui/coroutine/unsized-local-across-yield.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/ui/coroutine/unsized-local-across-yield.rs b/tests/ui/coroutine/unsized-local-across-yield.rs
new file mode 100644
index 000000000..7a8ed60e4
--- /dev/null
+++ b/tests/ui/coroutine/unsized-local-across-yield.rs
@@ -0,0 +1,21 @@
+#![feature(coroutine_trait)]
+#![feature(coroutines)]
+#![feature(unsized_locals)]
+//~^ WARN the feature `unsized_locals` is incomplete and may not be safe to use and/or cause compiler crashes
+
+use std::ops::Coroutine;
+
+fn across() -> impl Coroutine {
+ move || {
+ let b: [u8] = *(Box::new([]) as Box<[u8]>);
+ //~^ ERROR the size for values of type `[u8]` cannot be known at compilation time
+
+ yield;
+
+ for elem in b.iter() {}
+ }
+}
+
+fn main() {
+ across();
+}