rust/tests/ui/impl-trait/bounds_regression.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
449 B
Rust
Raw Normal View History

// run-pass
2018-06-13 07:11:23 +00:00
pub trait FakeGenerator {
type Yield;
type Return;
}
pub trait FakeFuture {
type Output;
}
pub fn future_from_generator<
T: FakeGenerator<Yield = ()>
>(x: T) -> impl FakeFuture<Output = T::Return> {
GenFuture(x)
}
2022-07-25 20:36:03 +00:00
struct GenFuture<T: FakeGenerator<Yield = ()>>(#[allow(unused_tuple_struct_fields)] T);
2018-06-13 07:11:23 +00:00
impl<T: FakeGenerator<Yield = ()>> FakeFuture for GenFuture<T> {
type Output = T::Return;
}
2018-06-13 17:10:41 +00:00
fn main() {}