Files
rust/tests/ui/coroutine/unsized-capture-across-yield.rs

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

21 lines
388 B
Rust
Raw Normal View History

2023-10-19 21:46:28 +00:00
#![feature(coroutine_trait)]
#![feature(coroutines)]
2023-10-19 16:06:43 +00:00
use std::ops::Coroutine;
2023-10-19 16:06:43 +00:00
fn capture() -> impl Coroutine {
2025-06-13 01:16:36 +02:00
let b: [u8] = *(Box::new([]) as Box<[u8]>); //~ERROR he size for values of type `[u8]` cannot be known at compilation time
#[coroutine]
move || {
println!("{:?}", &b);
yield;
for elem in b.iter() {}
}
}
fn main() {
capture();
}