about summary refs log tree commit diff
path: root/tests/ui/coroutine/live-upvar-across-yield.rs
blob: d13d480dcdcce00ca61041d214e9061efe9863d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//@ run-pass

#![feature(coroutines, coroutine_trait, stmt_expr_attributes)]

use std::ops::Coroutine;
use std::pin::Pin;

fn main() {
    let b = |_| 3;
    let mut a = #[coroutine] || {
        b(yield);
    };
    Pin::new(&mut a).resume(());
}