#![feature(generators, generator_trait)]
-use std::ops::{State, Generator};
+use std::ops::{GeneratorState, Generator};
use std::thread;
#[test]
};
match foo.resume() {
- State::Complete(()) => {}
+ GeneratorState::Complete(()) => {}
s => panic!("bad state: {:?}", s),
}
}
};
match foo.resume() {
- State::Complete(ref s) if *s == "foo" => {}
+ GeneratorState::Complete(ref s) if *s == "foo" => {}
s => panic!("bad state: {:?}", s),
}
}
};
match foo.resume() {
- State::Yielded(()) => {}
+ GeneratorState::Yielded(()) => {}
s => panic!("bad state: {:?}", s),
}
match foo.resume() {
- State::Complete(()) => {}
+ GeneratorState::Complete(()) => {}
s => panic!("bad state: {:?}", s),
}
}
};
match foo.resume() {
- State::Yielded(ref s) if *s == "foo" => {}
+ GeneratorState::Yielded(ref s) if *s == "foo" => {}
s => panic!("bad state: {:?}", s),
}
match foo.resume() {
- State::Complete(()) => {}
+ GeneratorState::Complete(()) => {}
s => panic!("bad state: {:?}", s),
}
}
};
match foo.resume() {
- State::Yielded(ref s) if *s == "bar" => {}
+ GeneratorState::Yielded(ref s) if *s == "bar" => {}
s => panic!("bad state: {:?}", s),
}
match foo.resume() {
- State::Complete(ref s) if *s == "foo" => {}
+ GeneratorState::Complete(ref s) if *s == "foo" => {}
s => panic!("bad state: {:?}", s),
}
}
};
match foo.resume() {
- State::Yielded(()) => {}
+ GeneratorState::Yielded(()) => {}
s => panic!("bad state: {:?}", s),
}
match foo.resume() {
- State::Complete(ref s) if *s == "foo" => {}
+ GeneratorState::Complete(ref s) if *s == "foo" => {}
s => panic!("bad state: {:?}", s),
}
}
let mut foo = || { yield };
thread::spawn(move || {
match foo.resume() {
- State::Yielded(()) => {}
+ GeneratorState::Yielded(()) => {}
s => panic!("bad state: {:?}", s),
}
match foo.resume() {
- State::Complete(()) => {}
+ GeneratorState::Complete(()) => {}
s => panic!("bad state: {:?}", s),
}
}).join().unwrap();
let mut foo = || { yield a };
thread::spawn(move || {
match foo.resume() {
- State::Yielded(ref s) if *s == "a" => {}
+ GeneratorState::Yielded(ref s) if *s == "a" => {}
s => panic!("bad state: {:?}", s),
}
match foo.resume() {
- State::Complete(()) => {}
+ GeneratorState::Complete(()) => {}
s => panic!("bad state: {:?}", s),
}
}).join().unwrap();