mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 17:24:06 +00:00
aef0f4024a
And suggest adding the `#[coroutine]` to the closure
23 lines
448 B
Rust
23 lines
448 B
Rust
#![feature(coroutines, coroutine_trait, stmt_expr_attributes)]
|
|
|
|
use std::ops::Coroutine;
|
|
use std::pin::Pin;
|
|
|
|
fn main() {
|
|
let mut a = 5;
|
|
let mut b = #[coroutine]
|
|
|| {
|
|
let d = 6;
|
|
yield;
|
|
_zzz(); // #break
|
|
a = d;
|
|
};
|
|
Pin::new(&mut b).resume();
|
|
//~^ ERROR this method takes 1 argument but 0 arguments were supplied
|
|
// This type error is required to reproduce the ICE...
|
|
}
|
|
|
|
fn _zzz() {
|
|
()
|
|
}
|