File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments