]> git.lizzy.rs Git - rust.git/blob - tests/ui/impl-trait/bounds_regression.rs
Rollup merge of #106427 - mejrs:translation_errors, r=davidtwco
[rust.git] / tests / ui / impl-trait / bounds_regression.rs
1 // run-pass
2
3 pub trait FakeGenerator {
4     type Yield;
5     type Return;
6 }
7
8 pub trait FakeFuture {
9     type Output;
10 }
11
12 pub fn future_from_generator<
13     T: FakeGenerator<Yield = ()>
14 >(x: T) -> impl FakeFuture<Output = T::Return> {
15     GenFuture(x)
16 }
17
18 struct GenFuture<T: FakeGenerator<Yield = ()>>(#[allow(unused_tuple_struct_fields)] T);
19
20 impl<T: FakeGenerator<Yield = ()>> FakeFuture for GenFuture<T> {
21     type Output = T::Return;
22 }
23
24 fn main() {}