diff options
Diffstat (limited to 'src/test/ui/impl-trait/bounds_regression.rs')
-rw-r--r-- | src/test/ui/impl-trait/bounds_regression.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/test/ui/impl-trait/bounds_regression.rs b/src/test/ui/impl-trait/bounds_regression.rs new file mode 100644 index 000000000..31fc46203 --- /dev/null +++ b/src/test/ui/impl-trait/bounds_regression.rs @@ -0,0 +1,24 @@ +// run-pass + +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) +} + +struct GenFuture<T: FakeGenerator<Yield = ()>>(#[allow(unused_tuple_struct_fields)] T); + +impl<T: FakeGenerator<Yield = ()>> FakeFuture for GenFuture<T> { + type Output = T::Return; +} + +fn main() {} |