From 7bf4dff155e1d2440f067d5f469ab8cc8c9ae44b Mon Sep 17 00:00:00 2001 From: David Renshaw <dwrenshaw@gmail.com> Date: Tue, 9 Jan 2018 08:04:31 -0500 Subject: [PATCH] add generator niche test --- tests/run-pass/generator_niche.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tests/run-pass/generator_niche.rs diff --git a/tests/run-pass/generator_niche.rs b/tests/run-pass/generator_niche.rs new file mode 100644 index 0000000..ce68d6e --- /dev/null +++ b/tests/run-pass/generator_niche.rs @@ -0,0 +1,19 @@ +// https://github.com/rust-lang/rust/issues/47253 + +#![feature(generators)] + +pub struct Foo { + _a: bool, + _b: Option<String>, +} + +fn main() { + let g = || { + let _f = Foo { _a: true, _b: None }; + yield (); + }; + match Some(g) { + None => (), + Some(_) => (), + } +} -- GitLab