blob: 8bc34fdd2f053e71dd7d5064a25ace79b8afb251 [file] [log] [blame]
#![feature(coroutines, coroutine_trait)]
use std::ops::{Coroutine, CoroutineState};
use std::pin::Pin;
fn dangle(x: &mut i32) -> &'static mut i32 {
let mut g = || {
yield;
x
};
loop {
match Pin::new(&mut g).resume(()) {
CoroutineState::Complete(c) => return c,
//~^ ERROR lifetime may not live long enough
CoroutineState::Yielded(_) => (),
}
}
}
fn main() {}