mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
aef0f4024a
And suggest adding the `#[coroutine]` to the closure
22 lines
509 B
Rust
22 lines
509 B
Rust
#![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 {
|
|
#[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();
|
|
}
|