]> git.proxmox.com Git - rustc.git/blob - src/test/run-pass/generator/auxiliary/xcrate.rs
New upstream version 1.33.0+dfsg1
[rustc.git] / src / test / run-pass / generator / auxiliary / xcrate.rs
1 #![feature(generators, generator_trait)]
2
3 use std::ops::Generator;
4
5 pub fn foo() -> impl Generator<Yield = (), Return = ()> {
6 || {
7 if false {
8 yield;
9 }
10 }
11 }
12
13 pub fn bar<T: 'static>(t: T) -> Box<Generator<Yield = T, Return = ()>> {
14 Box::new(|| {
15 yield t;
16 })
17 }