Skip to content

Commit

Permalink
Rollup merge of #86796 - JohnTitor:test-70703, r=jonas-schievink
Browse files Browse the repository at this point in the history
Add a regression test for issue-70703

Closes #70703
  • Loading branch information
JohnTitor authored Jul 2, 2021
2 parents 7fb3c29 + bc6514e commit f6ef2c8
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 f6ef2c8

Please sign in to comment.