We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 0145321 + 7026845 commit c857265Copy full SHA for c857265
src/test/ui/generator/issue-87142.rs
@@ -0,0 +1,32 @@
1
+// compile-flags: -Cdebuginfo=2
2
+// build-pass
3
+
4
+// Regression test for #87142
5
+// This test needs the above flags and the "lib" crate type.
6
7
+#![feature(type_alias_impl_trait, generator_trait, generators)]
8
+#![crate_type = "lib"]
9
10
+use std::ops::Generator;
11
12
+pub trait GeneratorProviderAlt: Sized {
13
+ type Gen: Generator<(), Return = (), Yield = ()>;
14
15
+ fn start(ctx: Context<Self>) -> Self::Gen;
16
+}
17
18
+pub struct Context<G: 'static + GeneratorProviderAlt> {
19
+ pub link: Box<G::Gen>,
20
21
22
+impl GeneratorProviderAlt for () {
23
+ type Gen = impl Generator<(), Return = (), Yield = ()>;
24
+ fn start(ctx: Context<Self>) -> Self::Gen {
25
+ move || {
26
+ match ctx {
27
+ _ => (),
28
+ }
29
+ yield ();
30
31
32
0 commit comments