Skip to content

Commit

Permalink
Add a regression test for issue-70703
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor committed Jul 1, 2021
1 parent ecef52a commit bc6514e
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/test/ui/inference/issue-70703.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// check-pass

trait Factory {
type Product;
}

impl Factory for () {
type Product = ();
}

trait ProductConsumer<P> {
fn consume(self, product: P);
}

impl<P> ProductConsumer<P> for () {
fn consume(self, _: P) {}
}

fn make_product_consumer<F: Factory>(_: F) -> impl ProductConsumer<F::Product> {
()
}

fn main() {
let consumer = make_product_consumer(());
consumer.consume(());
}

0 comments on commit bc6514e

Please sign in to comment.