rust/tests/ui/generator/unsized-local-across-yield.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
492 B
Rust
Raw Normal View History

#![feature(generator_trait)]
#![feature(generators)]
#![feature(unsized_locals)]
//~^ WARN the feature `unsized_locals` is incomplete and may not be safe to use and/or cause compiler crashes
2023-10-19 11:06:43 -05:00
use std::ops::Coroutine;
2023-10-19 11:06:43 -05:00
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();
}