You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to compile it with [email protected] (2019-02-04) yields (heh) the following errors:
error[E0599]: no method named `resume` found for type `[generator@src/main.rs:7:25: 10:6 _]` in the current scope
error[E0698]: type inside generator must be known in this context
For reference, here's the example I'm trying to compile:
#![allow(unused)]
#![feature(generators, generator_trait)]
use std::ops::{Generator, GeneratorState};
fn main() {
let mut generator = || {
yield 1;
return "foo"
};
match unsafe { generator.resume() } {
GeneratorState::Yielded(1) => {}
_ => panic!("unexpected return from resume"),
}
match unsafe { generator.resume() } {
GeneratorState::Complete("foo") => {}
_ => panic!("unexpected return from resume"),
}
}
The text was updated successfully, but these errors were encountered:
Here's an example:
https://doc.rust-lang.org/std/ops/trait.Generator.html
Trying to compile it with [email protected] (2019-02-04) yields (heh) the following errors:
For reference, here's the example I'm trying to compile:
The text was updated successfully, but these errors were encountered: